<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
p
        {margin-top:0;
        margin-bottom:0}
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
</head>
<body>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi,<br>
<br>
After some search through the older blogs, I was able to fix the issue by using UpdateLargestPossibleRegion() instead of update in the extract image filter and the other filters following extract image filter.
<br>
<br>
Regards,<br>
Ganesh<br>
<div style="font-family:Times New Roman; color:rgb(0,0,0); font-size:16px">
<hr tabindex="-1">
<div id="divRpF147233" style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Jayachandran, Ganesh<br>
<b>Sent:</b> Sunday, March 18, 2012 12:17 AM<br>
<b>To:</b> insight-users@itk.org<br>
<b>Subject:</b> error while extracting slice in x and y direction<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-size:10pt">
<br>
<div style="font-family:Times New Roman; color:rgb(0,0,0); font-size:16px"><br>
<div>
<div style="direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-size:10pt">
Hi,<br>
<br>
I am trying to extract a slice in the x and y direction other than the z direction. Initially the direction is set to &quot;z&quot; and then the direction is set to &quot;x&quot;. The code works fine for &quot;z&quot; direction but when I set the direction to &quot;x&quot;, I get an error<br>
as below<br>
<br>
<span style="color:rgb(255,0,0)">Requested region is (at least partially outside the largest possible region.<br>
<br>
<span style="color:rgb(0,0,0)">Kindly let me know what I have done wrong. Pl. find the code snippet below. The code is called iteratively for the same MR data.<br>
<br>
</span></span>&nbsp;&nbsp;&nbsp; <span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">size = inputRegion.GetSize();<br>
&nbsp;&nbsp;&nbsp; start = inputRegion.GetIndex();<br>
<br>
&nbsp;&nbsp;&nbsp; size[direction] = 0;<br>
&nbsp;&nbsp;&nbsp; start[direction] = number;<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; //Now set the parametrs to the extract the desired region<br>
&nbsp;&nbsp;&nbsp; //the parameters are size and slice number<br>
&nbsp;&nbsp;&nbsp; InputImageType::RegionType desiredRegion;<br>
&nbsp;&nbsp;&nbsp; desiredRegion.SetSize( size );<br>
&nbsp;&nbsp;&nbsp; desiredRegion.SetIndex( start );<br>
<br>
&nbsp;&nbsp;&nbsp; filter-&gt;SetExtractionRegion( desiredRegion );<br>
&nbsp;&nbsp;&nbsp; filter-&gt;SetInput( output );<br>
&nbsp;&nbsp;&nbsp; filter-&gt;Update();<br>
</span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified
 that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br>
</font>
</body>
</html>