<!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.6944.0">
<TITLE>nested filters behaving like nested Image functions</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi all,<BR>
<BR>
Sorry for a subject title so complicated, I tried to find an &quot;explicit&quot; sentence...<BR>
<BR>
In order to illustrate my questions, let's take a simple example:<BR>
<BR>
filter A will perform this operation in its GenerateData() :<BR>
<BR>
Given a set of pixels within the requested region of an input image I, do<BR>
{<BR>
&nbsp;&nbsp;&nbsp; // current Pixel in the input is named input_px. The corresponding pixel at the same position in the output is called ouput_px&nbsp;<BR>
&nbsp;&nbsp;&nbsp; apply a filter B locally: &quot;output_px = B( input_px)&quot;<BR>
}<BR>
<BR>
Some remarks:<BR>
<BR>
a) B should be created _before_ the traversal of the pixels set.<BR>
b) B performs a _local_ treatment, that means it just needs a required region on the input (as usually performed in itk with the region enlargement techniques.)<BR>
c) B is a filter, _not_ an imageFunction, that means that no current itk class allows to do:<BR>
<BR>
B-&gt;SetInputImage(I);<BR>
output_px = B-&gt;Evaluate( input_px_position );<BR>
<BR>
The questions are then:<BR>
1) How to deal with remark c)? Should I:<BR>
- create a requested region whose size is (1,1,1) in 3D and whose position is the current input pixel<BR>
- set it to filter B<BR>
- Update() on B<BR>
- Retrieve the value of output_pixel with&nbsp; GetPixel()<BR>
<BR>
2) If my previous solution is correct, how the filter B will behave with successive SetRequestedRegion + Update() calls as we have to traverse a set of different pixels that are not continuous? As the size of the requestedRegion doesn't change, its internal buffered region will remains the same ( i.e requested region + elargement needed for processing)? Or due to call of GetPixel of different regions within the image, some allocation will be done?<BR>
<BR>
I do not need to perform a kind of &quot;GraftOutput() operation&quot; as everytime I can copy the value of the output_pixel in another structure that is much leighter than the whole image as it is not very dense.<BR>
<BR>
I hope I have been enough clear...!<BR>
<BR>
Thank you!<BR>
<BR>
Jerome<BR>
<BR>
<BR>
-----------------------------------<BR>
Jerome SCHMID<BR>
Project Manager/ Engineer<BR>
Augmented and Virtual Reality<BR>
MIS Centre<BR>
Prince of Wales Hospital<BR>
Chinese University Of Hong-Kong<BR>
-----------------------------------<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>