[Insight-developers] trouble creating a binary filter

Aaron Cois cacst11+ at pitt . edu
Tue, 4 Jun 2002 16:31:40 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_00A1_01C20BE5.4E040DA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Greetings all.  I have been attempting to create a filter which takes in =
two types of images as inputs (a source image and a =
BloxBoundaryPointImage), and outputs a third image type.  It is only =
templated over the type of source image, as both the output type and the =
second input type are to remain stoic. =20

Following the lead of itkBinaryFunctorImageFilter, i have used that =
notation:=20

    SetNthInput(0,  const_cast<SourceImageType *>( image1 ) );

in my SetInput1 and SetInput2 functions, and have added

    this->SetNumberOfRequiredInputs( 2 );

to my constructor. =20

Everything compiles and builds fine, and i can initialize an instance of =
the filter, set its inputs, and call GetOutput(), but when i call =
Update() on the filter, it crashes with an abnormal program termination. =
 It is not getting far enough to call GenerateData() before it crashes.  =
I haven't been able to get any useful information out of the debugger (i =
am using VC), and was wondering if anyone had experienced similar =
problems or had any thoughts.  Thanks in advance.=20

                                                                         =
               Aaron Cois

------=_NextPart_000_00A1_01C20BE5.4E040DA0
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.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Greetings all.&nbsp; I have been =
attempting to=20
create a filter which takes in two types of images as inputs (a source =
image and=20
a BloxBoundaryPointImage), and outputs a third image type.&nbsp; It is =
only=20
templated over the type of source image, as both the output type and the =
second=20
input type are to remain stoic.&nbsp; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Following the lead of =
itkBinaryFunctorImageFilter,=20
i have used that notation: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; SetNthInput(0,&nbsp; =

const_cast&lt;SourceImageType *&gt;( image1 ) );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>in my SetInput1 and SetInput2 =
functions, and have=20
added</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
this-&gt;SetNumberOfRequiredInputs( 2 );<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to my constructor.&nbsp; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Everything compiles and builds fine, =
and i can=20
initialize an instance of the filter, set its inputs, and call =
GetOutput(), but=20
when i call Update() on the filter, it crashes with an abnormal program=20
termination.&nbsp; It is not getting far enough to call GenerateData() =
before it=20
crashes.&nbsp; I haven't been able to get any useful information out of =
the=20
debugger (i am using VC), and was wondering if anyone had experienced =
similar=20
problems or had any thoughts.&nbsp; Thanks in advance. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
Aaron Cois</DIV></FONT></FONT></DIV></BODY></HTML>

------=_NextPart_000_00A1_01C20BE5.4E040DA0--