<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:MingLiU;
        panose-1:2 2 5 9 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:MingLiU;
        panose-1:2 2 5 9 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-TW link=blue vlink=purple style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi all,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Type definition are shown:<o:p></o:p></span></p><p class=MsoNormal style='text-indent:24.0pt'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU;color:blue'>typedef</span><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> itk::DiffusionTensor3D< PixelType > DTIPixelType;</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='text-indent:24.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU;color:blue'>typedef</span><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> itk::Image< DTIPixelType, 3 > DTIImageType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::VectorImage< DTIPixelType, 6> DTIOutputImageType;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::Image< PixelType, 3 > ScalarImageType;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:24.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU;color:blue'>typedef</span><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> itk::VectorIndexSelectionCastImageFilter< DTIImageType, <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> ScalarImageType > VectorSelectType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::ImageToVectorImageFilter< ScalarImageType > VectorCombineType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::ImageFileReader< DTIImageType > ReaderType;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::ImageFileWriter< ScalarImageType > WriterType;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'> <span style='color:blue'>typedef</span> itk::ImageFileWriter< DTIOutputImageType > DTIWriterType;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Error:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>If I assign a DTIOutputImageType::Pointer for the output of the ImageToVectorImageFilter and feed the writer the pointer, I get this<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'>1>.\ImageReadExportNifti4.cxx(177) : error C2440: 'initializing' : cannot convert from 'itk::VectorImage<TPixel,VImageDimension> *' to 'itk::SmartPointer<TObjectType>'<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US>If I put the output of the ImageToVectorImageFilter directly to the writer, I get this</span><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:MingLiU'>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> *'<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you in advance for your response.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Meng-Kang Hsieh (Michael)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>OpSciTech, Erasmus Mundus<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Delft University of Technology<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>