15
15
import os
16
16
import os .path as op
17
17
18
- from ...utils .filemanip import (load_json , save_json , split_filename )
18
+ from ...utils .filemanip import (load_json , save_json , split_filename ,
19
+ fname_presuffix )
19
20
from ..base import (
20
21
CommandLineInputSpec , CommandLine , TraitedSpec ,
21
22
traits , isdefined , File , InputMultiPath , Undefined , Str )
@@ -3131,7 +3132,7 @@ class QwarpInputSpec(AFNICommandInputSpec):
3131
3132
'Note that the source dataset in the second run is the SAME as'
3132
3133
'in the first run. If you don\' t see why this is necessary,'
3133
3134
'then you probably need to seek help from an AFNI guru.' ,
3134
- argstr = '-inlev %d' ,
3135
+ argstr = '-inilev %d' ,
3135
3136
xor = ['duplo' ])
3136
3137
minpatch = traits .Int (
3137
3138
desc = '* The value of mm should be an odd integer.'
@@ -3462,7 +3463,7 @@ class Qwarp(AFNICommand):
3462
3463
>>> qwarp2.inputs.inilev = 7
3463
3464
>>> qwarp2.inputs.iniwarp = ['Q25_warp+tlrc.HEAD']
3464
3465
>>> qwarp2.cmdline # doctest: +ALLOW_UNICODE
3465
- '3dQwarp -base mni.nii -blur 0.0 2.0 -source structural.nii -inlev 7 -iniwarp Q25_warp+tlrc.HEAD -prefix Q11'
3466
+ '3dQwarp -base mni.nii -blur 0.0 2.0 -source structural.nii -inilev 7 -iniwarp Q25_warp+tlrc.HEAD -prefix Q11'
3466
3467
>>> res2 = qwarp2.run() # doctest: +SKIP
3467
3468
"""
3468
3469
_cmd = '3dQwarp'
@@ -3475,29 +3476,38 @@ def _list_outputs(self):
3475
3476
if not isdefined (self .inputs .out_file ):
3476
3477
prefix = self ._gen_fname (self .inputs .in_file , suffix = '_QW' )
3477
3478
ext = '.HEAD'
3479
+ suffix = '+tlrc'
3478
3480
else :
3479
3481
prefix = self .inputs .out_file
3480
3482
ext_ind = max ([prefix .lower ().rfind ('.nii.gz' ),
3481
3483
prefix .lower ().rfind ('.nii.' )])
3482
3484
if ext_ind == - 1 :
3483
3485
ext = '.HEAD'
3486
+ suffix = '+tlrc'
3484
3487
else :
3485
3488
ext = prefix [ext_ind :]
3489
+ suffix = ''
3486
3490
print (ext ,"ext" )
3487
- outputs ['warped_source' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '+tlrc' )+ ext )
3491
+ outputs ['warped_source' ] = fname_presuffix (prefix , suffix = suffix ,
3492
+ use_ext = False ) + ext
3488
3493
if not self .inputs .nowarp :
3489
- outputs ['source_warp' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_WARP+tlrc' )+ ext )
3494
+ outputs ['source_warp' ] = fname_presuffix (prefix ,
3495
+ suffix = '_WARP' + suffix , use_ext = False ) + ext
3490
3496
if self .inputs .iwarp :
3491
- outputs ['base_warp' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_WARPINV+tlrc' )+ ext )
3497
+ outputs ['base_warp' ] = fname_presuffix (prefix ,
3498
+ suffix = '_WARPINV' + suffix , use_ext = False ) + ext
3492
3499
if isdefined (self .inputs .out_weight_file ):
3493
3500
outputs ['weights' ] = os .path .abspath (self .inputs .out_weight_file )
3494
3501
3495
3502
if self .inputs .plusminus :
3496
- outputs ['warped_source' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_PLUS+tlrc' )+ ext )
3497
- outputs ['warped_base' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_MINUS+tlrc' )+ ext )
3498
- outputs ['source_warp' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_PLUS_WARP+tlrc' )+ ext )
3499
- outputs ['base_warp' ] = os .path .abspath (self ._gen_fname (prefix , suffix = '_MINUS_WARP+tlrc' ,)+ ext )
3500
-
3503
+ outputs ['warped_source' ] = fname_presuffix (prefix ,
3504
+ suffix = '_PLUS' + suffix , use_ext = False ) + ext
3505
+ outputs ['warped_base' ] = fname_presuffix (prefix ,
3506
+ suffix = '_MINUS' + suffix , use_ext = False ) + ext
3507
+ outputs ['source_warp' ] = fname_presuffix (prefix ,
3508
+ suffix = '_PLUS_WARP' + suffix , use_ext = False ) + ext
3509
+ outputs ['base_warp' ] = fname_presuffix (prefix ,
3510
+ suffix = '_MINUS_WARP' + suffix , use_ext = False ) + ext
3501
3511
return outputs
3502
3512
3503
3513
def _gen_filename (self , name ):
0 commit comments