How to convert 4D .niml.dset in fsaverage6 to 4D Nifti image

AFNI version info (afni -ver):
Mar 1 2023 (Version AFNI_23.0.07 'Commodus')

My problem is a s simple as the title. I already create a SUMA spec folder. I usually use matlab so this is my approach to it.
the 4th dimension is the runs.

  1. load the 4D dataset in matlab using "surfing_read".
  2. loop over the scans and create a text file with 1D extension with the data values for each run.
  3. create a 3D Nifti file for each *.1D data. (It doesn't work).

can someone please tell me what am I doing wrong? or is there an easier way to do it? thank you

Below is an example for the first run data in the dataset.

sumafolder='....../Data/freesurfer/fsaverage6/SUMA/';
specfile=[sumafolder 'fsaverage6_rh.spec'];
surfvol=[sumafolder 'fsaverage6_SurfVol.nii'];
firstrun_1D=[sumafolder 'cur1d.1D'];
rtpial=[sumafolder 'rh.pial.gii'];
4Ddata=surfing_read(4Dnimldset);
firstrun_data=4Ddata.surface_data(:,1);
dlmwrite([sumafolder 'cur1d.1D'],firstrun_data','\t')
unix(['3dSurf2Vol -spec ' specfile ' -surf_A ' rtpial  ' -sdata_1D ' firstrun_1D  ' -sv ' surfvol ' -prefix ' prefix ' -map_func ave -grid_parent ' surfvol]);

Hello,

I *thought* that you could do something like:

3dcopy -DAFNI_WRITE_1D_AS_PREFIX=Y INCREDIBLE_SURFACE.niml.dset copy.nii

However, it seems that we never allowed for a "natural" output of NIFTI-2 when a dimension (e.g. number of nodes) exceeds 32767 (max 16-bit signed int).
I have made an update for that, but we are waiting on a working network for the build system. If you are currently compiling yourself, please have at it.

Thanks for bringing this up.

  • rick