@@ -276,9 +276,7 @@ def _run_interface(self, runtime):
276
276
277
277
278
278
class _ApplyCoeffsFieldInputSpec (BaseInterfaceInputSpec ):
279
- in_data = InputMultiObject (
280
- File (exist = True , mandatory = True , desc = "input EPI data to be corrected" )
281
- )
279
+ in_data = File (exist = True , mandatory = True , desc = "input EPI data to be corrected" )
282
280
in_coeff = InputMultiObject (
283
281
File (exists = True ),
284
282
mandatory = True ,
@@ -288,23 +286,17 @@ class _ApplyCoeffsFieldInputSpec(BaseInterfaceInputSpec):
288
286
exists = True ,
289
287
desc = "the transform by which the fieldmap can be resampled on the target EPI's grid." ,
290
288
)
291
- in_xfms = InputMultiObject (
292
- File (exists = True ), desc = "list of head-motion correction matrices"
293
- )
294
- ro_time = InputMultiObject (
295
- traits .Float (mandatory = True , desc = "EPI readout time (s)." )
296
- )
297
- pe_dir = InputMultiObject (
298
- traits .Enum (
299
- "i" ,
300
- "i-" ,
301
- "j" ,
302
- "j-" ,
303
- "k" ,
304
- "k-" ,
305
- mandatory = True ,
306
- desc = "the phase-encoding direction corresponding to in_data" ,
307
- )
289
+ in_xfms = File (exists = True , desc = "list of head-motion correction matrices" )
290
+ ro_time = traits .Float (mandatory = True , desc = "EPI readout time (s)." )
291
+ pe_dir = traits .Enum (
292
+ "i" ,
293
+ "i-" ,
294
+ "j" ,
295
+ "j-" ,
296
+ "k" ,
297
+ "k-" ,
298
+ mandatory = True ,
299
+ desc = "the phase-encoding direction corresponding to in_data" ,
308
300
)
309
301
num_threads = traits .Int (nohash = True , desc = "number of threads" )
310
302
approx = traits .Bool (
@@ -361,18 +353,6 @@ class ApplyCoeffsField(SimpleInterface):
361
353
def _run_interface (self , runtime ):
362
354
from sdcflows .transform import B0FieldTransform
363
355
364
- n = len (self .inputs .in_data )
365
-
366
- ro_time = self .inputs .ro_time
367
- if len (ro_time ) == 1 :
368
- ro_time *= n
369
-
370
- pe_dir = self .inputs .pe_dir
371
- if len (pe_dir ) == 1 :
372
- pe_dir *= n
373
-
374
- unwarp = None
375
-
376
356
# Pre-cached interpolator object
377
357
unwarp = B0FieldTransform (coeffs = [nb .load (cname ) for cname in self .inputs .in_coeff ])
378
358
@@ -390,12 +370,12 @@ def _run_interface(self, runtime):
390
370
# self._results["out_field"] = out_field
391
371
392
372
# HMC matrices are only necessary when reslicing the data (i.e., apply())
393
- hmc_mats = None
373
+ # Check the length of in_xfms matches that of in_data
394
374
self ._results ["out_corrected" ] = unwarp .apply (
395
375
self .inputs .in_data ,
396
- pe_dir ,
397
- ro_time ,
398
- xfms = hmc_mats ,
376
+ self . inputs . pe_dir ,
377
+ self . input . ro_time ,
378
+ xfms = self . inputs . in_xfms ,
399
379
# num_threads=(
400
380
# None if not isdefined(self.inputs.num_threads) else self.inputs.num_threads
401
381
# ),
0 commit comments