<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; 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: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=abayiz@yahoo.com 
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 title=drescherjm@gmail.com 
href="mailto:drescherjm@gmail.com">John Drescher</A> </DIV>
<DIV><B>Cc:</B> <A title=insight-users@itk.org 
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: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV 
style="BACKGROUND-COLOR: #fff; FONT-FAMILY: times new roman, new york, times, serif; COLOR: #000; 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 size=2 face=Arial>
<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 href="mailto:abayiz@yahoo.com" 
ymailto="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 href="mailto:drescherjm@gmail.com" 
ymailto="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 
href="mailto:drescherjm@gmail.com" 
ymailto="mailto:drescherjm@gmail.com">drescherjm@gmail.com</A>&gt;<BR>To: Abayiz 
&lt;<A href="mailto:abayiz@yahoo.com" 
ymailto="mailto:abayiz@yahoo.com">abayiz@yahoo.com</A>&gt;<BR>Cc: alex Dowson 
&lt;<A href="mailto:alexdowson@hotmail.com" 
ymailto="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</A>&gt;; itk 
&lt;<A href="mailto:insight-users@itk.org" 
ymailto="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 
href="http://www.kitware.com" target=_blank>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>
<P>
<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></BODY></HTML>