[Insight-users] registration question

Luis Ibanez luis.ibanez at kitware.com
Fri May 28 12:06:03 EDT 2010


Hi Ken,

Thanks for sharing your findings.

I'm a bit lost in the details though...

What I'm reading from your email is that the image
origin and spacing got lost during the process of
writing out the data to a DICOM file.

Is that right ?


You could make an additional verification by
replacing the ImageSeriesWriter with an
ImageFileWriter and saving the resampled moving
image as a 3D single file, by using the MetaImage
file format (.mhd), or Nrrd (.nrrd), or Nifti (nii).

All of these file formats should preserve origin,
spacing and orientation.   (DICOM should preserve
it too... so.. once you run this verfication, we should
go back an take a closer look at how you are writing
out the DICOM series).


     Regards,


         Luis


-------------------------------------------------------------------------
On Fri, May 28, 2010 at 7:33 AM, Ken Urish <ken.urish at gmail.com> wrote:

> Luis
>
> Thanks for your response. Ive always been impressed by the excellent
> support in the itk community.
>
> Indeed, you are right. My z-axis spacing and origin is getting lost.......
> Im using dicom so I am surprised this is happening.
>
> When I look at the output of the registered and resampled output of
> the moving image - the spacing and origin is identical to the input of
> he fixed image. This is expected. I am doing a mattes registration so
> my code is similar to the example itk code. I am using the verser
> transform.
>
> When I take that identical output registered image and use it as input
> for the checkerboard filter program the z-axis origin and spacing are
> changed to 0 and 1 respectively.
>
> My registration output image info is collected from the resampled
> image just before it is sent to the image series writer using gdcmIO.
> The checkerboard input image info is collected just after the input
> reader. Thus my registration output writer is somehow loosing this
> z-axis info. Im keeping it in dicom so Im stuck on how Im loosing it.
>
> One solution would be to change the spacing and origin on my
> checkerboard program. But I would be interested in having this fixed
> on the initial registration program. Any thoughts on my error? I
> appreciate the help. I included the specific output below.
>
> Thanks
> --Ken--
>
>
> Registration Fixed input image:
>  Spacing: [0.3125, 0.3125, 3.48]
>  Origin: [-18.1241, -60.8059, 58.0112]
>  Direction:
> -0.0348995 0 -0.999391
> 0.999391 0 -0.0348995
> 0 -1 0
>
> Registration Moving input image:
>  Spacing: [0.364583, 0.364583, 0.7]
>  Origin: [-3.39372, -70.4365, 70]
>  Direction:
> -0.0348995 0 -0.999391
> 0.999391 0 -0.0348995
> 0 -1 0
>
> Registration OUTPUT Image of the resampled moving image:
>  Spacing: [0.3125, 0.3125, 3.48]
>  Origin: [-18.1241, -60.8059, 58.0112]
>  Direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
>
> =====================================================================
> Output of when the registered images are put straight through a checker
> filter:
>
> Checker Input image of the registrated output moving image
>  Spacing: [0.3125, 0.3125, 1]
>  Origin: [-18.1241, -60.8059, 0]
>  Direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
> Checker Input image of the fixed
>  Spacing: [0.3125, 0.3125, 3.48]
>  Origin: [-18.1241, -60.8059, 58.0112]
>  Direction:
> -0.0348995 0 -0.999391
> 0.999391 0 -0.0348995
> 0 -1 0
>
>
> Checker Output with no resampling
>  Spacing: [0.3125, 0.3125, 1]
>  Origin: [-18.1241, -60.8059, 0]
>  Direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100528/67048d03/attachment.htm>


More information about the Insight-users mailing list