[Insight-users] Image registration error

Blezek, Daniel J (GE, Research) blezek at crd.ge.com
Thu Jan 11 16:44:02 EST 2007


Eric,

  I've found it helpful to print some test points and pass them through
the transform.  You will need to simulate the whole process of
registration, i.e.

Print center of fixed image as an index (128,128,64), then try a corner
or two (0,0,0), (255,255,127).

ImageType::IndexType FixedCenter;
FixedCenter[0] = 128; ...
cout << "FixedCenter Index: " << FixedCenter << endl;

Print this center in physical coordinates of the fixed image
cout << "FixedCenter physical: " << fixedImage->IndexToPhysical (
FixedCenter ) << endl;

Transform and print
cout << "Transformed physical: " << transform->TransformPoint (
fixedImage->IndexToPhysical ( ...) ) ) << endl;

Finally, print the index in the moving image
cout << "MovingImage Index: " << movingImage->PhysicalToIndex (
transform->TransfromPoint ... ) << endl;

This usually helps understand what's happening.  I suspect that your
images have incompatible centers, or that you didn't set the transform's
center of rotation to be the center of the fixed image.  The code above
is just an idea of what you'll need to do, I'm not sure if I got the
method names correct, but you should be able to figure them out from the
doxygen documentation.

Cheers,
-dan

-----Original Message-----
From: insight-users-bounces+blezek=crd.ge.com at itk.org
[mailto:insight-users-bounces+blezek=crd.ge.com at itk.org] On Behalf Of
Daniel Mace
Sent: Thursday, January 11, 2007 4:32 PM
To: Eric John; insight-users
Subject: Re: [Insight-users] Image registration error

Eric,

The only way that exception could be thrown is if the pixel count for a
particular iteration through the GetValue() method equaled 0.  It could
be that for one reason or another, your previous inputs are not updating
their Region areas like they should.  Before setting your moving and
fixed images, try calling the ->Update() method on each one.

BTW, what kind of transform are you using, and what are your initial
parameters for it?

Cheers,
Dan

Eric John wrote:
>
> Hi Dan, I did have experience with rotating images out of view, but 
> the rotated image is basically centered in both of my image 
> viewers.....I even looked at the header file, but don't see anything 
> that would indicate offsets, etc. Any suggestions, I would like to use

> the pre-rotated image for preproccesing reasons?
>
> Thanks alot,
>
> Eric
>
>     From:  /Daniel Mace <dlm19 at duke.edu>/
>     To:  /Eric John <elviscrazyfingers at hotmail.com>/
>     CC:  /insight-users at itk.org/
>     Subject:  /Re: [Insight-users] Image registration error/
>     Date:  /Thu, 11 Jan 2007 16:11:44 -0500/
>     >Eric,
>     >
>     >It means that your moving image doesn't line up with any pixels
in
>     >your fixed image (i.e. you've rotated it completely off of the
map).
>     >  You need to adjust your starting parameters so that at least
some
>     >of the pixels are lined up.
>     >
>     >It's probably easiest just to set your initial parameters to the
>     >rotation instead of rotating beforehand (unless you are trying to
>     >preprocess all your images for normalization).  Don't forget that
in
>     >order to rotate your moving image by 90 degrees you actually have
to
>     >set your initial rotation parameter to -90 (or -1.57, as it's in
>     >radians).   The transformation parameters are all in terms of the
>     >fixed image, and not the moving image (e.g. a scale of 0.1
actually
>     >magnifies your moving image by 10, and a x translation of 50
>     >actually moves your moving image -50 units).  This caused me a
bit
>     >of confusion  starting out.
>     >
>     >Cheers,
>     >Dan
>     >
>     >Eric John wrote:
>     >>
>     >>Hello all, I am trying to register two 3-d MRI images (.mhd).
The
>     >>moving image was previously rotated 90 degrees so that both
images
>     >>would be in the same orientation for ease of registration.
Before
>     >>rotating, it caused no error, now I get this error:
>     >>
>     >>ExceptionObject caught !
>     >>
>     >>itk::ExceptionObject (012AFBA4)
>     >>Location: "unknown"
>     >>File:
>
>>C:\InsightToolkit-2.8.1\Code\Algorithms\itkMeanSquaresImageToImageMetr
ic.t
>     >>xx
>     >>Line: 369
>     >>Description: itk::ERROR:
MeanSquaresImageToImageMetric(01805120):
>     >>All the points
>     >>  mapped to outside of the moving image
>     >>
>     >>Any explanation for this? btw, this is one of the registration
>     >>examples: ImageRegistration8
>     >>  Thanks,
>     >>Eric
>     >>
>
>>----------------------------------------------------------------------
--
>     >>The MSN Entertainment Guide to Golden Globes is here. Get all
the
>     >>scoop. <http://g.msn.com/8HMBENUS/2740??PS=47575>
>
>>----------------------------------------------------------------------
--
>     >>
>     >>_______________________________________________
>     >>Insight-users mailing list
>     >>Insight-users at itk.org
>     >>http://www.itk.org/mailman/listinfo/insight-users
>     >>
>     >
>
>
> Type your favorite song.  Get a customized station.  Try MSN Radio 
> powered by Pandora. <http://g.msn.com/8HMBENUS/2752??PS=47575>

_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list