diff --git a/src/matlab/builders/configurations/BuildRegisterToStandardConfiguration.m b/src/matlab/builders/configurations/BuildRegisterToStandardConfiguration.m new file mode 100644 index 0000000..b0963d6 --- /dev/null +++ b/src/matlab/builders/configurations/BuildRegisterToStandardConfiguration.m @@ -0,0 +1,79 @@ +function [config] = BuildRegisterToStandardConfiguration() +%BUILDREGISTERTOSTANDARDCONFIGURATION Builds configuration for pipeline. +% Builds a configuration for a pipeline that registers volumes to a standard. +% +% Input: +% - ... +% +% Output: +% - config: Configuration. + +config = struct(); + +% get data folder relative to this file +filePath = fileparts(which(mfilename)); +pathToDataFolder = fullfile(filePath, '../../../../../neurochi/data/'); +pathToWorkspace = fullfile(pathToDataFolder, 'w1'); +pathToDataset = fullfile(pathToDataFolder, 'input'); +pathToParcellations = fullfile(pathToDataFolder, 'parcs'); +% for intermediary pipelines, send output to the transfer folder +pathToOutput = fullfile(pathToDataFolder, 'transfer'); + +%% pipeline: register to standard +% common configuration +config.verbose = true; +config.clobber = true; +config.pathToWorkspace = pathToWorkspace; +config.pathToDataset = pathToDataset; +config.pathToParcellations = pathToParcellations; +config.pathToOutput = pathToOutput; +% helps debug by not running all subjects +config.numSubjects = 1; + + +% step 1 +config.step1.dof = 6; +config.step1.interp = 'spline'; +config.step1.optional = false; +config.step1.clobber = config.clobber; +config.step1.verbose = config.verbose; +% step 2: flirt +config.step2.dof = 6; +config.step2.applyxfm = true; +config.step2.nosearch = true; +config.step2.interp = 'spline'; +config.step2.optional = false; +config.step2.clobber = config.clobber; +config.step2.verbose = config.verbose; +% step 3 +config.step3.optional = false; +config.step3.clobber = config.clobber; +config.step3.verbose = config.verbose; +% step 4 +config.step4.dof = 12; +config.step4.interp = 'spline'; +config.step4.optional = false; +config.step4.clobber = config.clobber; +config.step4.verbose = config.verbose; +% step 5 +config.step5.dof = 12; +config.step5.applyxfm = true; +config.step5.nosearch = true; +config.step5.interp = 'spline'; +config.step5.optional = false; +config.step5.clobber = config.clobber; +config.step5.verbose = config.verbose; +% step 6 +config.step6.optional = false; +config.step6.clobber = config.clobber; +config.step6.verbose = config.verbose; +% step 7 +config.step7.optional = false; +config.step7.clobber = config.clobber; +config.step7.verbose = config.verbose; +% step 8 +config.step8.optional = false; +config.step8.clobber = config.clobber; +config.step8.verbose = config.verbose; + +end diff --git a/src/matlab/builders/configurations/BuildSampleConfiguration.m b/src/matlab/builders/configurations/BuildSampleConfiguration.m index c573783..17b315f 100644 --- a/src/matlab/builders/configurations/BuildSampleConfiguration.m +++ b/src/matlab/builders/configurations/BuildSampleConfiguration.m @@ -1,12 +1,12 @@ function [config] = BuildSampleConfiguration() -%BUILDSAMPLECONFIGURATION Summary of this function goes here -% Detailed explanation goes here +%BUILDSAMPLECONFIGURATION Builds configuration for pipeline. +% Builds a configuration for a sample pipeline. % % Input: -% - config: Base configuration. +% - ... % % Output: -% - config: Configuiration. +% - config: Configuration. config = {}; @@ -47,8 +47,7 @@ % step configurations can also inherit from the sequence configurations pipeline1.step3.verbose = pipeline1.verbose; -% you can also order this by pipeline / step -%% pipeline 2: register parcellations +%% pipeline 2: register to standard pipeline2 = {}; pipeline2.verbose = common.verbose; pipeline2.pathToOutput = fullfile(pathToDataFolder, 'o2'); @@ -57,7 +56,7 @@ pipeline2.step1.interp = 'spline'; pipeline2.step1.optional = true; pipeline2.step1.verbose = pipeline2.verbose; -% step 2: flirt +% step 2: flirt pipeline2.step2.dof = 6; pipeline2.step2.applyxfm = true; pipeline2.step2.nosearch = true; @@ -141,10 +140,36 @@ pipeline3.step5.optional = true; pipeline3.step5.verbose = pipeline3.verbose; -% step 6: apply mask +% step 6: invert subcortical mask +pipeline3.step6.optional = true; pipeline3.step6.verbose = pipeline3.verbose; +% step 7: multiply segmented brain by inverted subcortical mask +pipeline3.step7.skip = true; +pipeline3.step7.verbose = pipeline3.verbose; +% step 8: tag subcortical mask as gray matter +pipeline3.step8.skip = true; +pipeline3.step8.verbose = pipeline3.verbose; + +% step 9: add subcortical mask back to segmented brain +pipeline3.step9.skip = true; + +% step 10: create tissue type masks +pipeline3.step10.skip = true; + +% step 11: dilate wm mask +pipeline3.step11.skip = true; + +% step 12: dilate csf mask +pipeline3.step12.skip = true; + +% step 13: combine wm and csf mask +pipeline3.step13.skip = true; + +% step 14: threshold wm and csf mask to keep intersect +pipeline3.step14 = struct(); %.skip = true; +pipeline3.step14.thr = 2; %% prepare fmri configuration object % @@ -159,7 +184,7 @@ % fmri.fMin = .01; % MIPLAB configs % fmri.fMax = .25; % task bandpass % fmri.fhwm = 0; % Full Width at Half Maximum of the Gaussian kernel -% +% % config.fmri = fmri; config.pipeline1 = pipeline1; diff --git a/src/matlab/builders/configurations/BuildTransformParcellationConfiguration.m b/src/matlab/builders/configurations/BuildTransformParcellationConfiguration.m new file mode 100644 index 0000000..2ad4ab4 --- /dev/null +++ b/src/matlab/builders/configurations/BuildTransformParcellationConfiguration.m @@ -0,0 +1,62 @@ +function [config] = BuildTransformParcellationConfiguration() +%BUILDTRANSFORMPARCELLATIONCONFIGURATION Builds configuration for pipeline. +% Builds a configuration for a pipeline that transforms a parcellation. +% +% Input: +% - ... +% +% Output: +% - config: Configuration. + +config = struct(); + +% get data folder relative to this file +filePath = fileparts(which(mfilename)); +pathToDataFolder = fullfile(filePath, '../../../../../neurochi/data/'); +pathToWorkspace = fullfile(pathToDataFolder, 'w1'); +pathToDataset = fullfile(pathToDataFolder, 'input'); +pathToParcellations = fullfile(pathToDataFolder, 'parcs'); +% for intermediary pipelines, send output to the transfer folder +pathToOutput = fullfile(pathToDataFolder, 'transfer'); + +%% pipeline: transform parcellation +% common configuration +config.verbose = true; +config.clobber = true; +config.pathToWorkspace = pathToWorkspace; +config.pathToDataset = pathToDataset; +config.pathToParcellations = pathToParcellations; +config.pathToOutput = pathToOutput; +% helps debug by not running all subjects +config.numSubjects = 1; +% select the parcellation to transform +% (must be present in `pathToParcellations`) +config.parcellation = 'mask_ventricles_MNIch2.nii.gz'; + +% step 1 +config.step1.numDilations = 0; +config.step1.clobber = config.clobber; +config.step1.verbose = config.verbose; +% step 2 +config.step2.interp = 'nn'; +config.step2.clobber = config.clobber; +config.step2.verbose = config.verbose; +% step 3 +config.step3.interp = 'nearestneighbour'; +config.step3.applyxfm = true; +config.step3.nosearch = true; +config.step3.optional = true; +config.step3.clobber = config.clobber; +config.step3.verbose = config.verbose; + +% step 4 +config.step4.interp = 'nearestneighbour'; +config.step4.applyxfm = true; +config.step4.nosearch = true; +config.step4.optional = true; +config.step4.clobber = config.clobber; +config.step4.verbose = config.verbose; + + +end + diff --git a/src/matlab/builders/pipelines/BuildRegisterParcellationPipeline.m b/src/matlab/builders/pipelines/BuildRegisterToStandardPipeline.m similarity index 61% rename from src/matlab/builders/pipelines/BuildRegisterParcellationPipeline.m rename to src/matlab/builders/pipelines/BuildRegisterToStandardPipeline.m index 16883ea..d080f31 100644 --- a/src/matlab/builders/pipelines/BuildRegisterParcellationPipeline.m +++ b/src/matlab/builders/pipelines/BuildRegisterToStandardPipeline.m @@ -1,10 +1,10 @@ -function [pipeline] = BuildRegisterParcellationPipeline(pathToWorkspace, ... - pathToDataset, ... - pathToParcellations, ... - pathToOutputsFromPreviousPipelines, ... - pathToOutput, ... - numSubjects, ... - config) +function [pipeline] = BuildRegisterToStandardPipeline(pathToWorkspace, ... + pathToDataset, ... + pathToParcellations, ... + pathToIntermediaryOutputs, ... + pathToOutput, ... + numSubjects, ... + config) %BUILDSAMPLEPIPELINE Example of a pipeline builder. % This builder creates a pipeline with one sequence per subject, based % on the format of a BIDS dataset's participants.tsv file. @@ -21,7 +21,7 @@ pathToWorkspace char = '.' pathToDataset char = '.' pathToParcellations char = '.' - pathToOutputsFromPreviousPipelines char = '.' + pathToIntermediaryOutputs char = '.' pathToOutput char = '.' numSubjects int8 {mustBeNonnegative} = 0 config = {} @@ -30,10 +30,10 @@ % names of inputs needed to start the sequence inputs = { ... fullfile(pathToDataset, '%s/anat/%s_T1w.nii.gz'), ... - fullfile(pathToOutputsFromPreviousPipelines, '%s/%s_T1w_brain_mul.nii.gz'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_T1w_brain_mul.nii.gz'), ... fullfile(pathToParcellations, 'ch2bet.nii.gz'), ... - fullfile(pathToParcellations, 'ch2.nii.gz'), ... - fullfile(pathToParcellations, 'schaefer_2018_400_subc.nii') }; + fullfile(pathToParcellations, 'ch2.nii.gz') ... +}; numInputs = length(inputs); % get information about participants @@ -66,16 +66,19 @@ subjectInputs = cell(1, numInputs); for j = 1 : numInputs input = inputs{j}; - subjectInputs{j} = sprintf(input, subjectName); + % get number of times subject name is needed + subjectNameOccurences = count(input, '%s'); + [subjectNameArray{1:subjectNameOccurences}] = deal(subjectName); + subjectInputs{j} = sprintf(input, subjectNameArray{:}); end pathToSubjectWorkspace = fullfile(pathToWorkspace, subjectName); pathToSubjectOutput = fullfile(pathToOutput, subjectName); - sequences{i} = BuildRegisterParcellationSequence(subjectInputs, ... - subjectName, ... - pathToSubjectWorkspace, ... - pathToSubjectOutput, ... - config); + sequences{i} = BuildRegisterToStandardSequence(subjectInputs, ... + subjectName, ... + pathToSubjectWorkspace, ... + pathToSubjectOutput, ... + config); end % create a pipeline with the sequences diff --git a/src/matlab/builders/pipelines/BuildTransformParcellationPipeline.m b/src/matlab/builders/pipelines/BuildTransformParcellationPipeline.m new file mode 100644 index 0000000..1d65f7c --- /dev/null +++ b/src/matlab/builders/pipelines/BuildTransformParcellationPipeline.m @@ -0,0 +1,95 @@ +function [pipeline] = BuildTransformParcellationPipeline(parcellation, ... + pathToWorkspace, ... + pathToDataset, ... + pathToParcellations, ... + pathToIntermediaryOutputs, ... + pathToOutput, ... + numSubjects, ... + config) +%BUILDSAMPLEPIPELINE Example of a pipeline builder. +% This builder creates a pipeline with one sequence per subject, based +% on the format of a BIDS dataset's participants.tsv file. +% +% Input: +% - pathToWorkspace: Path to the workspace. +% - pathToDataset: Path to input the root of the BIDS dataset. +% - pathToOutput: Path to where we will output the data. +% +% Output: +% - pipeline: Built pipeline. + +arguments + parcellation char + pathToWorkspace char = '.' + pathToDataset char = '.' + pathToParcellations char = '.' + pathToIntermediaryOutputs char = '.' + pathToOutput char = '.' + numSubjects int8 {mustBeNonnegative} = 0 + config = {} +end + +% names of inputs needed to start the sequence +inputs = { ... + fullfile(pathToDataset, '%s/anat/%s_T1w.nii.gz'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_T1w_brain_mul.nii.gz'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_MNI2T1w_dof6.mat'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_MNI2T1w_dof12.mat'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_MNI2T1w_warp.nii.gz'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_T1w_brain_dof6.nii.gz'), ... + fullfile(pathToIntermediaryOutputs, '%s/%s_T1w_brain_dof12.nii.gz'), ... + fullfile(pathToParcellations, parcellation) }; +numInputs = length(inputs); + +% get information about participants +subjects = readtable(fullfile(pathToDataset, 'participants.tsv'), ... + 'Delimiter', ... + '\t', ... + 'FileType', ... + 'delimitedtext', ... + 'PreserveVariableNames', ... + true); + +tableHeight = height(subjects); +if ~numSubjects + numSubjects = tableHeight; +else + numSubjects = min(numSubjects, tableHeight); +end + +sequences = cell(1, numSubjects); + +% create a sequence for each subject +for i = 1 : numSubjects + % get data for one participant + subject = subjects(i, :); + + % participant_id is the column name and it's a cell + subjectName = subject.participant_id{1}; + + % create an input array for each sequence + subjectInputs = cell(1, numInputs); + for j = 1 : numInputs + input = inputs{j}; + % get number of times subject name is needed + subjectNameOccurences = count(input, '%s'); + [subjectNameArray{1:subjectNameOccurences}] = deal(subjectName); + subjectInputs{j} = sprintf(input, subjectNameArray{:}); + end + + pathToSubjectWorkspace = fullfile(pathToWorkspace, subjectName); + pathToSubjectOutput = fullfile(pathToOutput, subjectName); + sequences{i} = BuildTransformParcellationSequence(subjectInputs, ... + parcellation, ... + subjectName, ... + pathToSubjectWorkspace, ... + pathToSubjectOutput, ... + config); +end + +% create a pipeline with the sequences +parallel = false; +pipeline = Pipeline(sequences, parallel); + +end + diff --git a/src/matlab/builders/sequences/BuildRegisterParcellationSequence.m b/src/matlab/builders/sequences/BuildRegisterToStandardSequence.m similarity index 65% rename from src/matlab/builders/sequences/BuildRegisterParcellationSequence.m rename to src/matlab/builders/sequences/BuildRegisterToStandardSequence.m index 6c66bd0..ca0dbd9 100644 --- a/src/matlab/builders/sequences/BuildRegisterParcellationSequence.m +++ b/src/matlab/builders/sequences/BuildRegisterToStandardSequence.m @@ -1,9 +1,9 @@ -function [sequence] = BuildRegisterParcellationSequence(inputs, ... - subjectName, ... - pathToWorkspace, ... - pathToOutput, ... - config) -%BUILDREGISTERPARCELLATIONSEQUENCE Example of a sequence builder. +function [sequence] = BuildRegisterToStandardSequence(inputs, ... + subjectName, ... + pathToWorkspace, ... + pathToOutput, ... + config) +%BUILDREGISTERTOSTANDARDSEQUENCE Example of a sequence builder. % This builder creates the typical sequence to perform the registration % of a parcellation. % @@ -148,73 +148,6 @@ step8Config, ... outputs8); -%% step 9 -% dilate parcellation -step9Params = {}; -step9Config = config.step9; -step9Params.inputVolume = 'schaefer_2018_400_subc.nii'; -step9Params.outputVolume = 'schaefer_2018_400_subc_dil.nii.gz'; -deps9 = { step9Params.inputVolume }; -outputs9 = { step9Params.outputVolume }; -step9 = Step(@Dilate, ... - step9Params, ... - deps9, ... - step9Config, ... - outputs9); - -%% step 10 -% apply inverse warp to parcellation to go down to dof 12 -step10Params = {}; -step10Config = config.step10; -step10Params.inputVolume = 'schaefer_2018_400_subc_dil.nii.gz'; -step10Params.referenceVolume = sprintf('%s_T1w_brain_dof12.nii.gz', subjectName); -step10Params.warpVolume = sprintf('%s_MNI2T1w_warp.nii.gz', subjectName); -step10Params.outputVolume = 'schaefer_2018_400_subc_invwarp.nii.gz'; -deps10 = { step10Params.inputVolume, ... - step10Params.referenceVolume, ... - step10Params.warpVolume }; -outputs10 = { step10Params.outputVolume }; -step10 = Step(@ApplyWarp, ... - step10Params, ... - deps10, ... - step10Config, ... - outputs10); - -%% step 11 -% apply inverted dof 12 transform to parcellation to go down to dof 6 -step11Params = {}; -step11Config = config.step11; -step11Params.inputVolume = 'schaefer_2018_400_subc_invwarp.nii.gz'; -step11Params.referenceVolume = sprintf('%s_T1w_brain_dof6.nii.gz', subjectName); -step11Params.initMatrix = sprintf('%s_MNI2T1w_dof12.mat', subjectName); -step11Params.outputVolume = 'schaefer_2018_400_subc_invdof12.nii.gz'; -deps11 = { step11Params.inputVolume, ... - step11Params.referenceVolume, ... - step11Params.initMatrix }; -outputs11 = { step11Params.outputVolume }; -step11 = Step(@PerformLinearImageRegistration, ... - step11Params, ... - deps11, ... - step11Config, ... - outputs11); - -%% step 12 -% apply inverted dof 6 transform to parcellation to go down to native -step12Params = {}; -step12Config = config.step12; -step12Params.inputVolume = 'schaefer_2018_400_subc_invdof12.nii.gz'; -step12Params.referenceVolume = sprintf('%s_T1w_brain_mul.nii.gz', subjectName); -step12Params.initMatrix = sprintf('%s_MNI2T1w_dof6.mat', subjectName); -step12Params.outputVolume = 'schaefer_2018_400_subc_invdof6.nii.gz'; -deps12 = { step12Params.inputVolume, ... - step12Params.referenceVolume, ... - step12Params.initMatrix }; -outputs12 = { step12Params.outputVolume }; -step12 = Step(@PerformLinearImageRegistration, ... - step12Params, ... - deps12, ... - step12Config, ... - outputs12); %% prepare the sequence % set up steps in order @@ -225,11 +158,7 @@ step5, ... step6, ... step7, ... - step8, ... - step9, ... - step10, ... - step11, ... - step12 }; + step8 }; % these files will be copied from the workspace to the output path outputs = { sprintf('%s_T1w_brain_dof6.nii.gz', subjectName) ... @@ -242,11 +171,7 @@ step6Params.outputMatrix ... step7Params.outputImage ... step7Params.outputFieldCoefficients ... - step8Params.outputVolume ... - step9Params.outputVolume ... - step10Params.outputVolume ... - step11Params.outputVolume ... - step12Params.outputVolume }; + step8Params.outputVolume }; sequence = Sequence(steps, ... inputs, ... diff --git a/src/matlab/builders/sequences/BuildTransformParcellationSequence.m b/src/matlab/builders/sequences/BuildTransformParcellationSequence.m new file mode 100644 index 0000000..0ee7a5b --- /dev/null +++ b/src/matlab/builders/sequences/BuildTransformParcellationSequence.m @@ -0,0 +1,112 @@ +function [sequence] = BuildTransformParcellationSequence(inputs, ... + parcellation, ... + subjectName, ... + pathToWorkspace, ... + pathToOutput, ... + config) +%BUILDTRANSFORMPARCELLATIONSEQUENCE Example of a sequence builder. +% This builder creates a sequence that applies a registration to a given +% parcellation. +% +% Input: +% - inputs: Inputs that will be copied into the workspace. +% - pathToWorkspace: Path to the sequence's workspace. +% - pathToOutput: Path to where we will output the data. +% +% Output: +% - sequence: Built sequence. + +parcellationName = extractBefore(parcellation, '.'); + +%% step 1 +% dilate parcellation +step1Params = {}; +step1Config = config.step1; +step1Params.inputVolume = parcellation; +step1Params.outputVolume = sprintf('%s_dil.nii.gz', parcellationName); +deps1 = { step1Params.inputVolume }; +outputs1 = { step1Params.outputVolume }; +step1 = Step(@Dilate, ... + step1Params, ... + deps1, ... + step1Config, ... + outputs1); + +%% step 2 +% apply inverse warp to parcellation to go down to dof 12 +step2Params = {}; +step2Config = config.step2; +% support skipping step 1, so taking the parcellation directly as input +if isfield(config.step1, 'skip') && config.step1.skip + step2Params.inputVolume = parcellation; +else + step2Params.inputVolume = step1Params.outputVolume; +end +step2Params.referenceVolume = sprintf('%s_T1w_brain_dof12.nii.gz', subjectName); +step2Params.warpVolume = sprintf('%s_MNI2T1w_warp.nii.gz', subjectName); +step2Params.outputVolume = sprintf('%s_invwarp.nii.gz', parcellationName); +deps2 = { step2Params.inputVolume, ... + step2Params.referenceVolume, ... + step2Params.warpVolume }; +outputs2 = { step2Params.outputVolume }; +step2 = Step(@ApplyWarp, ... + step2Params, ... + deps2, ... + step2Config, ... + outputs2); + +%% step 3 +% apply inverted dof 12 transform to parcellation to go down to dof 6 +step3Params = {}; +step3Config = config.step3; +step3Params.inputVolume = step2Params.outputVolume; +step3Params.referenceVolume = sprintf('%s_T1w_brain_dof6.nii.gz', subjectName); +step3Params.initMatrix = sprintf('%s_MNI2T1w_dof12.mat', subjectName); +step3Params.outputVolume = sprintf('%s_invdof12.nii.gz', parcellationName); +deps3 = { step3Params.inputVolume, ... + step3Params.referenceVolume, ... + step3Params.initMatrix }; +outputs3 = { step3Params.outputVolume }; +step3 = Step(@PerformLinearImageRegistration, ... + step3Params, ... + deps3, ... + step3Config, ... + outputs3); + +%% step 4 +% apply inverted dof 6 transform to parcellation to go down to native +step4Params = {}; +step4Config = config.step4; +step4Params.inputVolume = step3Params.outputVolume; +step4Params.referenceVolume = sprintf('%s_T1w_brain_mul.nii.gz', subjectName); +step4Params.initMatrix = sprintf('%s_MNI2T1w_dof6.mat', subjectName); +step4Params.outputVolume = sprintf('%s_registered.nii.gz', parcellationName); +deps4 = { step4Params.inputVolume, ... + step4Params.referenceVolume, ... + step4Params.initMatrix }; +outputs4 = { step4Params.outputVolume }; +step4 = Step(@PerformLinearImageRegistration, ... + step4Params, ... + deps4, ... + step4Config, ... + outputs4); + + +%% prepare the sequence +% set up steps in order +steps = { step1, ... + step2, ... + step3, ... + step4 }; + +% these files will be copied from the workspace to the output path +outputs = { step4Params.outputVolume }; % registered parcellation + +sequence = Sequence(steps, ... + inputs, ... + outputs, ... + pathToWorkspace, ... + pathToOutput, ... + true); + +end diff --git a/src/matlab/scripts/registerToStandardScript.m b/src/matlab/scripts/registerToStandardScript.m new file mode 100644 index 0000000..b61135c --- /dev/null +++ b/src/matlab/scripts/registerToStandardScript.m @@ -0,0 +1,19 @@ +% ensure variables are cleared +clearvars; + +% ensure src/matlab and subfolders are in the path +filePath = fileparts(which(mfilename)); +addpath(genpath(fullfile(filePath, '../../matlab'))); + +% build configuration +config = BuildRegisterToStandardConfiguration(); + +pipeline = BuildRegisterToStandardPipeline(config.pathToWorkspace, ... + config.pathToDataset, ... + config.pathToParcellations, ... + config.pathToOutput, ... + config.pathToOutput, ... + config.numSubjects, ... + config); + +pipelineExecution = pipeline.run(); diff --git a/src/matlab/scripts/transformParcellationScript.m b/src/matlab/scripts/transformParcellationScript.m new file mode 100644 index 0000000..2b44692 --- /dev/null +++ b/src/matlab/scripts/transformParcellationScript.m @@ -0,0 +1,20 @@ +% ensure variables are cleared +clearvars; + +% ensure src/matlab and subfolders are in the path +filePath = fileparts(which(mfilename)); +addpath(genpath(fullfile(filePath, '../../matlab'))); + +% build configuration +config = BuildTransformParcellationConfiguration(); + +pipeline = BuildTransformParcellationPipeline(config.parcellation, ... + config.pathToWorkspace, ... + config.pathToDataset, ... + config.pathToParcellations, ... + config.pathToOutput, ... + config.pathToOutput, ... + config.numSubjects, ... + config); + +pipelineExecution = pipeline.run(); \ No newline at end of file