Skip to content

Commit 705a13d

Browse files
committed
doc: warn contrastmgr deprecation in 5.0.7+
1 parent 4176856 commit 705a13d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

nipype/interfaces/fsl/model.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import os
1818
from glob import glob
1919
from shutil import rmtree
20+
from warnings import warn
2021

2122
import numpy as np
2223
from nibabel import load
@@ -30,6 +31,14 @@
3031
BaseInterfaceInputSpec)
3132
from .base import FSLCommand, FSLCommandInputSpec, Info
3233

34+
FSVersion = "0"
35+
_ver = Info.version()
36+
if _ver:
37+
if 'dev' in _ver:
38+
FSVersion = _ver.rstrip().split('-')[-1] + '.dev'
39+
else:
40+
FSVersion = _ver.rstrip().split('-v')[-1]
41+
3342

3443
class Level1DesignInputSpec(BaseInterfaceInputSpec):
3544
interscan_interval = traits.Float(mandatory=True,
@@ -1075,13 +1084,17 @@ class ContrastMgr(FSLCommand):
10751084
"""Use FSL contrast_mgr command to evaluate contrasts
10761085
10771086
In interface mode this file assumes that all the required inputs are in the
1078-
same location.
1087+
same location. This has deprecated for FSL versions 5.0.7+ as the necessary
1088+
corrections file is no longer generated by FILMGLS.
10791089
"""
10801090

1091+
if LooseVersion(FSVersion) >= LooseVersion("5.0.7"):
1092+
warn("ContrastMgr is deprecated in FSL 5.0.7+", DeprecationWarning)
10811093
_cmd = 'contrast_mgr'
10821094
input_spec = ContrastMgrInputSpec
10831095
output_spec = ContrastMgrOutputSpec
10841096

1097+
10851098
def _run_interface(self, runtime):
10861099
# The returncode is meaningless in ContrastMgr. So check the output
10871100
# in stderr and if it's set, then update the returncode

0 commit comments

Comments
 (0)