<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hello,</span></div><div><br><span></span></div><div><span>The size of input image is [220, 250, 144], and that of ROI image is [220,225,144]. <br></span></div><div>Any suggestion?</div><div><br><span></span></div><div><span>Thanks :) </span></div><div><br></div>  <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight: bold;">From:</span></b> alex Dowson &lt;alexdowson@hotmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Abayiz &lt;abayiz@yahoo.com&gt;; John Drescher &lt;drescherjm@gmail.com&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> itk &lt;insight-users@itk.org&gt; <br> <b><span
 style="font-weight: bold;">Sent:</span></b> Thursday, March 1, 2012 6:11 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Fwd:  How to Truncate Dicom Series?<br> </font> </div> <br>
<div id="yiv423309433"><div dir="ltr">
<div dir="ltr">
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">
<div>Hi</div>
<div>&nbsp;</div>
<div>What is your size and index of input image and ROI image ?</div>
<div>&nbsp;</div>
<div><br>&nbsp;</div>
<div style="font-style: normal; display: inline; font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: small; font-weight: normal; text-decoration: none;">
<div style="font: 10pt tahoma;">
<div>&nbsp;</div>
<div style="background: none repeat scroll 0% 0% rgb(245, 245, 245);">
<div style=""><b>From:</b> <a rel="nofollow" title="abayiz@yahoo.com" ymailto="mailto:abayiz@yahoo.com" target="_blank" href="mailto:abayiz@yahoo.com">Abayiz</a> </div>
<div><b>Sent:</b> Wednesday, February 29, 2012 8:37 PM</div>
<div><b>To:</b> <a rel="nofollow" title="drescherjm@gmail.com" ymailto="mailto:drescherjm@gmail.com" target="_blank" href="mailto:drescherjm@gmail.com">John Drescher</a> </div>
<div><b>Cc:</b> <a rel="nofollow" title="insight-users@itk.org" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">itk</a> </div>
<div><b>Subject:</b> Re: [Insight-users] Fwd: How to Truncate Dicom 
Series?</div></div></div>
<div>&nbsp;</div></div>
<div style="font-style: normal; display: inline; font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: small; font-weight: normal; text-decoration: none;">
<div style="background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; color: rgb(0, 0, 0); font-size: 12pt;">
<div><span>Hello,</span></div>
<div><br><span></span></div>
<div><span>Actually I found that I can handle this problem by using 
itkRegionOfInterestImageFiler, it works quite well, except it started to 
truncate the image from the opposite of the desired direction. Then I tried to 
set its index, but it gave me this error:</span></div>
<div><span><br></span></div>
<div>********************************************<br><span></span></div>
<div><span>Requested region is (at least partially) outside the largest possible 
region</span></div>
<div>********************************************</div>
<div>&nbsp;</div>
<div><br><span></span></div>
<div><span>I've already used "UpdateLargestPossibleRegion()" method, here is the 
partial code:</span></div>
<div><span><br></span></div>
<div>********************************************<br><span></span></div>
<div><span>reader-&gt;SetFileName(argv[1]);<br>&nbsp; 
reader-&gt;Update();<br>&nbsp; 
reader-&gt;UpdateLargestPossibleRegion();</span></div>
<div><br><span></span></div>
<div><span>&nbsp; ImageType::RegionType desiredRegion;<br>&nbsp; 
desiredRegion.SetSize(size);<br>&nbsp; 
desiredRegion.SetIndex(start);<br>&nbsp;<br>&nbsp; 
filter-&gt;SetRegionOfInterest(desiredRegion);<br>&nbsp; 
filter-&gt;SetInput(reader-&gt;GetOutput());<br><br>&nbsp; WriterType::Pointer 
writer = WriterType::New();<br>&nbsp; writer-&gt;SetFileName ( argv[2] 
);<br>&nbsp; writer-&gt;SetInput ( filter-&gt;GetOutput() );<br>&nbsp; 
writer-&gt;Update();</span></div>
<div>********************************************<br><span></span></div>
<div><br><span></span></div>
<div><span>Can anyone help? Thanks in advance. </span></div>
<div>&nbsp;</div>
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div dir="ltr"><font face="Arial" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b> John Drescher 
&lt;drescherjm@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Insight Users 
&lt;insight-users@itk.org&gt; <br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, February 28, 2012 4:05 
PM<br><b><span style="font-weight: bold;">Subject:</span></b> [Insight-users] 
Fwd: How to Truncate Dicom Series?<br></font></div><br>---------- Forwarded 
message ----------<br>From: Abayiz &lt;<a rel="nofollow" ymailto="mailto:abayiz@yahoo.com" target="_blank" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt;<br>Date: Tue, Feb 28, 
2012 at 7:44 AM<br>Subject: Re: [Insight-users] How to Truncate Dicom 
Series?<br>To: John Drescher &lt;<a rel="nofollow" ymailto="mailto:drescherjm@gmail.com" target="_blank" href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>&gt;<br><br><br>Hi,<br><br>I 
didn't find any way to do that as you suggested. Seems like there is<br>no way 
to set the index for the itkImageWriter. Am I doing 
wrong?<br><br>________________________________<br>From: John Drescher &lt;<a rel="nofollow" ymailto="mailto:drescherjm@gmail.com" target="_blank" href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>&gt;<br>To: Abayiz 
&lt;<a rel="nofollow" ymailto="mailto:abayiz@yahoo.com" target="_blank" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt;<br>Cc: alex Dowson 
&lt;<a rel="nofollow" ymailto="mailto:alexdowson@hotmail.com" target="_blank" href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</a>&gt;; itk 
&lt;<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>Sent: 
Tuesday, February 28, 2012 2:22 PM<br><br>Subject: Re: [Insight-users] How to 
Truncate Dicom Series?<br><br>&gt; Thank you for your reply. I also checked that 
example, but it starts to read<br>&gt; all the images, but I want to give up 
some slices of the original data. Any<br>&gt; suggestions?<br>&gt;<br>Read the 
series and then write it truncated.<br><br>John<br><br><br><br><br>-- <br>John 
M. Drescher<br>_____________________________________<br>Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br><br>Visit 
other Kitware open-source projects 
at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers 
ITK Training Courses, for more information 
visit:<br>http://www.kitware.com/products/protraining.html<br><br>Please keep 
messages on-topic and check the ITK FAQ 
at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to 
subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br><br><br></div></div></div>
<div>
</div><hr>
_____________________________________<br>Powered by www.kitware.com<br><br>Visit 
other Kitware open-source projects 
at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers 
ITK Training Courses, for more information 
visit:<br>http://www.kitware.com/products/protraining.html<br><br>Please keep 
messages on-topic and check the ITK FAQ 
at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to 
subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></div></div></div></div></div><br><br> </div> </div>  </div></body></html>