[Insight-users] Fwd: How to Truncate Dicom Series?
Abayiz
abayiz at yahoo.com
Wed Feb 29 10:07:32 EST 2012
Hello,
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:
********************************************
Requested region is (at least partially) outside the largest possible region
********************************************
I've already used "UpdateLargestPossibleRegion()" method, here is the partial code:
********************************************
reader->SetFileName(argv[1]);
reader->Update();
reader->UpdateLargestPossibleRegion();
ImageType::RegionType desiredRegion;
desiredRegion.SetSize(size);
desiredRegion.SetIndex(start);
filter->SetRegionOfInterest(desiredRegion);
filter->SetInput(reader->GetOutput());
WriterType::Pointer writer = WriterType::New();
writer->SetFileName ( argv[2] );
writer->SetInput ( filter->GetOutput() );
writer->Update();
********************************************
Can anyone help? Thanks in advance.
________________________________
From: John Drescher <drescherjm at gmail.com>
To: Insight Users <insight-users at itk.org>
Sent: Tuesday, February 28, 2012 4:05 PM
Subject: [Insight-users] Fwd: How to Truncate Dicom Series?
---------- Forwarded message ----------
From: Abayiz <abayiz at yahoo.com>
Date: Tue, Feb 28, 2012 at 7:44 AM
Subject: Re: [Insight-users] How to Truncate Dicom Series?
To: John Drescher <drescherjm at gmail.com>
Hi,
I didn't find any way to do that as you suggested. Seems like there is
no way to set the index for the itkImageWriter. Am I doing wrong?
________________________________
From: John Drescher <drescherjm at gmail.com>
To: Abayiz <abayiz at yahoo.com>
Cc: alex Dowson <alexdowson at hotmail.com>; itk <insight-users at itk.org>
Sent: Tuesday, February 28, 2012 2:22 PM
Subject: Re: [Insight-users] How to Truncate Dicom Series?
> Thank you for your reply. I also checked that example, but it starts to read
> all the images, but I want to give up some slices of the original data. Any
> suggestions?
>
Read the series and then write it truncated.
John
--
John M. Drescher
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120229/cffeec49/attachment.htm>
More information about the Insight-users
mailing list