It will label the objects and color the object separately. Each object is a region of pixels of similar magnitude. What is the condition for pixels belonging to the same object (a region)? (PixelType distanceThreshold = 4; To my knowledge, the algorithm compares neighboring pixels with interest pixel, if the intensity of the absolute value between the pixel and interest pixel is smaller than or equal the value of the threshold T=4 above, the nearby pixel is included in the region where the interest pixel is located). But I think only the threshold value is not enough to define a region? I still do not understand how an object (a region) is formed??
-The minSize is set, all objects with fewer pixels than the minimum will be discarded. So, after applying the threshold will get the neighboring pixels, and minSize will determine the number of pixels in that region. Is that right?
-Label: 1
min: -210
max: 162
median: -1638.88
mean: -5.03348
sigma: 16.4559
variance: 270.796
sum: -541034
count: 107487
region: ImageRegion (000000994B9AF658)
Dimension: 2
Index: [50, 61]
Size: [391, 391]
The result above is for an object. What is the index value (Index: [50, 61]) ? And why the min value is negative (for grayscale images)?
I really started with the ITK library. It’s really great. Thank you for your help! :))
To learn more about what a filter does, read its description found on Doxygen. In this case, this ConnectedComponentFunctorImageFilter does the segmentation. To see the details, look at the code.
Index: [50, 61] is the top-left pixel of the bounding box region containing label 1. The CT images have values typically ranging from -1000 to +3000. Region “1” contains some negative values.
The median: -1638.88 seems wrong. If the minimum value is -210, the median cannot be lower than that. This might be a bug. Can you tell us how you invoked the example? ITK version, which image did you use as input etc.
Hi @dzenanz!
thank you very much!
Index: [50, 61] is the top-left pixel of the bounding box region containing label 1. It means the box is a rectangle or square. So that region is any shape or any closed curve is it true?
I run that example by ITK 4.11.0. The image is a phantom (with T=30, minSize=2). this image: b.dcm (515.0 KB)
many thanks,
As for how the algorithm works: regular connected components filter groups into a single object only filters which have exactly the same intensity. Scalar connected component starts with each pixel as a single object, then merges them if any two adjacent pixels on the object borders have intensity difference smaller than “distanceThreshold”. If you have a gradient image which ranges from 0 to 255 in intensities, tester.exe C:\a\01gradient.png 25 100 produces a single object:
The problem is that histogram resolution is not enough to properly calculate the median value. All the values fall into the bin with lowRange of -0.5 and highRange of 3276.25 (middle of which is 1637.875).
If we add labelStatisticsImageFilter->SetHistogramParameters(256, -1024, 3072); before labelStatisticsImageFilter->Update();, the medians are calculated reasonably: