# Different methods to measure the volume of fibers generated by XFiber extension

This guideline aims to identify different ways to analyze the volume fraction of fibers traced by the XFiber extension.

The purpose of XFiber extension of the Avizo software is to trace the centerline of fibers in 3D images. XFiber provides a full statistical analysis of the fibers, including the volume%. However, unlike other properties of fibers, measuring the volume of fibers requires extra steps. This guideline aims to identify different ways to analyze the volume fraction of fibers traced by the XFiber extension.

There are multiple ways to measure the volume of fibers generated by the XFiber extension. The following lists these different ways where the overall volume% and volume of individual fibers can be extracted from the results of XFiber. The original grayscale image (named "Original_Image"), the spatial graph including the results of the XFiber (named "Correlation_Lines_Obtrained_from_XFiber"), and a binary image including the segmented fibers (named "Binary_Fiber_Image_Thresholded_from_Original_Image") have been used as input. The details of how these can be generated are provided in the software guideline (Look under User's Guide/XFiber/"The detection workflow for the example of steel fibers in reinforced concrete for details about how to generate the correlation lines" or find the projects in AVIZO_ROOT/data/tutorials/fibertracing/ ).

Spatial Graph Local Statistics module can help to extract several properties in different areas of the image. For measuring the volume%, however, there is a need to either define an estimate of the shape of the fibers or feed a binary image of the segmented fibers into the module to measure the vol% of the fibers.

For measuring the vol% using an estimated pre-defined fiber shape:

- Attach a Spatial Graph Local Statistics module to the spatial graph set generated by XFiber
- Set the "Compute Area" to Full Volume
- Under "Compute Input" set the object model to Cylinder and set the "Section Radius" to the estimated radius of the fibers, here 4 (it may be a good idea to set it to the same value as the "Outer Cylinder Radius" value used in Cylinder Correlation module that was used to extract the fibers).
- Click Apply.

In the attached file, please look at "Spatial Graph Local
Statistics_Object_Model" module.

Using this method, Avizo will assume a uniform fiber
shape around the spatial graphs and uses this assumption to construct and
measure the volume% of fibers in the overall image. A more accurate way to
measure the volume% would be to feed a binary image of the segmented fibers
into the Spatial Graph Local Statistics module.

For measuring vol% using a binary image including the
segmented fibers:

- Attach a Spatial Graph Local Statistics module to the spatial graph set generated by XFiber
- Set the "Compute Area" to Full Volume
- Under "Object Mask", select the binary image of the segmented fibers.
- Click Apply.

In the attached file, please look at "Spatial Graph Local
Statistics_Object_Mask" module.

If instead of the overall volume, there is a need to get
the statistics locally, the "Compute Area" can be defined differently.

To measure the variations of vol% in different blocks:

- Attach a Spatial Graph Local Statistics module to the spatial graph set generated by XFiber
- Set the "Compute Area" to "Input Cell".
- Under "Compute Option", Set the "Resolution" to "1" "10" "1". This will generate the local statistics in 10 blocks in the Y-direction.
- Under "Output", select "Density" and "Spreadsheet". The Density option will generate an image where brightness corresponds to the Volume% in each block and the Spreadsheet option will generate a table including the variations for different blocks.

In the attached file, look at "Spatial Graph Local
Statistics_Local_Variations".

It should be noted that generating a spreadsheet including all the results may be time- and memory-exhausting for larger files. A faster way to do this would be using a "Line Probe" module to read the information from the images generated from the Spatial Graph Local Statistics. An example of this is included on the line probe attached to the image (look at the "Line Probe for Local Variations in Volume" module attached to the image). Please keep in mind that Line Probe is directional, and the reported numbers start at Point 1 and end at Point 2.

In addition to generating statistics for the full volume or blocks of volume, volume of individual fibers can also be generated. If a binary image of segmented fibers is available, the "Fiber Shape Statistics" can be used to generate the volume of individual fibers.

To measure volume of individual fibers using a binary
image including the segmented fibers:

- Attach
a "Fiber Shape Statistics" module to the spatial graph.
- Set
the "Mask" to the binary image of the segmented fibers.
- Set
the "Grayscale" to the original image.
- Click
Apply.

The results can be found by looking at the "Fiber Shape
Statistics" module in the attached file.

It is also possible to have an estimate of the volume of
individual fibers without using a segmented image. This can be done by
converting the spatial graph into a label field, dilating the labels to an
estimated size, so they would have a volume close to the actual fibers, and
using label analysis to measure the volume of fibers.

To measure volume of individual fibers using an estimate of fiber shape:

- Attach a "Convert Geometry to Label" to the spatial graph.
- Set the "Reference" to the original grayscale image and select the option "Label Output".
- Attach a "Dilation" module, set the "Type" to "Ball" and set the "Size" to "3".
- Attach a "Label Analysis" module to the results and click Apply.

The file "Correlation_Lines_Obtrained_from_XFiber.Label-Analysis" will have the estimated volume of each fiber.

*The dataset used in this tutorial is an Ultra High-Performance Fiber Reinforced Concrete, courtesy provided by Dr. Alenka Mauko and Dr. Aljosa Sajna from the Slovenian National Building and Civil Engineering Institute.*