Skip to content

Commit e27ca16

Browse files
author
Bogdan Petre
committed
FILMGLS gifti output support for surface mode
1 parent 4d1352a commit e27ca16

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

nipype/interfaces/fsl/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Info(PackageInfo):
5757
"NIFTI_PAIR": ".img",
5858
"NIFTI_GZ": ".nii.gz",
5959
"NIFTI_PAIR_GZ": ".img.gz",
60+
"GIFTI": ".func.gii"
6061
}
6162

6263
if os.getenv("FSLDIR"):
@@ -72,8 +73,8 @@ def output_type_to_ext(cls, output_type):
7273
7374
Parameters
7475
----------
75-
output_type : {'NIFTI', 'NIFTI_GZ', 'NIFTI_PAIR', 'NIFTI_PAIR_GZ'}
76-
String specifying the output type.
76+
output_type : {'NIFTI', 'NIFTI_GZ', 'NIFTI_PAIR', 'NIFTI_PAIR_GZ', 'GIFTI'}
77+
String specifying the output type. Note: limited GIFTI support.
7778
7879
Returns
7980
-------

nipype/interfaces/fsl/model.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,12 +813,20 @@ class FILMGLS(FSLCommand):
813813
_cmd = "film_gls"
814814
input_spec = FILMGLSInputSpec
815815
output_spec = FILMGLSOutputSpec
816+
816817
if Info.version() and LooseVersion(Info.version()) > LooseVersion("5.0.6"):
817818
input_spec = FILMGLSInputSpec507
818819
output_spec = FILMGLSOutputSpec507
819820
elif Info.version() and LooseVersion(Info.version()) > LooseVersion("5.0.4"):
820821
input_spec = FILMGLSInputSpec505
821822

823+
def __init__(self, **inputs):
824+
super(FILMGLS, self).__init__(**inputs)
825+
if Info.version() and LooseVersion(Info.version()) > LooseVersion("5.0.6"):
826+
if 'output_type' not in inputs:
827+
if isdefined(self.inputs.mode) and self.inputs.mode == 'surface':
828+
self.inputs.output_type = 'GIFTI'
829+
822830
def _get_pe_files(self, cwd):
823831
files = None
824832
if isdefined(self.inputs.design_file):

0 commit comments

Comments
 (0)