Convert mrDiffusion ROIs into Nifti files - vistalab/vistasoft GitHub Wiki

mrDiffusion ROIs are saved as mat files. Some software (e.g. Quench) need roi files to be written in nifti (.nii.gz) format.

Here is example code that will xform mrDiffusion ROIs into nifti files. To transform mrVista functional ROIs into mrDiffusion ROIs, click [here](Convert mrVista ROIs into mrDiffusion ROIs).

% Path of the diffusion ROI .mat file
roiPath = '/pathToDiffusionData/ROIs/LV1.mat';

% Path of the acpc'd anatomy file
t1Path = '/pathToAnatomyData/t1.nii.gz';

% Name of the new nifti roi file that will be created
roiName = 'LV1';

% Whether or not to save
saveFlag = true; 

%% Run it
[nii, roiName] = dtiRoiNiftiFromMat(roiPath, t1Path, roiName, saveFlag);