if (FALSE) {
# Get general folder
folder <- system.file("extdata", package = "neurodata")
# Get covariates
covariates <- system.file("covariates.txt", package = "neurodata")
# Read covariates information
clinical_info <- read.csv(file = covariates, sep = ';')
# Folder of the patient
patient_folder <- file.path(folder,"patient01")
# Getting the paths of the MRI scan sequences for one patient
# the NeuroNorm built-in function load_mri_patient() can be used for this.
sequences <- load_mri_patient(patient_folder)
# Getting preferred atlas template and template mask
# Using the MNI152 template available in the MNITemplate package
library(MNITemplate)
atlas <- getMNIPath()
atlas_mask <- readMNI("Brain_Mask")
# Preprocessing the patient's sequences
patient_preprocessed_mri <- preprocess_modalities(mri.patient = sequences,
folder.patient = patient_folder,
modalities = c('T1','T2','FLAIR'),
atlas = atlas, mask = atlas_mask,
inhomogeneity = 'N4',
transformation = 'SyN')
}
Run the code above in your browser using DataLab