[Insight-users] Region growing criteria based only on region boundary?
David Doria
daviddoria+itk at gmail.com
Wed Aug 5 14:34:55 EDT 2009
Using the ConnectedThresholdImageFilter, the [low, high] threshold must be
set to a constant value for the whole growing process. Using the
ConfidenceConnectedImageFilter, the statistics of the entire region that has
been formed so far is used in determining if the next pixel should be added
to the region. What I am looking for is a way to add the next pixel to the
region based on a test that only uses the query pixel's neighbors that are
already in the region.
In a 1D example, if the pixels are:
1 2 3 4 5 6 15 16 17
the neighborhood test is set to:
"is the query pixel less than 2 away from all of its neighbors that are
already in the region"
and the seed pixel is the left-most pixel, then "1 2 3 4 5 6" would be the
result of the region growth.
Looking at ConnectedThresholdImageFilter.txx, it seems like maybe I have to
define my own *Function class, so
typedef BinaryThresholdImageFunction<InputImageType, double> FunctionType;
could be changed to something like:
typedef RegionBoundaryDifferenceFunction<InputImageType, double>
FunctionType;
Then the growing would remain identical:
typename FunctionType::Pointer function = FunctionType::New();
typedef FloodFilledImageFunctionConditionalIterator<OutputImageType,
FunctionType> IteratorType;
IteratorType it ( outputImage, function, m_SeedList );
it.GoToBegin();
while( !it.IsAtEnd())
{
it.Set(m_ReplaceValue);
++it;
progress.CompletedPixel(); // potential exception thrown here
}
}
The details of RegionBoundaryDifferenceFunction would just be finding the
boundary points in the existing region that are neighbors of the query pixel
and seeing if they all meet a criteria. Is this close to where I should be
headed? Is there an existing framework that lets me override this part
without actually having to edit/add itk source?
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090805/4cbb151d/attachment.htm>
More information about the Insight-users
mailing list