[Insight-users] Re: MultiResMIRegistration

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 8 12:35:08 EDT 2004


Hi Christos,


A) I'm afraid that you may be misinterpreting
    the code in

      InsightApplications/
          MultiResMIRegistration/
               MIMApplicationBase.txx.

    I assume that you are refering to line 241:

    double scale = 1.0 / vnl_math_sqr(
             m_Parser->GetTranslationScale() );

    The VNL function "vnl_math_sqr()" does not compute
    the square root but the square.

    What you seem to be interpreting as:

                 1 / sqrt( 320 )

    is actually:

                 1 / ( 320 * 320  )




B) The exception that you are getting may be comming
    from many places, not necessarily the Mattes MI
    metric.

    It can be produced by any filter if it is put in a
    situation where the Requested region has not been
    properly updated during the pipeline negociation.

    You will have to post a minimal code example where
    you observe this problem if you want to get some
    assistance for finding a solution.



C) As you correctly said:
                               "IDEALLY" the optimizer
    should find the global minimum. However in practice
    is it almost impossible to expect any numerical
    method to provide a global solution. Instead we
    will always find local solutions.

    In the case of the binary images that you mention
    we will also have to deal with the amount of overlap
    between the two images.


    If the optimizer is returning you a distorted square
    that is fully overlapped with the other shape, then
    the optimizer has fulfilled its contract since this
    is a valid optimum value for MI.

    If you don't want the square to be shared... Well...
    simply use a "Rigid" transform instead of an "Affine"
    transform.     :-)

    That will actually run faster since it will optimize 6
    parameters instead of 12.

    When you select an Affine transform in the registration
    you are implicitly saying that you will be happy with
    any deformation, including combinations of scaling,
    shearing, rotation and translation.




Regards,


    Luis



---------------------------
Christos Panagiotou wrote:

> Dear Luis
> 
> thanks again for a very detailed post :)
> some questions about your answers!
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Christos,
>>
>> Isn't it fun to find good
>> parameters for registration ?     :-)
>>
>>
>> ----
>>
>> About your questions:
>>
>> 0)  As you pointed out, the factor is
>>     a "suggestion". The relative scaling
>>     between the translations and rotation
>>     also allows you to control how fast to
>>     advance in rotation with respect to
>>     how much to advance in translations.
>>
>>     Depending on the predominant type of
>>     mis-registration present in your images,
>>     different range of factors may me more
>>     convenient.
>>
>>     The suggestion is simply a reasonable
>>     parameter from which you can start the
>>     fascinating process of fine tunning the
>>     values for your specific types of images.
>>
>>
>> A)  There is not an inherent problem with the
>>     MIMApplicationBase.txx way of computing the
>>     scaling parameters. This values is a reasonable
>>     first guess. You may use double of it, or half
>>     of it and still be able to tune other registration
>>     parameters in order to make the optimizer converge.
>>
>>
>> B)  I don't see why you suggest to make the scaling
>>     equal to  "131748". it seems that you forget the
>>     sqrt() from your own computation, where you found
>>     that the scaling should be around 363.
> 
> 
> -----------------------------------
> well 131748 is the value before the sqrt
> MIMAppBase.txx takes the input scale factor (in this case 320) and then 
> it computes the sqrt
> of the input
> 
> so its 1.0 / sqrt(320)
> its like sqrt(sqrt(11748)) and it is a bit different than 1.0 / 363
> thats why i ve asked...
> ----------------------------------
> 
>>
>>
>>
>> E)  Mutual Information may be quite counter-intuitive when
>>     you apply it to trivial data, like the binary images
>>     that you mention.  What you are asking to minimize is
>>     the sparseness of the joint histogram. The optimizer
>>     may end up selecting any transform parameters that lead
>>     to such minimization. That includes to put all the white
>>     of the square over all the black of the rectangle and
>>     viceversa, since in this case you get a diagonal histogram.
>>     And, although most people would consider that solution a
>>     dramatic failure of the registration, well, that's just
>>     a valid result for minimzing Mutual Information.
> 
> 
> 
> --------------
> well about histogram... i mostly use the viola method
> i ve tried to run the mattes implementation and i get an exception
> Requested region is (at least partially) outside the largest possible 
> region. (how can i overcome this or what does this mean?
> it seams to be invariant in the selection of histogram bins or spatial 
> sample number (i use ITK 1.6)?)
> 
> well the optimizer should idealy find the "global" minimum of negative 
> MI so the all white of the square over all the black
> of the rectangle globaly minimizes only when there is exact registration 
> in this case (am i wrong?)
> h(a)+h(b)-h(a,b) (viola implementation)
> 
> what i get as a result in my case is a cube (moving image) affinly 
> transformed to a paralelogram (fixed image)
> the resampled moving image (a sheared paralelogram) fully overlaps the 
> fixed however its ... sheared!
> weeeell... as you said its probably optimization... i ve tried loads of 
> attempts with varying learning rates and iterations and multi resolution 
> levels but i can get the exact
> result... and i thought it would be a simple test the cube/para case!
> maybe mattes implementation (after getting rid of the exception) would 
> help me to opimize it due to the smoothness of the metric.
> 
> i ll try to post some histograms when i generate them
> 
> really thanks for your reply
> christos
> _______________________________________________
> 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