[Insight-users] Ok more especific
Luis Ibanez
luis.ibanez at kitware.com
Mon May 23 17:03:21 EDT 2005
Hi Javier,
Thanks for you kindly providing a more detailed
description of your problem.
Here are several comments:
1) There is not such a thing as "the way" of doing
deformable registration. The ITK Software Guide
describes in fact three different deformable registration
techniques that are available in the Toolkit.
They are:
1.1) FEM-Based registration
1.2) DEMONS registration
1.3) BSpline free-form registration
There are a series of criterion for selecting which
one of these methods to use. For example, Demons is
only applicable to intra-modality images.
The combination that you are using is just "one way" of
performing deformable registration.
You will find many other methods for performing deformable
registration. For example, LevelSets and model-to-image
registration.
The notion that there is "the way" of doing something is
just a pernicious remanent of our years of being subject
to the alienation of the "publish-or-perish" fallacy.
Where every research group is supposed to come up with a
"new and better way" of doing something.
This deep misunderstanding of the basics of the scientific
method have converted research institutions in narcissist
organizations dedicated to build-up a system based on
reputation and authority instead of facts and technological
competence. Probably the more regrettable effect of this
alienation is that it has undermined the public trust
in the research community and in academia.
2) What I suggested you to initialize was not the Metric, but
the Transform. Given that registration is an optimization
process, you must provide a reasonable initialization for
the parameters of the Transform. This is particularly important
in Deformable Registration methods because you are dealing
with Transforms that have large number of parameters and it
will take too long for the optimizer to explore those high
dimensional optimization spaces.
3) From your email, should we understand that you explicitly
called the "SetComputeGradient()" method and that with this
you get an output that is closer to the FixedImage ?
4) The Examples in the Software Guide are showing you "one way"
of combining the component of the registration framework.
There are not intended to serve as authoritative ways of
performing registration. They simply show particular combinations
that result in trade-offs that are convenient in practice.
In principle, you can use the MutualInformationMetric with
any Optimizer and with any Transform. It is known however, that
MutualInformation tends to be noisy and therefore you have better
chances of success if you combine this metric with an optimizer
that is resistant to the presence of noise in the cost function.
We apreciate that you provide aditional details about your problem.
However, at this point it is still unclear what is the difficulty
that you are facing.
From your message I can only grasp that:
"the OutPutImage is like FixedImage
but is not very well."
Is there a chance that you could post a screenshot of that result so
we could assess the state of your registration ?
Or maybe you could better describe why is that the resampled moving
image is not matching the fixed image very well.
Regards,
Luis
==========================
javier silva bravo wrote:
> I am developing an aplication for endoscopy test of cancer. I am trying
> to use BSplineTransform, BSplineInterpolate, LBFGSBOptimizer and
> MeanSquaresImageToImageMetric ok.
>
> Why I am using that (BSplineTransform, BSplineInterpolate,
> LBFGSBOptimizer and MeanSquaresImageToImageMetric )? because I need
> DEFORMABLEREGISTRATION and the SoftwareGuide says that to do
> DeformableRegistration they (BSplineTransform, BSplineInterpolate,
> LBFGSBOptimizer and MeanSquaresImageToImageMetric ) are the way.
>
> I am working with images *.bmp and *.tif 537X418 pixels and 222KB.
>
> when I saw the DeformableRegistration4,5,6,7,8
> (InsightToolkit-2.0.0\Examples\Registration) they say me the way to use
> BSplineTransform so I change DeformableRegistration7 to 2D images, but
> the OutPutImage was like MovingImage always. I send my question and you
> tell me the reason was I did not help the metric
> (MeanSquaresImageToImageMetric) so I said you How can I help
> MeanSquaresImageToImageMetric?.
>
> Again I send the code but yesterday I find a instruction
> SetComputeGradient() and the OutPutImage is like FixedImage but is not
> very well.
>
> Ha I do not remeber sometime you say me if I was using
> MutualInformationImageToImageMetric and I would like to know how to use
> but I know the answer SoftwareGuide so I saw the Guide and
> ImageRegistration2.cxx and tell me if I want to use it
> (MutualInformationImageToImageMetric) alwas do i need
> itkGradientDescentOptimizer.h, itkNormalizeImageFilter.h
> itkDiscreteGaussianImageFilter.h ??
>
> Thank you for you Help.
>
>
> >From: Luis Ibanez <luis.ibanez at kitware.com>
> >To: javier silva bravo <javier_silva_bravo at hotmail.com>
> >CC: insight-users at itk.org
> >Subject: Re: [Insight-users] Where I can find examples or paper about
> >Date: Wed, 18 May 2005 21:37:28 -0400
> >
> >
> >
> >Hi Javier,
> >
> >
> >
> >Please be more specific.
> >
> >Our divinatory skills are quite limited and
> >tend to fade as we are rapidly aging.
> >
> >
> >
> >
> >
> >When you say:
> >
> >
> >
> > "It does not work"
> >
> >
> >
> >Do you mean:
> >
> >
> >1) It doesn't compile ?
> >2) It compiles but does not link ?
> >3) It links but produces segmentation faults at run time ?
> >4) It throws exceptions at run time ?
> >5) It runs without crashing but the registration result
> > does not aligns the images as expected ?
> >
> >
> >
> >We will be more than happy to help you, but we need your
> >help in providing enough information about your problem.
> >
> >
> >
> >
> >BTW, note that *ALL* the code shown in the software guide
> >is available in the directory Insight/Examples
> >
> >In particular... the image registration examples are available
> >in
> >
> >
> > Insight/Examples/Registration
> >
> >
> >You could happily go straight for the files:
> >
> >
> > ImageRegistration14.cxx
> > ImageRegistration15.cxx
> > ImageRegistration16.cxx
> >
> >
> >where that metric is used.
> >
> >
> >
> >
> >These examples are compiled and executed every night in 55
> >different platforms ranging from cygwin, to Linux, to IRIX.
> >
> >http://www.itk.org/Testing/Dashboard/20050517-0500-Nightly/TestDetail/__Examples_Registration_ImageRegistration14Test.html
> >
> >
> >
> >
> >
> >Regards,
> >
> >
> >
> > Luis
> >
> >
> >
> >
> >---------------------------
> >javier silva bravo wrote:
> >
> >>Yes Luis but I don undertand why it does not work.
> >>
> >>In the guide says:
> >>
> >>typedef itk::MutualInformationImageToImageMetric<
> >>
> >>InternalImageType,
> >>
> >>InternalImageType > MetricType;
> >>
> >>MetricType::Pointer metric = MetricType::New();
> >>registration->SetMetric( metric );
> >>
> >>metric->SetFixedImageStandardDeviation( 0.4 );
> >>metric->SetMovingImageStandardDeviation( 0.4 );
> >>metric->SetNumberOfSpatialSamples( 50 );
> >>
> >>typedef itk::NormalizeImageFilter<
> >>FixedImageType,
> >>InternalImageType
> >> > FixedNormalizeFilterType;
> >>typedef itk::NormalizeImageFilter<
> >>MovingImageType,
> >>InternalImageType
> >> > MovingNormalizeFilterType;
> >>FixedNormalizeFilterType::Pointer fixedNormalizer =
> >>FixedNormalizeFilterType::New();
> >>MovingNormalizeFilterType::Pointer movingNormalizer =
> >>MovingNormalizeFilterType::New();
> >>
> >>fixedNormalizer->SetInput( fixedImageReader->GetOutput() );
> >>
> >>movingNormalizer->SetInput( movingImageReader->GetOutput() );
> >>
> >>Now tell me what am i doing wrong?
> >>
> >>typedef itk::MutualInformationImageToImageMetric<
> >> FixedImageType,
> >> MovingImageType> MetricType;
> >> typedef itk::NormalizeImageFilter<
> >> FixedImageType,
> >> InternalImageType>
> >>FixedNormalizeFilterType;
> >> typedef itk::NormalizeImageFilter<
> >> MovingImageType,
> >> InternalImageType>
> >>MovingNormalizeFilterType;
> >>
> >>FixedNormalizeFilterType::Pointer fixedNormalizer =
> >>FixedNormalizeFilterType::New();
> >> MovingNormalizeFilterType::Pointer movingNormalizer =
> >>MovingNormalizeFilterType::New();
> >>
> >> MetricType::Pointer metric = MetricType::New();
> >>
> >> fixedNormalizer->SetInput( fixedImage );
> >> movingNormalizer->SetInput( movingImageReader->GetOutput() );
> >>
> >> registration->SetFixedImage( fixedNormalizer->GetOutput() );
> >> registration->SetMovingImage( movingNormalizer->GetOutput() );
> >> metric->SetFixedImage( fixedNormalizer->GetOutput() );
> >> metric->SetMovingImage( movingNormalizer->GetOutput() );
> >> interpolator->SetInputImage(movingImageReader->GetOutput());
> >>
> >> FixedImageType::RegionType fixedRegion =
> >>fixedImage->GetBufferedRegion();
> >> registration->SetFixedImageRegion( fixedRegion );
> >> metric->SetFixedImageRegion(fixedRegion);
> >>
> >>metric->SetTransformParameters( transform->GetParameters() );
> >>
> >>metric->SetInterpolator( interpolator );
> >>
> >>metric->SetFixedImageStandardDeviation(0.49);
> >>
> >>metric->SetMovingImageStandardDeviation(0.49);
> >>
> >>metric->SetNumberOfSpatialSamples( 50 );
> >>
> >>metric->SetComputeGradient(1);
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> >From: Luis Ibanez <luis.ibanez at kitware.com>
> >> >To: javier silva bravo <javier_silva_bravo at hotmail.com>
> >> >CC: insight-users at itk.org
> >> >Subject: Re: [Insight-users] Where I can find examples or paper
> >>about
> >> >Date: Wed, 18 May 2005 17:51:51 -0400
> >> >
> >> >
> >> >Hi Javier,
> >> >
> >> >You will find detailed information about both of your
> >> >questions in the ITK Software Guide:
> >> >
> >> >
> >> > http://www.itk.org/ItkSoftwareGuide.pdf
> >> >
> >> >
> >> >The guide describe examples on how to use the ImageSeries
> >> >and how to do multi-modality registration.
> >> >
> >> >
> >> >The code for this examples is avalable in the directory
> >> >
> >> >
> >> > Insight/Examples
> >> >
> >> >
> >> >
> >> >
> >> > Regards,
> >> >
> >> >
> >> > Luis
> >> >
> >> >
> >> >--------------------------
> >> >javier silva bravo wrote:
> >> >
> >> >>itk::NumericSeriesFileNames
> >> >>I need read and write a secuence of Images.
> >> >>and where i can find too information about
> >> >>MuttualInformationImagetoImageMetric? because I dont know how
> >>to
> >> >>use them.
> >> >> Thank you.
> >> >>
> >>
> >>
> >>------------------------------------------------------------------------
> >> >>MSN Premium. Protégete, Comunícate y Diviértete Haz clic aquí
> >> >><http://g.msn.com/8HMBESMX/2743??PS=47575>
> >> >>
> >> >>
> >>
> >>
> >>------------------------------------------------------------------------
> >> >>
> >> >>_______________________________________________
> >> >>Insight-users mailing list
> >> >>Insight-users at itk.org
> >> >>http://www.itk.org/mailman/listinfo/insight-users
> >> >
> >> >
> >> >
> >>
> >>------------------------------------------------------------------------
> >>T1msn Hotmail Plus. Más espacio, más funcional Haz clic aquí
> >><http://g.msn.com/8HMBESMX/2755??PS=47575>
> >>
> >>
> >>------------------------------------------------------------------------
> >>
> >>_______________________________________________
> >>Insight-users mailing list
> >>Insight-users at itk.org
> >>http://www.itk.org/mailman/listinfo/insight-users
> >
> >
> >
>
> ------------------------------------------------------------------------
> T1msn Search. Todo lo que buscas ahora más rápido Haz clic aquí
> <http://g.msn.com/8HMBESMX/2728??PS=47575>
More information about the Insight-users
mailing list