[Insight-developers] ImageToImageFilter: dimension reduction problem

Wilson Chang wmcst6+@pitt.edu
Fri, 29 Mar 2002 16:41:04 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_00D5_01C1D740.846513A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, We have been working on a visualization project with itk and vtk =
that requires having all of our images in 3-D or less.  Therefore, I =
have been working on a filter that reduces the number of dimensions of =
an image.  This filter inherits from the ImageToImageFilter class.  The =
snag that I have run into is the GenerateInputRequestedRegion function =
in the ImageToImageFilter class:


template<class TInputImage, class TOutputImage>
void=20
ImageToImageFilter<TInputImage,TOutputImage>
::GenerateInputRequestedRegion()
{
...
      =
input->SetRequestedRegion(this->GetOutput()->GetRequestedRegion());
...

This line of code basicly requires that the input and output image have =
the same number of dimensions.  When I try to override this =
GenerateInputRequestedRegion in my filter, I still get a compile error =
saying:

cannot convert from 'const class itk::ImageRegion<2>' to 'const class =
itk::ImageRegion<3>'

Is it possible that the superclass' definition of this function is being =
called regardless of whether i've redefined this function?=20

ideas?

thanks,
wilson

------=_NextPart_000_00D5_01C1D740.846513A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2712.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, We have been working on a =
visualization project=20
with itk and vtk that requires having all of our images in 3-D or =
less.&nbsp;=20
Therefore, I have been working on a filter that reduces the number of =
dimensions=20
of an image.&nbsp; This filter inherits from the ImageToImageFilter =
class.&nbsp;=20
The snag that I have run into is the GenerateInputRequestedRegion =
function in=20
the ImageToImageFilter class:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>template&lt;class TInputImage, class=20
TOutputImage&gt;<BR>void=20
<BR>ImageToImageFilter&lt;TInputImage,TOutputImage&gt;<BR>::GenerateInput=
RequestedRegion()<BR>{<BR>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
input-&gt;SetRequestedRegion(this-&gt;GetOutput()-&gt;GetRequestedRegion(=
));<BR></FONT><FONT=20
face=3DArial size=3D2>...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This line of code basicly requires that =
the input=20
and output image have the same number of dimensions.&nbsp; When I try to =

override this GenerateInputRequestedRegion in my filter, I still get a =
compile=20
error saying:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>cannot convert from 'const class=20
itk::ImageRegion&lt;2&gt;' to 'const class=20
itk::ImageRegion&lt;3&gt;'</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is it possible that the superclass' =
definition of=20
this function is being called regardless of whether i've redefined this=20
function? </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ideas?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>wilson</FONT></DIV></BODY></HTML>

------=_NextPart_000_00D5_01C1D740.846513A0--