<!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 &lt;Janne.Hamalainen@hus.fi&gt; wrote:<BR>
&gt;<BR>
&gt;&nbsp; Hi,<BR>
&gt;<BR>
&gt; I've made a filter that changes the output dimensions based on the data in<BR>
&gt; the input. I know that I need give the correct output regions when pipeline<BR>
&gt; update goes upstream using the GenerateOutputInformation-method, but in my<BR>
&gt; filter the output dimensions are known only after the GenerateData-method is<BR>
&gt; invoked. My question is what is the correct way to handle this situation? I<BR>
&gt; cannot obviously calculate the output regions (RequestedRegion etc.) during<BR>
&gt; the GenerateOutputInformation, because I cannot assume that the input is<BR>
&gt; unchanged. On the otherhand if I update the output regions during<BR>
&gt; GenerateData, the pipeline-mechanism does not work correctly, but I end up<BR>
&gt; giving the original (the regions of the input) to the next filter along the<BR>
&gt; pipeline. I hope I made myself clear, and hope someone can give a hint on<BR>
&gt; how to handle this situation...<BR>
&gt;<BR>
&gt; Cheers, Janne<BR>
&gt;<BR>
&gt;<BR>
&gt; --<BR>
&gt; Janne Hämäläinen<BR>
&gt; Physicist<BR>
&gt; HUS, Helsinki Medical Imaging Center<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; Insight-users mailing list<BR>
&gt; Insight-users@itk.org<BR>
&gt; <A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>