This directory contains a series of scripts that will preprocess FLAIR images and prepare them for lesion estimation and conversion to MNI space. Note, the Lesion Quantification Toolkit will be run on these derivatives.
Raw data (FLAIR and T1-weighted images) should be placed in the original_data folder, and the subs.txt file should be updated to indicate which files need to be processed.
Scripts are kept in the "scripts" directory, and outputs will appear in the "outputs" directory.
to run all scripts on new data, open a terminal at the root directory, and type make
Scripts (contained in the scripts directory) are:
- image_processing_01_preprocessing.sh This script reorients the brain to the MNI standard, crops the field of view, applies intensity normalization, and applies hd-bet to all images (a superior version of bet)
- image_processing_02_matlab_ples.sh This script calls the lesion segmentation toolbox (a subsidiary toolbox build for SPM12) to estimate the white matter hyperintense regions in subject space
- image_processing_03_alignment.sh This script serves to align the data from subject space to the MNI using the high-resolution T1-weighted file as the basis for the transforms. Briefly, the order of operations is a) align the FLAIR image to the T1-weighted image, b) align the T1-weighted image to the MNI, c) nonlinearly align the T1-weighted image to the MNI, d) concatenate all transformations into a single computation, and e) apply the transformations to the white matter hyperintense segmentation.
- There are two "helper" scripts - the first is the batch_ples.m file that will call the MATLAB white matter hyperintensity code (the shell script is thus a wrapper). The second script is a python script that reads the .html files generated by the lesion segmentation toolbox and spits the lesion volume and lesion number into a .csv file called summary.csv
Outputs
Outputs are contain the probabilistic lesion nifti volumes (these begin with ples_lpa and end with _in_MNI_space.nii.gz. These files can be fed into other software that does disconnectome mapping such as the BCBlab toolkit or the lesion quantification toolkit in Matlab. The T1 image in MNI space is also provided for each participant, as is the LST .html output and the summary statistics in the summary.csv file (lesion volume and number).
Intermediate files can be restored by uncommenting the last section of the Makefile and re-running it. # Flair_processing