|
4 | 4 |
|
5 | 5 | import os.path as op |
6 | 6 |
|
7 | | -from ..base import traits, TraitedSpec, File, Undefined, InputMultiObject |
| 7 | +from ..base import ( |
| 8 | + traits, TraitedSpec, File, Undefined, InputMultiObject, isdefined) |
8 | 9 | from .base import MRTrix3BaseInputSpec, MRTrix3Base |
9 | 10 |
|
10 | 11 |
|
@@ -50,10 +51,16 @@ class FitTensorInputSpec(MRTrix3BaseInputSpec): |
50 | 51 | "only applies to the non-linear methods" |
51 | 52 | ), |
52 | 53 | ) |
| 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")) |
53 | 59 |
|
54 | 60 |
|
55 | 61 | class FitTensorOutputSpec(TraitedSpec): |
56 | 62 | out_file = File(exists=True, desc="the output DTI file") |
| 63 | + predicted_signal = File(desc="Predicted signal from fitted tensors") |
57 | 64 |
|
58 | 65 |
|
59 | 66 | class FitTensor(MRTrix3Base): |
@@ -81,6 +88,9 @@ class FitTensor(MRTrix3Base): |
81 | 88 | def _list_outputs(self): |
82 | 89 | outputs = self.output_spec().get() |
83 | 90 | 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) |
84 | 94 | return outputs |
85 | 95 |
|
86 | 96 |
|
@@ -144,12 +154,18 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): |
144 | 154 | "[ az el ] pairs for the directions." |
145 | 155 | ), |
146 | 156 | ) |
| 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")) |
147 | 162 |
|
148 | 163 |
|
149 | 164 | class EstimateFODOutputSpec(TraitedSpec): |
150 | 165 | wm_odf = File(argstr="%s", desc="output WM ODF") |
151 | 166 | gm_odf = File(argstr="%s", desc="output GM ODF") |
152 | 167 | csf_odf = File(argstr="%s", desc="output CSF ODF") |
| 168 | + predicted_signal = File(desc="output predicted signal") |
153 | 169 |
|
154 | 170 |
|
155 | 171 | class EstimateFOD(MRTrix3Base): |
@@ -187,6 +203,9 @@ def _list_outputs(self): |
187 | 203 | outputs["gm_odf"] = op.abspath(self.inputs.gm_odf) |
188 | 204 | if self.inputs.csf_odf != Undefined: |
189 | 205 | 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) |
190 | 209 | return outputs |
191 | 210 |
|
192 | 211 |
|
|
0 commit comments