<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>What is your size and index of input image and ROI image ?</DIV>
<DIV> </DIV>
<DIV><BR> </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> </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> </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> </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->SetFileName(argv[1]);<BR>
reader->Update();<BR>
reader->UpdateLargestPossibleRegion();</SPAN></DIV>
<DIV><BR><SPAN></SPAN></DIV>
<DIV><SPAN> ImageType::RegionType desiredRegion;<BR>
desiredRegion.SetSize(size);<BR>
desiredRegion.SetIndex(start);<BR> <BR>
filter->SetRegionOfInterest(desiredRegion);<BR>
filter->SetInput(reader->GetOutput());<BR><BR> WriterType::Pointer
writer = WriterType::New();<BR> writer->SetFileName ( argv[2]
);<BR> writer->SetInput ( filter->GetOutput() );<BR>
writer->Update();</SPAN></DIV>
<DIV>********************************************<BR><SPAN></SPAN></DIV>
<DIV><BR><SPAN></SPAN></DIV>
<DIV><SPAN>Can anyone help? Thanks in advance. </SPAN></DIV>
<DIV> </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
<drescherjm@gmail.com><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> Insight Users
<insight-users@itk.org> <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 <<A href="mailto:abayiz@yahoo.com"
ymailto="mailto:abayiz@yahoo.com">abayiz@yahoo.com</A>><BR>Date: Tue, Feb 28,
2012 at 7:44 AM<BR>Subject: Re: [Insight-users] How to Truncate Dicom
Series?<BR>To: John Drescher <<A href="mailto:drescherjm@gmail.com"
ymailto="mailto:drescherjm@gmail.com">drescherjm@gmail.com</A>><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 <<A
href="mailto:drescherjm@gmail.com"
ymailto="mailto:drescherjm@gmail.com">drescherjm@gmail.com</A>><BR>To: Abayiz
<<A href="mailto:abayiz@yahoo.com"
ymailto="mailto:abayiz@yahoo.com">abayiz@yahoo.com</A>><BR>Cc: alex Dowson
<<A href="mailto:alexdowson@hotmail.com"
ymailto="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</A>>; itk
<<A href="mailto:insight-users@itk.org"
ymailto="mailto:insight-users@itk.org">insight-users@itk.org</A>><BR>Sent:
Tuesday, February 28, 2012 2:22 PM<BR><BR>Subject: Re: [Insight-users] How to
Truncate Dicom Series?<BR><BR>> Thank you for your reply. I also checked that
example, but it starts to read<BR>> all the images, but I want to give up
some slices of the original data. Any<BR>> suggestions?<BR>><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>