This repository contains a Gray Matter(GM) segmentator implementation for the MATLAB Platform based on SPM12 and CAT12. This tool was designed specifically for the preprocessing of the images for the Diagonal Sulcus Dectection repository. All credits to the creators of those amazing toolboxes.
- Download MATLAB Runtime version 9.5 (R2018b) from the official site for your specific SO (Windows, Linux, Mac).
- Install the "MCR_R2018b" file downloaded.
- If you are using Windows, download the standalone version. Otherwise, compile it for your system following the steps described in the Compile Standalone section.
- Download and install Matlab 9.5 Matlab R2018b (Recommended)
- Download and install SPM12 v7771 addon for Matlab.
- Download and install CAT12.9 (r2560) toolbox for SPM.
For more information about how to install those complements, please refer to the official website of SPM and CAT12
-
In the Standalone version, execute
SegmentGM.exe.In the Matlab Platform, open
run_segment_gm.mand run it. -
Execute
SegmentGM.exeand wait it to load. -
A dialog box will pop out to select the nifti images that you want to segment.
-
Results will be placed in a folder called
mri, located alongside the input images. GM segments will be named as the input images with thewp1prefix.
- Input images can be in
.niiand.nii.gzformat. - It takes aproximately 10~15min to process each image.
- The processing is CPU intensive.
- You can run several instances of the segmentator if you want to do it more quickly, however keep in mind that is going to consume more CPU and memory RAM.
- Terminal outputs will be stored in the
output.txtfile or the individual ones in thereportfolder
As a prerequisite, follow the instructions for installation in the Matlab Platform subsection.
In order to compile the GM segmentator, follow this steps:
- Clone this repository.
- (Optional) Download 7Zip standalone version for your SO and extract the content inside the provided
7zipfolder. - Open the script
compile_segment_gm.min MATLAB and run it. - The compiled version will be located in the
compiledfolder.