[Insight-users] Re: ask for help : Extract Region of interest

Luis Ibanez luis.ibanez at kitware.com
Tue, 03 Feb 2004 17:49:48 -0500


Hi Deliang,


The RegionOfInterestImageFilter works
for N-Dimensional images.

The filter is templated over the image
type, so you can do 4D or 5D images for
example.


Simply define the image type, such as

   typedef itk::Image< char, 5 >  ImageType;

   typedef itk::RegionOfInterestImageFilter<
                ImageType, ImageType > FilterType;


In order to use the example in

  Insight/Examples/IO/
     ImageReadRegionOfInterestWriter.cxx

for processing 3D MRIs simply go to
line 74 and replace

   const unsigned int Dimension = 2;

with

   const unsigned int Dimension = 3;



then rebuild the executable.



Regards,


    Luis



--------------------
Deliang Ye wrote:

> Hi Luis,
> 
> Thanks a lot for your help, actually, we want to extract volumetric region
> of interest, not only 2D image, does itkRegionOfInterestImageFilter work for
> this aim?
> 
> Appreciate you very much for your help!
> 
> -Deliang Ye
> 
> ----- Original Message ----- 
> From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "Deliang Ye" <dye at jhu.edu>
> Cc: <Insight-users at itk.org>
> Sent: Tuesday, February 03, 2004 3:16 PM
> Subject: Re: ask for help : Extract Region of interest
> 
> 
> 
>>Hi Deliang,
>>
>>
>>You may want to use the
>>
>>    itkRegionOfInterestImageFilter
>>
> 
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html
> 
>>
>>With this filter, you specify the region of
>>the input image that you want to extract, and
>>the filter will produce a new image containing
>>only the pixels inside this region.  The origin
>>of the image will be recomputed in order to match
>>the first fixel of the extracted region.
>>
>>
>>For an example on the use of this filter  you may
>>want to look at the file
>>
>>   Insight/Examples/IO/
>>     ImageReadRegionOfInterestWrite.cxx
>>
>>
>>You can actually use this example as the complete
>>solution, since you can run it as a command line
>>application, provide your image as input, extract
>>the region and save the new image in a file.
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
>>
>>------------------
>>Deliang Ye wrote:
>>
>>>Hi Luis,
>>>
>>>I got a rat's MRI(img/hdr) 256X256X256, how can I chop some slices from
> 
> the
> 
>>>MRI?, so that we only leave region of interest for our anlaysis.
>>>
>>>Thanks a lot for your help!
>>>
>>>-Deliang Ye
>>>
>>>
>>
>>
> 
>