Hi all,<br><br>I try to extract a slide of a 3D image with the ExtractImageFilter. I mainly used the code I found in the Software Guide under &quot;7.7   Extracting Slices&quot;. I always get this error:<br><br><span style="color: rgb(255, 0, 0);">  itk::InvalidRequestedRegionError (0153BF38)</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  Location: &quot;void __thiscall itk::DataObject::PropagateRequestedRegion(void) throw (class itk::InvalidRequestedRegionError)&quot;</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">  File: ..\..\InsightToolkit-3.16.0\Code\Common\itkDataObject.cxx</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">  Line:397</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">  Description: Requested region is (at least partially outside the largest possible region.</span><br>
<br>The image is a global variable and used with several (itk) functions. One of those is the ExtractImageFilter.<br>This is the code:<br><br>   <span style="font-family: courier new,monospace;">  typedef itk::Image&lt;PixelType, 2&gt; OutputImageType;    //dimension</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    typedef itk::ExtractImageFilter&lt;ImageType, OutputImageType&gt; ExtractFilterType;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ExtractFilterType::Pointer extractFilter = ExtractFilterType::New();</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ImageType::RegionType inputRegion = image-&gt;GetLargestPossibleRegion(); //image size</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    ImageType::SizeType size = inputRegion.GetSize();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    size[1]=0;    //y-Dimension wird gelöscht</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ImageType::IndexType start = inputRegion.GetIndex(); </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    start[1]=slice; //constant y-value</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ImageType::RegionType desiredRegion;  //region of the slide in the 3D inage</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    desiredRegion.SetSize(size);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    desiredRegion.SetIndex(start);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    extractFilter-&gt;SetExtractionRegion(desiredRegion); //add region to filter</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    extractFilter-&gt;SetInput(image); //Input: image</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    OutputImageType::Pointer outimage = OutputImageType::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    try</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">         extractFilter-&gt;Update(); //filtering</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">         outimage = extractFilter-&gt;GetOutput();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    catch(itk::ExceptionObject &amp;err)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        std::cerr &lt;&lt; &quot;ExeptionObject caught!&quot; &lt;&lt; std::endl;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        std::cerr &lt;&lt; &quot;Image2QImage Slice extract.&quot; &lt;&lt; std::endl;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        std::cerr &lt;&lt; err &lt;&lt; std::endl;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    }</span><br>
<br>It would be great if someone knows what I have to change to avoid the error.<br>Thanks in advance!<br>Regards<br><br>melanie<br>