Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
130 lines (88 sloc) 6.82 KB

Exercise 6: Analyzing Complex Shapes

  1. FIJI / ImageJ Macro's
  • Read first about using FIJI and recording macros here
  1. 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

New Nodes

  • 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
  • Macro Panel
  • 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

Setup

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

Basic Workflow

  1. Start KNIME.
  2. Download this workflows.
  3. 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.

Tasks

  1. Try using the different input tables to generate different images
  2. Create grid of overlapping balls like the one shown
  • Grid
  1. How would you create a cylinder using the position and radius ellipsoid model we have specified?
  2. 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.

Workflow Overview

Tasks

  1. Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Thickness Analysis
  2. Connect the components together so it works
  3. Verify that the thickness gives the right results by using the Line Chart blocks
  4. What happens when the balls overlap?
  5. What is the thickness of a cylinder? Does this make sense?
  6. What happens when the object is larger than the field of view?
  7. 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

  • CCA
  • To an image like this
  • CCA

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

Tasks

Workflow 2D

  1. 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?
  1. Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Watershed Segmentation
  2. Connect the components together so it works and use the 'Double Ball Overlap' as an easy test image.
  3. The 'Connected Component Analysis' should give you an image like the one shown above
  4. 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?
  1. 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

  • Skeleton CCA

Here is what the vessels look like after they have been thinned, labeled, and regrown

  • Skeleton Grid

The workflow itself

Workflow 2D

Tasks

  1. Adjust the settings so you get each branch as a separate component (its own label)
  2. Calculate the segments and export the results in table like below
  • Skeleton Output
  1. Add smaller vessels to the Basic Cylinder/Vessel Template
  2. 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.jar file 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.

Workflow Overview

The premade surface curvature node looks like this

Workflow Overview

Tasks

  1. Select all the nodes from 3DBlobSimulator and copy/paste (this works) them into Curvature Analysis
  2. Connect the components together so it works
  3. Calculate the curvature for a simple system with one sphere
  4. Adjust the parameters in the ImageJ Macro block, specifically 'sigma'
  • What does sigma do?
  • How does it affect the final results?
  1. Make a parallel pipeline with another sized sphere and compare them
  • You should get a chart like below when it is running correctly
  • Compare Balls