[Insight-users] [Insight-developers] use templated value as another templated parameter

Gao, Yi gaoyi.cn at gmail.com
Thu Jun 16 06:05:11 EDT 2011


Hi Cory,

Thank you! That helps a lot! Previously I didn't noticed this public
static attribute.... :)

Thanks!

Best,
yi



On Wed, Jun 15, 2011 at 11:12 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
> Yi,
>
> typedef itk::Image<double, typename TOutputImage::ImageDimension>
> InternalImageType;
>
> should work.
>
> Hope that helps,
> Cory
>
> On Wed, Jun 15, 2011 at 8:52 PM, Gao, Yi <gaoyi.cn at gmail.com> wrote:
>> Hi all,
>>
>> The email title seems to be strange.... My situation is:
>>
>> 1. I want to design an image filter class.
>>
>> 2. The filter class is templated over the input and output image
>> types, like this:
>>
>> template<typename TInputImage, typename TOutputImage>
>> class filter
>> {
>>   computeSomething();
>> }
>>
>> 3. In the member function computeSomething(), I need an intermediate
>> image storage, which is like:
>>
>> typedef itk::Image<double, TheDimensionOfInputImage> InternalImageType;
>>
>> Therefore I need to get the TheDimensionOfInputImage from the input
>> image and define this new template, but I knew that putting
>> GetImageDimension() there won't work....
>>
>> Could I know if there's a way of doing that?
>>
>>
>> Thanks!
>>
>> Best,
>> yi
>> _______________________________________________
>> 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://kitware.com/products/protraining.html
>>
>> 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-developers
>>
>
>
>
> --
> Cory Quammen
> Computer Integrated Systems for Microscopy and Manipulation (CISMM)
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~cquammen
>


More information about the Insight-users mailing list