Hi, David,<div>        I&#39;m afraid it doesn&#39;t work, the codes are following for 16bit nrrd. The memory still increases up to the size of the image not the region of image I defined. Is it due to the image type or something? The codes are following:</div>

<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>UShortImageType::IndexType index;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>index[0] = startX;</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>index[1] = startY;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>index[2] = startZ;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>UShortImageType::SizeType size;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>size[0] = sizeX;</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>size[1] = sizeY;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>size[2] = sizeZ;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>UShortImageType::RegionType region;</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>region.SetIndex( index);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>region.SetSize( size);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ushortImageReader::Pointer reader = ushortImageReader::New();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;SetFileName(fileName);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;GetOutput()-&gt;SetRequestedRegion(region);</div>

<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>reader-&gt;Update();</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>catch ( itk::ExceptionObject &amp;err)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cout &lt;&lt; &quot;Error in bin_image_writer: &quot; &lt;&lt; err &lt;&lt; std::endl; </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>

</div><div><br></div><div><br></div><div>Yan<br><br><div class="gmail_quote">On Tue, Aug 14, 2012 at 4:08 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div class="im">On Tue, Aug 14, 2012 at 4:59 PM, yan xu <span dir="ltr">&lt;<a href="mailto:xy198908@gmail.com" target="_blank">xy198908@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, all<div>      I&#39;m facing a problem to read only portion of the image to test the algorithm since the whole image is too big for the memory. I have tried using the itk pipeline through extractimage filter, but I don&#39;t think it works. The memory still goes larger and larger. My image type is 16bit nrrd. What I hope is that the only the desired region of the image is loaded into the memory. Is there a solution for that? Thank you!</div>


</blockquote><div><br></div></div><div>I&#39;ve never done it, but you could try this:</div><div><br></div><a href="http://www.itk.org/Wiki/ITK/Examples/SimpleOperations/RequestedRegion" target="_blank">http://www.itk.org/Wiki/ITK/Examples/SimpleOperations/RequestedRegion</a><br clear="all">


<br>on your ImageReader.</div><span class="HOEnZb"><font color="#888888"><div class="gmail_quote"><br><div>David</div></div>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Yan Xu</div><div>Research Assistant</div><div><span>Bio-Image Analytics Laboratory</span>
</div>
<div>Department of Electrical and Computer Engineering</div>
<div>University of Houston<br></div>
<div> </div><br>
</div>