Can you provide a bit more information as to the output dimensions are not known until GenerateData() is invoked?<br><br>If the output dimension is a function of the input dimension and other parameters of the filter, then you should be able to code that in the GenerateOutputInformation() method.
<br><br>If the output dimension is a function of the data in the input image, for instance a bounding region about a foreground object, then this is another story. <br><br>GenerateOutputInformation() is responsible for setting the LargestPossibleRegion of the output, the spacing, the origin, the directions, and the number of components per pixel. A filter needs to provide an implementation of this method if the filter changes the size of a 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><div><span class="gmail_quote">On 7/6/06, <b class="gmail_sendername">Hämäläinen Janne</b> <<a href="mailto:Janne.Hamalainen@hus.fi">
Janne.Hamalainen@hus.fi</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<div>
<p><font size="2">Hi,<br>
<br>
I've made a filter that changes the output dimensions based on the data in the input. I know that I need give the correct output regions when pipeline update goes upstream using the GenerateOutputInformation-method, but in my filter the output dimensions are known only after the GenerateData-method is invoked. My question is what is the correct way to handle this situation? I cannot obviously calculate the output regions (RequestedRegion etc.) during the GenerateOutputInformation, because I cannot assume that the input is unchanged. On the otherhand if I update the output regions during GenerateData, the pipeline-mechanism does not work correctly, but I end up giving the original (the regions of the input) to the next filter along the pipeline. I hope I made myself clear, and hope someone can give a hint on 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>
</font>
</p>
</div>
</div><br>_______________________________________________<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br>