Skip to content

Commit d47e966

Browse files
Bogdan Petreeffigies
Bogdan Petre
authored andcommitted
FILMGLS gifti output support for surface mode
1 parent 83e3903 commit d47e966

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

nipype/interfaces/fsl/base.py

+3-2
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

+8
Original file line numberDiff line numberDiff line change
@@ -812,12 +812,20 @@ class FILMGLS(FSLCommand):
812812
_cmd = "film_gls"
813813
input_spec = FILMGLSInputSpec
814814
output_spec = FILMGLSOutputSpec
815+
815816
if Info.version() and LooseVersion(Info.version()) > LooseVersion("5.0.6"):
816817
input_spec = FILMGLSInputSpec507
817818
output_spec = FILMGLSOutputSpec507
818819
elif Info.version() and LooseVersion(Info.version()) > LooseVersion("5.0.4"):
819820
input_spec = FILMGLSInputSpec505
820821

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

0 commit comments

Comments
 (0)