Skip to content

Ants brain extraction interface #1231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 10, 2015
Merged

Conversation

MartinPerez
Copy link
Contributor

Here is a wrapper for the ants brain extraction script , #1230. Hope it will be useful to others as well. I provide test and also made a very small modification to antsCorticalThicknessoutputSpec not following the capital O in Output convention.

@chrisgorgo
Copy link
Member

please rebase/merge master - we have fixed the CircleCI tests

@MartinPerez
Copy link
Contributor Author

Sorry for the delay. I rebased...

@MartinPerez
Copy link
Contributor Author

tests still failing after rebase :S

>>> brainextraction.inputs.brain_template = 'study_template.nii.gz'
>>> brainextraction.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz'
>>> brainextraction.cmdline
'antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz -o highres001_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing a quotation mark at the end. This makes one of the tests to fail: https://travis-ci.org/nipy/nipype/jobs/87317019#L4110

output_spec = antsBrainExtractionOutputSpec
_cmd = 'antsBrainExtraction.sh'

def _format_arg(self, opt, spec, val):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be any need to overload format_args for these inputs as they are pretty straight forward. I would recommend removing this for code clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. got rid of the unnecessary overload!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still seeing the overloaded _format_arg .

@MartinPerez
Copy link
Contributor Author

I think all is fine now.

def _format_arg(self, opt, spec, val):
return super(ANTSCommand, self)._format_arg(opt, spec, val)

def _run_interface(self, runtime, correct_return_codes=[0]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is also not necessary

@MartinPerez
Copy link
Contributor Author

good to go?

'(default = 1)'))
keep_temporary_files = traits.Int(argstr='-k %d',
desc='Keep brain extraction/segmentation warps, etc (default = 0).')
use_floatingpoint_precision = traits.Enum(0, 1, argstr='-q %d',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjmjohnson - do all ants commands now have this option, if so should this be moved to the base class?

@hjmjohnson
Copy link
Contributor

@satra all of ANTs does not have this command. It is being implemented one program at a time. :( Sorry.

@blakedewey
Copy link
Contributor

@hjmjohnson is this true for the --verbose option? See my last commit in #1260.

@hjmjohnson
Copy link
Contributor

This depends on what you consider an "ANTs" program. There is no formal mechanism for tools build as part of the ANTs package to maintain a consistent interface. There is an attempt to keep similar items consistent (via copy-n-paste coding) across tools, but it is not rigorously enforced.

I honestly do not know how uniform the --verbose option is across tools, that would require a review of the ANTs code base.

@blakedewey
Copy link
Contributor

Should we merge this as is then?

chrisgorgo added a commit that referenced this pull request Nov 10, 2015
@chrisgorgo chrisgorgo merged commit 665ee55 into nipy:master Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants