Skip to content

Commit 1f3d251

Browse files
committed
added predicted_signal option to tensor
added predicted signal to estimate output spec
1 parent 54f5029 commit 1f3d251

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

nipype/interfaces/mrtrix3/reconst.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import os.path as op
66

7-
from ..base import traits, TraitedSpec, File, Undefined, InputMultiObject
7+
from ..base import (
8+
traits, TraitedSpec, File, Undefined, InputMultiObject, isdefined)
89
from .base import MRTrix3BaseInputSpec, MRTrix3Base
910

1011

@@ -50,10 +51,16 @@ class FitTensorInputSpec(MRTrix3BaseInputSpec):
5051
"only applies to the non-linear methods"
5152
),
5253
)
54+
predicted_signal = File(
55+
argstr='-predicted_signal %s',
56+
desc=(
57+
"specify a file to contain the predicted signal from the tensor "
58+
"fits. This can be used to calculate the residual signal"))
5359

5460

5561
class FitTensorOutputSpec(TraitedSpec):
5662
out_file = File(exists=True, desc="the output DTI file")
63+
predicted_signal = File(desc="Predicted signal from fitted tensors")
5764

5865

5966
class FitTensor(MRTrix3Base):
@@ -81,6 +88,9 @@ class FitTensor(MRTrix3Base):
8188
def _list_outputs(self):
8289
outputs = self.output_spec().get()
8390
outputs["out_file"] = op.abspath(self.inputs.out_file)
91+
if isdefined(self.inputs.predicted_signal):
92+
outputs['predicted_signal'] = op.abspath(
93+
self.inputs.predicted_signal)
8494
return outputs
8595

8696

@@ -144,12 +154,18 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec):
144154
"[ az el ] pairs for the directions."
145155
),
146156
)
157+
predicted_signal = File(
158+
argstr='-predicted_signal %s',
159+
desc=(
160+
"specify a file to contain the predicted signal from the FOD "
161+
"estimates. This can be used to calculate the residual signal"))
147162

148163

149164
class EstimateFODOutputSpec(TraitedSpec):
150165
wm_odf = File(argstr="%s", desc="output WM ODF")
151166
gm_odf = File(argstr="%s", desc="output GM ODF")
152167
csf_odf = File(argstr="%s", desc="output CSF ODF")
168+
predicted_signal = File(desc="output predicted signal")
153169

154170

155171
class EstimateFOD(MRTrix3Base):
@@ -187,6 +203,9 @@ def _list_outputs(self):
187203
outputs["gm_odf"] = op.abspath(self.inputs.gm_odf)
188204
if self.inputs.csf_odf != Undefined:
189205
outputs["csf_odf"] = op.abspath(self.inputs.csf_odf)
206+
if self.inputs.predicted_signal != Undefined:
207+
outputs["predicted_signal"] = op.abspath(
208+
self.inputs.predicted_signal)
190209
return outputs
191210

192211

0 commit comments

Comments
 (0)