-
Notifications
You must be signed in to change notification settings - Fork 532
FIX: Handle changes in CLI structure of mrtrix3.DWIBiasCorrect #3248
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
Conversation
I think this may be a change in CLI... This line shows: app.warn('Use of -fsl option in dwibiascorrect script is discouraged due to its strong dependence ' + \
'on brain masking (specifically its inability to correct voxels outside of this mask).' + \
'Use of the -ants option is recommended for quantitative DWI analyses.') If this has changed, then we need to adjust our behavior based on the version of MRtrix3 installed. |
If I'm reading it correctly, MRtrix3/mrtrix3#1449 changed from Given that at least some MRtrix3 commands are Python, I wonder if there's a cleaner way to invoke these through a function API, rather than subprocesses. Though that also may have changed. |
@effigies I think you're right, but I wonder whether to create a version-specific inputspec, or simply change the relevant trait in accordance with the user's Mrtrix3's version? |
Correct; they changed from command-line options to using the MRtrix3
Given the degree to which the MRtrix3 Python API is custom and very much nonstandard, I suspect not; at least not without essentially duplicating the functionality of the
The change is from |
Terminal warning issued to user was copy&pasted from 3.0_RC3, but not properly modified to reflect the changes to the dwibiascorrect interface introduced in 3.0.0. As observed in nipy/nipype#3248 by @effigies.
Also MRtrix3/mrtrix3#2171 may have contributed to the confusion; sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, then I think we want to add:
class DWIBiasCorrect(MRTrix3Base):
...
def _format_arg(self, name, trait_spec, value):
if name in ('use_ants', 'use_fsl'):
ver = self.version
# Changed in version 3.0, after release candidates
if ver is not None and (ver[0] < '3' or ver.startswith("3.0_RC")):
return f"-{trait_spec.argstr}"
super()._format_arg(name, trait_spec, value)
And we need to update the doctest to say dwibiascorrect ants dwi.mif dwi_biascorr.mif
.
@GalBenZvi Do you have time to finish this one off? I think we're probably due for a release soon, and it would be nice to have this in. |
@effigies I'm sorry, I was under the impression that it was finished, could you maybe explain to me what do you want me to do? Obviously I would love to contribute. |
Sure, my previous review had a number of suggestions. If that doesn't seem actionable, I can send a PR against your branch with my suggested changes. |
Sure, I'll do my best to get to it as soon as possible. Sorry for the delay. |
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #3248 +/- ##
==========================================
- Coverage 65.02% 64.98% -0.04%
==========================================
Files 302 302
Lines 39941 39947 +6
Branches 5281 5283 +2
==========================================
- Hits 25973 25961 -12
- Misses 12902 12914 +12
- Partials 1066 1072 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Okay, this looks all set. Thanks for this addition! |
Resolves #3247 .