[Insight-users] Problem in writing vector images
Hsieh
M.Hsieh at student.tudelft.nl
Mon Apr 11 09:12:04 EDT 2011
Hi all,
After extracting scalar components from vector image using
itkVectorIndexSelectionCastImageFilter.h and some image processing on
each of them, now I want to put these scalar images back into one vector
image by using, idea searched from the insight user archive,
itkImageToVectorImageFilter.h, a type conversion error occurred when I
tried to write the "VectorImage" image from the output of
itkImageToVectorImageFilter to the image file writer.
Type definition are shown:
typedef itk::DiffusionTensor3D< PixelType > DTIPixelType;
typedef itk::Image< DTIPixelType, 3 > DTIImageType;
typedef itk::VectorImage< DTIPixelType, 6> DTIOutputImageType;
typedef itk::Image< PixelType, 3 > ScalarImageType;
typedef itk::VectorIndexSelectionCastImageFilter< DTIImageType,
ScalarImageType >
VectorSelectType;
typedef itk::ImageToVectorImageFilter< ScalarImageType >
VectorCombineType;
typedef itk::ImageFileReader< DTIImageType > ReaderType;
typedef itk::ImageFileWriter< ScalarImageType > WriterType;
typedef itk::ImageFileWriter< DTIOutputImageType >
DTIWriterType;
Error:
If I assign a DTIOutputImageType::Pointer for the output of the
ImageToVectorImageFilter and feed the writer the pointer, I get this
1>.\ImageReadExportNifti4.cxx(177) : error C2440: 'initializing' :
cannot convert from 'itk::VectorImage<TPixel,VImageDimension> *' to
'itk::SmartPointer<TObjectType>'
If I put the output of the ImageToVectorImageFilter directly to the
writer, I get this
1>.\ImageReadExportNifti4.cxx(178) : error C2664:
'itk::ImageFileWriter<TInputImage>::SetInput' : cannot convert parameter
1 from 'itk::VectorImage<TPixel,VImageDimension> *' to 'const
itk::VectorImage<TPixel,VImageDimension> *'
I wonder if the problem is caused by the typedef of the images. I'm
confused between "Vector" image type and "VectorImage" image type. Is
there a specific writer for the VectorImage type? Or is there another
way to do what I intended, combining scalar images to one vector image?
Thank you in advance for your response.
Best regards,
Meng-Kang Hsieh (Michael)
OpSciTech, Erasmus Mundus
Delft University of Technology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110411/7104d1dd/attachment.htm>
More information about the Insight-users
mailing list