[Insight-developers] possible tcon topics

Miller, James V (CRD) millerjv at crd.ge.com
Fri Oct 27 09:42:57 EDT 2000


Have you tried setting your typedef as:

  typedef itk::Image<int, typename TImage::ImageDimension> TempImage;

Note the use of typename.

Does this work for your case?

Jim

-----Original Message-----
From: Lydia Ng [mailto:lng at statsci.com]
Sent: Thursday, October 26, 2000 1:28 PM
To: Insight-developers at public.kitware.com
Subject: [Insight-developers] possible tcon topics


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?



_______________________________________________
Insight-developers mailing list
Insight-developers at public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers




More information about the Insight-developers mailing list