[Insight-users] how to set the initial parameter for a rigid registration manually?

Luis Ibanez luis.ibanez at kitware.com
Sat Mar 6 14:12:35 EST 2010


Hi Michiel,

Thanks for sending the image data.

1) Given that the direction cosines of your Fixed image
    are an identity matrix, the geometrical center of your
    Fixed image is:

              Origin +  Spacing * Size / 2

    That is:

     X: 44.0625 + 0.3125 *  215 / 2  =  77.65625
     Y:   0.0       + 0.3125 *  172 / 2  =  26.875
     Z:   0.0       + 1.9808 *    48 / 2  =  47.53919


1) Given that the direction cosines of your Moving image
    are an identity matrix, the geometrical center of your
    Moving image is:

              Origin +  Spacing * Size / 2

    That is:

     X:   0.0  + 0.3125 *  512 / 2  =  80.0
     Y:   0.0  + 0.3125 *  512 / 2  =  80.0
     Z:   0.0  + 1.9291 *    52 / 2  =  50.15


3) The relative position between the geometrical
     centers of the Moving image and Fixed image

          X:    80.0   - 77.65625   =     2.34375
          Y:    80.0   - 26.875       =   53.125
          Z:    50.15 - 47.53919   =     2.610

      that is consistent with the translation that
      the Transform initializer is reporting:

             [0, 0, 0, 2.34375, 53.125, 2.64351]



So, the TransformInitializer is doing the right thing.
Something else is wrong in the setup of your
registration process.


Questions:

A) Do you get the Exception message at the
     first iteration of the optimizer ?

B)  If you get the Exception message after
      several iterations of the optimizer, could
      you please post to the list:

        1) Type of the optimizer that you are using
        2) Full list of optimizer numerical parameters
        3) Scaling array that you are passing to the
            optimizer.



     Thanks


          Luis


-------------------------------------------------------------------------
On Tue, Mar 2, 2010 at 4:19 AM, michiel mentink
<michael.mentink at st-hughs.ox.ac.uk> wrote:
> hi Luis,
>
> fixed image size:      [215, 172, 48]
> fixed image origin:    [44.0625, 0, 0]
> fixed image spacing:   [0.3125, 0.3125, 1.9808]
> fixed image direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
> moving image size:      [512, 512, 52]
> moving image origin:    [0, 0, 0]
> moving image spacing:   [0.3125, 0.3125, 1.92911]
> moving image direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
> image mask size:      [215, 172, 48]
> image mask origin:    [44.0625, 0, 0]
> image mask spacing:   [0.3125, 0.3125, 1.9808]
> image mask direction:
> 1 0 0
> 0 1 0
> 0 0 1
>
> when GeometryOn() is used:  Initial Transform Parameters: [0, 0, 0, 2.34375,
> 53.125, 2.64351]
>
>
> When MomentsOn() is used:  Initial Transform Parameters: [0, 0, 0, 7.70064,
> 49.5835, -0.0834114]
>
>
>
> cheers,
>
> Michael
>
>
> On Mon, Mar 1, 2010 at 11:11 PM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Hi Michiel,
>>
>> It is very unlikely that the CenteredTransformInitializer
>> will fail to overlap the two images.
>>
>>
>> DO NOT assign any value manually to the Transform.
>> That's what the Initializer is for.
>>
>>
>> Please do the following:
>>
>>   1) Set the initializer to use GeometryOn();
>>
>>   2) Run the code again and
>>       post to this mailing list the following information:
>>
>>        a) The Transform just as it is initialized by the
>>             initializer ( no need to run registration iterations).
>>
>>        b) Origin, Spacing, Orientation and number of pixels
>>             of both the Fixed Image and Moving Images.
>>
>>
>>  Thanks
>>
>>
>>       Luis
>>
>>
>>
>> ----------------------------------------------------
>> On Mon, Mar 1, 2010 at 11:40 AM, michiel mentink
>> <michael.mentink at st-hughs.ox.ac.uk> wrote:
>> > spoke too soon :(
>> >
>> > Now the moving image dimensions are zeroed too.
>> >
>> > help?
>> >
>> > On Mon, Mar 1, 2010 at 4:30 PM, michiel mentink
>> > <michael.mentink at st-hughs.ox.ac.uk> wrote:
>> >>
>> >> ah solved it.
>> >>
>> >> For any that are interested:
>> >>
>> >>  TransformType::OutputVectorType translation_vector;
>> >>   translation_vector[0] = 0.0;
>> >>   translation_vector[1] = 0.0;
>> >>   translation_vector[2] = 0.0;
>> >>   transform->SetTranslation(translation_vector);
>> >>
>> >> and then comment out
>> >>   initializer->InitializeTransform();
>> >>
>> >> Still doesn't solve my problem though.
>> >>
>> >> cheers, Michael
>> >>
>> >>
>> >> On Mon, Mar 1, 2010 at 3:39 PM, michiel mentink
>> >> <michael.mentink at st-hughs.ox.ac.uk> wrote:
>> >>>
>> >>> Dear all,
>> >>>
>> >>> is there anyway of setting the initial iteration of the
>> >>> CentredTransformInitializer manually?
>> >>>
>> >>> The CentredTransformInitializer uses either GeometryOn() or
>> >>> momentsOn()
>> >>> that calculates
>> >>> the center of the image, but that produces an initial parameter that
>> >>> fails the registration even
>> >>> before it starts, because its errors:
>> >>> Description: itk::ERROR: MeanSquaresImageToImageMetric(0x9dfa3f0): All
>> >>> the points mapped to outside of the moving image
>> >>>
>> >>> Alternatively, can I just overwrite the parameters that are produced
>> >>> by
>> >>> the centredTransformInitializer? How?
>> >>>
>> >>> I'm using the VersorRigid3DTransform.
>> >>>
>> >>> cheers, Michael
>> >>>
>> >>
>> >
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.html
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.itk.org/mailman/listinfo/insight-users
>> >
>> >
>
>


More information about the Insight-users mailing list