History of AFNI updates  

|
August 06, 2021 11:26PM
Hi-

I would loop over each hemisphere like there, rather than use the "both" file, because you would need to specify the hemisphere in the surface, anyways.
foreach hemi ( lh rh ) 
  3dVol2Surf \
      -spec std.141.TT_N27_${hemi}.spec \
      -surf_A smoothwm \
      -surf_B pial \
      -sv TT_N27_SurfVol.nii \
      -grid_parent sumMaps.nii.gz \
      -map_func ave \
      -f_steps 10 \
      -f_index nodes \
      -out_niml std.141.${hemi}.sumMap.niml.dset

    # "-grid_parent .." should be a volume here
    # you can also make the output a NIFTI directly, by including the suffix on the dset in "-prefix .."
    # use "-sdata .." to provide the surface dataset that should be mapped into the vol
     3dSurf2Vol \
          -spec std.141.mySubj_both.spec \
           -surf_A lh.smoothwm \
           -surf_B lh.pial \
           -grid_parent mySubj.nii \
           -sv mySubj.nii \
           -map_func ave \
           -f_steps 10 \
           -f_index voxels  \
           -sdata std.141.${hemi}.sumMap.niml.dset \
          -prefix sumMapSubj_${hemi}.nii.gz
end

Note how you can output a NIFTI directly, above. You can add the two files to make a single NIFTI:
3dcalc \
   -a sumMapSubj_lh.nii.gz \
   -b sumMapSubj_rh.nii.gz \
    -expr 'a+b*not(bool(a))' \
   -prefix sumMapSubj_both.nii.gz
The reason the expression isn't just 'a+b', is juuust in case there is any overlap of nonzero values between the two volumetric datasets. By construction of the two hemispheric surfaces, I don't think there should be, but this should ensure that.

Though, just to note for future reference, to copy a BRIK/HEAD file to NIFTI, you can:
3dcopy FILE_NAME.HEAD FILE_NAME_NEW.nii.gz
The dataset you tried to convert with 3dAFNItoNIFTI wasn't actually a BRIK/HEAD dset, I guess, because the "-grid_parent .." being used wasn't a volumetric dataset.

How does that work?

--pt
Subject Author Posted

Using AFNI to co-register two surfaces Attachments

Alireza July 30, 2021 03:43AM

Re: Using AFNI to co-register two surfaces

ptaylor July 30, 2021 03:45PM

Re: Using AFNI to co-register two surfaces

Alireza August 06, 2021 04:05PM

Re: Using AFNI to co-register two surfaces

ptaylor August 06, 2021 11:26PM

Re: Using AFNI to co-register two surfaces

Alireza August 08, 2021 06:39AM

Re: Using AFNI to co-register two surfaces

Daniel Glen August 08, 2021 10:07AM