AFNI data format and sub-brick selection/indexing

nipype

#1

Hello,
I am new to nipype and would like to turn my afni scripts into a workflow. Unfortunately there is no example workflow for afni on the nipype website and I ran into an issue already at the first step:

In all afni commands indexing of scan volumes is done by adding a sub-brick selection suffix, e.g. mydata+orig[5] to select the sub-brick/volume 5.

For example, when I would like to cut off the 10 initial volumes from a dataset, the afni command would be:
3dTcat -prefix output_filename input_file+orig'[10..$]'

When using the afni interface of nipype, could I just define tcat.inputs.outfile this way, or will this not be passed to the raw afni code?

I noticed for afni.Calc() they added some more arguments, such as start_idx, stop_idx to slice the input file, but it only works for the first input file. This is quite a limitation, since 3dcalc is used to perform complex calculations between several input datasets.

Are there any examples for afni workflows, or should I replace all functions that require selection of volumes with FSL or SPM equivalents?


#2

I’m not an AFNI user, but checking the Nipype code I can see that you provide in_files for TCatSubBrick as tuples of file names and subbrick selectors, see the example here.

Regarding new arguments to Calc, I think github repository could be a good place to post issue and/or creating a Pull Request that adds them to the nipype interface.