<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>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><br></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><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> 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 ymailto="mailto:abayiz@yahoo.com" 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 ymailto="mailto:drescherjm@gmail.com" 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 ymailto="mailto:drescherjm@gmail.com" href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>><br>To: Abayiz <<a ymailto="mailto:abayiz@yahoo.com" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>><br>Cc: alex Dowson <<a ymailto="mailto:alexdowson@hotmail.com" href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</a>>; itk
<<a ymailto="mailto:insight-users@itk.org" 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 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></body></html>