<DIV>Hi Luis, </DIV>
<DIV>Thanks for you advices. I've tried the AddImageFilter, but it doesn't work for Vector images.</DIV>
<DIV> </DIV>
<DIV>Here is my code:</DIV>
<DIV> </DIV>
<DIV><!--StartFragment -->typedef itk::Vector<float,3> vectortype; <BR>typedef itk::Image<vectortype, 3> deformationFieldType; <BR><BR>typedef itk::AddImageFilter <deformationFieldType, deformationFieldType, deformationFieldType> addtype; <BR><BR>addtype::Pointer addFilter = addtype::New(); <BR></DIV>
<DIV> </DIV>
<DIV>And when I compile, I get the following errors:</DIV>
<DIV> </DIV>
<DIV>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(66): error C2440: 'initializing' : cannot convert from 'const itk::Image<TPixel,VImageDimension>::PixelType' to 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> and<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR>
TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix<T> operator +(const vnl_diag_matrix<T> &,const vnl_matrix<T> &)' : could not deduce template argument for 'const vnl_diag_matrix<T> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67):
error C2784: 'vnl_matrix<T> operator +(const vnl_matrix<T> &,const vnl_diag_matrix<T> &)' : could not deduce template argument for 'const vnl_matrix<T> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_diag_matrix<T> operator +(const vnl_diag_matrix<T> &,const vnl_diag_matrix<T> &)' : could not deduce template
argument for 'const vnl_diag_matrix<T> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_diag_matrix.h(236) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix<T> operator +(const vnl_matrix<T> &,const vnl_matrix_fixed<T,M,N> &)' : could not deduce template argument for
'const vnl_matrix<T> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(804) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix<T> operator +(const vnl_matrix_fixed<T,M,N> &,const vnl_matrix<T> &)' : could not deduce template argument for 'const
vnl_matrix_fixed<T,M,N> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(798) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix_fixed<T,M,N> operator +(T,const vnl_matrix_fixed<T,M,N> &)' : could not deduce template argument for 'const
vnl_matrix_fixed<T,M,N> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(646) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix_fixed<T,M,N> operator +(T,const vnl_matrix_fixed<T,M,N> &)' : could not deduce template argument for 'const vnl_matrix_fixed<T,M,N> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR>
[<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(646) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix_fixed<T,M,N> operator +(const vnl_matrix_fixed<T,M,N> &,T)' : could not deduce template argument for 'const vnl_matrix_fixed<T,M,N> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR>
TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(637) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix_fixed<T,M,N> operator +(const vnl_matrix_fixed<T,M,N> &,const vnl_matrix_fixed<T,M,N> &)' : could not deduce template argument for 'const vnl_matrix_fixed<T,M,N> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR>
TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix_fixed.h(628) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector<T> operator +(const vnl_vector<T> &,const vnl_vector_fixed<T,n> &)' : could not deduce template argument for 'const vnl_vector<T> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR>
TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(596) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector<T> operator +(const vnl_vector_fixed<T,n> &,const vnl_vector<T> &)' : could not deduce template argument for 'const vnl_vector_fixed<T,n> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR>
TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(587) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector_fixed<T,n> operator +(const vnl_vector_fixed<T,n> &,const vnl_vector_fixed<T,n> &)' : could not deduce template argument for 'const vnl_vector_fixed<T,n> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR>
[<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(576) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector_fixed<T,n> operator +(T,const vnl_vector_fixed<T,n> &)' : could not deduce template argument for 'const vnl_vector_fixed<T,n> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR>
[<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(509) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector_fixed<T,n> operator +(T,const vnl_vector_fixed<T,n> &)' : could not deduce template argument for 'const vnl_vector_fixed<T,n> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR>
]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(509) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector_fixed<T,n> operator +(const vnl_vector_fixed<T,n> &,T)' : could not deduce template argument for 'const vnl_vector_fixed<T,n> &' from 'const itk::Functor::Add2<TInput1,TInput2,TOutput>::AccumulatorType'<BR> with<BR> [<BR> TInput1=itk::Image<VectorType,3>::PixelType,<BR> TInput2=itk::Image<VectorType,3>::PixelType,<BR> TOutput=itk::Image<VectorType,3>::PixelType<BR>
]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector_fixed.h(499) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix<T> operator +(const T &,const vnl_matrix<T> &)' : could not deduce template argument for 'const vnl_matrix<T> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix.h(35) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_matrix<T> operator +(const T
&,const vnl_matrix<T> &)' : could not deduce template argument for 'const vnl_matrix<T> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_matrix.h(35) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector<T> operator +(T,const vnl_vector<T> &)' : could not deduce template argument for 'const vnl_vector<T> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR>
with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector.h(45) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2784: 'vnl_vector<T> operator +(T,const vnl_vector<T> &)' : could not deduce template argument for 'const vnl_vector<T> &' from 'const itk::Image<TPixel,VImageDimension>::PixelType'<BR> with<BR> [<BR> TPixel=VectorType,<BR>
VImageDimension=3<BR> ]<BR> C:\ITK\itk\Utilities\vxl\core\vnl\vnl_vector.h(45) : see declaration of 'operator`+''<BR>C:\ITK\itk\Code\BasicFilters\itkAddImageFilter.h(67): error C2677: binary '+' : no global operator found which takes type 'const itk::Image<TPixel,VImageDimension>::PixelType' (or there is no acceptable conversion)<BR> with<BR> [<BR> TPixel=VectorType,<BR> VImageDimension=3<BR> ]<BR></DIV>
<DIV><BR> </DIV>
<DIV> </DIV>
<DIV>Thanks for helping me, </DIV>
<DIV> </DIV>
<DIV>Monica</DIV>
<DIV> </DIV>
<DIV><BR><B><I>Luis Ibanez <luis.ibanez@kitware.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Monica,<BR><BR><BR>Did you tried the AddImageFilter ?<BR>http://www.itk.org/Insight/Doxygen/html/classitk_1_1AddImageFilter.html<BR><BR><BR>When you use the WarpImageFilter<BR>http://www.itk.org/Insight/Doxygen/html/classitk_1_1WarpImageFilter.html<BR>for deforming an input image using a Vector field, the<BR>Vector field is expected to have the same extent, and<BR>spacing as the input image. In other words they are<BR>defined over the same grid.<BR><BR>It shouldn't be too hard to modify this filter in order<BR>to use an arbitrary deformation field. Please let us<BR>know if you need help in making such changes in the code.<BR><BR><BR><BR>Thanks<BR><BR><BR><BR>Luis<BR><BR><BR><BR>---------------------------<BR>Monica Lumbardi wrote:<BR><BR>> Hi everyone,<BR>> <BR>> I would like to add one DeformationField to an other<BR>> DeformationField but I don't know how to do
it.<BR>> Has anybody an idea how to perform it?<BR>> I'm also interested in knowing what happens if I apply<BR>> DeformationField with <BR>> size: 157 189 136<BR>> spacing: 1 1 1<BR>> <BR>> to an image with:<BR>> size: 79 95 68<BR>> spacing: 2 2 2 <BR>> <BR>> Thanks in advance.<BR>> <BR>> Monica<BR>> <BR>> <BR>> <BR>> <BR>> __________________________________<BR>> Do you Yahoo!?<BR>> New and Improved Yahoo! Mail - 100MB free storage!<BR>> http://promotions.yahoo.com/new_mail <BR>> _______________________________________________<BR>> Insight-users mailing list<BR>> Insight-users@itk.org<BR>> http://www.itk.org/mailman/listinfo/insight-users<BR>> <BR><BR><BR><BR><BR></BLOCKQUOTE><p>
                <hr size=1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/50x/*http://promotions.yahoo.com/new_mail/static/efficiency.html">Yahoo! Mail</a> - 50x more storage than other providers!