[Insight-users] Re: Extracting Coronal, Saggital, Axial

Luis Ibanez luis . ibanez at kitware . com
Sat, 09 Aug 2003 20:34:30 -0400


Hi Marcellus,

1) when copying SizeType you don't need to copy component
    by component.

    You can (should) do:

    size = reader->GetOutput()->GetRequestedRegion().GetSize();

Instead of

 >  size[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
 >  size[1] = reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
 >  size[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;


2) Before accessing the Output of any filter (including a reader)
    you must call Update() on that filter. The output of a filter
    is not valid until Update() has been invoked.


3) If you want to use the ExtractImageFilter for getting a 2D
    image out of a 3D image, please make sure that instantiate
    the class using as 3D image as input and a 2D image as output.
    Something like

    typedef   itk::Image< char, 3 >   InputImage3D;
    typedef   itk::Image< char, 2 >   InputImage2D;

    typedef  itk::ExtractImageFilter<
                             InputImage3D,
                             InputImage2D  >  FilterType;

     FilterType::Pointer filter = FilterType::New(); 


     Then, when you set the region with the method

     filter->SetExtractRegion( region );

     make sure that you set one and only one component of
     the region size to zero.




Regards,


    Luis


-------------------------
marcellus walace wrote:
> Hi Luis,
> 
> I'm trying to extract sagital coronal and transversal view form a 3D 
> file using
> itk class ExtractImageFilter, but I've a problem when I change the size 
> arry of the region.
> 
> when I initialiez the size of my region like this:
> 
> size[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size[1] = reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
>  size1[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size1[1] =reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size1[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
>  size2[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size2[1] = reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size2[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
> There isn't any problems.
> But when I do this:
> 
> //for sagittal
> size[0] = 0;//reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size[1] = reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
> //for coronal
>  size1[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size1[1] = 0;//reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size1[2] = reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
> //for transversal view
>  size2[0] = reader->GetOutput()->GetRequestedRegion().GetSize()[0] ;
>  size2[1] = reader->GetOutput()->GetRequestedRegion().GetSize()[1] ;
>  size2[2] = 0;//reader->GetOutput()->GetRequestedRegion().GetSize()[2] ;
> 
> I'v an execution error .... I'm sure because of the zeros but...What 
> should I do?
> to view regions only in two dimensions?
> 
> I can not use the Extract file application I My chief wants me to work 
> only with dicom files
> So I try to view the regions directly?
> Can you help me?
> 
> Regards
> 
> Marcellus
> 
> 
> 
> 
>> From: Luis Ibanez <luis . ibanez at kitware . com>
>> To: marcellus walace <marcelluswalace at hotmail . com>
>> CC: ITK <Insight-users at public . kitware . com>
>> Subject: Re: Extracting Coronal, Saggital, Axial
>> Date: Fri, 01 Aug 2003 15:39:09 -0400
>>
>>
>> Hi Marcellus,
>>
>> ITK does not provide any visualization.
>> ITK performs image segmentation and registration.
>>
>> The concepts of Coronal, Axial and Saggital
>> are mainly related to visualization.
>>
>> Two possible options are
>>
>> 1) You may extract 2D slices from a 3D volume
>>    using the itk::ExtractImageFilter.
>> http://public . kitware . com/Insight/Doxygen/html/classitk_1_1ExtractImageFilter . html 
>>
>>
>>    Then, you can use this 2D slices for display
>>    as images in a GUI.
>>
>>
>> 2) You could also use VTK for visualizing the slice.
>>    In that case you may want to convert the ITK image
>>    into a VTK image using the ImageToVTKImage filter
>>    available in InsightApplications/Auxiliary/vtk.
>>
>>    Then pass the  vtkImageData to the vtkImageViewer2
>>    class. This class allows to select the orientation
>>    and the slice to be viewed.
>> http://www . vtk . org/doc/nightly/html/classvtkImageViewer2 . html
>>
>>
>>
>> Regards,
>>
>>
>>    Luis
>>
>>
>> ------------------------
>> marcellus walace wrote:
>>
>>>
>>> Hi Luis,
>>>
>>> I've sent you a mail yesterday but you didn't answer me. So I would 
>>> like to know if itk provides
>>> some algorithms codes which build coronal, transversal, and sagital 
>>> views of  medical file series.
>>> I'm now reading the software guide and I can't see some indications 
>>> about the subject.
>>> Please can you help me.
>>>
>>> Regards,
>>>
>>> _________________________________________________________________
>>> Protect your PC - get McAfee.com VirusScan Online 
>>> http://clinic . mcafee . com/clinic/ibuy/campaign . asp?cid=3963
>>>
>>>
>>
>>
>>
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
> http://join . msn . com/?page=features/virus
> 
>