-
Notifications
You must be signed in to change notification settings - Fork 26
Connectivity preprocessing
Currently, this tool supports functional connectivity between cortical labels (fMRI/MEG) or invasive electrodes. There are two preprocessing steps that are needed for creating the connectivity files for display: First, you need to preprocess the given modality (fMRI/MEG/electrodes) input files.
- fMRI connectivity preprocessing
- MEG connectivity preprocessing (in progress)
- Electrodes connectivity preprocessing (in progress)
Second, process the output of the first step for creating the connectivity files necessary for display:
- fMRI connectivity processing
- MEG connectivity processing (in progress)
- Electrodes connectivity processing (in progress)
The fMRI preprocessing creates two files, one for each hemisphere: labels_data_{atlas-name}{resting_state_measure}{hemi}.npz. The files are located in the links/mmvt_blend/subject-name/fmri folder. These npz files include two variables: data (labels_num x T), and names, the labels names. To load them and run a functional connectivity analysis, you should call the connectivity preprocessing module as the following:
python -m src.preproc.connectivity -s subject-name -a atlas-name -f calc_lables_connectivity --connectivity_modality fmri --windows_length windows-length --windows_shift windows-shift
Where windows-length is the length of the windows, and windows-shift is the shift in each slide. The unit is the fMRI TR. For example, if your fMRI TR is 3s, windows-length=20 and windows-shift=3, than the windows length will be 60s, and the windows shift 9s. If you don't know the TR, you can call this function:
python -m src.preproc.fMRI -s subject-name -f get_tr --fmri_fname fmri_fname
Where fmri_fname is your fMRI file's name, like subject-name.fsaverage.rh.nii.gz for example.The only two supported file types are nii.gz and mgz. If fmri-fname type is nii.gz, the code will convert it to mgz.