@@ -42,18 +42,21 @@ def _get_affine_matrix(params, source):
42
42
43
43
params : np.array (upto 12 long) in native package format
44
44
source : the package that generated the parameters
45
- supports SPM, AFNI, FSL, NIPY
45
+ supports SPM, AFNI, FSFAST, FSL, NIPY
46
46
"""
47
47
if source == 'FSL' :
48
48
params = params [[3 , 4 , 5 , 0 , 1 , 2 ]]
49
49
elif source == 'AFNI' :
50
50
params = params [[4 , 5 , 3 , 1 , 2 , 0 ]]
51
51
params [3 :] = params [3 :] * np .pi / 180.
52
+ elif source == 'FSFAST' :
53
+ params = params [[5 , 6 , 4 , 2 , 3 , 1 ]]
54
+ params [3 :] = params [3 :] * np .pi / 180.
52
55
if source == 'NIPY' :
53
56
# nipy does not store typical euler angles, use nipy to convert
54
57
from nipy .algorithms .registration import to_matrix44
55
58
return to_matrix44 (params )
56
- #process for FSL, SPM and AFNI
59
+ #process for FSL, SPM, AFNI and FSFAST
57
60
rotfunc = lambda x : np .array ([[np .cos (x ), np .sin (x )],
58
61
[- np .sin (x ), np .cos (x )]])
59
62
q = np .array ([0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 , 0 ])
@@ -76,7 +79,7 @@ def _get_affine_matrix(params, source):
76
79
# Shear
77
80
Sh = np .eye (4 )
78
81
Sh [(0 , 0 , 1 ), (1 , 2 , 2 )] = params [9 :12 ]
79
- if source == 'AFNI' :
82
+ if source in ( 'AFNI' , 'FSFAST' ) :
80
83
return np .dot (T , np .dot (Ry , np .dot (Rx , np .dot (Rz , np .dot (S , Sh )))))
81
84
return np .dot (T , np .dot (Rx , np .dot (Ry , np .dot (Rz , np .dot (S , Sh )))))
82
85
@@ -158,7 +161,7 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec):
158
161
realignment_parameters = InputMultiPath (File (exists = True ), mandatory = True ,
159
162
desc = ("Names of realignment parameters"
160
163
"corresponding to the functional data files" ))
161
- parameter_source = traits .Enum ("SPM" , "FSL" , "AFNI" , "NiPy" ,
164
+ parameter_source = traits .Enum ("SPM" , "FSL" , "AFNI" , "NiPy" , "FSFAST" ,
162
165
desc = "Source of movement parameters" ,
163
166
mandatory = True )
164
167
use_differences = traits .ListBool ([True , False ], minlen = 2 , maxlen = 2 ,
0 commit comments