I checked the AFNI program list and it seems that 3dNetCorr is the current best (and only?) way to create a correlation matrix in AFNI. I would like to create the following correlation matrix:

A correlation between the Average/mean Frequency (AF) and the Power-Law Exponent (PLE).

Different ROIs. The ROIs represent the dots/measurements in the correlation matrix for all subjects.

The problem is that 3dNetCorr requires a single AND 4D dataset as input, that is, a time-series is required. Now I face two possible problems:

I lose the time-series once I correlate AF and PLE (over all voxels) first via 3dTcorrelate. The output file of 3dTcorrelate creates a 3D dataset that contains the pearson-correlation (a single value) between AF and PLE for each voxel.

If I don’t correlate AF and PLE first, in order to keep the time-series for both, I have two datafiles as input for 3dNetCorr, and this is also not supported.

In both cases my inputs are not vaild for 3dNetCorr. Is there any possible solution in AFNI?

That doesn’t sound like a correlation matrix… That sounds like a scatterplot? I don’t understand what the column/row entries would be (is it per subject?). Also, what are the “time series” you want to correlate for each row/column entry?

With 3dNetCorr, the most common usage would be:

take a subject that has 2 datasets on the same grid: a map of ROIs, and a 4D dataset of time series

calculate a correlation matrix where each column/row represents one ROI, and each element in the matrix is the correlation between the row-ROI’s average time series and the column-ROI’s average time series.

I don’t understand the dimensionality of your matrix of interest. Perhaps you can explain further, where the pieces fit (as above).

It is possible that if you have a lot of “derived” quantities in text files, not in volumetric datasets, you might be best off creating the correlation matrices (or scatterplots) in, say, a separate Python script.

I think that you are right. I have to use a scatterplot instead of a correlation matrix. There are many ROIs and for each ROI I would like to calculate the correlation between AF and PLE. This correlation should reflect the mean over all subjects for each ROI (and not values for single subjects).

Each value/point/position in the scatterplot would represent the correlation between AF and PLE for different ROIs. In other words: the different ROIs are placed in the scatterplot depending on how high their correlation between the two measurements is.

ptaylor Wrote:

It is possible that if you have a lot of “derived”
quantities in text files, not in volumetric
datasets, you might be best off creating the
correlation matrices (or scatterplots) in, say, a
separate Python script.

–pt

Exactly. I already used AFNI (3dTcorrelate) to calculate the AF-PLE correlation for different ROIs (via 3dROIstats) for each subject. So I have to use another program like Python or Matlab.

One more mini question though: When calculating the mean value (e.g. in a mask), it does not make a difference to use either 3dMaskave or 3dROIstats, right? By standard and if not specified by optional commands, both simply calculate the mean.

3dROIstats can calculate statistics per ROI in a dataset, while 3dmaskave will treat the mask as binary (single ROI only).

So, if you have 3 separate ROIs, 3dROIstats will output 3 separate mean values, while 3dmaskave would output just one (the making a mask of the union of the ROIs, creating one single “super ROI” in this case).

The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.