Please use this identifier to cite or link to this publication:
This document describes a filter called itkMultipleUnlabeledImagesToLabeledImageFilter, which takes multiple images as input and generates a single image of labeled pixels. Pixels to be labeled for each image are determined by an intensity threshold. Submitted with this document is the source code for the filter and source code for demonstrating filter usage via an image input as an argument. Also included is source code for testing the functionality of the filter.
minus 4 Files (109Kb)
minus Automatic Testing Results by Insight-Journal Dashboard on Wed Nov 1 20:01:55 2006 for revision #1
starstarstarstarstar expertise: 5 sensitivity: 4
yellow This project passed all of its tests.
Click here for more details.

Go here to access the main testing dashboard.

minus A useful review, but with some problems by Gaetan Lehmann on 10-31-2006 for revision #1
starstarstarstarstar expertise: 4 sensitivity: 4
The author present a new filter to combine several binary image in a single labeled image. Open Science:
The source code is provided, as well as the input images, but not the result image. It is easy to reproduce the example. Reproducibility:
I have downloaded, compile without problem. The test program can't run as it is: the ${CMAKE_SOURCE_DIR} string in images/testfiles is not expanded when read by the test program. Even by replacing manually the string above by the full path, I failed to get the expected output: the image is all black. Use of Open Source Software:
fully ITK Open Source Contributions:
The source code provided is designed to be reused, and is provided as a contribution to ITK Code Quality:
The code does not fully follow the ITK coding style (indentation, brackets, ...) - a minor issue - and doesn't use the pipeline architecture of ITK - this time, a major issue. Applicability to other problems:
It seem to be a quite common need to combine the result of different segmentations procedures in a labeled image. This code may be reused in many cases. Suggestions for future work:
  • use the ITK pipeline architecture. You can avoid doing most of the work by implementing your class as a subclass of NaryFunctorImageFilter.
  • provide the output image
  • fix the test. You should test the output image with ImageCompare
  • implement the collision case
  • perhaps call it NaryBinaryImageToLabelImageFilter ?
Additional Comments:
The problems above looks like small beginner's mistakes. Please contact me if you need some help to fix the problems above. I'd be pleased to help :-)

Comment by Robert Tamburo: Thanks for the review! yellow
Hi Gaetan, thanks for the review. I've addressed some of your suggestions and uploaded them. Changes made were:
- Changed the test to find input images correctly
- Provided the output image
- Added Image Compare to the CMake file to test the output image
- Fixed coding style (I manually spaced everything. I think XCode was autoformating and inserting tabs)

Your output image was actually probably correct. The labels that are assigned should take on values between 1-4, so the image may look completely black depending on the viewer used. I rescaled the intensities in a graphics editor for the picture in the article. I suppose I can add intensity rescaling to the test for visual verification.

I intended for the filter to operate on non-binary images in addition to binary images. That way a single image with more than one set of interesting pixels can be used. The filter uses a user-defined threshold for each input images and assigns a label to those pixels. Then the filter adds each of label images to form the output image. I took advantage filters already in ITK, namely itkThresholdImageFilter and itkAddImageFilter.

Anyway, I'll look into making it fit into the pipeline architecture (I think making the input image a vector image should do it). I'll also looking into subclassing from the NaryFunctorImageFilter.
Add a new review
Quick Comments

Download All

Statistics more
Global rating: starstarstarstarstar
Review rating: starstarstarstarstar [review]
Code rating: starstarstarstarstar
Paper Quality: plus minus

Information more
Categories: Filtering, Mathematical Morphology, Thresholding
Keywords: filter assigning labels
Toolkits: ITK, CMake
Export citation:


Linked Publications more
N4ITK:  Nick's N3 ITK Implementation For MRI Bias Field Correction N4ITK: Nick's N3 ITK Implementation For MRI Bias Field Correction
by Tustison N., Gee J.
Exporting Contours to DICOM-RT Structure Set Exporting Contours to DICOM-RT Structure Set
by Gorthi S., Bach Cuadra M., Thiran J.

View license
Loading license...

Send a message to the author
Powered by Midas