@@ -517,6 +517,64 @@ class Cat(AFNICommand):
517
517
input_spec = CatInputSpec
518
518
output_spec = AFNICommandOutputSpec
519
519
520
+ class CatMatvecInputSpec (AFNICommandInputSpec ):
521
+ in_file = traits .List (
522
+ traits .Tuple (traits .Str (), traits .Str ()),
523
+ descr = "list of tuples of mfiles and associated opkeys" ,
524
+ mandatory = True ,
525
+ argstr = "%s" ,
526
+ position = - 2 )
527
+ out_file = File (
528
+ descr = "File to write concattenated matvecs to" ,
529
+ argstr = " > %s" ,
530
+ position = - 1 ,
531
+ mandatory = True )
532
+ matrix = traits .Bool (
533
+ descr = "indicates that the resulting matrix will"
534
+ "be written to outfile in the 'MATRIX(...)' format (FORM 3)."
535
+ "This feature could be used, with clever scripting, to input"
536
+ "a matrix directly on the command line to program 3dWarp." ,
537
+ argstr = "-MATRIX" ,
538
+ xor = ['oneline' ,'fourXfour' ])
539
+ oneline = traits .Bool (
540
+ descr = "indicates that the resulting matrix"
541
+ "will simply be written as 12 numbers on one line." ,
542
+ argstr = "-ONELINE" ,
543
+ xor = ['matrix' ,'fourXfour' ])
544
+ fourxfour = traits .Bool (
545
+ descr = "Output matrix in augmented form (last row is 0 0 0 1)"
546
+ "This option does not work with -MATRIX or -ONELINE" ,
547
+ argstr = "-4x4" ,
548
+ xor = ['matrix' ,'oneline' ])
549
+
550
+ class CatMatvec (AFNICommand ):
551
+ """Catenates 3D rotation+shift matrix+vector transformations.
552
+
553
+ For complete details, see the `cat_matvec Documentation.
554
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/cat_matvec.html>`_
555
+
556
+ Examples
557
+ ========
558
+
559
+ >>> from nipype.interfaces import afni
560
+ >>> cmv = afni.CatMatvec()
561
+ >>> cmv.inputs.in_file = [('structural.BRIK::WARP_DATA','I')]
562
+ >>> cmv.inputs.out_file = 'warp.anat.Xat.1D'
563
+ >>> cmv.cmdline # doctest: +ALLOW_UNICODE
564
+ 'cat_matvec structural.BRIK::WARP_DATA -I > warp.anat.Xat.1D'
565
+ >>> res = cmv.run() # doctest: +SKIP
566
+
567
+
568
+ """
569
+
570
+ _cmd = 'cat_matvec'
571
+ input_spec = CatMatvecInputSpec
572
+ output_spec = AFNICommandOutputSpec
573
+
574
+ def _format_arg (self , name , spec , value ):
575
+ if name == 'in_file' :
576
+ return spec .argstr % (' ' .join ([i [0 ]+ ' -' + i [1 ] for i in value ]))
577
+ return super (CatMatvec , self )._format_arg (name , spec , value )
520
578
521
579
class CopyInputSpec (AFNICommandInputSpec ):
522
580
in_file = File (
0 commit comments