[Insight-users] Text output problems in MultiResMIRegistration

Luis Ibanez luis.ibanez at kitware.com
Thu Nov 18 16:18:44 EST 2004


Hi Vincent,


What happens after you get the message:

     > Preprocess the images ...

???

Does it crashes ?
Does it keeps running ?
Does it exists ?

Did you forced the program to stop ?


It may simply be that it is still computing
the first level of the pyramid....


Did you checked with your Task Manager to see
if the programs is still running and taking
CPU cycles ?

The normal output from this filter is the following:
(fresh from a Linux run with today's CVS version)

========================================================
Parsing input ...
Fixed image filename: brainweb165a10f17.mha
Moving image filename: brainweb1e5a10f17Rot10Tx15.mha
Permute order: [0, 1, 2]
Flip axes: [0, 0, 0]
Number of levels: 5
Fixed image shrink factors: [4, 4, 1]
Moving image shrink factors: [8, 8, 1]
Number of iterations: [2500, 2500, 2500, 2500, 2500]
Learning rates: [1e-04, 1e-05, 5e-06, 1e-06, 5e-07]
Translation scale: 320
Output filename: t1tot2.mhd

Preprocess the images ...
Register the images ...
--- Starting level 0
  No. Iterations: 2500 Learning rate: 1e-04
--- Starting level 1
  No. Iterations: 2500 Learning rate: 1e-05
--- Starting level 2
  No. Iterations: 2500 Learning rate: 5e-06
--- Starting level 3
  No. Iterations: 2500 Learning rate: 1e-06
--- Starting level 4
  No. Iterations: 2500 Learning rate: 5e-07
Final parameters: [-1.7988e-05, 0.000144513, -0.0873063, 0.996182, 
2.38895, -17.2621, 0.103705]
Overall transform matrix:
0.984755 0.173946 0.000291063
-0.173946 0.984755 1.06049e-05
-0.000284781 -6.10723e-05 1

Overall transform offset:
[-15.0512, 0.0384943, 0.135935]
Generating output ...

=========================================

The whole process took  109 seconds
in a dual processor Pentium IV, 2.4Ghz
running Debian Linux and Gcc 3.3

==========================================

The time between the message:

      Preprocess the images ...

and the message

      Register the images ...


was about 3 seconds.

===============================

Note that this example is memory demanding, it may
reache a memory footprint of 750 Mbytes.

You may want to double check with your Task Manager
to see if your system is swapping memory to disk.
If this is the case, that will explain a long
computation time...

===================================

BTW, did you compiled this program with optmization ?



Please let us know what you find,


    Thanks



       Luis



-------------------
Vicente Grau wrote:

> Luis,
> 
> thank you very much for your help. I am sorry I didn't explain my 
> problem well enough. The fact is that I don't get any messages from the 
> Command/Observer at all. The text output I get from the program is:
> 
> MultiResMIRegistration.exe BrainWebT1toT2b.txt
> Parsing input ...
> Fixed image filename: brainweb165a10f17.mha
> brainweb1e5a10f17Rot10Tx15.mha
> Permute order: [0, 1, 2]
> Flip axes: [0, 0, 0]
> Number of levels: 5
> Fixed image shrink factors: [4, 4, 1]
> Moving image shrink factors: [8, 8, 1]
> Number of iterations: [2500, 2500, 2500, 2500, 2500]
> Learning rates: [0.0001, 1e-05, 5e-06, 1e-06, 5e-07]
> Translation scale: 320
> Output filename: t1tot2.mha
> Preprocess the images ...
> 
> and that's all. There are other std::cout<< lines that should be 
> executed (in MIMApplicationBase::Execute(), std::cout << "Register the 
> images ... ") that don't seem to work (I have checked on gdb if the 
> program went through them, and it did so but with no effect.) I also 
> added other cout << lines myself, not related to the Command/ Observer, 
> but directly in the function MIMPreprocessor::Execute(), and I found 
> that  they stopped working right after the normalizer->Update(); line. 
> That's why I thought this could be interfering with the std output. I 
> don't know what else it could be; any ideas?
> 
> Thank you very much.
> 
> Vicente
> 
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Vicente,
>>
>>
>> Thanks for your detailed report.
>>
>> The MultiResMIRegistration application only have one
>> Observer connected to the registration algorithm.
>>
>> This observer is only intended to react to the changes
>> in resolution level. In other words, since this is a
>> multi-resolution registration, IterationEvents are triggered
>> *at the end* of the registration process of each level
>> of the pyramid.
>>
>> What the Command/Observer does at that point is to invoke
>> the StartNewLevel() method of the MIMRegistrator. In lines
>> 180-202. This method *only* prints out the number of iterations
>> and the learning rate that is going to be used for the *next*
>> level of the pyramid.
>>
>> In summary:  In this application you should only expect *one*
>> printed line per change in level of the pyramid. Since you are
>> setting your registration to use 5 levels, you will only get
>> 4 messages.
>>
>> If you want to get trace output from the registration process
>> inside each one of the pyramid level, you may want to add
>> another Command/Observer and connect it to the optimizer.
>>
>> You will find multiple examples on how to do this in the
>> ITK Software Guide
>>
>>        http://www.itk.org/ItkSoftwareGuide.pdf
>>
>>
>> in the registration chapter.
>>
>>
>>
>>   Please let us konw if you have further questions,
>>
>>
>>
>>      Thanks
>>
>>
>>
>>         Luis
>>
>>
>>
>> -----------------------
>> Vicente Grau wrote:
>>
>>> Hi everybody,
>>>
>>> I have recently installed ITK Release 1.8.1 on a Windows XP platform 
>>> using cygwin. Running MultiResMIRegistration on two sample images 
>>> (brainweb165a10f17.mha and brainweb1e5a10f17Rot10Tx15.mha, both in 
>>> the ftp server), the program returns a reasonable registered image. 
>>> However, I can see no text output from the Observer. Adding some 
>>> cout<< lines to check where it fails, I have tracked the problem down 
>>> to MIMPreprocessor.txx: in function Execute(), it stops printing 
>>> anything right after the line:
>>> normalizer->Update();
>>>
>>> Is it possible that this command somehow interferes with text 
>>> printing in my window?
>>> I have debugged the program with gdb and it runs correctly past this 
>>> line, only it doesn't react to cout<<  lines anymore.
>>> I have gone through the pdfs and the list, but I couldn't find 
>>> anything related. Any help will be much appreciated!
>>>
>>> This is the parameters file I am using as input to the program.
>>>
>>> brainweb165a10f17.img
>>> brainweb1e5a10f17Rot10Tx15.img
>>> 0 1 2
>>> 0 0 0
>>> 5
>>> 4 4 1
>>> 8 8 1
>>> 2500 2500 2500 2500 2500
>>> 1e-4 1e-5 5e-6 1e-6 5e-7
>>> 320
>>> t1tot2.mha
>>>
>>>
>>> Vicente Grau
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>
>>
> _______________________________________________
> 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