<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>Thanks for the answer, now it works after I set its start index to [0,25,0]. </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 <alexdowson@hotmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Abayiz <abayiz@yahoo.com>; John Drescher <drescherjm@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> itk <insight-users@itk.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, March 2, 2012 11:59 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="yiv1561618088"><div dir="ltr">
<div dir="ltr">
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">
<div> </div>
<div> </div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">Hi</div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;"> </div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">According
to your code. Your start index and size is same. You had replaced with inSize
variable.. ? I donot think it makes any sense. </div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;"> </div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">Your index
should like (0,0,0) and size should (220,225,144). </div>
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;"><br><br> </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> </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> Friday, March 02, 2012 2:35 PM</div>
<div><b>To:</b> <a rel="nofollow" title="alexdowson@hotmail.com" ymailto="mailto:alexdowson@hotmail.com" target="_blank" href="mailto:alexdowson@hotmail.com">alex Dowson</a> ; <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> </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>Hi Alex and John, <br></span></div>
<div><br><span></span></div>
<div><span>Thank you so much for your answers.</span> <span>I did use the
itkRegionOfInterestImageFilter. And here is my code:</span></div>
<div><span><br></span></div>
<div>****************************</div>
<div> start[0] = inSize[0];<br> start[1] = inSize[1];<br>
start[2] = inSize[2];</div>
<div> </div>
<div> size[0] = inSize[0];<br> size[1] = inSize[1]/1.162;<br>
size[2] = inSize[2];<br><span></span></div>
<div> </div>
<div> desiredRegion.SetSize(size);<br>
desiredRegion.SetIndex(start);</div>
<div> </div>
<div>filter->SetRegionOfInterest(desiredRegion);</div>
<div>filter->SetInput(reader->GetOutput());</div>
<div>*****************************</div>
<div> </div>
<div>I doubt its starting point is causing the problem, but I didn't figure out
any solution yet. I tried to change it, but it was not helpful. <br></div>
<div>Thanks. <br></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 face="Arial" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b> alex Dowson
<alexdowson@hotmail.com><br><b><span style="font-weight: bold;">To:</span></b> Abayiz <abayiz@yahoo.com>
<br><b><span style="font-weight: bold;">Cc:</span></b> itk
<insight-users@itk.org> <br><b><span style="font-weight: bold;">Sent:</span></b> Friday, March 2, 2012 6:05
AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users]
Fwd: How to Truncate Dicom Series?<br></font></div>
<div> </div>
<div id="yiv1561618088">
<div dir="ltr">
<div dir="ltr">
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">
<div>Hi</div>
<div> </div>
<div>I think it’s in range. Can you show your code ? what exactly you trying to
do ? After reading file are you using any filter and then doing ROI filter
?</div>
<div> </div>
<div>Alex<br></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> </div>
<div style="background: none repeat scroll 0% 0% rgb(245, 245, 245);">
<div><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> Thursday, March 01, 2012 1:04 PM</div>
<div><b>To:</b> <a rel="nofollow" title="alexdowson@hotmail.com" ymailto="mailto:alexdowson@hotmail.com" target="_blank" href="mailto:alexdowson@hotmail.com">alex Dowson</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> </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>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> </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
<alexdowson@hotmail.com><br><b><span style="font-weight: bold;">To:</span></b> Abayiz <abayiz@yahoo.com>; John
Drescher <drescherjm@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> itk <insight-users@itk.org>
<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>
<div> </div>
<div id="yiv1561618088">
<div dir="ltr">
<div dir="ltr">
<div style="font-family: 'Calibri'; color: rgb(0, 0, 0); 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: rgb(0, 0, 0); font-size: small; font-weight: normal; text-decoration: none;">
<div style="font: 10pt tahoma;">
<div> </div>
<div style="background: none repeat scroll 0% 0% rgb(245, 245, 245);">
<div><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> </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> </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 face="Arial" size="2">
<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 rel="nofollow" ymailto="mailto:abayiz@yahoo.com" target="_blank" href="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 rel="nofollow" ymailto="mailto:drescherjm@gmail.com" target="_blank" href="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 rel="nofollow" ymailto="mailto:drescherjm@gmail.com" target="_blank" href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>><br>To: Abayiz
<<a rel="nofollow" ymailto="mailto:abayiz@yahoo.com" target="_blank" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>><br>Cc: alex Dowson
<<a rel="nofollow" ymailto="mailto:alexdowson@hotmail.com" target="_blank" href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</a>>; itk
<<a rel="nofollow" ymailto="mailto:insight-users@itk.org" target="_blank" href="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 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></div></div></div></div></div><br><br></div></div></div></div></div></div></div></div><br><br> </div> </div> </div></body></html>