smri_ants_registration.py example results in smoothing sigmas error

93 views
Skip to first unread message

Fred Loney

unread,
May 23, 2013, 9:48:50 PM5/23/13
to nipy...@googlegroups.com
Running the Nipype smri_ants_registration.py example results in the error:

    Interface Registration failed to run.

Running the antsRegistration command generated by the example results in the error:

    The number of smoothing sigmas does not match the number of levels.

This command is run with a ANTS SVN trunk build, since this 'new registration' is not yet available in an ANTS release. Tracing the error through ANTS indicates that this is an ANTS smoothing-sigmas option parsing error, which I posted on the ANTS discussion forum.

Setting the example sigma_units to 'mm' rather than 'vox' corrects the problem. Perhaps the smoothing_sigmas option should be adjusted upwards accordingly.

The default antsRegistration smoothing is in physical space, i.e. 'mm'. However, Nipype Registration requires sigma_units. This input should be optional. I will add this fix to my Git fork and submit a pull request. I will also double the smoothing_sigmas values, although I don't know if that is the right adjustment for the test images.

Fred

Satrajit Ghosh

unread,
May 24, 2013, 2:03:05 AM5/24/13
to nipy-user
thanks fred,

in this particular case i think we want users to be aware of what space they want those numbers to be. so we should fix the example. what do you think? 

cheers,

satra


Fred

--
 
---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Satrajit Ghosh

unread,
May 24, 2013, 2:04:00 AM5/24/13
to nipy-user
ps, i also want the default values to match those of antsCorticalThickness.sh.

cheers,

satra

Fred Loney

unread,
May 24, 2013, 7:13:13 PM5/24/13
to nipy...@googlegroups.com
Hi Satra,

I agree that the example should specify the space. I suggest the following:
  • The smri_ants_registration.py example sigma_units is set to 'mm' rather than 'vox'.
  • The Registration interface sigma_units input option is not set to mandatory.
This way it is clear what space is used in the example, but the interface is consistent with the antsRegistration command, which allows a default unit for those who choose to omit it.

antsCorticalThickness.sh does not specify the antsRegistration sigma unit.

Fred

Fred Loney

unread,
May 24, 2013, 7:40:24 PM5/24/13
to nipy...@googlegroups.com
BTW, the example images have voxel size of 8mm^3, although the exact smoothing_sigmas values don't much matter for the example.

Johnson, Hans J

unread,
May 25, 2013, 6:50:48 AM5/25/13
to nipy...@googlegroups.com
Fred,

I disagree with your proposal to remove the mandatory flag from sigma_units.  Having the sigma_units as a mandatory option requires the end user to specify it, and therefore the end-user must understand this parameter.  There is no default value that "obviously" makes sense.  It is terrible to do an large processing task and then determine that the default behavior is that what was desired.  

Hans



--
 
---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.

Fred Loney

unread,
Jun 3, 2013, 3:49:08 PM6/3/13
to nipy...@googlegroups.com
Hi Hans,

Making sigma_units optional is consistent with the Nipype interface philosophy of reflecting the underlying tool as closely as possible. The Registration interface proposal neither adds to nor subtracts from antsRegistration, where the sigma units are optional.

I concur with you that it is good practice to specify the units in your workflow. However, the Nipype mechanism should not force this policy on users.

Fred

Johnson, Hans J

unread,
Jun 3, 2013, 3:52:04 PM6/3/13
to nipy...@googlegroups.com
Fred,

Good point.  I defer to you on making the most appropriate changes.

Satrajit Ghosh

unread,
Jun 3, 2013, 4:08:25 PM6/3/13
to nipy-user
hi hans and fred,

along these lines i would like the interface to support a registration of the following nature.


(note the two metrics in a row)

i'll try to get to it later this week, but if any of you get to it before me, please let me know.

cheers,

satra

Johnson, Hans J

unread,
Jun 3, 2013, 5:31:12 PM6/3/13
to nipy...@googlegroups.com
Satra,

I think it already does.  Can you please elaborate on what is missing?

Hans

Satrajit Ghosh

unread,
Jun 3, 2013, 7:49:10 PM6/3/13
to nipy-user
hi hans,

i'm not sure it can do the two metrics for syn.

cheers,

satra

Fred Loney

unread,
Jun 7, 2013, 7:47:16 PM6/7/13
to nipy...@googlegroups.com
Although the antsRegistration help indicates that multiple metrics per stage is not yet supported, the ANTS source does support it. The Nipype help copies this incorrect help text. The metric weights must sum to 1 for a given stage. The way to wrap multiple metrics in Nipype Registration is to change the metric, metric_weight, radius_or_number_of_bins,sampling_strategy and sampling_percentage traits to allow a list of lists. E.g.:

sampling_strategy = traits.List(
    trait=traits.Enum("Dense", "Regular", "Random", None), ...

becomes:

sampling_strategy_item_trait = traits.Enum("Dense", "Regular", "Random", None)
sampling_strategy = traits.List(
    trait=traits.Either(
        
sampling_strategy_item_trait,
        traits.List(trait=
sampling_strategy_item_trait)
 
Then the _optionalMetricParameters checks that the input cardinalities are consistent.

The Nipype Registration help note should be changed to indicate that multiple metrics per stage are unused in ANTS 1.9.1 and earlier. 

If you want me to implement this on a branch in my fork and submit a pull request, I can do so.

Fred

Fred Loney

unread,
Jun 7, 2013, 7:49:01 PM6/7/13
to nipy...@googlegroups.com
The multiple metrics per stage enhancement was added to the ANTS master on 11/25/2012.

Satrajit Ghosh

unread,
Jun 7, 2013, 9:30:39 PM6/7/13
to nipy-user
hi fred,
 
Then the _optionalMetricParameters checks that the input cardinalities are consistent.

The Nipype Registration help note should be changed to indicate that multiple metrics per stage are unused in ANTS 1.9.1 and earlier. 

If you want me to implement this on a branch in my fork and submit a pull request, I can do so.

that would be wonderful. 

cheers,

satra

Fred Loney

unread,
Jun 7, 2013, 9:58:26 PM6/7/13
to nipy...@googlegroups.com
I will submit a pull request next week.

Chris Filo Gorgolewski

unread,
Jun 9, 2013, 3:59:34 AM6/9/13
to nipy...@googlegroups.com
Thank you for spotting - and (hopefully) fixing this!

Fred Loney

unread,
Jun 10, 2013, 7:36:08 PM6/10/13
to nipy...@googlegroups.com
I submitted a pull request to support multiple metrics per stage. For traceability, this pull request does not address the distinct sigma units problem, which will be in a separate pull request. 
Reply all
Reply to author
Forward
0 new messages