[Insight-developers] possible tcon topics

Lydia Ng lng at statsci.com
Thu Oct 26 13:27:47 EDT 2000


Hi,

I have a couple of questions/issues that might be
interesting for the tcon and/or list-discussion

Issues:
1) Using C++ STL
2) Accessing the image dimension
3) Filters within filters

--------------------------------------------
1) For one of my algorithms I am making use of
the STL priority_queue (in <queue>) and
the STL sort function (in <algorithm>).

I know these work for VC++. Do they exist for gcc?
Are they robust/stable?
Should we be using a subset of the STL or can we use the whole library?

--------------------------------------------
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?

------------------------------------------------------------
3) Can we use filters within the operation of a filter?
Are there any major issues with doing things this way?






More information about the Insight-developers mailing list