The ImportImageFilter can be used in a mode that does not allocate/copy
any memory. It simply re-uses the same pointer you've set to it by
setting the third param to false.<br>
&nbsp;&nbsp; <br>
<span style="font-style: italic;">&nbsp; /** .... If &quot;LetFilterManageMemory&quot; is true, then this class<br>
&nbsp;&nbsp; * will free the memory when this object is destroyed. */<br>
&nbsp; void SetImportPointer(TPixel *ptr, unsigned long num,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool LetFilterManageMemory);<br>
<span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"><br>
<span style="font-style: italic;"></span></span></span></span></span>Once that is done, you can also ensure that the filters in you&#39;re pipeline, update only a specific subregion.<br>
&nbsp; filter-&gt;GetOutput()-&gt;SetRequestedRegion( subregion );<br>
That will ensure that allocations of dataobjects downstream are of the needed size alone.<br>
<br>
Another thing to watch out for is the ReleaseDataFlag of filters, so as
not to have each filter keeping a copy of the output lying around, but
have it release it to the downstream filter once the downstream filter
is done processing it.<span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"></span><br><br><br>
</span></span></span></span><span style="font-style: italic;"><span style="font-style: italic;"><span style="font-style: italic;"></span></span></span><div><span class="gmail_quote">On 6/19/07, <b class="gmail_sendername">
Fieselmann, Andreas (ext)</b> &lt;<a href="mailto:andreas.fieselmann.ext@siemens.com">andreas.fieselmann.ext@siemens.com</a>&gt; 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><font face="Arial" size="2"><span>Hallo 
everyone,</span></font></div>
<div><font face="Arial" size="2"><span></span></font>&nbsp;</div>
<div><font face="Arial"><font size="2"><font><span>I would 
like to import a 3D image into ITK using the 
</span></font>itkImportImageFilter<span>. This works 
fine, but my problem is that&nbsp;the image has a size of about 50 Mio. 
voxels&nbsp;and&nbsp;this obvoiusly takes some time to 
copy.</span></font></font></div>
<div><font face="Arial"><font size="2"><span>What I would 
like to do now is to import only a subregion of my image into ITK (the region 
which I&#39;m actually interested in). So I have a pointer to the memory where the 
image data is stored in a contiguous block, I have the total size of the image 
and I have the bounding coordinates of the subregion (e.g. a 
cube).</span></font></font></div>
<div><font face="Arial"><font size="2"><span>Is there a way 
to tell the itkImportImageFilter to import only my subregion ? Or is there a 
different filter that can perform this task ?</span></font></font></div>
<div><font face="Arial"><font size="2"><span>Thank you very 
much in advance,</span></font></font></div>
<div><font face="Arial"><font size="2"><span>Andreas</span></font></font></div>
<div><font face="Arial"><font size="2"><span>&nbsp;</span></font></font></div>
<div><font face="Arial" size="2"><span></span></font>&nbsp;</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></blockquote></div><br><br clear="all"><br>-- <br>karthik