Skip to content

Commit df6e842

Browse files
committed
Add FSFAST option to RapidArt
1 parent fe6bebd commit df6e842

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

nipype/algorithms/rapidart.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@ def _get_affine_matrix(params, source):
4242
4343
params : np.array (upto 12 long) in native package format
4444
source : the package that generated the parameters
45-
supports SPM, AFNI, FSL, NIPY
45+
supports SPM, AFNI, FSFAST, FSL, NIPY
4646
"""
4747
if source == 'FSL':
4848
params = params[[3, 4, 5, 0, 1, 2]]
4949
elif source == 'AFNI':
5050
params = params[[4, 5, 3, 1, 2, 0]]
5151
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.
5255
if source == 'NIPY':
5356
# nipy does not store typical euler angles, use nipy to convert
5457
from nipy.algorithms.registration import to_matrix44
5558
return to_matrix44(params)
56-
#process for FSL, SPM and AFNI
59+
#process for FSL, SPM, AFNI and FSFAST
5760
rotfunc = lambda x: np.array([[np.cos(x), np.sin(x)],
5861
[-np.sin(x), np.cos(x)]])
5962
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):
7679
# Shear
7780
Sh = np.eye(4)
7881
Sh[(0, 0, 1), (1, 2, 2)] = params[9:12]
79-
if source == 'AFNI':
82+
if source in ('AFNI', 'FSFAST'):
8083
return np.dot(T, np.dot(Ry, np.dot(Rx, np.dot(Rz, np.dot(S, Sh)))))
8184
return np.dot(T, np.dot(Rx, np.dot(Ry, np.dot(Rz, np.dot(S, Sh)))))
8285

@@ -158,7 +161,7 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec):
158161
realignment_parameters = InputMultiPath(File(exists=True), mandatory=True,
159162
desc=("Names of realignment parameters"
160163
"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",
162165
desc="Source of movement parameters",
163166
mandatory=True)
164167
use_differences = traits.ListBool([True, False], minlen=2, maxlen=2,

0 commit comments

Comments
 (0)