[Insight-users] multiresolution registration example problem

Luis Ibanez luis . ibanez at kitware . com
Wed, 10 Sep 2003 19:00:58 -0400


Hi Fang,

Thanks for sending this extra information.
 
Now it looks like a real bug report    :-)


and... guess what ?

You actually found a bug,


The problem is that the example is expecting three
required arguments in the command line and having
a fourth argument as optional.

The arguments are:

1) input fixed image filename
2) input moving image filename
3) output resampled movin image filename
4) default pixel value for resampling.

Parameter (4) is optional, but the code that
is testing for its presence is checking for

       if(  argc > 3   )

instead of

      if( argc >  4  )  

In  your run, you are not providing the fourth
argument, and the faulty test results in trying
to access argv[4].

We are commiting a fix to the repository.

In the meantime you can simply make this change
in your checkout. That will be in line 493 of

Insight/Examples/Registration/MultiResImageRegistration2.cxx

... you could also, simply provide the fourth
argument. What this fourth number does is
to define the default pixel value to be used for
those pixels that are not valid after the image
has been resampled.

You will find an explanation on these details
in the Software Guide
http://www . itk . org/ItkSoftwareGuide . pdf
Section 6.7.1, pdf-page 199.


Enjoy ITK !


    Luis


---------------------------
Shunming Fang wrote:

>Hello, Luis, 
>This following command is what I used:
>MultiResImageRegistration2 ~/images/zl8536.png
>~/images/zl8537.png test-align-1.png
>
>
>and platform is linux mandrake9.1
>
>the result is the following:
>0   -0.864992   [0.988072, -0.00819142, 0.000408725,
>1.00102, -15.9422, 1.35913]
>1   -0.779529   [0.992701, -0.00540314, 0.000897426,
>1.00367, -8.31183, 3.76287]
>2   -0.81427   [1.00454, 0.00681987, -0.00504781,
>1.01437, -0.34184, 4.45487]
>3   -0.855973   [1.00169, 0.0053049, -0.00501401,
>1.01449, -4.33777, 4.63524]
>0   -0.811293   [1.00328, 0.00562555, -0.0051139,
>1.014, -2.34205, 4.50452]
>1   -0.807756   [1.00258, 0.00503576, -0.00517005,
>1.01392, -3.29878, 4.21354]
>2   -0.813329   [1.00256, -0.002271, -0.00453737,
>1.01234, -4.15675, 3.6999]
>3   -0.80103   [1.00295, -0.00190371, -0.0045426,
>1.01237, -3.65945, 3.75177]
>4   -0.804694   [1.00337, -0.00166423, -0.00455078,
>1.01229, -3.16115, 3.71051]
>5   -0.810511   [1.00377, -0.00128286, -0.00456329,
>1.0122, -2.66879, 3.62347]
>6   -0.815741   [1.00415, -0.000801718, -0.00450179,
>1.01214, -2.16917, 3.604]
>7   -0.816978   [1.00449, -0.000464478, -0.00448094,
>1.01217, -1.67126, 3.64967]
>8   -0.818078   [1.00429, -0.000530459, -0.00447901,
>1.01217, -1.92126, 3.65013]
>9   -0.819099   [1.00402, -0.000262477, -0.00443527,
>1.01222, -2.15837, 3.72936]
>0   -0.728706   [1.00393, -0.000320457, -0.00443831,
>1.01224, -2.28335, 3.72745]
>1   -0.729574   [1.0039, -0.000324708, -0.0044871,
>1.01225, -2.2919, 3.60275]
>2   -0.729804   [1.00391, -0.000276545, -0.00453896,
>1.01223, -2.24369, 3.48742]
>3   -0.730089   [1.00388, -0.000307532, -0.00455162,
>1.01227, -2.30472, 3.47395]
>4   -0.730064   [1.00386, -0.000284744, -0.00457822,
>1.01227, -2.31653, 3.41258]
>5   -0.730217   [1.00384, -0.000277533, -0.00459527,
>1.01228, -2.36268, 3.37043]
>6   -0.730278   [1.00381, -0.000269365, -0.00460999,
>1.01227, -2.40565, 3.32505]
>7   -0.730033   [1.00378, -0.000277456, -0.00461338,
>1.01228, -2.46798, 3.32053]
>8   -0.73   [1.00373, -0.000207213, -0.00461581,
>1.01233, -2.5303, 3.32528]
>9   -0.730016   [1.00368, -6.24624e-05, -0.0046212,
>1.01236, -2.5928, 3.32552]
>10   -0.730119   [1.00354, 0.000439174, -0.00462824,
>1.01242, -2.65519, 3.32916]
>11   -0.730443   [1.0035, 0.000434461, -0.00463879,
>1.01243, -2.716, 3.31472]
>12   -0.730462   [1.00347, 0.000449354, -0.00464509,
>1.01245, -2.77742, 3.32631]
>13   -0.730513   [1.00344, 0.000491896, -0.00465574,
>1.01251, -2.8178, 3.37401]
>14   -0.73047   [1.00346, 0.000513298, -0.0046545,
>1.01256, -2.78915, 3.38649]
>15   -0.730477   [1.00345, 0.000582191, -0.00467051,
>1.0126, -2.75832, 3.38142]
>Result =
> Translation X = -2.75832
> Translation Y = 3.38142
> Iterations    = 17
> Metric value  = -0.730578
>Segmentation fault
>
>and I also check MultiResRegistration1, it worked on
>the same two images. I didn't use any debug version or
>tools.
>Thanks
>Fang
>--- Luis Ibanez <luis . ibanez at kitware . com> wrote:
>  
>
>>Hi Fang,
>>
>>A little bit more of information may be helpful...  
>>   :-)
>>
>>
>>1) Could you please tell us more about your images ?
>>2) Did the seg faults ocurred just after running the
>>example ?
>>3) Did you get any messages before it crashed ?
>>4) What platform are you working on ?
>>5) Did you attempt to run in a debugger and identify
>>     the place where the example seg.faults  ?
>>6) Are you sure that it seg. faulted ? or did it
>>show
>>     an "Abort" message ?
>>
>>
>>Regards,
>>
>>
>>     Luis
>>
>>---------------------------
>>Shunming Fang wrote:
>>
>>    
>>
>>>Hello, Guys,
>>>I has converted my two focal paire images to png
>>>      
>>>
>>and
>>    
>>
>>>use MultiResImageRegistration2 to test the
>>>multiresolution registration, but fial, it just
>>>      
>>>
>>show
>>    
>>
>>>segmetation faults, any thoughts aobut it?
>>>Thanks
>>>Fang
>>>
>>> 
>>>
>>>      
>>>
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>http://sitebuilder . yahoo . com
>
>  
>