[Insight-users] Templates created in compilation with different dimensions

Ricardo A Corredor ra.corredor at gmail.com
Mon Apr 15 12:49:20 EDT 2013


Hi,

I have one question about templates in ITK. Actually I have some code that
uses macros to create in compilation time all the  "templated declarations"
(it is not my code so I just say what I understand). I'm trying to use the
itkShiftScaleImageFilter, but I have a compilation error: "error: no
matching function for call ...". It seems that it is trying to use a 4D
image as input and a 3D image as output which is not coherent for the
filter, but in the framework I'm working I can force the output type, but
not the input type. So, I don't know if it should be responsibility of my
code to avoid the creation of a templated declaration with a dimension 4 or
if it should be responsibility of ITK code to avoid a compilation error when
the conversion is not possible.

Here I show you my error:

include/InsightToolkit/BasicFilters/itkShiftScaleImageFilter.txx: In
instantiation of ‘void itk::ShiftScaleImageFilter<TInputImage,
TOutputImage>::ThreadedGenerateData(const OutputImageRegionType&, int)
[*with TInputImage = itk::Image<double, 4u>; TOutputImage =
itk::Image<double, 3u>*; itk::ShiftScaleImageFilter<TInputImage,
TOutputImage>::OutputImageRegionType = itk::ImageRegion<3u>]’:
../packages/itk/src/bbitkShiftScaleImage.cxx:91:1:   required from here
../thirdparty_install/include/InsightToolkit/BasicFilters/itkShiftScaleImageFilter.txx:86:84:
error: no matching function for call to
‘itk::ImageRegionConstIterator<itk::Image&lt;double, 4u>
>::ImageRegionConstIterator(const InputImageType*, const
OutputImageRegionType&)’
../thirdparty_install/include/InsightToolkit/BasicFilters/itkShiftScaleImageFilter.txx:86:84:
note: candidates are:
In file included from
../thirdparty_install/include/InsightToolkit/Common/itkImageRegionIterator.h:20:0,
                 from
../thirdparty_install/include/InsightToolkit/BasicFilters/itkShiftScaleImageFilter.txx:21,
                 from
../thirdparty_install/include/InsightToolkit/BasicFilters/itkShiftScaleImageFilter.h:137,


Thanks and I hope any of you understand more or less my problem (hard to
explain :P)

Regards!


Ricardo
RaC



--
View this message in context: http://itk-users.7.n7.nabble.com/Templates-created-in-compilation-with-different-dimensions-tp31153.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list