1
1
"""ANTs' utilities."""
2
2
import os
3
3
from ...utils .imagemanip import copy_header as _copy_header
4
- from ..base import traits , isdefined , TraitedSpec , File , Str , InputMultiPath
4
+ from ..base import traits , isdefined , TraitedSpec , File , Str , InputMultiObject
5
5
from .base import ANTSCommandInputSpec , ANTSCommand
6
6
7
7
@@ -400,11 +400,10 @@ class AI(ANTSCommand):
400
400
'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1]
401
401
-o initialization.mat -p 0 -s [20,0.12] -t Affine[0.1] -v 0'
402
402
403
- >>> AI(
404
- ... fixed_image='structural.nii',
405
- ... moving_image='epi.nii',
406
- ... metric=('Mattes', 32, 'Regular', 1),
407
- ... search_grid=(12, (1, 1, 1)),
403
+ >>> AI(fixed_image='structural.nii',
404
+ ... moving_image='epi.nii',
405
+ ... metric=('Mattes', 32, 'Regular', 1),
406
+ ... search_grid=(12, (1, 1, 1)),
408
407
... ).cmdline
409
408
'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1]
410
409
-o initialization.mat -p 0 -s [20,0.12] -g [12.0,1x1x1] -t Affine[0.1] -v 0'
@@ -418,15 +417,11 @@ class AI(ANTSCommand):
418
417
def _run_interface (self , runtime , correct_return_codes = (0 ,)):
419
418
runtime = super (AI , self )._run_interface (runtime , correct_return_codes )
420
419
421
- setattr (
422
- self ,
423
- "_output" ,
424
- {
425
- "output_transform" : os .path .join (
426
- runtime .cwd , os .path .basename (self .inputs .output_transform )
427
- )
428
- },
429
- )
420
+ self ._output = {
421
+ "output_transform" : os .path .join (
422
+ runtime .cwd , os .path .basename (self .inputs .output_transform )
423
+ )
424
+ }
430
425
return runtime
431
426
432
427
def _format_arg (self , opt , spec , val ):
@@ -439,8 +434,7 @@ def _format_arg(self, opt, spec, val):
439
434
return spec .argstr % val
440
435
441
436
if opt == "search_grid" :
442
- val1 = "x" .join (["%g" % v for v in val [1 ]])
443
- fmtval = "[%s]" % "," .join ([str (val [0 ]), val1 ])
437
+ fmtval = "[%s,%s]" % (val [0 ], "x" .join ("%g" % v for v in val [1 ]))
444
438
return spec .argstr % fmtval
445
439
446
440
if opt == "fixed_image_mask" :
0 commit comments