@@ -1327,56 +1327,60 @@ def _parse_inputs(self, skip=None):
1327
1327
trait_spec .output_name = 'unwarped_file'
1328
1328
1329
1329
# Handle shift output
1330
- vsm_save_masked = (isdefined (self .inputs .save_shift ) and self .inputs .save_shift )
1331
- vsm_save_unmasked = (isdefined (self .inputs .save_unmasked_shift ) and
1332
- self .inputs .save_unmasked_shift )
1333
-
1334
- if ((vsm_save_masked or vsm_save_unmasked ) and
1335
- not isdefined (self .inputs .shift_out_file )):
1336
- trait_spec = self .inputs .trait ('shift_out_file' )
1337
-
1338
- if input_fmap :
1339
- trait_spec .name_source = 'fmap_in_file'
1340
- elif input_phase :
1341
- trait_spec .name_source = 'phasemap_in_file'
1342
- elif input_vsm :
1343
- trait_spec .name_source = 'shift_in_file'
1344
- else :
1345
- raise RuntimeError (('Either phasemap_in_file, shift_in_file or '
1346
- 'fmap_in_file must be set.' ))
1347
-
1348
- trait_spec .output_name = 'shift_out_file'
1330
+ if not isdefined (self .inputs .shift_out_file ):
1331
+ vsm_save_masked = (isdefined (self .inputs .save_shift ) and self .inputs .save_shift )
1332
+ vsm_save_unmasked = (isdefined (self .inputs .save_unmasked_shift ) and
1333
+ self .inputs .save_unmasked_shift )
1334
+
1335
+ if (vsm_save_masked or vsm_save_unmasked ):
1336
+ trait_spec = self .inputs .trait ('shift_out_file' )
1337
+ trait_spec .output_name = 'shift_out_file'
1338
+
1339
+ if input_fmap :
1340
+ trait_spec .name_source = 'fmap_in_file'
1341
+ elif input_phase :
1342
+ trait_spec .name_source = 'phasemap_in_file'
1343
+ elif input_vsm :
1344
+ trait_spec .name_source = 'shift_in_file'
1345
+ else :
1346
+ raise RuntimeError (('Either phasemap_in_file, shift_in_file or '
1347
+ 'fmap_in_file must be set.' ))
1349
1348
1350
- if vsm_save_unmasked :
1351
- trait_spec .name_template = '%s_vsm_unmasked'
1349
+ if vsm_save_unmasked :
1350
+ trait_spec .name_template = '%s_vsm_unmasked'
1351
+ else :
1352
+ trait_spec .name_template = '%s_vsm'
1352
1353
else :
1353
- trait_spec . name_template = '%s_vsm'
1354
+ skip += [ 'save_shift' , 'save_unmasked_shift' , 'shift_out_file' ]
1354
1355
1355
1356
# Handle fieldmap output
1356
- fmap_save_masked = isdefined (self .inputs .save_fmap ) and self .inputs .save_shift
1357
- fmap_save_unmasked = (isdefined (self .inputs .save_unmasked_fmap ) and
1358
- self .inputs .save_unmasked_fmap )
1359
-
1360
- if ((fmap_save_masked or fmap_save_unmasked ) and
1361
- not isdefined (self .inputs .fmap_out_file )):
1362
- trait_spec = self .inputs .trait ('fmap_out_file' )
1363
-
1364
- if input_vsm :
1365
- trait_spec .name_source = 'shift_in_file'
1366
- elif input_phase :
1367
- trait_spec .name_source = 'phasemap_in_file'
1368
- elif input_fmap :
1369
- trait_spec .name_source = 'fmap_in_file'
1370
- else :
1371
- raise RuntimeError (('Either phasemap_in_file, shift_in_file or '
1372
- 'fmap_in_file must be set.' ))
1373
-
1374
- trait_spec .output_name = 'fmap_out_file'
1357
+ if not isdefined (self .inputs .fmap_out_file ):
1358
+ fmap_save_masked = (isdefined (self .inputs .save_fmap ) and self .inputs .save_fmap )
1359
+ fmap_save_unmasked = (isdefined (self .inputs .save_unmasked_fmap ) and
1360
+ self .inputs .save_unmasked_fmap )
1361
+
1362
+ if (fmap_save_masked or fmap_save_unmasked ):
1363
+ trait_spec = self .inputs .trait ('fmap_out_file' )
1364
+ trait_spec .output_name = 'fmap_out_file'
1365
+
1366
+ if input_vsm :
1367
+ trait_spec .name_source = 'shift_in_file'
1368
+ elif input_phase :
1369
+ trait_spec .name_source = 'phasemap_in_file'
1370
+ elif input_fmap :
1371
+ trait_spec .name_source = 'fmap_in_file'
1372
+ else :
1373
+ raise RuntimeError (('Either phasemap_in_file, shift_in_file or '
1374
+ 'fmap_in_file must be set.' ))
1375
1375
1376
- if fmap_save_unmasked :
1377
- trait_spec .name_template = '%s_fieldmap_unmasked'
1376
+ if fmap_save_unmasked :
1377
+ trait_spec .name_template = '%s_fieldmap_unmasked'
1378
+ else :
1379
+ trait_spec .name_template = '%s_fieldmap'
1378
1380
else :
1379
- trait_spec .name_template = '%s_fieldmap'
1381
+ skip += ['save_fmap' , 'save_unmasked_fmap' , 'fmap_out_file' ]
1382
+
1383
+ print skip
1380
1384
1381
1385
return super (FUGUE , self )._parse_inputs (skip = skip )
1382
1386
0 commit comments