<br>Hi Isabel,<br><br>Please look at the top lines of the ImageRegistration8.cxx example (lines 25-34).<br>You will find the parameters that were used when running this example when <br>generating the text and images for the ITK Software Guide:
<br><br><br>// Software Guide : BeginCommandLineArgs<br>// INPUTS: {brainweb1e1a10f20.mha}<br>// INPUTS: {brainweb1e1a10f20Rot10Tx15.mha}<br>// ImageRegistration8Output.mhd<br>// ImageRegistration8DifferenceBefore.mhd
<br>// ImageRegistration8DifferenceAfter.mhd<br>// OUTPUTS: {ImageRegistration8Output.png}<br>// OUTPUTS: {ImageRegistration8DifferenceBefore.png}<br>// OUTPUTS: {ImageRegistration8DifferenceAfter.png}<br>// Software Guide : EndCommandLineArgs
<br><br><br>The input images can be downloaded from:<br><br> <a href="http://public.kitware.com/pub/itk/Data/BrainWeb/">http://public.kitware.com/pub/itk/Data/BrainWeb/</a><br><br>get all the .tgz files and extract them with the command "tar -xzf "
<br><br>The misalignment in brainweb1e1a10f20Rot10Tx15.mha was actually produced <br>by using a ResampleImageFilter, along with a VersorRigid3DTransform.<br><br><br>If you are trying to replicate the experiment, you should first use exactly the
<br>same components used in the ITK Software Guide, in particular, the same <br>input images and the same command line arguments.<br><br><br> Please let us know if you have problems using the <br> parameters indicated at the top of the example.
<br><br><br> Thanks<br><br><br> Luis<br><br><br>================================================<br><div><span class="gmail_quote">On 7/27/07, <b class="gmail_sendername">IsabelleNg</b> <<a href="mailto:isabelleNg@homeworking.org">
isabelleNg@homeworking.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hello,<br><br>I would like to repeat the experiment in
ImageRegistration8.cxx. According<br>to the code, the input image has been misaligned with a known misalignment.<br>Could you please explain how this was done exactly? I tried to repeat the<br>experiment, but probably because of the use of a set of different inputs, I
<br>didn't get the same results (or perhaps my code was incorrect). Below is the<br>pipeline I used in an attempt to replicate the experiment. I would<br>appreciate if you could let me know the correctness of this pipeline.
<br><br>Thanks in advance,<br>Isabelle<br><br>****************************<br>Input:<br><br>fImage: 128*128*128; spacing: 5*5*5 mm^3<br>mImage: 512*512*128; spacing: 1*1*3 mm^3<br><br>****************************<br><br>
<br> initializer->SetTransform( randTransform );<br> initializer->SetFixedImage( fImage );<br> initializer->SetMovingImage( mImage );<br> initializer->GeometryOn();<br> initializer->InitializeTransform();
<br><br> initializer->SetTransform( transform );<br> initializer->SetFixedImage( fImage );<br> initializer->SetMovingImage( mImage );<br> initializer->GeometryOn();<br> initializer->InitializeTransform();
<br><br> AxisType axis;<br> axis[0] = 0.0;<br> axis[1] = 0.0;<br> axis[2] = 1.0;<br> rotation.Set( axis, angle );<br> randomRotation.Set( axis, angle );<br> transform->SetRotation( rotation );<br> randTransform->SetRotation( randomRotation );
<br><br> // up to now: randTransform = transform ************<br> // now, introduce misalignment:<br><br> randTransform->SetTranslation( randTranslation );<br> randomRotation.SetRotationAroundX( randRx * PI / 180.0
);<br><br> // generate the misaligned image<br><br> resampler2->SetTransform( randTransform );<br> resampler2->SetInput( mImage );<br> resampler2->SetSize( size ); // note: using the fixed image's<br>
resolution!!!<br> resampler2->SetOutputOrigin( origin );<br> resampler2->SetOutputSpacing( spacing );<br> resampler2->Update();<br> mImage = resampler2->GetOutput();<br><br> registration->SetOptimizer( optimizer );
<br> registration->SetInterpolator( interpolator );<br> registration->SetTransform( transform ); // using the unmodified<br>transform<br> registration->SetFixedImageRegion(<br>fixedImageReader->GetOutput()->GetBufferedRegion() );
<br> registration->SetFixedImage( fImage );<br> registration->SetMovingImage( mImage ); //the resampled image<br><br><br><br><br><br>Luis Ibanez wrote:<br>><br>><br>> Hi Isabelle,<br>><br>> The CenteredTransformInitializer will set up the
<br>><br>><br>> * Center<br>> * Translation<br>><br>><br>> of your transform.<br>><br>> The Center is not part of the set of Parameters,<br>> while the Translation is. This means that when you
<br>> set the parameters of the transform, after getting<br>> it from the initializer, you will modify its Translation<br>> but not its center of rotation.<br>><br>><br>><br>> That being said...<br>>
<br>><br>><br>> The test of robustness that you are referring to is<br>> *purely anecdotic* and it doesn't serve any useful<br>> purpose, other than *to fool the reviewers* who still<br>> participate in the masquerade of the peer-review system
<br>> that is still practiced in our domain.<br>><br>><br>><br>> Here are some arguments on why such test of robustness<br>> is useless:<br>><br>><br>><br>> 1) The rigid transform has a parametric space of 6 Dimensions
<br>><br>> If the point of convergence of the registration is a point Q<br>> in that six-dimensional space, you are trying to illustrate<br>> how large is the region of capture around that 6D point.
<br>><br>> The assumption is that you can find all the points P such<br>> that by starting at P in the parametric space, the optimization<br>> will converge to a very close neighborhood of Q.<br>>
<br>> The loci of all points P could then be considered to be the<br>> area of capture of the registration. The larger this are is,<br>> the more resilient the registration process will be to variations
<br>> on the initialization conditions of the transform.<br>><br>> If we look at the Metric as a cost function defined in that 6D<br>> space, you are looking for the watershed that is associated to
<br>> the point of convergence Q. The ideal way of finding the region<br>> of capture will be to find the watershed associated to the scalar<br>> value of the image metric in that 6d space.<br>><br>
> The assumption above has the flaw that optimizer are not continuous.<br>><br>> They do not follow smooth continuous paths on the parametric space.<br>> Instead, most of the optimizers perform sequences of discrete steps
<br>> that create broken paths on the parametric space. Even when the<br>> optimizer is initialized in a point that is inside the capture<br>> region, the optimizer settings such as step length, and number
<br>> of iterations, may lead to early termination of the optimization<br>> before the path reaches a neighborhood of the point Q.<br>><br>> You may find interesting to look at the diagram in the ITK Software
<br>> Guide,<br>><br>> <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>><br>> that shows how the optimizer parameters and the metric parameters
<br>> result in very different paths on the transform parametric space.<br>><br>> See for example figure 8.15 in pdf-page 376. See also the metric<br>> plots, and the plots of translations in the parametric space,
<br>> that are shown for most of the registration in that same chapter.<br>><br>><br>> For an illustration of the notion of the capture region in the<br>> metric cost function, you may want to look at the figure
8.46.<br>><br>> As opposed to all the "peer-reviewed" publications, in the ITK<br>> Software Guide you will find the actual code, images and full set<br>> of parameters that were used for generating these plots.
<br>><br>> You will also find the instructions for downloading the scripts<br>> that were used for generating the GNUPlot diagrams shown in this<br>> chapter.<br>><br>><br>> Note that the plot in figure
8.46 only explores 2 out of the 6<br>> dimensions that you will have to deal with, in a 3D rigid transform.<br>><br>> This plot is a discretization of that space, (e.g. about 100 x 100 ).<br>> The equivalent plot in a 6D space will require you to do 100^6
<br>> samples, that if you store in float numbers will be an 6D image of<br>> 400 Megabytes. In order to find the value for each pixel of such<br>> 6D image you will need to compute the metric of the two 3D images
<br>> for the transform parameters associated to the 6D pixel.<br>><br>><br>> Even if you compute such image, and then run inside it a watershed<br>> from the point Q. That still doesn't guarantee that starting from
<br>> any given point P inside the watershed will result in a convergence<br>> to the point Q. The specific settings of the optimizer parameters<br>> may be or may not be appropriate for producing such discretized path.
<br>><br>><br>><br>> 2) In practice you are suggesting to have a very coarse sampling of<br>> the capture region by providing *some* paths, and based on the<br>> length of those paths, *induce* that the registration has a certain
<br>> "degree of robustness".<br>><br>><br>> This is an interesting but still *ANECDOTIC* piece of information.<br>><br>><br>> It is as useful as to tell you that person X has travel through the
<br>> Amazonian forest 27 times and has never been bitten by a snake.<br>><br>> That doesn't mean much, regarding the chances of person Y to make<br>> a new trip in the Amazonian forest and being bitten by a snake.
<br>><br>> It certainly provides some degree of *psychological comfort* to be<br>> able to report that you have run the registration under a variety<br>> of perturbed conditions and yet achieved convergence. But, that's
<br>> the only thing it is.... "psychological comfort". Because the number<br>> of perturbed conditions that you will be able to explore will be<br>> infinitesimally small compared to the number of potential paths
<br>> in the 6D space that surrounds point Q in the parametric space.<br>><br>><br>> It is still a piece of information that will looks nice in typical<br>> decadent journal, and it will be comic to see reviewers buying into
<br>> it. Since they never perform the reproduction of the experiments,<br>> they won't realize how useless and insignificant such measure<br>> of robustness will be.<br>><br>><br>> The measure may only start being significant if you manage to
<br>> perform a dense-enough sampling of the 6D parametric space, and<br>> to mathematically evaluate the coverage of such sampling.<br>><br>> E.g.<br>> A sampling that covers the equivalent of 60% of the parametric
<br>> space at a range of +/- 100mm of translations and +/- 10 degrees<br>> of otation.<br>><br>><br>> Now,... even if you manage to cover a large fraction of the<br>> parametric space you would have done so with only
<br>><br>> *ONE SPECIFIC PAIR of IMAGES*<br>><br>> as the input of the image metric. The result can't hardly be<br>> extrapolated to *other images*, e.g. image with bias field,
<br>> with other dynamic ranges of intensity, with other pixel spacing,<br>> with different levels of noise.<br>><br>><br>><br>><br>> 3) As Richard Feynman put it:<br>><br>><br>> "It is very hard to actually *know* something"
<br>><br>><br>> Our imaging community is *very lax* when it comes to differentiate<br>> the *appearance* of knowledge from the actual *posession* of<br>> knowledge.<br>><br>><br>><br>>
<br>> Please don't be fooled by the many things that you see<br>> in Journals and Conference papers. Keep in mind that<br>> most of it has been published with the sole purpose of<br>> providing material for academic promotions and to fill-up
<br>> established yearly quotas for intellectual production.<br>><br>><br>> As a reader, and actual practitioner of the imaging arts<br>> you ought to be *more critical* and exigent when it comes
<br>> to the deduce / induce information from what other report<br>> in venues that do not require to demonstrate reproducibility.<br>><br>><br>><br>><br>><br>> Regards,<br>><br>>
<br>><br>> Luis<br>><br>><br>><br>> --------------------<br>> IsabelleNg wrote:<br>>> Thank you Karthik for your reply.<br>>><br>>> I just realize that I omitted some info. I am using an
<br>>> centered-initializer<br>>> to initialize the transform (rigid 3d). In this case, would the following<br>>> be<br>>> a valid sequence?<br>>><br>>> rigidTransform->SetIdentity();
<br>>> resampler->SetTransform( randomXform );<br>>> initializer->SetMovingImage( resample->Getoutput() );<br>>> initializer->SetTransform( rigidTransform );<br>>><br>>> registration->SetInitialTransformParameters(
<br>>> rigidTransform->GetParameters()<br>>> )<br>>><br>>> Thanks again,<br>>> Isabelle<br>>><br>>><br>>><br>>><br>>><br>>> Karthik Krishnan-2 wrote:<br>
>><br>>>>On 5/4/07, IsabelleNg <<a href="mailto:isabelleNg@homeworking.org">isabelleNg@homeworking.org</a>> wrote:<br>>>><br>>>>><br>>>>>ITK-users,<br>>>>>
<br>>>>>I wish to test one of the registration algorithm by applying random<br>>>>>transformations to the moving image. This is often done in papers that<br>>>>>report registration results as tests of robustness and capture range. Is
<br>>>>>it<br>>>>>valid to perform these tests by simply initializing the transform with<br>>>>>random numbers? i..e by calling<br>>>>><br>>>>>registration->SetInitialTransformationParameters( randomXform)?
<br>>>><br>>>><br>>>>Hi Isabelle<br>>>><br>>>>Yes. It is identical.<br>>>><br>>>>Or, do we actually need to physically write out the randomly misaligned<br>>>>
<br>>>>>images and then feed back into the algorithm?<br>>>>><br>>>>>How would results differ with these 2 approaches?<br>>>><br>>>><br>>>>There wouldn't be a difference. There would be a marginal difference
<br>>>>depending on the transform used to resample the moving image before<br>>>>writing<br>>>>to the disk. In the first case, the initial transform is the same as the<br>>>>one<br>>>>used for registration.
<br>>>><br>>>><br>>>>--<br>>>>Karthik Krishnan<br>>>>R&D Engineer,<br>>>>Kitware Inc.<br>>>><br>>>>_______________________________________________
<br>>>>Insight-users mailing list<br>>>><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>>>><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br>>>><br>>>><br>>><br>>><br>> _______________________________________________<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>
<br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>><br>><br>Quoted from:<br><a href="http://www.nabble.com/Testing-Robustness-of-Registration-tf3694891.html#a10346650">
http://www.nabble.com/Testing-Robustness-of-Registration-tf3694891.html#a10346650</a><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Testing-Robustness-of-Registration-tf3694891.html#a11834836">
http://www.nabble.com/Testing-Robustness-of-Registration-tf3694891.html#a11834836</a><br>Sent from the ITK - Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________
<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote>
</div><br>