-
Notifications
You must be signed in to change notification settings - Fork 533
FIX: Remove 'reg_term'/'regularisation' from dwi2tensor interface #2731
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
Codecov Report
@@ Coverage Diff @@
## master #2731 +/- ##
==========================================
- Coverage 67.45% 64.02% -3.43%
==========================================
Files 340 338 -2
Lines 43155 43119 -36
Branches 5351 5350 -1
==========================================
- Hits 29111 27609 -1502
- Misses 13346 14443 +1097
- Partials 698 1067 +369
Continue to review full report at Codecov.
|
Since this is still valid for older versions of mrtrix3, we shouldn't remove it altogether. You can make the input spec depend on the version of the library. See, for example, nipype/nipype/interfaces/freesurfer/preprocess.py Lines 1336 to 1428 in ffd8cf8
nipype/nipype/interfaces/freesurfer/preprocess.py Lines 1462 to 1465 in ffd8cf8
In this case, you'd probably want to go the other way around, with the newer version as the superclass and the older as the subclass. Let me know if you have any questions. |
doesn't |
Ah, I'd forgotten about that one. My approach wouldn't work without version info, either. |
I added version info to the interface (changes pushed), which seems to work.
|
Removing |
indeed. essentially its saying that if the environment conflicts with the use, raise an exception. we should think about cleaner ways to handle versioning in nipype 2.0. |
26ad945
to
67cfe04
Compare
Alright, updated to do it Chris's way. |
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.
Can you also re-run make specs
?
nipype/interfaces/mrtrix3/base.py
Outdated
class Info(PackageInfo): | ||
version_cmd = which('mrconvert') | ||
if version_cmd: | ||
version_cmd = version_cmd + ' --version' |
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.
If mrconvert
is in your PATH
, then you can simplify this as just:
version_cmd = 'mrconvert --version'
nipype/interfaces/mrtrix3/base.py
Outdated
if ver is None: | ||
return LooseVersion('0.0.0') | ||
|
||
return cls.version()) |
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.
I assume you want:
return LooseVersion(ver)
Or shorter:
@classmethod
def looseversion(cls):
return LooseVersion(cls.version() or '0.0.0')
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.
Actually, I think we can't use the auto-test if you're going to do the dual specs. I commented with the "correct" way to handle this.
Although I hate to have wasted your time, it might be simpler to revert to a single spec and remove the default value. usedefault
was only set to true in #2533.
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.
Great, thanks! Just a couple minor cleanups left.
nipype/interfaces/mrtrix3/reconst.py
Outdated
from ..base import traits, TraitedSpec, File, Undefined | ||
from .base import MRTrix3BaseInputSpec, MRTrix3Base | ||
from .base import MRTrix3BaseInputSpec, MRTrix3Base, Info |
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.
No longer using the Info
and LooseVersion
imports.
nipype/interfaces/mrtrix3/reconst.py
Outdated
@@ -39,8 +40,9 @@ class FitTensorInputSpec(MRTrix3BaseInputSpec): | |||
argstr='-method %s', | |||
desc=('select method used to perform the fitting')) | |||
reg_term = traits.Float( | |||
5.e3, usedefault=True, | |||
5.e3, |
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.
Could you go ahead and remove the 5.e3
? The reason usedefault=True
was added was because it looked like a default was intended by the original interface author. If we're not going to apply defaults, we should remove it.
Also please merge or rebase against master to fix tests. |
- mrtrix3: use looseversion to avoid undefined version - Address review comment and update auto_FitTensor test - mrtrix3.FitTensor: switch back to single spec, usedefault=False
264a8b6
to
286eecf
Compare
Summary
regularisation
(reg_term
) option from MRtrix3 dwi2tensor interface.This option was removed as part of refactoring in:
MRtrix3/mrtrix3@9b886a94289a
Fixes
Acknowledgment