@@ -225,6 +225,7 @@ class _RobustAverageInputSpec(BaseInterfaceInputSpec):
225
225
nonnegative = traits .Bool (
226
226
True , usedefault = True , desc = "whether the output should be clipped below zero"
227
227
)
228
+ num_threads = traits .Int (desc = "number of threads" )
228
229
229
230
230
231
class _RobustAverageOutputSpec (TraitedSpec ):
@@ -234,6 +235,7 @@ class _RobustAverageOutputSpec(TraitedSpec):
234
235
traits .Float , desc = "the ratio to the grand mean or global signal drift"
235
236
)
236
237
out_hmc = OutputMultiObject (File (exists = True ), desc = "head-motion correction matrices" )
238
+ out_hmc_volumes = OutputMultiObject (File (exists = True ), desc = "head-motion correction volumes" )
237
239
238
240
239
241
class RobustAverage (SimpleInterface ):
@@ -319,13 +321,18 @@ def _run_interface(self, runtime):
319
321
if self .inputs .mc_method == "AFNI" :
320
322
from nipype .interfaces .afni import Volreg
321
323
322
- res = Volreg (
324
+ volreg = Volreg (
323
325
in_file = self ._results ["out_volumes" ],
324
- args = "-Fourier -twopass" ,
326
+ interp = "Fourier" ,
327
+ args = "-twopass" ,
325
328
zpad = 4 ,
326
329
outputtype = "NIFTI_GZ" ,
327
- ).run ()
328
- # self._results["out_hmc"] = res.outputs.oned_matrix_save
330
+ )
331
+ if isdefined (self .inputs .num_threads ):
332
+ volreg .inputs .num_threads = self .inputs .num_threads
333
+
334
+ res = volreg .run ()
335
+ self ._results ["out_hmc" ] = res .outputs .oned_matrix_save
329
336
330
337
elif self .inputs .mc_method == "FSL" :
331
338
from nipype .interfaces .fsl import MCFLIRT
@@ -338,6 +345,7 @@ def _run_interface(self, runtime):
338
345
self ._results ["out_hmc" ] = res .outputs .mat_file
339
346
340
347
if self .inputs .mc_method :
348
+ self ._results ["out_hmc_volumes" ] = res .outputs .out_file
341
349
data = nb .load (res .outputs .out_file ).get_fdata (dtype = "float32" )
342
350
343
351
data = np .clip (
0 commit comments