[Insight-users] FastMarchingImageFilter seed points
Luis Ibanez
luis . ibanez at kitware . com
Tue, 03 Jun 2003 13:21:00 -0400
Hi Tim,
Right now there is not a direct way to provide
a labeled image as a representation of seed points.
However this is actually a good idea since there
are several methods that can easily generate good
sets of seed points. (e.g. confidence connected
with a low variance multiplier, and statistical
classifiers).
The following code could help you to generate
seed points from your labeled image.
---------------------------------------------------------------
typedef itk::Imge<unsigned char, 3> LabelImageType;
typedef itk::ImageRegionConstIteratorWithIndex<
LabelImageType > IteratorType;
IteratorType it( image, image->GetBufferedRegion() );
it.GoToBegin();
typedef FastMarchingFilterType::NodeContainer NodeContainer;
typedef FastMarchingFilterType::NodeType NodeType;
NodeContainer::Pointer seeds = NodeContainer::New();
seeds->Initialize();
NodeType node;
node.SetValue( 0.0 );
unsigned int i=0;
while( !it.IsAtEnd() )
{
if( it.Get() )
{
node.SetIndex( it.GetIndex );
seeds->InsertElement( i, node );
++i;
}
++it;
}
fastMarching->SetTrialPoints( seeds );
---------------------------------------------------------
We could integrate these lines in a method like "SetSeedImage()"
or something along those lines in the FastMarching filter.
The most relevant issue would probably be the definition of the
label. In the code above, we assume that pixel != 0 means that
the pixel is a seed point. However in a labeled image, people
may prefer to store multiple labeling schemes, for example
storing 8 segmentations one in each bit plane...
One possible compromise is to create a new class:
ImageToNodesFilter< InputImage, NodeContainer, Functor >
It would be templated over the input image, the output node
container and the Functor defining the boolean condition under
which the pixel will be considered to be a seed point.
In this way we don't have to modify the FastMarching filter,
and we could be able to maximize the flexibility of the
LabeledImage to Seeds conversion.
Regards
Luis
---------------------
Tim Rudge wrote:
> Hi,
>
> Is it possible to set seed trial points in the FastMarchingImageFilter
> by directly supplying the LabelImage? The reason I ask is that I want to
> supply the seeds from another filter, e.g. a threshold, where they are
> already setup in an image of the same dimensions as the dataset.
>
> Thanks,
> Tim
>
> Tim Rudge
> ---------
> Cellular Development Lab
> Dept. Plant Sciences
> Cambridge University
> _______________________________________________
> Insight-users mailing list
> Insight-users at public . kitware . com
> http://public . kitware . com/mailman/listinfo/insight-users
>