We use Fiji and Ilastik to analyse the structure of silk fibers.
Given an image of silk fibers and Roi file indicating regions of interest and specific fibers of interest we do the following:
- Use Ilastik to identify the fibers in the image
- Use Fiji to analyse the fibers within the regions of interest
- Use Fiji to do additional analysis on the specific fibers marked by the user
The Fiji macro orchestrating all these steps is available at the Fiji folder.
We trained an auto-context Ilastik model to identify fibrillated structures in an image. To optimize the identification, three independent models were developed for each type of fibrillated structure: for bundles inside and outside a gland, and for the fibers at the nano-fibrlis stage. For each model the training used at least 3 representative images (available in the Ilastik folder).
The Ilastik version used to train and run the models is 1.3.3post3
Here we analyse all the fiber segments in the image to get their width and their type (either "Main" or "Connecting"). We also gather some overall information (e.g., Min/Max/Mean Main/Connecting fiber thickness), To do that:
- The image is converted to mask by running the Ilastik model to identify the fibers in it
- Than we run "Local thickness" on the image that creates an image where every pixel is replaced by its thickness (the radios of the maximal circle containing the pixel where the circle is fully resides in the image foreground)
- The Ilastik image is also used to create a skeleton image where the identified fibers are skeletonized
- We then segmentize the skeleton by removing the skeleton intersections.
- We then go over each segment in the segmentize skeleton, determine whether it is "main fiber" or "connecting fiber" according to its orientation and then get its width information using the local thickness image.
- To get the length of each segment we count the number of pixels in it. In case of the length of the "connecting fibers", we subtract from this count, the width of the "Main fibers" to which it is connected.
Here we specifically analyse the line rois provided by the user in the Roi file (see Appendix). These ROIs mark “Connecting fibers” of a specific "ladder" (consecutive fibers between two “Main fibers”). For each “Connecting fiber” in the ladder we calculate its width (min, max and mean) and its distance to the next connecting fiber in the ladder (min, max and mean). To get this information we do the following:
- We use the local thickness image (see Nano-fibrils... to extract for each ROI, in each ladder, in each region of interest, its min, max and mean width.
- To get the distance information between each connecting fiber to the next fiber we first create a mask containing only that fiber, and run a distance transform on it, getting the distance of any other pixel in the image to that fiber.
- Then, we find the fiber that its mid coordinates are the closest to that fiber. looking at the pixels of that fiber in the distance transform image gives us the desired distance information.
All measurements are scaled to microns using the "Scale" ROI provided by the user (see Appendix)
The ROI file provided by the user has the Fiji ROI file format and must be stored on disk at the same folder where the related image resides. Following Fiji's convention, the ROI file name should be identical to the image file name with "_RoiSet" suffix and a ".zip" extension.
The ROIs within the ROI file follow the following naming convention:
- "Scale" region: A line ROI that its length is equal to 200nm - Use to scale the image
- "RM" prefix indicates a region of interest where automatic fiber analysis is to be conducted
- "RC" prefix indicates a region of interest that contains a ladder - set of connecting fibers that connects two main fibers.
- All other ROIs in the file are line ROIs contained within an "RC" ROI marking the fibers of interest to be further analysed (see Semi-automated-analysis).