[Insight-users] What optimizer and transform can/should I use?

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 21 11:58:43 EDT 2005


Hi Yu,

Thanks for providing the additional
information that we requested.


1) Your images are small indeed. The computation
   of the Metric shouldn't take 2 second in such
   a small image.


2) Ok


3) Are you using Visual C++ ?

   If so, before building your program, you can
   go to the menu "Build" --> "Configuration Manager"
   and select "Release" in the first drop-up menu.


4) Ok


If the after compiling for release, you find that
the program still takes two seconds per iteration
of the metric, then,... something is going wrong.


Please let us know what you find,


   Thanks a lot,


       Luis




========================================================
Yu Qi wrote:
> 
> 
> Hi,
> I am sorry I did not provide details about my problem.
> Here are the answers to thoes questions:
>  
> 1) What is the size of your images ?
> very small (used to test the code) 64X64X28, both.
>  
> 2) In what machine are you running this program ?
> PM1.8G CPU      512 Memory.
> I use the same machine to register the same volumes by the mattes MI 
> metric. And it cost only a few seconds.
>  
> 3) Did you compiled the program for Release ?
> I use build every time. And when I try to compile it, a popup window 
> said that "no compile tool is associated with the file extension". How 
> can I compile it?
> 
> 4) What Interpolator are you using ?
> Linear. I use it with Mattes MI and it works OK. Actually, I only change 
> the Mattes MI to  NMI metric while keep others unchanged(Versor 3D 
> transformation and optimizer).
>  
> Thank you!
> Best regards,
> Yu Qi
> 
> */Luis Ibanez <luis.ibanez at kitware.com>/* 写道:
> 
> 
>     Hi Yu,
> 
>     Please provide more technical details instead of
>     anecdotic information.
> 
>     If you are honestly concerned about speed, you
>     must start by reporting the following information:
> 
>     1) What is the size of your images ?
>     2) In what machine are you running this program ?
>     3) Did you compiled the program for Release ?
>     4) What Interpolator are you using ?
> 
> 
>     Two seconds may be excellent if your images are in
>     the range of Gigabytes,.. and it is very poor if
>     your images are in the range of Kilobytes.
> 
>     Two seconds are to be expected if you are using
>     an old SGI machine, and indicate that something
>     is wrong if you are running in a contemporary
>     Desktop.
> 
>     Two seconds may be ok if you are compiling your
>     code for Debug, because in that case most of
>     the functions that could have been inlined...
>     are not compiled inline.
> 
>     The bulk of the computation during one iteration
>     of the optimizer is spend on Interpolation and
>     on Mapping. A slow interpolator will have a
>     dramatic effect on the time needed for completing
>     one iteration.
> 
> 
>     Please let us know the answers to
>     the questions above,
> 
> 
> 
>     Thanks
> 
> 
>     Luis
> 
> 
> 
>     -----------------------------------------------------
>     Yu Qi wrote:
> 
>      > Hi,
>      > I tried the Versor transform function and optimizer.
>      > and following is the code for metric
>      >
>      > / unsigned int numberOfBins =32;
>      > MetricType::HistogramType::SizeType histogramSize;
>      > histogramSize[0] = numberOfBins;
>      > histogramSize[1] = numberOfBins;
>      > metric->SetHistogramSize( histogramSize );
>      > /
>      > / const unsigned int numberOfParameters =
>      > transform->GetNumberOfParameters();/
>      > / typedef MetricType::ScalesType ScalesType;
>      > ScalesType scales( numberOfParameters );/
>      > / scales.Fill( 1.0 );
>      >
>      > metric->SetDerivativeStepLengthScales(scales);/
>      > /
>      > /
>      > I do not know why the computation was so slow.
>      > Every iteration will take 2 second.
>      > Do you know why?
>      >
>      > Thanks!
>      > Best regards,
>      > Yu Qi
>      > *//*
>      > *//*
>      > *//*
>      > */Luis Ibanez /* 写道:
>      >
>      >
>      > Hi Yu,
>      >
>      >
>      > The Optimizers to use depends a lot on the Transform
>      > that you choose. Therefore the decision about the
>      > Transform should be taken first.
>      >
>      > Since this is 3D and you probably are dealing with
>      > images from the same patient, I would suggest that
>      > you use a rigid Transform such as:
>      >
>      > VersorRigid3DTransform
>      >
>     http://www.itk.org/Insight/Doxygen/html/classitk_1_1VersorRigid3DTransform.html
>      >
>      > and therefore use the
>      >
>     &g! t; VersorRigid3DTransformOptimizer
>      >
>     http://www.itk.org/Insight/Doxygen/html/classitk_1_1VersorRigid3DTransformOptimizer.html
>      >
>      >
>      > There are multiple options for Mutual Information, but
>      > if you insist in using Normalized Mutual Information,
>      > then the class that you need is:
>      >
>      >
>     http://www.itk.org/Insight/Doxygen/html/classitk_1_1NormalizedMutualInformationHistogramImageToImageMetric.html
>      >
>      >
>      > You will fin! d a versy similar example on the
>      > ITK Software Guide
>      >
>      > http://www.itk.org/ItkSoftwareGuide.pdf
>      >
>      > in section: 8.6.4, pdf-page 391. The source code is
>      > available in
>      >
>      >
>      > Insight/Examples/Registration/
>      > ImageRegistration8.cxx
>      >
>      >
>      >
>      > You are *STRONGLY* encouraged to read the full Chapter
>      > on registration before you attempt to use this particular
>      > example.
>      >
>      >
>      >
>      > Regards,
>      >
>      >
>      > Luis
>      >
>      >
>      >
>      > --------------
>      > Yu Qi wrote:
>      > > Hi.
>      > > I am going to register 3d MRI and fMRI using Normalized MI metric.
>      > >
>      > > What optimizer and transform can I use?
>      > > Can I use any of the transform and optimizer supplied by ITK?
>      > >
>      > > And which is the most popular one for normalized MI?
>      > >
>      > > Thank you!
>      > >
>      > >
>      > >
>      > >
>      > > *Best Regards!*
>      > > **
>      > > *Yu Qi*
>      > >
>      > >
>      > >
>      >
>      >
>      > __________________________________________________
>      > 赶快注册雅虎超大容量免费邮箱?
>      > http://cn.mail.yahoo.com
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      >
>      > _______________________________________________
>      > Insight-users mailing list
>      > Insight-users at itk.org
>      > http://www.itk.org/mailman/listinfo/insight-users
> 
> 
> 
> ------------------------------------------------------------------------
> DO YOU YAHOO!?
> 雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 
> <http://cn.mail.yahoo.com/?id=77072>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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