<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7232.11">
<TITLE>RE: [Insight-users] Pipeline execution when output information depends on input data</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Yes, the output dimension is a function of the data in the input image (the bounding region as you guessed correctly ;). That's exactly the reason for the problem...<BR>
<BR>
-Janne<BR>
<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Jim Miller [<A HREF="mailto:millerjv@gmail.com">mailto:millerjv@gmail.com</A>]<BR>
Sent: Sat 7/8/2006 3:54 PM<BR>
To: Hämäläinen Janne<BR>
Cc: insight-users@itk.org<BR>
Subject: Re: [Insight-users] Pipeline execution when output information depends on input data<BR>
<BR>
Can you provide a bit more information as to the output dimensions are not<BR>
known until GenerateData() is invoked?<BR>
<BR>
If the output dimension is a function of the input dimension and other<BR>
parameters of the filter, then you should be able to code that in the<BR>
GenerateOutputInformation() method.<BR>
<BR>
If the output dimension is a function of the data in the input image, for<BR>
instance a bounding region about a foreground object, then this is another<BR>
story.<BR>
<BR>
GenerateOutputInformation() is responsible for setting the<BR>
LargestPossibleRegion of the output, the spacing, the origin, the<BR>
directions, and the number of components per pixel. A filter needs to<BR>
provide an implementation of this method if the filter changes the size of a<BR>
pixel, changes the dimension of an image (3D to 2D), etc.<BR>
<BR>
The RequestedRegions are established via other calls to the pipeline.<BR>
<BR>
Jim<BR>
<BR>
<BR>
On 7/6/06, Hämäläinen Janne <Janne.Hamalainen@hus.fi> wrote:<BR>
><BR>
> Hi,<BR>
><BR>
> I've made a filter that changes the output dimensions based on the data in<BR>
> the input. I know that I need give the correct output regions when pipeline<BR>
> update goes upstream using the GenerateOutputInformation-method, but in my<BR>
> filter the output dimensions are known only after the GenerateData-method is<BR>
> invoked. My question is what is the correct way to handle this situation? I<BR>
> cannot obviously calculate the output regions (RequestedRegion etc.) during<BR>
> the GenerateOutputInformation, because I cannot assume that the input is<BR>
> unchanged. On the otherhand if I update the output regions during<BR>
> GenerateData, the pipeline-mechanism does not work correctly, but I end up<BR>
> giving the original (the regions of the input) to the next filter along the<BR>
> pipeline. I hope I made myself clear, and hope someone can give a hint on<BR>
> how to handle this situation...<BR>
><BR>
> Cheers, Janne<BR>
><BR>
><BR>
> --<BR>
> Janne Hämäläinen<BR>
> Physicist<BR>
> HUS, Helsinki Medical Imaging Center<BR>
><BR>
> _______________________________________________<BR>
> Insight-users mailing list<BR>
> Insight-users@itk.org<BR>
> <A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
><BR>
><BR>
><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>