[ITK-users] How to use a binary mask in a registration process ?
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Sep 17 09:37:47 EDT 2015
Hello,
I can see from your output that the metric value is significantly different when the mask is enable. So the mask is having an effect, but your registration is just not working.
I can also see that the optimization is not moving much due to being stuck in a local minima.
There could be a number of reasons for this such as the data is too noise, the scales of the features it to fine, or just the initialization is poor. For the optimization in the ImageRegistration method, the features need to be relatively close. Scale space and smoothing can help with filtering for the right features at the scale that the optimizer needs to step.
I would suggest spending some time with the ExhaustiveOptimizer and the EvaluateMetric method to better understand the metric and the parameter space. Here is an example which uses the ExhaustiveOptimizer for initialization [1]. You can also use the ExhaustiveOptimize or the EvaluateMetric to render the Metric value into an image for visualization.
You may also want to simplify your problem to better understand how to successfully setup registration, which can then be applied to the more complicated problem.
HTH,
Brad
[1] http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethodExhaustive_8py-example.html
On Sep 17, 2015, at 3:49 AM, neon29 <florian.nicolas at ensta-bretagne.org> wrote:
> Bradley Lowekamp wrote
>> Hello,
>>
>> So why do you think the masks are not working? What is the output with and
>> without masks? Can you share you data? Is the metric value different with
>> and w/o the masks?
>>
>> I'd also recommend setting the SamplingStrategy to None until you have the
>> masks working they way you expect.
>>
>>
>> Brad
>
> I have set the SamplingStrategy to None without noticing any change. Here is
> the results of the two registrations (without and with masks) and links to
> the resulting image (I only display the masks as I am not sure to be allowed
> to share my data):
>
> without masks
> <http://itk-insight-users.2283740.n2.nabble.com/file/n7587817/without_masks_ITK.png>
> :
>
>
> 0 = -0.18317 : (-9.999904028900822e-05, -11.044272032278226,
> 96.60714639019373)
> -------------
> 1 = -0.18345 : (-0.0001999990022488051, -11.044272084667545,
> 96.6071464599318)
> -------------
> 2 = -0.18370 : (-0.00029999722853172624, -11.04427252056758,
> 96.60714686580299)
> -------------
> 3 = -0.18362 : (-0.0002499972558627034, -11.04427247476726,
> 96.60714684059529)
> -------------
> 4 = -0.18373 : (-0.0002749970826503679, -11.044272417641816,
> 96.60714676712918)
> -------------
> 5 = -0.18371 : (-0.0002624971035453863, -11.044272397156764,
> 96.60714675699322)
> -------------
> itk::simple::Transform
> Euler2DTransform (0x757ad60)
> RTTI typeinfo: itk::Euler2DTransform<double>
> Reference Count: 4
> Modified Time: 25179210
> Debug: Off
> Object Name:
> Observers:
> none
> Matrix:
> 1 0.000262497
> -0.000262497 1
> Offset: [-11.1839, 96.788]
> Center: [688.994, 531.823]
> Translation: [-11.0443, 96.6071]
> Inverse:
> 1 -0.000262497
> 0.000262497 1
> Singular: 0
> Angle = -0.000262497
>
> --------
> Optimizer stop condition: RegularStepGradientDescentOptimizerv4: Step too
> small after 6 iterations. Current step (6.25e-06) is less than minimum step
> (1e-05).
> Number of iterations: 7
> --------
>
>
> with masks
> <http://itk-insight-users.2283740.n2.nabble.com/file/n7587817/masks_ITK.png>
> :
>
> 0 = -0.00623 : (9.99985477821897e-05, -11.044271338978085,
> 96.6071463678905)
> -------------
> 1 = -0.00614 : (4.9999718539333366e-05, -11.044271424621682,
> 96.60714669916005)
> -------------
> 2 = -0.00618 : (9.97888121303202e-10, -11.044271528245424,
> 96.60714704149814)
> -------------
> 3 = -0.00623 : (2.500063478804917e-05, -11.044271421099985,
> 96.60714712319714)
> -------------
> 4 = -0.00621 : (4.978968605942277e-05, -11.044270902597372,
> 96.6071503222739)
> -------------
> 5 = -0.00618 : (3.729000935970828e-05, -11.044270928466227,
> 96.60715040837387)
> -------------
> 6 = -0.00619 : (2.4790825641270987e-05, -11.044270949334763,
> 96.60715054969222)
> -------------
> itk::simple::Transform
> Euler2DTransform (0x3cce740)
> RTTI typeinfo: itk::Euler2DTransform<double>
> Reference Count: 4
> Modified Time: 25177171
> Debug: Off
> Object Name:
> Observers:
> none
> Matrix:
> 1 -2.47908e-05
> 2.47908e-05 1
> Offset: [-11.0311, 96.5901]
> Center: [688.994, 531.823]
> Translation: [-11.0443, 96.6072]
> Inverse:
> 1 2.47908e-05
> -2.47908e-05 1
> Singular: 0
> Angle = 2.47908e-05
>
> --------
> Optimizer stop condition: RegularStepGradientDescentOptimizerv4: Step too
> small after 7 iterations. Current step (6.25e-06) is less than minimum step
> (1e-05).
> Number of iterations: 8
> --------
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/How-to-use-a-binary-mask-in-a-registration-process-tp7587799p7587817.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
More information about the Insight-users
mailing list