HaskinsPed .spec file for SUMA

Hello all,

I’m trying to project a volume onto the surface using the AFNI+SUMA interface. The data are in HaskinsPed space, however I can’t seem to get the right parcellation to pass to SUMA so that the group map is aligned with the template.

My attempt was to run the HaskinsPed template through freesurfer then use @SUMA_Make_Spec_FS to make the spec file. This step was successful, however once I open AFNI+SUMA and have them talking, when I overlay the group data AFNI is forced back to “Forced switch from ‘Original View’ to ‘Talairach View’”.

It seems like I’m missing a step or completed these in the wrong order. Does anyone have any suggestions?

Andrew

AFNI should be showing all the volumetric files in “tlrc view”, which refers to the data being in a standard space. You can see what space and what “afni view” a dataset is with this command

3dinfo -info -av_space mydset.nii.gz

The same command can be applied to many datasets at one time like this:

3dinfo -space -av_space -prefix ~/abin/HaskinsPeds_*.HEAD
HaskinsPeds +tlrc HaskinsPeds_NL_atlas1.0
HaskinsPeds +tlrc HaskinsPeds_NL_template1.0
HaskinsPeds +tlrc HaskinsPeds_aff_atlas1.0
HaskinsPeds +tlrc HaskinsPeds_aff_template1.0

To apply the HaskinsPeds space to a dataset like the datasets produced by FreeSurfer, you can change the space of a dataset with

3drefit -space HaskinsPeds mydset.nii.gz

Thanks Daniel! This helped the “orig to tlrc” issue but the dataset image is misaligned, presumably because the HaskinsPeds.spec file is in freesurfer space.

Is there a standard process for creating the spec files for ref images like the ones that come included in SUMA like MNI152_2009? This way I could create the surface mapping directly on the HaskinsPeds template without going to free surfer space?

Andrew

FreeSurfer shouldn’t be moving the original image. It regrids, but shouldn’t move it. How are you visualizing this?

Perhaps that’s part of the issue. The group dataset I’m trying to visualize seems misaligned to the HaskinsPeds T1.nii and *.spec file. Maybe the group data needs to be regrided?

I’m visualizing using AFNI+SUMA:


afni -niml &
suma -spec ../../ref/HaskinsPeds/freesurfer/HaskinPeds/SUMA/std.141.HaskinPeds_both.spec -sv ../../ref/HaskinsPeds/freesurfer/HaskinPeds/SUMA/T1_new.nii &

*Press “t” to get AFNI & SUMA to talk…

NOTE: T1_new.nii is the output from


3drefit -space HaskinsPeds ../../ref/HaskinsPeds/freesurfer/HaskinPeds/SUMA/T1.nii

I’ve attached a few screenshots to visualize the misalignment.

How did you generate the overlay dataset that you show here?

through 3dUndump

----- HISTORY -----
[andrewlynn@PSYQHU1JV40: Wed Apr 13 13:02:23 2022] {AFNI_21.3.10:macos_10.12_local} 3dUndump -xyz -datum float -prefix /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t_RAI -master /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/ref/atlas/BN_atlas_group_HaskinsPeds_2.5_mask_RAI+tlrc.HEAD /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t_voxel_data.txt
[andrewlynn@PSYQHU1JV40: Wed Apr 13 13:02:23 2022] {AFNI_21.3.10:macos_10.12_local} 3dresample -orient LPI -prefix /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t -input /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t_RAI+tlrc.BRIK

I’ve also reoriented the HaskinsPeds-Freesurfer anatomical file to LPI so it matches the dataset, but this does not fix the problem.

I can’t quite see the full command, so I’ll try to guess. If there is no master dataset, 3dUndump interprets the xyz coordinates in the input file as RAI (Right to left, Anterior to posterior, Inferior to superior). Otherwise, the xyz order matches the master dataset. It might be the text file you are using assumes the order of the master dataset. Instead of using xyz order, if you use the ijk definition for the coordinates (0 to n-1 columns, 0 to m-1 rows, 0 to k-1 slices), the storage order and direction of the master dataset would be assumed. Still 3dUndump may not even be the best way to get your data into an AFNI or NIFTI format. If you have binary data, you could use something like to3d. In any case, if this doesn’t work, send some datasets, and Pete Molfese or I will take a look.

Thanks Daniel,

I’ve worked out the RAI specific issue. I’ve make sure that the 3dmaskdump to 3dUndump pipeline is consistently in RAI, which I then 3dresample to LPI to match the original data orientation. When putting together this analysis pipeline I worked with the ijk system but I found keeping things in RAI was easier.

Moreover, the group data set is aligned with the HaskinsPeds_NL_template (that I have down sampled to 2.5mm). See attached.

Breaking down the commands:


3dUndump -xyz -datum float \
-prefix /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t_RAI \
-master /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/ref/atlas/BN_Atlas_246_2.5mm_to_HaskinsPediatric_RAI+tlrc.HEAD \ /Volumes/NBL_Projects/NBL_WorkingPapers/HomeMath_RSA/groupanalyses/ROI/Group_within_ratio_Region_digitratio_t_voxel_data.txt


Group_within_ratio_Region_digitratio_t_voxel_data.txt

This is the output from a RSA analysis where I have assigned the tvalue of the model fit for each ROI to all the voxels in that ROI. I’ve done this by editing the output of the 3dmaskdump of the atlas of ROIs (also -master here). I’ve ensured the output is written in RAI orientation since the this is the orientation output by 3dmaskdump and 3dUndump

I’ve emailed a zip file to both Daniel and Peter with the the input to this command as well as the function I use to create the txt and *BRIK/HEAD files that are misaligned to the HaskinsPeds freesurfer output.