Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
173 lines (109 sloc) 9 KB
title author date output
Exercise 4
Advanced Segmentation and Component Labeling
March 16, 2016
html_document

Downloading the data

  1. The data for the example can be downloaded from here
  2. Open the file in Archive Manager and extract the data to /scratch (only on D61.1 machines)

Many of these workflows are fairly complicated and would be time consuming to reproduce, follow the instructions here for how to import a workflow from the zip files on this site

Problems!

If you load a workflow and get an error message, click on the details button. If it says 'Node ... not available' it means you need to update your 'Image Processing Extensions' follow the instructions below to perform this update: instructions

  • If you cannot find the 'Salt and Pepper' node, this also means you are not using the latest Image Processing Extensions so update it as described above

Getting Started

  • Steps are shown in normal text, comments are shown in italics.

  • Knime Basics: here

  • Use workflow variables: here

Exploring ROC Curves

The task from the lecture of identifying the street Street in the road Road image. We thus have these data loaded in the workflow as the image and ground truth respectively.

ROC Curve

The ROC curve's discussed in the last lecture we will use as a tool for evaluating our accuracy for the rest of the course. An example work-flow is below to generate the above curve.

ROC Workflow

Download the workflows here

Tasks

  1. Where does filtering come into this workflow?
  • Which filter elements might improve the area under the ROC?
  • Try making workflows to test out a few different filters
  1. Where might morphological operations fit in?
  • How can you make them part of this workflow as well?
  1. (Challenge) Use the Parameter Optimization Loop Start node to find the best filter size to maximize the ROC area

Automatic Thresholding

The example takes on image of cells and simulates having a poor microscope, so we can test methods for performing thresholds even on very variable data.

Workflow

Basic Workflow - Automatic Thresholding

  1. Start KNIME (click OK for default workspace)
  2. Import the above Workflow from an Archive
  3. Right click the image reader to make sure it has downloaded, otherwise you can redownload the test image from here Test Image and import it using the 'Image Reader' (make sure to remove the old one first)
  4. Right click the 'Loop End' node and click 'Execute'
  5. View the output and it (scroll left) should look like the following table

Output Images

Tasks

  1. Try using different automatic threshold methods available in 'Global Threshold' to improve the results.
  • How will you quantify improvement
  1. Would adding a filter improve the results? Where should it be added and why?
  2. What other approaches could you use for segmenting images to get around the issue?
  3. Try to adjust the parameters to get the final result Output Images

Performing K-Means Analysis

In this example we use K-Means to automatically segment the images used in the second lecture

Workflow

  1. Right click the image reader to make sure it has downloaded, otherwise you can redownload the test images from here

New Nodes

  • K-Means
  • A node performing the K-Means analysis on a table (not an image!)
  • You can specify the number of clusters to find
  • You cannot specify a distance metric and the default is the Euclidean metric discussed in class.
  • You select the columns to use for the feature-vectors in analysis in the 'Include' area of the 'K-Means Properties' window.
  • Image to Labeled Table
  • This is a meta-node (feel free to open it) that turns an image into a feature vector representation so we can use it with various classification algorithms since they are only implemented on tables.

Tasks

  1. Adjust the number of groups in the KMeans and the weights used for the position components
  • What do the weights mean?
  • Does a set of values work for all images?

Advanced Tasks

  1. Add more image features by using the 'Joiner' tool and multiple 'Image to Labeled Table' to combine other common feature vectors (Gaussian, Sobel, etc)
  • Does this improve the segmentation?
  • How many new feature vectors can be added and still improve the final image?

Output Images

Trainable Segmentation

In this example we use a basic training method (Decision Tree) to learn how to segment data from a small test example. We then apply it to an entire image.

Workflow

  1. Right click the image reader to make sure it has downloaded, otherwise you can redownload the test images from here

When it is running correctly the result will look something like the image below Output Images

New Nodes

  • Interactive Annotator
  • This node lets you manually select labels, points, and seeds in your image using standard drawing tools.
  • The node can be finicky and often requires deleting all of the current labels and starting over
  • A brief video (please watch) showing how 3 rectangular labels can be added to a small image region is shown here

Tasks

  1. Using the interactive annotator, train the system to identify 2 different phases
  • Try 3, does it work well
  • Does the size or diversity (change image crop) of the regions change the final result?
  1. Advanced try adding more channels to the feature vector to improve the segmentation
  • Why can you not add position to this table?
  • What would you have to do to incorporate position?

Advanced Tasks

  1. Inside the 'Decision Tree Preparation' metanode there is a 'Column Filter' which removes the positions, add them back and see if the quality of the segmentation can be improved

Contouring

Workflow

Starting with the workflow from exercise 3 called Cell Segmentation, we see that the morphological operations perform a reasonable job for filling in the holes in the bone and identifying the bone area.

Output Images

Tasks

  1. Instead of the morphology block, use the 'Convex Hull'
  • Does the output look better or worse?
  • What advantages might the convex hull have over the morphological approach (hint: think about larger holes)
  1. Try using the 'Fill Holes'
  • How well does this work?
  • What advantages might this have?
  • What disadvantages might it have (what do the cracks mean?)
  1. How does using the different approaches affect the final calculations for porosity fraction
  2. How could these steps be combined to get a better result?

Appendix

LiveWire Contouring in MeVisLab

A free tool called MeVisLab offers LiveWire 3D contouring tools which work similar to the Photoshop version with much more flexibility. A tool (.mlab) and sample contour (.csv) are provided in here by David Haberthuer (david.haberthuer@psi.ch) from PSI demonstrating and visualizing this contouring on a human brain image. A video showing how it works is available here

Module Reference and CSO Reference