[Insight-users] Further connected component questions

Luis Ibanez luis . ibanez at kitware . com
Sun, 07 Dec 2003 20:32:10 -0500


Hi Radhika,

Thanks for your clarification.

In order to get the list of indices in the mask of one of
the components you can simply use a while() loop using the
ImageRegionConstIteratorWithIndex.
http://www . itk . org/Insight/Doxygen/html/classitk_1_1ImageRegionConstIteratorWithIndex . html

Something like:

typedef itk::Image< char, 3 > ImageType;
typedef itk::ImageRegionConstIteratorWithIndex   IteratorType;

ImageType::Pointer image = GetImageOfComponent();

IteratorType it( image, image->GetBufferedRegion() );

it.GoToBegin();
while( !it.IsAtEnd() )
   {
   if( it.Get() != 0 )
     {
     std::cout << it.GetIndex() << std::endl;
     }
   ++it;
   }



About the other measures, there are no specific
filters in ITK for performings such measures
subject to a mask.  You can however use variants
of the while() loop shown above in order to
compute those measures.

If your images are 2D you could consider the
itkPath class and its relatives in order to
represent boundaries.


Regards,


    Luis



-----------------------------
Radhika Sivaramakrishna wrote:

> Hi Luis,
> I am sending this from my home account, since I am subscribed on both. I am
> absolutely
> thrilled about the turnaround time on this group and how fast and
> painstakingly you
> reply to questions.
> Thanks for all the responses. They have been really helpful.
> In continuation of my earlier questions:
> 
> 1) By list of voxels, I meant indices of the voxels.
> 
> 
> Regarding the other questions on comparing one component to the other:
> yes, I do need to be able to do all that you suggested:
> 
>     1) Their size in voxels
>     2) average intensity
>     3) lengths of their boundaries
>     4) comparing x, y and z extents of each against other etc.
> 
> Thanks
> Radhika
> 
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>