[Insight-developers] possible tcon topics
Luis Ibanez
ibanez at cs.unc.edu
Thu Oct 26 14:38:44 EDT 2000
Hi,
Your code in the first part of (2) looks fine.
Is this error ("zero size structure") produced by VC++ ?
I use to access the image dimension in the same way as you do,
in particular for creating iterators, and that worked ok.
Could you please, post the error message, and the line
in which it seems to be produced.
Thanks
Luis
----------------------------------
Lydia Nag wrote:
2) Suppose in my process I want a temporary image
of type int and the same size/dimension of an input image.
I first tried something like this:
template< class TImage>
class MyProcess
{
public:
typedef itk::Image<int,TImage::ImageDimension> TempImage;
typename TempImage::Pointer temp;
};
void main()
{
typedef itk::Image<float,2> ImageT;
MyProcess<ImageT> aProcess;
}
But I get an error complaining about zero size structure. Probably
due to TImage::ImageDimension not being passed properly.
My second attempt includes an extra template parameter for MyProcess:
template< class TImage, unsigned int VDimension =
TImage::ImageDimension>
class MyProcess
{
public:
typedef itk::Image<int,VDimension> TempImage;
typename TempImage::Pointer temp;
};
This works fine but it is this bad style?
Should I be doing this another way?
-----------------------------------------------------
More information about the Insight-developers
mailing list