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

Matt McCormick matt.mccormick at kitware.com
Mon Apr 15 13:16:12 EDT 2013


Hi Ricardo,

Generally, there should be concept checks for dimensions per here:

  http://www.itk.org/Wiki/ITK/Proposals:Concept_Checking

If there is not one for your specific case, please consider
contributing a patch:

  http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html

Thanks,
Matt

On Mon, Apr 15, 2013 at 12:49 PM, Ricardo A Corredor
<ra.corredor at gmail.com> wrote:
> 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.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list