making an atlas from 360 nifti rois

I am in interested in performing 3dnetcorr on resting state images using the HCP parcellation scheme plus subcortical structures and thus am interested in making an atlas. I have the roi’s in mni space based on a transformation from freesurfer which means i also have the annot and list files of each file from freesurfer also…i have checked the nifti files and they seem to be in the correct places

i have extensively read everything i can on how to do this and have tried @atlassize, which seems to require a combined nifti or brik file, and i have tried everything i can find about how to combine this many roi’s into an atlas such that the adjacency matrix calculated by AFNI has the partial correlation values of the node/node interactions labeled by the correct parcellation name. There is also a description about how to batch process adding multiple roi;'s but i spent almost a day trying every possible variation on this and it either doesnt work or combines them into a single whole brain mri and the correlation matrix isnt seperated out by which roi is which

any ideas…i have spent 3 weeks trying unsuccessfully to achieve this pipedream

I would use @MakeLabelTable to do this, I think.

Also, what format are your ROIs in? Are they individual NIFTI files, each one a (binary) mask?

To be an “atlas”, the basic process will be to make a single volume, where each ROI is made up of voxels of a different integer (they need not be consecutive 1…N). You can then associate a string label with each integer, if you would like.

It depends how much you really want to make an atlas specifically, vs how much you just want a volume of ROIs with labels attached.

For making an atlas specifically, you might want to see the documentation here, under the section “How to make an atlas for yourself”:

But to make a volume that is an ROI map for running 3dNetCorr, then I would just use @MakeLabelTable; how the ROIs get combined into a file depends on the format they are in now (see above question on that).

The 3dNetCorr documentation on its partial correlation is:

-part_corr       :output the partial correlation matrix. It is 
                      calculated from the inverse of regular Pearson
                      matrix, R, as follows: let M = R^{I} be in the inverse
                      of the Pearson cc matrix.  Then each element p_{ij} of
                      the partial correlation (PC) matrix is given as:
                      p_{ij} = -M_{ij}/sqrt( M_{ii} * M_{jj} ).
                      This will also calculate the PC-beta (PCB) matrix,
                      which is not symmetric, and whose values are given as:
                      b_{ij} = -M_{ij}/M_{ii}.
                      Use as you wish.  For both PC and PCB, the diagonals
                      should be uniformly (negative) unity.


Adding on to this, we will soon be releasing a version of the HCP atlas in MNI space that is more correct that the others now available. This work was done with Meghan Robinson and Mike Beauchamp, mostly following the recipe they posted here:

Paul described the process. So if you have a unique region to index correspondence, all in a single dataset, either script should give you something useful. @Atlasize calls @MakeLabelTable to create its table and do a few more things like creating a CustomAtlases.niml file. Note the “labeltable” and the “atlas_points_list” are a bit different. 3dNetCorr can label the results using the " -ts_wb_strlabel " option if there is a labeltable in the input dataset, but I don’t think that works yet for an atlas_points_list attribute in the header.

Basically i have 370 roi’s each as a separate volumetric Nifti file in MNI space.

I am not particularly married to the atlas concept and a table which allowed me to extract a time course from all 370 areas individually. I looked through the @makelabeltable help description and its not really clear to me how to take these files and use this script to make a set of points…nor how to get this table to acquire a partial correlation from it