[Insight-users] More than one seed point in itk::FastMarchingImageFilter
Guido H. Jajamovich
gjajamo at gmail.com
Tue Jun 12 11:40:23 EDT 2012
Hi Francesco,
I would recommend changing the id of the second seed; that is,
seeds->Initialize();
seeds->InsertElement( 0, node1 );
seeds->InsertElement( 1, node2 ); // instead of:
seeds->InsertElement( 0, node2 );
It looks like you were replacing node1 with node2.
Sincerely,
Guido
On Tue, Jun 12, 2012 at 6:00 AM, Mr Francesco Grussu
<francesco.grussu at eecs.qmul.ac.uk> wrote:
> Dear all,
> I am trying to modify the FastMarchingImageFilter.cxx from the ITK Guide
> in order to use more than one seed point with a Fast Marching segmentation
> filter from itk::FastMarchingImageFilter .
>
> I suppose that I have to pass these seed points as Node containers
> (FastMarchingFilterType::NodeContainer) but I cannot understand how to do
> it exactly. Should I call the InsertElement() method of the
> FastMarchingFilterType::NodeContainer object (via a its smart pointer)
> more than once? To use more than one seed point, I thought to write
> something like that:
>
> ******************
>
> typedef FastMarchingFilterType::NodeContainer NodeContainer;
> NodeContainer::Pointer seeds = NodeContainer::New();
>
> InternalImageType::IndexType seedPosition1;
> seedPosition1[0] = SEED1X; // a macro previously defined
> seedPosition1[1] = SEED1Y; // a macro previously defined
>
> InternalImageType::IndexType seedPosition2;
> seedPosition2[0] = SEED2X; // a macro previously defined
> seedPosition2[1] = SEED2Y; // a macro previously defined
>
> const double seedValue = 0.0;
>
> typedef FastMarchingFilterType::NodeType NodeType;
>
> NodeType node1;
> node1.SetValue( seedValue );
> node1.SetIndex( seedPosition1 );
>
> NodeType node2;
> node2.SetValue( seedValue );
> node2.SetIndex( seedPosition2 );
>
> seeds->Initialize();
> seeds->InsertElement( 0, node1 );
> seeds->InsertElement( 0, node2 );
>
> ******************
>
> However, the segmentation I get is the same as if I had used just the
> second seed point (with node2). node1 seems to be completely ignored by
> the Fast Marching Filter.
> Do you have any suggestions?
>
> Thanks a lot,
> regards
>
> --Francesco
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list