[Insight-developers] (no subject)

Yinpeng Jin yj76@columbia.edu
Wed, 24 Jan 2001 11:44:37 -0500


How do I define a image object with the same dimension from the templated
input?
for example:

template <class Tinput>
class A{

typedef Image <bool, Tinput::ImageDimension> boolImage;

boolImage::Pointer m_boolMember;
}


this doesn't work, the error message is below, I guess the complier just
assume that Tinput::ImageDimension is 0.

c:\insight\insight\code\common\itksize.h(197) : warning C4200: nonstandard
extension used : zero-sized array in struct/union
        c:\insight\insight\code\common\itkimageregion.h(175) : see reference
to class template instantiation 'itk::Size<0>' being compiled
        c:\insight\insight\code\common\itkimage.h(418) : see reference to
class template instantiation 'itk::ImageRegion<0>' being compiled
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(100) : see reference
to class template instantiation 'itk::Image<double,0,class
itk::ValarrayImageContainer<unsigned long,double> >' being compiled
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(102) : see reference
to class template instantiation
'itk::SegmentFuzzyBasic<TInputImage,TOutputImage>' being compiled
c:\insight\insight\code\common\itkimageregion.h(175) : error C2229: class
'itk::ImageRegion<0>' has an illegal zero-sized array
        c:\insight\insight\code\common\itkimage.h(418) : see reference to
class template instantiation 'itk::ImageRegion<0>' being compiled
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(100) : see reference
to class template instantiation 'itk::Image<double,0,class
itk::ValarrayImageContainer<unsigned long,double> >' being compiled
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(102) : see reference
to class template instantiation
'itk::SegmentFuzzyBasic<TInputImage,TOutputImage>' being compiled
c:\insight\insight\code\common\itkimage.h(419) : error C2229: class
'itk::Image<double,0,class itk::ValarrayImageContainer<unsigned long,double>
>' has an illegal zero-sized array
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(100) : see reference
to class template instantiation 'itk::Image<double,0,class
itk::ValarrayImageContainer<unsigned long,double> >' being compiled
        c:\myinsight\itksegment\itksegmentfuzzybasic.h(102) : see reference
to class template instantiation
'itk::SegmentFuzzyBasic<TInputImage,TOutputImage>' being compiled