[Insight-users] convert/caster/ itk::VectorImage<unsigned char, 3u> to itk::Image<itk::Vector<unsigned char, 3u>, 3u>

Baoyun Li baoyun_li123 at yahoo.com
Tue Mar 10 11:40:02 EDT 2009


Dear  All:

I am trying to do some statistical classification following below ITK documents: Insight-StatisticalClassification.ppt.

http://www.na-mic.org/svn/NAMICSandBox/trunk/ITKAdvancedCourse/doc/presentations/Insight-StatisticalClassification.ppt

I am working on two program:

1, ConverImageToVectorImage.cxx 

 2, ImageKmeansModelClassifier.cxx 


Both program works well individually, now I am trying to put them together, that means read 3 individual image and perform kmeans classification.
I have the following problem.

1: the output of itk::ImageToVectorImageFilter< ImageType > is vector image type--------itk::VectorImage<unsigned char, 3u>
2: the input of  itk::ImageKmeansImageFilter is image type-----------------itk::Image<itk::Vector<unsigned char, 3u>, 3u> .

If I used ImageKmeansImageFilter->SetInput(ImageToVectorImageFilter->GetOutput()), the program does not work.

But if we save the output of ImageToVectorImageFilter, and read itk::Image, the program works.

Can somebody told me how to convert itk:VectorImage to itk:Image? 
Will itk::VectortoImageAdptor works? I looks the itk::VectortoImageAdptor  documents, still not clear how to use it.

Can somebody teach me more detial?


Baoyun


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090310/ce52352e/attachment.htm>


More information about the Insight-users mailing list