[Insight-users] Filter with 2 different output types gets updated twice?
Parag Chandra
pchandra@radonc.unc.edu
Fri, 28 Feb 2003 15:22:02 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0065_01C2DF3D.2522C530
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've written a custom filter (derived from ImageToImageFilter) which =
produces both an Image and a PointSet and takes a single input Image. I =
have overridden GenerateOutputInformation() so that only the output =
image copies information from the input image, and I have also =
overridden GenerateOutputRequestedRegion() so that it does nothing, =
because it doesn't make sense to set a pointset's region to an image's =
region and vice versa. My test program simply connects an ImageWriter to =
the filter's image output, and a PointSetWriter to the filter's pointset =
output and calls Write() on each of those writers. Both calls to Write() =
trigger my filter's GenerateData() method because along the way, =
DataObject::PropagateRequestedRegion() is called and that makes a call =
to PointSet::RequestedRegionIsOutsideOfTheBufferedRegion(). This last =
call always returns true because PointSet::m_BufferedRegion is always =
-1. What is the best way to overcome this and write a filter that =
produces different types of outputs?
Thanks.
-Parag Chandra
------=_NextPart_000_0065_01C2DF3D.2522C530
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.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I've written a custom filter (derived =
from=20
ImageToImageFilter) which produces both an Image and a PointSet and =
takes a=20
single input Image. I have overridden GenerateOutputInformation() so =
that only=20
the output image copies information from the input image, and I have =
also=20
overridden GenerateOutputRequestedRegion() so that it does nothing, =
because it=20
doesn't make sense to set a pointset's region to an image's region and =
vice=20
versa. My test program simply connects an ImageWriter to the filter's =
image=20
output, and a PointSetWriter to the filter's pointset output and calls =
Write()=20
on each of those writers. Both calls to Write() trigger my filter's=20
GenerateData() method because along the way,=20
DataObject::PropagateRequestedRegion() is called and that makes a call =
to=20
PointSet::RequestedRegionIsOutsideOfTheBufferedRegion(). This last call =
always=20
returns true because PointSet::m_BufferedRegion is always -1. What is =
the best=20
way to overcome this and write a filter that produces different types of =
outputs?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-Parag =
Chandra</FONT></DIV></BODY></HTML>
------=_NextPart_000_0065_01C2DF3D.2522C530--