ConvertDset error

AFNI version info (afni -ver):
Precompiled binary macos_13_ARM_clang: May 22 2024 (Version AFNI_24.1.10 'Publius Septimius Geta')

code text  # or delete if not needed

ConvertDset -o_Type 1D -input sub-100307_task-REST_acq-LR_run-01_bold_surf.niml.dset -prefix sub-100307_lh_func.1D

Error ConvertDset: Option -o_type not understood. Try -help for usage
   Here's hoping these excerpts from 'ConvertDset -help' enlighten:
        '-o_TYPE: TYPE of output datasets'
        '-i_TYPE: TYPE of input datasets'
        '-prefix OUT_PREF: Output prefix for data set.'

I created a dset file using the "3dVol2Surf" command. Since I need to access the time series data at each vertex, it seems necessary to convert between 1D, dset, and gii formats. However, when I ran the ConvertDset command, I encountered an unexpected error. Specifically, the flag "o_TYPE" does not seem to be recognized due to its uppercase letters. However, when I run echo ConvertDset -o_TYPE ..., it prints "ConvertDset -o_TYPE", so I don’t understand why the error occurs.

Replied via email but put here for reference:

Your command:

ConvertDset \
   -o_Type 1D \
   -input sub-100307_task-REST_acq-LR_run-01_bold_surf.niml.dset \
   -prefix sub-100307_lh_func.1D

Should probably be written as:

ConvertDset \
   -o_1D \
   -input sub-100307_task-REST_acq-LR_run-01_bold_surf.niml.dset \
   -prefix sub-100307_lh_func.1D

It's a funny bit of syntax to swap in the "type" within the "-o_*" option flag itself, rather than to take the type as an argument to a given option. But that is what is meant by this part of the help file description (and used in other parts of SUMA-related code):
-o_TYPE: TYPE of output datasets
where TYPE is one of:
niml_asc (or niml): for ASCII niml format.
niml_bi: for BINARY niml format.
1D: for AFNI's 1D ascii format.
...

And the output type should be known by the program from looking at the prefix dataset's extension.

Note that I think you can also use 3dmaskdump directly on *.niml.dset files, like:

3dmaskdump DSET.niml.dset > out.text.1D

Each row is a time series; for a volumetric dset, you would get the voxel's "i j k" indices prepended to teach time series at the start of each line, but for a surface dataset, by default the node number and two zeros will go at the start, so you know where each time series came from. You can also apply a mask, if you have one, to get a subset of time series. NB: for many input volumes or surfaces, if you don't use a mask, you will get a large text file out.

--pt

You can also skip the type formats completely and the prefix option, and the program will determine the output from the file extension:

ConvertDset -input stats.FT.surf.lh.niml.dset -o teststatsout.1D

The output gets named something like teststatsout.1D.dset. One can use "-o_1Dp_stdout" to get text only to stdout and then redirect that to a file, and then the -prefix option is ignored.

Regards,
Daniel

2 Likes