[Insight-users] Image transformation tool that resizes the FOV

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 2 15:57:28 EDT 2009



Hi Frank,

I assume that by "DCM" you are referring to
the Direction Cosines Matrix, Is that right ?

If so, I don't quite see why do you expect,
or want the direction cosines to be modified
if you are just changing the resolution of the
image.


Are you intending to *rotate* the image grid ?


If so, then what you want to use is the following
combination:


        * ResampleImageFilter
        * VersorRigid3DTransform
        * LinearInterpolator


Set the rotation that you expect/want, in the Versor
(unit quaternion) parameter of the Transform, and then
run the ResampleImageFilter. The output image will have
the description of the new output Grid.


Note that another alternative is to use the IdentityTransform
and setting a non-identity matrix in the OutputDirection()
of the ResampleImageFilter.  In other words, you set in the
ResampleImageFilter the DCM (direction cosines) values that
you want to see in the output image.  These two procedures
are *not* equivalent.  The one with the VersorRigid3DTransform
is what you would do in the context of image registration, when
you are relating two different coordinate systems. While the
IdentityTransform is what you would use when you simply want
to resample the image with a new image grid.


You will find this explained in detail in the
ITK Software Guide.

         http://www.itk.org/ItkSoftwareGuide.pdf

in particular in
Section 6.9.4. "Resample Image Filter"
in pdf-pages:  254-274.



     Regards,


        Luis



---------------------
Frank Ezekiel wrote:
> Luis:
> 
>         I'm not sure this example meets my needs.     I'm working with 3D data, and want to EXPAND the FOV with appropriate modifications to the DCM and quaternion records.
> 
>         So, my ideal app would take a 3D input nifti file of any resolution and dimensions and produce one of the requested resolution and dimensions.
> 
> 
> The command line might look like this:
> 
> Prog                    SourceData      TargetFile   Output:  xdim ydim zdim xres yres zres
> 
> "ModifyImageExtent      InputImageName OutputImageName  256   256   256   1.0   1.0  1.0"
> 
> 
>         So far I've looked at the ResampleVolumesToBeIsotropic example, and this works just fine for changing the image extent.  BUT, it does not show examples of how to use ITK to modify the DCM and quaternion because in this example the image extent is not changing.
> 
> 
>         Do you have any other examples and/or functions to suggest?
> 
> Thanks in advance,
> 
> Frank
> 
> 
> 
> 
> 
> 
> 
> 
> At 02:01 PM 3/26/2009, you wrote:
> 
> 
>>Hi Frank,
>>
>>It looks like you simply need to extract a region of interest
>>out of an input nifti file.
>>
>>You may want to look at the example:
>>
>>    Insight/Examples/IO
>>        ImageReadRegionOfInterestWrite.cxx
>>
>>
>> Regards,
>>
>>
>>    Luis
>>
>>
>>---------------------
>>Frank Ezekiel wrote:
>>
>>>Hi Luis:
>>>       I'm looking for a tool that will transform a 3d nifti file containing structural data so that the FOV is changed and the header information (DCM, Quaternion) is properly modified.    For example, I might want to transform an image within a 256 mm cubed volume such that it only contains the central 200mm on each axis.
>>>       Can you suggest any existing ITK examples?   Or point me towards the functions I'll need?
>>>Thanks as always,
>>>Frank
> 
> 
> 


More information about the Insight-users mailing list