[Insight-developers] Re: [Insight-users]
ScalarImageToHistogramGenerator with mask support
Karthik Krishnan
karthik.krishnan at kitware.com
Fri Nov 24 14:05:25 EST 2006
On 11/22/06, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>
>
> Hi,
>
> I need to generate an histogram of an image, but only in a mask... and
> ScalarImageToHistogramGenerator doesn't support masks.
>
> Is there a class to do that in ITK ?
Sorry for the late reply.
Yes, I wrote a bunch of classes to do that.. but its not in ITK yet..
The class you're looking for below is itk::ImageToListGenerator that takes a
scalar image and generates a list sample and optionally accepts a mask as
well, which is specified, the class will generate list samples confined to
the mask. Once you have that sample (itk::ListSample), you can use the usual
ITK classes to do what you want with it, for instance generating a
histogram.. For example, below this class is used to generate K-means within
the mask.
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2Ftrunk%2FBayesianSegmentationModule%2FitkImageToListGenerator.h&rev=1106&sc=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2Ftrunk%2FBayesianSegmentationModule%2FitkImageToListGenerator.txx&rev=0&sc=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2Ftrunk%2FBayesianSegmentationModule%2FitkImageToListGeneratorTest.cxx&rev=0&sc=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2Ftrunk%2FBayesianSegmentationModule%2FitkScalarImageKmeansImageFilterWithMask.h&rev=0&sc=0
http://www.na-mic.org:8000/websvn/filedetails.php?repname=NAMICSandBox&path=%2Ftrunk%2FBayesianSegmentationModule%2FitkScalarImageKmeansImageFilterWithMask.txx&rev=0&sc=0
If you want, I can add it to ITK in a couple of days.. It'll be good if you
can look at the code and see if it suits your needs.
Thanks
Regards
-karthik
A quick look at the code used in ScalarImageToHistogramGenerator show that
> the changes to implement that feature will not be easy.
> I would be pleased to write the code to implement that feature, but as I'm
> not familiar with the satistic framework, I would appreciate some advice
> about the way to go.
>
> Thanks,
>
> Gaetan
>
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
--
Karthik Krishnan
R&D Engineer,
Kitware Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20061124/1f5de6f4/attachment.htm
More information about the Insight-developers
mailing list