[Insight-users] Fwd: How to Truncate Dicom Series?

alex Dowson alexdowson at hotmail.com
Fri Mar 2 04:59:37 EST 2012



Hi

According to your code. Your start index and size is same. You had replaced with inSize variable.. ? I donot think it makes any sense.  

Your index should like (0,0,0) and size should (220,225,144).  


 

From: Abayiz 
Sent: Friday, March 02, 2012 2:35 PM
To: alex Dowson ; John Drescher 
Cc: itk 
Subject: Re: [Insight-users] Fwd: How to Truncate Dicom Series?

Hi Alex and John, 



Thank you so much for your answers. I did use the itkRegionOfInterestImageFilter. And here is my code:


****************************
  start[0] = inSize[0];
  start[1] = inSize[1];
  start[2] = inSize[2];

  size[0] = inSize[0];
  size[1] = inSize[1]/1.162;
  size[2] = inSize[2];


  desiredRegion.SetSize(size);
  desiredRegion.SetIndex(start);

filter->SetRegionOfInterest(desiredRegion);
filter->SetInput(reader->GetOutput());
*****************************

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. 

Thanks. 



--------------------------------------------------------------------------------
From: alex Dowson <alexdowson at hotmail.com>
To: Abayiz <abayiz at yahoo.com> 
Cc: itk <insight-users at itk.org> 
Sent: Friday, March 2, 2012 6:05 AM
Subject: Re: [Insight-users] Fwd: How to Truncate Dicom Series?


Hi

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 ?

Alex


From: Abayiz 
Sent: Thursday, March 01, 2012 1:04 PM
To: alex Dowson 
Cc: itk 
Subject: Re: [Insight-users] Fwd: How to Truncate Dicom Series?

Hello,


The size of input image is [220, 250, 144], and that of ROI image is [220,225,144]. 

Any suggestion?


Thanks :) 


--------------------------------------------------------------------------------
From: alex Dowson <alexdowson at hotmail.com>
To: Abayiz <abayiz at yahoo.com>; John Drescher <drescherjm at gmail.com> 
Cc: itk <insight-users at itk.org> 
Sent: Thursday, March 1, 2012 6:11 AM
Subject: Re: [Insight-users] Fwd: How to Truncate Dicom Series?


Hi

What is your size and index of input image and ROI image ?


 

From: Abayiz 
Sent: Wednesday, February 29, 2012 8:37 PM
To: John Drescher 
Cc: itk 
Subject: Re: [Insight-users] Fwd: How to Truncate Dicom Series?

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




--------------------------------------------------------------------------------
_____________________________________
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/20120302/fc79c180/attachment.htm>


More information about the Insight-users mailing list