[Insight-users] How to add multi-seeds

Luis Ibanez luis.ibanez at kitware.com
Mon Nov 10 18:18:07 EST 2008


Hi Orientation f,


Each time that you call InsertElement, you should
increase the seed id number, for example by using
an integer "seedCounter" as in:


    seeds->InsertElement( seedCounter++, node );


Your code should be as follows:


          ImageType3D::IndexType seed;
          int seedCount;
          seedCount = m_SeedPoints.size();

          NodeType node;
          const double seedValue = 0.0;

          node.SetValue( seedValue );

          seeds->Initialize();

          for(int k=0; k<seedCount;k++)
            {
            seed[0]= start[0] + int( m_SeedPoints[k].xIndex );
            seed[1]= start[1] + int( m_SeedPoints[k].yIndex );
            seed[2]= start[2] + int( m_SeedPoints[k].zIndex );
            node.SetIndex( seed );
            seeds->InsertElement( k, node );
            }


          fastMarching->SetTrialPoints(  seeds  );



   Regards,


       Luis


----------------------
orientation f wrote:
> Hi,
> For multi-objects segmentation, it is necessary to set a set of seeds. 
> According to ITK examples, in level set segmentation, a single seed can 
> be located as follow:
> ImageType3D::IndexType seed;
>         int seedCount;
>         seedCount=m_SeedPoints.size();
>        
>         for(int k=0; k<seedCount;k++)
>         {
>                 seed[0]= start[0] + int( m_SeedPoints[k].xIndex );
>                 seed[1]= start[1] + int( m_SeedPoints[k].yIndex );
>                 seed[2]= start[2] + int( m_SeedPoints[k].zIndex );
>         }
>                
>         NodeType node;
>         const double seedValue = 0.0;
>        
>         node.SetValue( seedValue );
>         node.SetIndex( seed );
>        
>         seeds->Initialize();
>         seeds->InsertElement( 0, node );
>        
>         fastMarching->SetTrialPoints(  seeds  );
>  
> If I want to set several seeds ,what should I do?
> Thanks!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list