I am looking to see whether group differences exist within a network using 3dNetCorr. (I included the whole brain correlation as well but I don’t think that’s what I really want).

I have obtained the .netcc files using:
3dNetCorr -prefix DMN_netcorr -mask anat_mask_rs+tlrc -inset NEW_MASK_warp2std+tlrc -in_rois DMN_net_rs.nii -ts_out -ts_label -ts_wb_corr

Then, I tried: fat_mat_sel.py -m DMN_netcorr_000.netcc -P ‘CC’ -A 1 -B 1 -T -o (as per an old post answer because to be honest, I’m not entirely sure how to use this… but I was trying to figure it out)… but then I got this error:

Traceback (most recent call last):
File “/home/abin/fat_mat_sel.py”, line 5, in
import lib_fat_plot_sel as PS
File “/home/abin/lib_fat_plot_sel.py”, line 17, in
from mpl_toolkits.axes_grid1 import make_axes_locatable
ImportError: No module named axes_grid1

Once I figure this out, I would like to compare the correlations on a group level and look at between group differences. Could you please give me some feedback on the error and the best way to do the next steps? I suppose I would use the -l (list) option to include each animal’s .netcorr dataset but then, can I compare differences between the matrices? Sorry for the juvenile questions - this is all new to me.


Hi, Sharyn-

Re. the fat_mat_sel.py command you are running-- what do you want to do/know about it beyond what is described in the help file for the options?
I don’t think you want those -A and -B values to be the same: those are the min and max of the colorbar in a plot-- from the program help:

-A, --A_plotmin=MIN      :minimum colorbar value (default is the minimum
                              value found in the matrix).
-B, --B_plotmax=MAX      :maximum colorbar value (default is the maximum
                              value found in the matrix).

The “-T” is for the python-matplotlib behavior of making “tight layout” in the plot (just adjusts how the plot and label text fill figure space).

The “-o” will output a separate NETCC file with just the individual matrix of the selected type-- in your case, Pearson correlation coeffic ient (CC) values:

-o, --out_ind_matr       :output individual matrix files of properties,
                              which might be useful for viewing or entering
                              into other programs for analysis.  The new file
                              will have the same prefix as the old, with the
                              name of the parameter appended at the end of the
                              handle, such as, e.g.: PREFIX_000.grid -> 
                              PREFIX_000_FA.grid  or  PREFIX_000_CC.netcc.

For doing group level things, I wondering if using the “FAT MVM” tools would be what you want? The demo is described here:


It depends very much what you mean by “differences” (in what regard? ROI by ROI, or as an omnibus group? Including covariates? How many groups?).

Re. the error message that you are getting:
What version of Python are you running? From the command line:

python --version


What version of matplotlib do you have? From python or ipython environment:

import matplotlib



Thanks for the answer Paul. Python version: 2.6.6 matplotlib version ( I see, however, that I do not have R installed so will have to do that for fatcat_MWM)

I have 2 groups of n=11 young and n=12 aged primates. I ran 3dnetcorr on ROIs that are part of the DMN. I wanted to look at overall connectivity in this network between the groups and see if there are any differences. When I run a seed based analysis, I do see significant differences in connectivity with certain ROIs but I wanted to look more on a network level. Is this redundant? Am I going about this all wrong? So, in this case, would fat_mvm be my best option?

I guess I’m just confused by fat_mvm because I was trying to compare 2 correlation matrices from 2 different groups as opposed to correlating connectivity with other measures (although I may want to do that in the future). So, would I just 3dttest the individual .netcc files to get a contrast map that is network based as opposed to ROI based?

Hi, Sharyn-

OK, I think you will have ot update the matplotlib version; actually, even Python 2.6.* is pretty old now; I would have thought it would be 2.7, say? (I haven’t updated these commands to work in Python 3.* yet… Someday…). What operating system are you using?

Re. the analysis/design:
I guess there will be some redundant information in those analyses-- is that a bad thing, though? If you see the same kind of results with somewhat different analyses, I’m not sure that is bad. I think the fat_mvm stuff would definitely make sense for that kind of analysis, perhaps moreso than seedbased maps, esp. if you are interested in a network of regions.

When you saying “comparing 2 correlation matrices from 2 different groups”, what does that mean? You don’t have correlation matrices from the same set of regions across all subjects? I wouldn’t know how to test something like that…

You don’t have to correlate the connectivity values in the matrices with lots of things-- you could just include the group membership categorical variable, and that would provide information you want, perhaps? Also, note that the “follow-up post hoc tests” from fat_mvm would give you the ROI-by-ROI results for the same model, so you get that information for free, too, basically.


Hey Paul -
You don’t have correlation matrices from the same set of regions across all subjects?

I do for each individual subject - is there a way I can group the matrices from each subject within a group to get a “group matrix” - or is that not even the correct way to do it? Should I just have 12 .netcc files designated as “young” and 11 .netcc files designated as “old” that get fed into fat_mvm… kind of like you’re saying here…??
[you could just include the group membership categorical variable]

and then the grouping gets done that way?

so, my .csv file would have the subject ID in one column and just whether they’re young or old in the other? (jeez… the subjects in the demo dataset are pretty well off!! $$$)

Thanks again!

Hi, Sharyn-

Well, the fat_mvm approach would be to use each subject’s matrix and do modeling with those; you would make a CSV file (similar to the one in the FAT-MVM demo), but you would mostly need the “group” column/variable for your case-- that is what would define who is “young” and who is “old”. That is what controls the grouping, yes.

This PDF from the Bootcamp handouts would be useful to look at:

Re. “so, my .csv file would have the subject ID in one column and just whether they’re young or old in the other?”
→ yes.

Re. “(jeez… the subjects in the demo dataset are pretty well off!! $$$)”
→ ha, well, the currency isn’t listed, so…


Hi Paul -I am using linux… I never answered that. So, you’re saying do NOT update to python 3.0??


The fat_mvm* programs are not Python 3.0 compatible (at present).


Hi Paul - Me again… So, I ran the fat_mvm_prep and got this error:

fat_mvm_prep.py -p MVM_prep -c NHP_matrix.csv -l NHP_input_list.txt

++ Opening and reading CSV file…
++ … done opening and reading CSV file.
++ Converting (hopefully appropriate) strings to numbers…
Traceback (most recent call last):
File “/home/rossisl/abin/fat_mvm_prep.py”, line 255, in
csv_data, csv_coltypes = GR.ConvertCSVfromStr(csv_raw, csv_colvars,NA_WARN)
File “/home/rossisl/abin/lib_fat_funcs.py”, line 1532, in ConvertCSVfromStr
Lx,Ly = np.shape(dat2)
ValueError: need more than 1 value to unpack

My csv just has the 2 columns as discussed, the subject ID (but I did use their names, not numerical values, as the path to the .netcc files includes their names) and the group (young or aged). The ID in column 1 of .csv matches the 2nd column in the list. Any ideas what I did wrong?


Having subject names in files/paths should really be avoided. It makes it essentially impossible to share them for debugging…

Will have to ponder.