Classifier Pipeline
SPM Pipeline (Training Samples)
français | english
Navigation
Home
Sitemap
This wiki
This page

SPM Pipeline

The SPM pipeline segments the brains into GM/WM/CSF/Other and creates a average template of all tissues. For the purpose of Alzheimer classifier the GM (tissue type 1) is the only tissue of interest. The file "training_SPM_DARTEL_create_template.mat" loads a batch with all the necessary settings to process the segmentation and warping into the average template space. The only thing to do is to add the cases of interest to the “Named File Selector” module. This can be done either by browsing/selecting the files or by use of the “Ed” button by pasting a list of files.

Before starting the actual pipeline, you should check the consistency of the data, especially the dimensions of the volume that must be exactly the same for all scans. The simplest way to check the homogenity is by using 'VBM8->Tools->Display one slice for all images'. It is also a good idea to test the pipeline with two or three scans to test if the process runs without errors. During this process a cup of coffee may be approriate ;-)

Use a prepared batch as template. For the default settings, only two things have to be configured.

  • The working directory with the images.
  • The list of files to treat. It is a good idea to group the data such as the AD scans come before all NC scans. This will facilitate the classification process. But in any case the order of the files have to be matched to a vector indicating the DX status of each scan!

Prepare MATLAB

Before starting, please make sure you followed all the steps in the installation section.

Start MATLAB and run

>> spm

(image: spm_start)

click the "PET & VBM" button

(image: pet_vbm)

click the "Batch" button

(image: batch)

To load the VBM module:

  • "File->Add Application"
  • change to directory:   path_to\MATLAB\2009a\toolbox\spm8\vbm8\
  • select file "tbx_cfg_vbm8.m"
  • click on the "Done" button

(image: batch_vbm)

To load spm_pipeline module:

  • "File->Add Application"
  • change directory to: path_to\MATLAB\2009a\toolbox\spm8\spm_pipeline\
  • select the file cfg_pipeline_master.m
  • click the "Done" button

(image: batch_vbm_classifier_pipeline)

To load a template batch:

  • "File->Load Batch"
  • change directory to: D:\path\to\batch\file\
  • select the batch file (*.mat) (load this example file)
  • click on the "Done" button

(image: loaded_batch)

Prepare the Batch

Click on the module "Change Directory" and select the working directory by double clicking on the item "Directory".

Change to the desired directory and click on "Done".

(image: batch_change_directory)

To add the list of files to be processed, there are two different ways:

a)

  • Click on the module "Named File Selector".
  • Double click on the item "File Set". Warning! If you delete the item "File Set", the items will be changed to the directory containing the images
  • Remove the already selected files from the list by clicking on them
  • Select the images by clicking

b)

  • Click on "Ed" and paste the path of a list of files
  • Once the list is complete, click on done

(image: batch_file_set)

 Make sure that in the module NewSegment, the path for the tissue probability maps is correct:

  • Click on the "NewSegment" module
  • Verify the path of each tissue probability map (6 in total)

(image: batch_newseg.jpg)

If some path are incorrects, correct them by:

  • Double-clicking on the Tissue probability map field
  • Browse to the directory: matlab_path\R2009b\toolbox\spm8\toolbox\Seg
  • Choose the tissue type number for the file filter (1->GM, 2->WM, 3->CSF, 4->Bone, 5-> Soft tissue, 6->Air/Background)
  • Select the template TMP.nii (VERY IMPORTANT to select it with the correct filter)

(image: tissue_prob_map.jpg)

-> in the batch editor, the tissue probability maps should appear in the following format: filepath, tissue type. Ex: D:\Program Files\MATLAB\R2009b\toolbox\spm8\toolbox\Seg\TMP.nii,2 (for WM)

Note: don't change the number of gaussian from its default value.

Run the Batch

Run the batch by clicking on the green triangle. The result of the process will be file called "dp_mwc1.mat". The dod product variable name is "Phi". (> load dp_mwc1.mat)

Search
Share