Skip to content

ENH: Update multi-stage recon-all directives #1991

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 4 commits into from
May 10, 2017

Conversation

effigies
Copy link
Member

@effigies effigies commented May 2, 2017

The goal of this PR is to give access to most* multi-stage flags, in particular the autorecon2-volonly and autorecon-hemi flags.

At present, estimating thread consumption is difficult, and recon-all -parallel -openmp N can consume up to 2N threads at OpenMP-enabled sections of the surface processing sections of autorecon2 and autorecon3. This change allows autorecon2-volonly to be tagged as consuming N threads, and (for instance) two invocations of autorecon-hemi to each be tagged as consuming N threads.

This also updates the docstring to document and test the more recent commandline altering changes.


* The one that's missing is gcatrain-iter, which takes 2 arguments and would thus be fiddlier to deal with. (I'm not really sure why gcareg-iters and gcareg-tol are included in that section; but I wouldn't call them directives.) I can put it in for completeness sake, but given that I'm not even sure how to test it, that feels like an invitation to write a bug.

@effigies effigies force-pushed the enh/reconall_directives branch from 5cfbea9 to 4b8314f Compare May 3, 2017 17:59
@codecov-io
Copy link

codecov-io commented May 3, 2017

Codecov Report

Merging #1991 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1991      +/-   ##
==========================================
- Coverage   72.15%   72.14%   -0.01%     
==========================================
  Files        1117     1117              
  Lines       56456    56487      +31     
  Branches     8112     8125      +13     
==========================================
+ Hits        40736    40755      +19     
- Misses      14443    14456      +13     
+ Partials     1277     1276       -1
Flag Coverage Δ
#smoketests 72.14% <50%> (-0.01%) ⬇️
#unittests 69.71% <50%> (-0.01%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/freesurfer/preprocess.py 65.16% <50%> (-0.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f39e222...8fcc097. Read the comment docs.

@effigies effigies force-pushed the enh/reconall_directives branch from 4b8314f to 1fa5adb Compare May 3, 2017 18:15
if all((name == 'hippocampal_subfields_T2',
isdefined(self.inputs.hippocampal_subfields_T1) and
self.inputs.hippocampal_subfields_T1)):
trait_spec.argstr = trait_spec.argstr.replace('T2', 'T1T2')
argstr = trait_spec.argstr.replace('T2', 'T1T2')
return argstr % value
Copy link
Member Author

Choose a reason for hiding this comment

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

This part here was a (minor) bug, in that trait_spec is non-ephemeral, so changing trait_spec.argstr changes it for all future calls. Unlikely to affect anything except the doctests, but still worth cleaning up.

@@ -950,14 +989,24 @@ def _is_resuming(self):
def _format_arg(self, name, trait_spec, value):
if name == 'T1_files':
if self._is_resuming():
return ''
return None
Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to returning None just because that avoids the extra spaces in the cmdline string, making the doctests less painful to debug.

@effigies effigies changed the title ENH: Update multi-stage recon-all directives [WIP] ENH: Update multi-stage recon-all directives May 3, 2017
@effigies
Copy link
Member Author

effigies commented May 3, 2017

Marking this [WIP] until I verify that we don't need to rework the _steps nonsense to fit these new directives.

@effigies effigies force-pushed the enh/reconall_directives branch from cd3d917 to e9ed516 Compare May 4, 2017 22:09
@effigies
Copy link
Member Author

effigies commented May 4, 2017

Needed to update _steps.

@effigies effigies force-pushed the enh/reconall_directives branch from 6bc955a to e9ed516 Compare May 5, 2017 18:23
@effigies effigies changed the title [WIP] ENH: Update multi-stage recon-all directives ENH: Update multi-stage recon-all directives May 5, 2017
@effigies
Copy link
Member Author

effigies commented May 5, 2017

This is working as expected on my end.

'surf/lh.inflated.H', 'surf/rh.inflated.H',
'surf/lh.inflated.K', 'surf/rh.inflated.K'], []),
]
_autorecon2_lh_steps = [
Copy link
Member

Choose a reason for hiding this comment

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

only a nitpick - is there a reason this is called _lh_ as opposed to say _hemi_

otherwise looks reasonable to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I specify lh in the filenames. I then make a rh copy below, just swapping the filenames out.

@effigies effigies force-pushed the enh/reconall_directives branch from e9ed516 to 8fcc097 Compare May 8, 2017 21:05
@satra satra merged commit bfdb164 into nipy:master May 10, 2017
@effigies effigies deleted the enh/reconall_directives branch May 14, 2017 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants