<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Alexander,<div><br></div><div>In addition to what Robert said, take a look at this submission to the Insight Journal by</div><div><br></div><div>David Doria (Criminisi Inpainting), see if it's what you are looking for,</div><div><br></div><div><a href="http://www.insight-journal.org/browse/publication/787">http://hdl.handle.net/10380/3250</a></div><div><br></div><div>Good
 luck,</div><div><br></div><div>Dawood</div><div><br></div><div><br></div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</div><div><br></div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</div><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "><pre>There may be a more elegant way, but I would do the following:

- Create a copy of the input image with ImageDuplicator. Fill the duplicated
image with zeroes.
- Use RegionOfInterestImageFilter to extract the computed region from the
input image.
- Perform filtering on the output of the ROI filter.
- Use PasteImageFilter to copy the filter result into the zero-filled image.

See <a href="http://www.itk.org/Wiki/ITK/Examples">http://www.itk.org/Wiki/ITK/Examples</a> for example usage of the
aforementioned filters.


On Thu, Mar 17, 2011 at 10:51 AM, Alexander Taghva &lt;<a href="http://www.itk.org/mailman/listinfo/insight-users">alextaghva at gmail.com</a>&gt;wrote:

&gt;<i> Hello,
</i>&gt;<i>
</i>&gt;<i> I would like to take an image, crop it to its nonzero content, perform some
</i>&gt;<i> filtering, then zero pad the image back to its original dimensions.  So far,
</i>&gt;<i> I am able to compute the bounding box with a mask spatial object doing
</i>&gt;<i> something like this:
</i>&gt;<i>
</i>&gt;<i> RegionType boundingBoxRegion = m_MaskSO-&gt;GetAxisAlignedBoundingBoxRegion();
</i>&gt;<i>
</i>&gt;<i>  but I don't know where to go from here.  I'm relatively new to ITK.
</i>&gt;<i> Thanks for your help.
</i>&gt;<i>
</i>&gt;<i> Alex</i></pre></span></div></td></tr></table><br>