Exercise 6: Analyzing Complex Shapes
- FIJI / ImageJ Macro's
- Read first about using FIJI and recording macros here
- For this exercise you will need to enhance the set of tools KNIME has access to using the plugins built into FIJI. Follow the instructions here for installing FIJI and setting the KNIME ImageJ1 Macro to find it's plugin folder
- ImageJ1 Macro
- This node allows you to run ImageJ macros on images in KNIME.
- You specify the macro to run in the panel below. There are pre-built 'Snippets' which can be selected or 'Pure Code' where everything can be copy and pasted from a Macro created in ImageJ
- The macro is then run on each image in a selected column one row at a time
- There are two output ports, the first is the image, the second the results table
- Most plugins do not place information in the results table, but for certain ones like histograms or thickness they will
In this exercise you will build together a chain of analyses step by step. You import the first workflows (which have some components preassembled) and then work to build them together
- Start KNIME.
- Download this workflows.
- Import the above Workflow from an Archive.
Part 1 - Object Simulation (3DBlobSimulator)
In this portion you will get comfortable with making 3D objects, using similar tools to what we had before. The objects now have both a position and dimensions in X, Y, and Z.
- Try using the different input tables to generate different images
- Create grid of overlapping balls like the one shown
- How would you create a cylinder using the position and radius ellipsoid model we have specified?
- Add noise to the output image (Salt and Paper and other types). This is particularly useful for later sections since poor segmentations will strongly affect the results of specific analyses.
Part 2 - Thickness Analysis
In this part you will calculate the thickness using the ImageJ plugin developed by Bob Dougherty with the source code available here. It can be found in FIJI under the Analyze -> Local Thickness menu.
The workflow should at the end look something like follows.
- Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Thickness Analysis
- Connect the components together so it works
- Verify that the thickness gives the right results by using the Line Chart blocks
- What happens when the balls overlap?
- What is the thickness of a cylinder? Does this make sense?
- What happens when the object is larger than the field of view?
- What happens as you add noise? How much noise is it robust against?
Part 3 - Watershed Labeling (and 2D)
In this part you will use the watershed labeling and compare the results with the standard connected component labeling KNIME.
-The goal is to go from an image like this
Since here we assume these are two cells which just happen to be located very close to one another and do not want them labeled as part of the same object
- Start with the 2D model which includes all the nodes already
- How do you compare the different methods?
- Which works best?
- Is there a morphological-based method that might work as well?
- Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Watershed Segmentation
- Connect the components together so it works and use the 'Double Ball Overlap' as an easy test image.
- The 'Connected Component Analysis' should give you an image like the one shown above
- Use the 'Watershed' based on the distance map and other blocks to try and get the second image.
- Why is the Connected Component Analysis block needed for this approach?
- Try using a morphological based approach to get a third segmentation
Part 4 - Skeleton Analysis
In this section, the focus is to adjust thinning and pruning techniques to try and segment the provided image better into a skeleton object.
Here is standard component labeling
Here is what the vessels look like after they have been thinned, labeled, and regrown
The workflow itself
- Adjust the settings so you get each branch as a separate component (its own label)
- Calculate the segments and export the results in table like below
- Add smaller vessels to the
Basic Cylinder/Vessel Template
- Add noise to the input image and determine how tolerant the system is to noise
Part 5 - Curvature Analysis (Advanced)
In this part you will calculate the thickness using the ImageJ plugin developed by Stephan Preibisch and Mark Longair with the source code available here. It can be found in FIJI under the Plugins -> Analyze -> Compute Curvatures menu.
- This requires that the
VIB-lib-2.0.0-SNAPSHOT.jarfile is manually copied from the FIJI/jars folder to the FIJI/Plugins folder otherwise it will not run correctly and you will see an error message
The final workflow (parallel pipeline) should at the end look something like follows.
The premade surface curvature node looks like this
- Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Curvature Analysis
- Connect the components together so it works
- Calculate the curvature for a simple system with one sphere
- Adjust the parameters in the ImageJ Macro block, specifically 'sigma'
- What does sigma do?
- How does it affect the final results?
- Make a parallel pipeline with another sized sphere and compare them