From fc2409c2a935a95b51f8c9bd69c722dcee042bdc Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 7 Sep 2020 00:11:57 +0200 Subject: [PATCH 01/21] small fix for FFX specification in case the prefix is just 'r' --- src/convertOnsetTsvToMat.m | 1 + src/createAndReturnOnsetFile.m | 8 +++++++- src/getRealignParamFile.m | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/convertOnsetTsvToMat.m b/src/convertOnsetTsvToMat.m index 2fef93d8..4f10c253 100644 --- a/src/convertOnsetTsvToMat.m +++ b/src/convertOnsetTsvToMat.m @@ -12,6 +12,7 @@ 'This onset tsv file deos not exist:', ... tsvFile); error(errorStruct); + end % Read the tsv file diff --git a/src/createAndReturnOnsetFile.m b/src/createAndReturnOnsetFile.m index b364439c..886d7e18 100644 --- a/src/createAndReturnOnsetFile.m +++ b/src/createAndReturnOnsetFile.m @@ -5,15 +5,21 @@ % % convert the tsv files to a mat file to be used by SPM + replacePrefixBy = ''; prefix = getPrefix('FFX', opt, funcFWHM); if strcmp(opt.space, 'T1w') prefix = getPrefix('FFX_space-T1w', opt, funcFWHM); end + if strcmp(prefix, 'r') + prefix = 'rsub-'; + replacePrefixBy = 'sub-'; + end + [funcDataDir, boldFileName] = spm_fileparts(boldFileName{1}); tsvFile = strrep(boldFileName, '_bold', '_events.tsv'); - tsvFile = strrep(tsvFile, prefix, ''); + tsvFile = strrep(tsvFile, prefix, replacePrefixBy); tsvFile = fullfile(funcDataDir, tsvFile); onsetFileName = convertOnsetTsvToMat(opt, tsvFile, isMVPA); diff --git a/src/getRealignParamFile.m b/src/getRealignParamFile.m index 88215a8e..44c9c619 100644 --- a/src/getRealignParamFile.m +++ b/src/getRealignParamFile.m @@ -5,6 +5,11 @@ [prefix, motionRegressorPrefix] = getPrefix('FFX_space-T1w', opt, funcFWHM); end + if strcmp(prefix, 'r') + prefix = 'rsub-'; + motionRegressorPrefix = 'sub-'; + end + [funcDataDir, boldFileName] = spm_fileparts(fullpathBoldFileName{1}); realignParamFile = strrep(boldFileName, prefix, motionRegressorPrefix); From 170aa9aee89a18a5996c0cee9b82beda97d4ca50 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Tue, 8 Sep 2020 14:12:33 +0200 Subject: [PATCH 02/21] refactor processing pipeline --- src/getFuncVoxelDims.m | 23 ++ src/saveMatlabBatch.m | 6 +- src/spmBatching/bidsResults.m | 5 +- src/spmBatching/bidsSmoothing.m | 2 +- src/spmBatching/bidsSpatialPrepro.m | 300 ++++------------------- src/spmBatching/setBatchCoregistration.m | 74 ++++++ src/spmBatching/setBatchRealign.m | 50 ++++ src/spmBatching/setBatchSegmentation.m | 61 +++++ src/unzipImgAndReturnsFullpathName.m | 18 ++ 9 files changed, 288 insertions(+), 251 deletions(-) create mode 100644 src/getFuncVoxelDims.m create mode 100644 src/spmBatching/setBatchCoregistration.m create mode 100644 src/spmBatching/setBatchRealign.m create mode 100644 src/spmBatching/setBatchSegmentation.m create mode 100644 src/unzipImgAndReturnsFullpathName.m diff --git a/src/getFuncVoxelDims.m b/src/getFuncVoxelDims.m new file mode 100644 index 00000000..15676a17 --- /dev/null +++ b/src/getFuncVoxelDims.m @@ -0,0 +1,23 @@ +function [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) + % [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) + % + % + + % get native resolution to reuse it at normalisation; + if ~isempty(opt.funcVoxelDims) % If voxel dimensions is defined in the opt + voxDim = opt.funcVoxelDims; % Get the dimension values + else + % SPM Doesnt deal with nii.gz and all our nii should be unzipped + % at this stage + hdr = spm_vol(fullfile(subFuncDataDir, [prefix, fileName])); + voxDim = diag(hdr(1).mat); + % Voxel dimensions are not pure integers before reslicing, therefore + % round the dimensions of the functional files to the 1st decimal point + voxDim = abs(voxDim(1:3)'); + voxDim = round(voxDim * 10) / 10; + % Add it to opt.funcVoxelDims to have the same value for + % all subjects and sessions + opt.funcVoxelDims = voxDim; + end + +end \ No newline at end of file diff --git a/src/saveMatlabBatch.m b/src/saveMatlabBatch.m index 30aee51b..c8602328 100644 --- a/src/saveMatlabBatch.m +++ b/src/saveMatlabBatch.m @@ -1,4 +1,4 @@ -function saveMatlabBatch(batch, batchType, opt, subID) +function saveMatlabBatch(matlabbatch, batchType, opt, subID) % saveMatlabBatch(batch, batchType, opt, subID) % % Also save some basic environnment info @@ -25,12 +25,12 @@ function saveMatlabBatch(batch, batchType, opt, subID) [OS, GeneratedBy] = getEnvInfo(); GeneratedBy(1).Description = batchType; - save(fullfile(jobsDir, filename), 'batch', 'OS', 'GeneratedBy'); + save(fullfile(jobsDir, filename), 'matlabbatch'); % write as json for more "human readibility" opts.indent = ' '; - json.matlabbach = batch; + json.matlabbach = matlabbatch; json.GeneratedBy = GeneratedBy; json.OS = OS; diff --git a/src/spmBatching/bidsResults.m b/src/spmBatching/bidsResults.m index ed43cd74..0a86cb54 100644 --- a/src/spmBatching/bidsResults.m +++ b/src/spmBatching/bidsResults.m @@ -115,6 +115,9 @@ function bidsResults(opt, funcFWHM, conFWHM, isMVPA) batch{end}.spm.stats.results.export{2}.nidm.modality = 'FMRI'; batch{end}.spm.stats.results.export{2}.nidm.refspace = 'ixi'; + if strcmp(opt.space, 'T1w') + batch{end}.spm.stats.results.export{2}.nidm.refspace = 'subject'; + end batch{end}.spm.stats.results.export{2}.nidm.group.nsubj = results.nbSubj; @@ -151,7 +154,7 @@ function bidsResults(opt, funcFWHM, conFWHM, isMVPA) disp({SPM.xCon.name}'); error( ... 'This SPM file %s does not contain a contrast named %s', ... - fullfile(Dir, 'SPM.mat'), ... + fullfile(ffxDir, 'SPM.mat'), ... opt.result.Steps(1).Contrasts(iCon).Name); end diff --git a/src/spmBatching/bidsSmoothing.m b/src/spmBatching/bidsSmoothing.m index c6a34665..07d4fa41 100644 --- a/src/spmBatching/bidsSmoothing.m +++ b/src/spmBatching/bidsSmoothing.m @@ -26,7 +26,7 @@ function bidsSmoothing(funcFWHM, opt) matlabbatch = setBatchSmoothing(BIDS, opt, subID, funcFWHM); - saveMatlabBatch(matlabbatch, 'Smoothing', opt, subID); + saveMatlabBatch(matlabbatch, ['Smoothing_FWHM-' num2str(funcFWHM)], opt, subID); spm_jobman('run', matlabbatch); diff --git a/src/spmBatching/bidsSpatialPrepro.m b/src/spmBatching/bidsSpatialPrepro.m index edc1ee18..5c7b3e7f 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -1,199 +1,84 @@ function bidsSpatialPrepro(opt) - %% The scripts performs spatial preprocessing of the functional and structural data. + % bidsSpatialPrepro(opt) + % + % Performs spatial preprocessing of the functional and structural data. % The structural data are segmented and normalized to MNI space. % The functional data are re-aligned, coregistered with the structural and % normalized to MNI space. - - %% TO DO - % find a way to paralelize this over subjects - + % + % The + % + % Assumptions: + % - will take the first T1w images as reference + % - assume the anatomical T1w to use for normalization is in the + % first session + % - the batch is build using dependencies across the different batch modules + + % TO DO + % - find a way to paralelize this over subjects + % - average T1s across sessions if necessarry + + % Indicate which session the structural data was collected + structSession = 1; + % if input has no opt, load the opt.mat file if nargin < 1 load('opt.mat'); fprintf('opt.mat file loaded \n\n'); end - + % load the subjects/Groups information and the task name [group, opt, BIDS] = getData(opt); - - % Indicate which session the structural data was collected - structSession = 1; - - % creates prefix to look for - prefix = getPrefix('preprocess', opt); - + fprintf(1, 'DOING PREPROCESSING\n'); - + %% Loop through the groups, subjects, and sessions for iGroup = 1:length(group) - + groupName = group(iGroup).name; - + for iSub = 1:group(iGroup).numSub - + matlabbatch = []; % Get the ID of the subject % (i.e SubNumber doesnt have to match the iSub if one subject % is exluded for any reason) subID = group(iGroup).subNumber{iSub}; % Get the subject ID - + printProcessingSubject(groupName, iSub, subID); - + % identify sessions for this subject - [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); - - % get all runs for that subject across all sessions + [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); + + fprintf(1, ' BUILDING SPATIAL JOB : SELECTING ANATOMCAL\n'); + % get all T1w images for that subject and anat = spm_BIDS(BIDS, 'data', ... 'sub', subID, ... 'ses', sessions{structSession}, ... 'type', 'T1w'); + % we assume that the first T1w is the correct one (could be an % issue for dataset with more than one anat = anat{1}; - - %% Structural file directory - [subStrucDataDir, structFile, ext] = spm_fileparts(anat); - - if strcmp(ext, '.gz') - % unzip nii.gz structural file to be read by SPM - anat = load_untouch_nii(anat); - save_untouch_nii(anat, fullfile(subStrucDataDir, structFile)); - [anatImage] = fullfile(subStrucDataDir, structFile); - else - [anatImage] = fullfile(subStrucDataDir, [structFile ext]); - end - - % NAMED FILE SELECTOR + anatImage = unzipImgAndReturnsFullpathName(anat); + matlabbatch{1}.cfg_basicio.cfg_named_file.name = 'Anatomical'; matlabbatch{1}.cfg_basicio.cfg_named_file.files = { {anatImage} }; - - %% REALIGN + fprintf(1, ' BUILDING SPATIAL JOB : REALIGN\n'); - sesCounter = 1; - - for iSes = 1:nbSessions % For each session - - % get all runs for that subject across all sessions - [runs, nbRuns] = getInfo(BIDS, subID, opt, 'Runs', sessions{iSes}); - - for iRun = 1:nbRuns % For each run - - % get the filename for this bold run for this task - [fileName, subFuncDataDir] = getBoldFilename( ... - BIDS, ... - subID, sessions{iSes}, runs{iRun}, opt); - - % check that the file with the right prefix exist - files = inputFileValidation(subFuncDataDir, prefix, fileName); - - [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); - - fprintf(1, ' %s\n', files{1}); - - matlabbatch{2}.spm.spatial.realign.estwrite.data{sesCounter} = ... - cellstr(files); - - sesCounter = sesCounter + 1; - - end - end - - matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.weight = {''}; - - % The following lines are commented out because those parameters - % can be set in the spm_my_defaults.m - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.quality = 1; - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.sep = 2; - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.fwhm = 5; - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.rtm = 1; - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.interp = 2; - % matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0]; - % matlabbatch{2}.spm.spatial.realign.estwrite.roptions.which = [0 1]; - % matlabbatch{2}.spm.spatial.realign.estwrite.roptions.interp = 3; - % matlabbatch{2}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0]; - % matlabbatch{2}.spm.spatial.realign.estwrite.roptions.mask = 1; + [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt); - %% COREGISTER - % REFERENCE IMAGE : DEPENDENCY FROM NAMED FILE SELECTOR ('Structural') fprintf(1, ' BUILDING SPATIAL JOB : COREGISTER\n'); - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).name = 'class'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).value = 'cfg_files'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).name = 'strtype'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).value = 'e'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).sname = ... - 'Named File Selector: Structural(1) - Files'; - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).src_exbranch = ... - substruct( ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}); - matlabbatch{3}.spm.spatial.coreg.estimate.ref(1).src_output = ... - substruct('.', 'files', '{}', {1}); - - % SOURCE IMAGE : DEPENDENCY FROM REALIGNEMENT - % ('Realign: Estimate & Reslice: Mean Image') - matlabbatch{3}.spm.spatial.coreg.estimate.source(1) = cfg_dep; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).tname = 'Source Image'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).name = 'filter'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).value = 'image'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).name = 'strtype'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).value = 'e'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).sname = ... - 'Realign: Estimate & Reslice: Mean Image'; - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).src_exbranch = ... - substruct( ... - '.', 'val', '{}', {2}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}); - matlabbatch{3}.spm.spatial.coreg.estimate.source(1).src_output = ... - substruct('.', 'rmean'); - - % OTHER IMAGES : DEPENDENCY FROM REALIGNEMENT ('Realign: Estimate & Reslice: - % Realigned Images (Sess 1 to N)') - % files %% - for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).name = ... - 'filter'; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).value = ... - 'image'; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).name = ... - 'strtype'; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).value = ... - 'e'; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).sname = ... - ['Realign: Estimate & Reslice: Realigned Images (Sess ' (iSes) ')']; - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).src_exbranch = ... - substruct( ... - '.', 'val', '{}', {2}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}); - matlabbatch{3}.spm.spatial.coreg.estimate.other(iSes).src_output = ... - substruct('.', 'sess', '()', {iSes}, '.', 'cfiles'); - end - - % The following lines are commented out because those parameters - % can be set in the spm_my_defaults.m - % matlabbatch{3}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi'; - % matlabbatch{3}.spm.spatial.coreg.estimate.eoptions.sep = [4 2]; - % matlabbatch{3}.spm.spatial.coreg.estimate.eoptions.tol = ... - % [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001]; - % matlabbatch{3}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7]; - - %% SEGMENT STRUCTURALS + % REFERENCE IMAGE : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') + matlabbatch = setBatchCoregistration(matlabbatch); + + fprintf(1, ' BUILDING SPATIAL JOB : SEGMENT ANATOMICAL\n'); % (WITH NEW SEGMENT -DEFAULT SEGMENT IN SPM12) % DATA : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') - fprintf(1, ' BUILDING SPATIAL JOB : SEGMENT STRUCTURAL\n'); - matlabbatch = setBatchSegmentation(matlabbatch); - - %% NORMALIZE FUNCTIONALS + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE FUNCTIONALS\n'); - + for iJob = 5:9 matlabbatch{iJob}.spm.spatial.normalise.write.subj.def(1) = ... cfg_dep('Segment: Forward Deformations', ... @@ -202,7 +87,7 @@ function bidsSpatialPrepro(opt) '.', 'val', '{}', {1}, ... '.', 'val', '{}', {1}), ... substruct('.', 'fordef', '()', {':'})); - + % The following lines are commented out because those parameters % can be set in the spm_my_defaults.m % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.bb = ... @@ -210,9 +95,9 @@ function bidsSpatialPrepro(opt) % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.interp = 4; % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.prefix = ... % spm_get_defaults('normalise.write.prefix'); - + end - + matlabbatch{5}.spm.spatial.normalise.write.subj.resample(1) = ... cfg_dep('Coregister: Estimate: Coregistered Images', ... substruct( ... @@ -221,10 +106,10 @@ function bidsSpatialPrepro(opt) '.', 'val', '{}', {1}, ... '.', 'val', '{}', {1}), ... substruct('.', 'cfiles')); - + % original voxel size at acquisition matlabbatch{5}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE STRUCTURAL fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE STRUCTURAL\n'); matlabbatch{6}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -238,7 +123,7 @@ function bidsSpatialPrepro(opt) '.', 'biascorr', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{6}.spm.spatial.normalise.write.woptions.vox = [1 1 1]; - + % NORMALIZE GREY MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE GREY MATTER\n'); matlabbatch{7}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -252,7 +137,7 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{7}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE WHITE MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE WHITE MATTER\n'); matlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -266,7 +151,7 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{8}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE CSF MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE CSF\n'); matlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -280,93 +165,16 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{9}.spm.spatial.normalise.write.woptions.vox = voxDim; - + saveMatlabBatch(matlabbatch, 'spatialPreprocessing', opt, subID); - + spm_jobman('run', matlabbatch); - + end end - -end - -function [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) - - % get native resolution to reuse it at normalisation; - if ~isempty(opt.funcVoxelDims) % If voxel dimensions is defined in the opt - voxDim = opt.funcVoxelDims; % Get the dimension values - else - % SPM Doesnt deal with nii.gz and all our nii will be unzipped - % at this stage - hdr = spm_vol(fullfile(subFuncDataDir, [prefix, fileName])); - voxDim = diag(hdr(1).mat); - % Voxel dimensions are not pure integers before reslicing, therefore - % Round the dimensions of the functional files to the 1st decimal point - voxDim = abs(voxDim(1:3)'); - voxDim = round(voxDim * 10) / 10; - % Add it to opt.funcVoxelDims to have the same value for - % all subjects and sessions - opt.funcVoxelDims = voxDim; - end + end -function matlabbatch = setBatchSegmentation(matlabbatch) - % define SPM folder - spmLocation = spm('dir'); - % SAVE BIAS CORRECTED IMAGE - matlabbatch{4}.spm.spatial.preproc.channel.vols(1) = ... - cfg_dep('Named File Selector: Structural(1) - Files', ... - substruct( ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct('.', 'files', '{}', {1})); - matlabbatch{4}.spm.spatial.preproc.channel.biasreg = 0.001; - matlabbatch{4}.spm.spatial.preproc.channel.biasfwhm = 60; - matlabbatch{4}.spm.spatial.preproc.channel.write = [0 1]; - % CREATE SEGMENTS IN NATIVE SPACE OF GM,WM AND CSF - % (CSF - in case I want to compute TIV later - stefbenet) - matlabbatch{4}.spm.spatial.preproc.tissue(1).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',1']}; - matlabbatch{4}.spm.spatial.preproc.tissue(1).ngaus = 1; - matlabbatch{4}.spm.spatial.preproc.tissue(1).native = [1 1]; - matlabbatch{4}.spm.spatial.preproc.tissue(1).warped = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(2).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',2']}; - matlabbatch{4}.spm.spatial.preproc.tissue(2).ngaus = 1; - matlabbatch{4}.spm.spatial.preproc.tissue(2).native = [1 1]; - matlabbatch{4}.spm.spatial.preproc.tissue(2).warped = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(3).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',3']}; - matlabbatch{4}.spm.spatial.preproc.tissue(3).ngaus = 2; - matlabbatch{4}.spm.spatial.preproc.tissue(3).native = [1 1]; - matlabbatch{4}.spm.spatial.preproc.tissue(3).warped = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(4).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',4']}; - matlabbatch{4}.spm.spatial.preproc.tissue(4).ngaus = 3; - matlabbatch{4}.spm.spatial.preproc.tissue(4).native = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(4).warped = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(5).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',5']}; - matlabbatch{4}.spm.spatial.preproc.tissue(5).ngaus = 4; - matlabbatch{4}.spm.spatial.preproc.tissue(5).native = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(5).warped = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(6).tpm = ... - {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',6']}; - matlabbatch{4}.spm.spatial.preproc.tissue(6).ngaus = 2; - matlabbatch{4}.spm.spatial.preproc.tissue(6).native = [0 0]; - matlabbatch{4}.spm.spatial.preproc.tissue(6).warped = [0 0]; - - % SAVE FORWARD DEFORMATION FIELD FOR NORMALISATION - matlabbatch{4}.spm.spatial.preproc.warp.mrf = 1; - matlabbatch{4}.spm.spatial.preproc.warp.cleanup = 1; - matlabbatch{4}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2]; - matlabbatch{4}.spm.spatial.preproc.warp.affreg = 'mni'; - matlabbatch{4}.spm.spatial.preproc.warp.fwhm = 0; - matlabbatch{4}.spm.spatial.preproc.warp.samp = 3; - matlabbatch{4}.spm.spatial.preproc.warp.write = [1 1]; -end diff --git a/src/spmBatching/setBatchCoregistration.m b/src/spmBatching/setBatchCoregistration.m new file mode 100644 index 00000000..e8f20158 --- /dev/null +++ b/src/spmBatching/setBatchCoregistration.m @@ -0,0 +1,74 @@ +function matlabbatch = setBatchCoregistration(matlabbatch) + + matlabbatch{end+1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).name = 'class'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).value = 'cfg_files'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).name = 'strtype'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).value = 'e'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).sname = ... + 'Named File Selector: Structural(1) - Files'; + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).src_output = ... + substruct('.', 'files', '{}', {1}); + + % SOURCE IMAGE : DEPENDENCY FROM REALIGNEMENT + % ('Realign: Estimate & Reslice: Mean Image') + matlabbatch{end}.spm.spatial.coreg.estimate.source(1) = cfg_dep; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).tname = 'Source Image'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).name = 'filter'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).value = 'image'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).name = 'strtype'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).value = 'e'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).sname = ... + 'Realign: Estimate & Reslice: Mean Image'; + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {2}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + matlabbatch{end}.spm.spatial.coreg.estimate.source(1).src_output = ... + substruct('.', 'rmean'); + + % OTHER IMAGES : DEPENDENCY FROM REALIGNEMENT ('Realign: Estimate & Reslice: + % Realigned Images (Sess 1 to N)') + % files %% + for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).name = ... + 'filter'; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).value = ... + 'image'; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).name = ... + 'strtype'; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).value = ... + 'e'; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).sname = ... + ['Realign: Estimate & Reslice: Realigned Images (Sess ' (iSes) ')']; + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {2}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).src_output = ... + substruct(... + '.', 'sess', '()', {iSes}, ... + '.', 'cfiles'); + end + + % The following lines are commented out because those parameters + % can be set in the spm_my_defaults.m + % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi'; + % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.sep = [4 2]; + % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.tol = ... + % [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001]; + % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7]; + +end + diff --git a/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m new file mode 100644 index 00000000..49bf0fc6 --- /dev/null +++ b/src/spmBatching/setBatchRealign.m @@ -0,0 +1,50 @@ +function [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt) + + matlabbatch{end+1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; + + [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); + + sesCounter = 1; + + for iSes = 1:nbSessions + + % get all runs for that subject across all sessions + [runs, nbRuns] = getInfo(BIDS, subID, opt, 'Runs', sessions{iSes}); + + for iRun = 1:nbRuns + + % get the filename for this bold run for this task + [fileName, subFuncDataDir] = getBoldFilename( ... + BIDS, ... + subID, sessions{iSes}, runs{iRun}, opt); + + % check that the file with the right prefix exist and we get and + % save its voxeldimension + prefix = getPrefix('preprocess', opt); + files = inputFileValidation(subFuncDataDir, prefix, fileName); + [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); + + fprintf(1, ' %s\n', files{1}); + + matlabbatch{end}.spm.spatial.realign.estwrite.data{sesCounter} = ... + cellstr(files); + + sesCounter = sesCounter + 1; + + end + end + + % The following lines are commented out because those parameters + % can be set in the spm_my_defaults.m + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.quality = 1; + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.sep = 2; + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.fwhm = 5; + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.rtm = 1; + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.interp = 2; + % matlabbatch{end}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0]; + % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.which = [0 1]; + % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.interp = 3; + % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0]; + % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.mask = 1; + +end \ No newline at end of file diff --git a/src/spmBatching/setBatchSegmentation.m b/src/spmBatching/setBatchSegmentation.m new file mode 100644 index 00000000..be33fcda --- /dev/null +++ b/src/spmBatching/setBatchSegmentation.m @@ -0,0 +1,61 @@ +function matlabbatch = setBatchSegmentation(matlabbatch) + + % define SPM folder + spmLocation = spm('dir'); + + % SAVE BIAS CORRECTED IMAGE + matlabbatch{end+1}.spm.spatial.preproc.channel.vols(1) = ... + cfg_dep('Named File Selector: Structural(1) - Files', ... + substruct( ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'files', '{}', {1})); + matlabbatch{end}.spm.spatial.preproc.channel.biasreg = 0.001; + matlabbatch{end}.spm.spatial.preproc.channel.biasfwhm = 60; + matlabbatch{end}.spm.spatial.preproc.channel.write = [0 1]; + + % CREATE SEGMENTS IN NATIVE SPACE OF GM,WM AND CSF + % (CSF - in case I want to compute TIV later - stefbenet) + matlabbatch{end}.spm.spatial.preproc.tissue(1).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',1']}; + matlabbatch{end}.spm.spatial.preproc.tissue(1).ngaus = 1; + matlabbatch{end}.spm.spatial.preproc.tissue(1).native = [1 1]; + matlabbatch{end}.spm.spatial.preproc.tissue(1).warped = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(2).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',2']}; + matlabbatch{end}.spm.spatial.preproc.tissue(2).ngaus = 1; + matlabbatch{end}.spm.spatial.preproc.tissue(2).native = [1 1]; + matlabbatch{end}.spm.spatial.preproc.tissue(2).warped = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(3).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',3']}; + matlabbatch{end}.spm.spatial.preproc.tissue(3).ngaus = 2; + matlabbatch{end}.spm.spatial.preproc.tissue(3).native = [1 1]; + matlabbatch{end}.spm.spatial.preproc.tissue(3).warped = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(4).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',4']}; + matlabbatch{end}.spm.spatial.preproc.tissue(4).ngaus = 3; + matlabbatch{end}.spm.spatial.preproc.tissue(4).native = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(4).warped = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(5).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',5']}; + matlabbatch{end}.spm.spatial.preproc.tissue(5).ngaus = 4; + matlabbatch{end}.spm.spatial.preproc.tissue(5).native = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(5).warped = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(6).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',6']}; + matlabbatch{end}.spm.spatial.preproc.tissue(6).ngaus = 2; + matlabbatch{end}.spm.spatial.preproc.tissue(6).native = [0 0]; + matlabbatch{end}.spm.spatial.preproc.tissue(6).warped = [0 0]; + + % SAVE FORWARD DEFORMATION FIELD FOR NORMALISATION + matlabbatch{end}.spm.spatial.preproc.warp.mrf = 1; + matlabbatch{end}.spm.spatial.preproc.warp.cleanup = 1; + matlabbatch{end}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2]; + matlabbatch{end}.spm.spatial.preproc.warp.affreg = 'mni'; + matlabbatch{end}.spm.spatial.preproc.warp.fwhm = 0; + matlabbatch{end}.spm.spatial.preproc.warp.samp = 3; + matlabbatch{end}.spm.spatial.preproc.warp.write = [1 1]; +end + diff --git a/src/unzipImgAndReturnsFullpathName.m b/src/unzipImgAndReturnsFullpathName.m new file mode 100644 index 00000000..250710ff --- /dev/null +++ b/src/unzipImgAndReturnsFullpathName.m @@ -0,0 +1,18 @@ +function unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) + % unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) + % + % + + [directory, filename, ext] = spm_fileparts(fullpathImgName); + + if strcmp(ext, '.gz') + % unzip nii.gz structural file to be read by SPM + fullpathImgName = load_untouch_nii(fullpathImgName); + save_untouch_nii(fullpathImgName, fullfile(directory, filename)); + [unzippedFullpathImgName] = fullfile(directory, filename); + + else + [unzippedFullpathImgName] = fullfile(directory, [filename ext]); + + end +end \ No newline at end of file From 32946c35c1d510b5670c22c1a165223da965f0ad Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 12:33:57 +0200 Subject: [PATCH 03/21] update readme and add bids-matlab submodule --- .gitmodules | 3 +++ README.md | 13 +++++++++++++ lib/bids-matlab | 1 + 3 files changed, 17 insertions(+) create mode 100644 .gitmodules create mode 160000 lib/bids-matlab diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..75d45327 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/bids-matlab"] + path = lib/bids-matlab + url = https://github.com/cpp-lln-lab/bids-matlab.git diff --git a/README.md b/README.md index 6636e0a0..96df16c9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ - [Assumption](#assumption) - [Setting up](#setting-up) - [getOptions](#getoptions) + - [spm_my_defaults](#spm_my_defaults) - [model JSON files](#model-json-files) - [Order of the analysis](#order-of-the-analysis) - [Docker](#docker) @@ -126,8 +127,20 @@ Set the task to analyze in the BIDS data set The directory where your files are located on your computer: make sure you have a copy of the data set as this pipeline will change it. `opt.derivativesDir = '/Data/auditoryBIDS/derivatives'` +#### spm_my_defaults + + Some more SPM options can be set in the `spm_my_defaults.m`. +- Use of FAST and not AR1 for auto-correlation modelisation + +Using FAST does not seem to affect results on time series with "normal" TRs but +improves results when using sequences: it is therefore used by default in this +pipeline. + +> Olszowy, W., Aston, J., Rua, C. et al. Accurate autocorrelation modeling +> substantially improves fMRI reliability. Nat Commun 10, 1220 (2019). +> https://doi.org/10.1038/s41467-019-09230-w ### model JSON files This files allow you to specify which contrasts to run and follow the BIDS statistical model extension and as implement by [fitlins](https://fitlins.readthedocs.io/en/latest/model.html) diff --git a/lib/bids-matlab b/lib/bids-matlab new file mode 160000 index 00000000..dd04a370 --- /dev/null +++ b/lib/bids-matlab @@ -0,0 +1 @@ +Subproject commit dd04a3709dcbfd04255cd43ef1caced94872ddc8 From 7a148c30cca7192cd96d89adcc74ad5ff311cf21 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 12:34:54 +0200 Subject: [PATCH 04/21] add manual coregistration tool --- src/mancoreg/mancoreg.m | 180 +++++++++++++++++++++ src/mancoreg/mancoreg_callbacks.m | 252 ++++++++++++++++++++++++++++++ 2 files changed, 432 insertions(+) create mode 100644 src/mancoreg/mancoreg.m create mode 100644 src/mancoreg/mancoreg_callbacks.m diff --git a/src/mancoreg/mancoreg.m b/src/mancoreg/mancoreg.m new file mode 100644 index 00000000..1c499f0f --- /dev/null +++ b/src/mancoreg/mancoreg.m @@ -0,0 +1,180 @@ +function mancoreg(targetimage,sourceimage); +% +% Manual coregistration tool +% +% FORMAT mancoreg(targetimage,sourceimage); +% +%---------------------------------------------------------------------------- +% This function displays 2 ortho views of a TARGET and +% a SOURCE image that can be manually coregistered. +% +% The source image (bottom graph) can be manually +% rotated and translated with 6 slider controls. In the source +% graph the source image can be exchanged with the target image +% using a radio button toggle. This is helpful for visual fine control +% of the coregistration. The transformation matrix can be applied +% to a selected set of volumes with the "apply transformation" button. +% If the transformation is to be applied to the original source file +% that file will also need to be selected. If the sourceimage or +% targetimage are not passed the user will be prompted with a file browser. +% +% The code is loosely based on spm_image.m and spm_orthoviews.m +% It requires the m-file with the callback functions for the user +% controls (mancoreg_callbacks.m). +%---------------------------------------------------------------------------- +% JH 10.01.2004 +% modified DSS 10/02/2009 +% +% Change LOG +% +% Version 1.0.1 +% Radio button cannot be turned off on matlab for linux (6.5.0). Changed to +% two radio buttons for toggle on/off (12.1.2004, JH) +% +% Version 1.0.2 +% Added: Plot of transformation matrix, values are shown next to sliders +% and "reset transformation" button (12.1.2004, JH) +% +% Version 1.0.3 +% Added: Made compatible with SPM5 and corrected "Yawn" (altho I like it) + +global st mancoregvar + +%% Make sure we have both image filenames and map images +%---------------------------------------------------------------------------- + +if ~exist('targetimage') + targetimage=spm_select(1,'image','Please select target image') +end + +if ~exist('sourceimage') + sourceimage=spm_select(1,'image','Please select source image') +end; + +targetvol=spm_vol(targetimage); +sourcevol=spm_vol(sourceimage); + + +%% Init graphics window +%---------------------------------------------------------------------------- + +fg = spm_figure('Findwin','Graphics'); +if isempty(fg) + fg=spm_figure('Create','Graphics'); + if isempty(fg), + error('Cant create graphics window'); + end; +else + spm_figure('Clear','Graphics'); +end; +WS = spm('WinScale'); + +htargetstim=spm_orthviews('Image',targetvol,[0.1 0.55 0.45 0.48]); + spm_orthviews('space'); + spm_orthviews('AddContext',htargetstim); + +hsourcestim=spm_orthviews('Image',sourcevol,[0.1 0.08 0.45 0.48]); + spm_orthviews('AddContext',hsourcestim); + +spm_orthviews('maxbb'); + +mancoregvar.targetimage=st.vols{1}; +mancoregvar.sourceimage=st.vols{2}; + +%% Define and initialise all user controls +%---------------------------------------------------------------------------- + +% 1.a Titles and boxes + +uicontrol(fg,'style','text','string','Manual coregistration tool','position',[200 825 200 30].*WS,'Fontsize',16,'backgroundcolor',[1 1 1]); + +uicontrol(fg,'style','frame','position',[360 750 240 60].*WS); +uicontrol(fg,'style','frame','position',[360 40 240 410].*WS); + +uicontrol(fg,'style','text','string','TARGET IMAGE','position',[370 780 80 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string',targetimage,'position',[370 760 220 019].*WS,'Fontsize',10); + +uicontrol(fg,'style','text','string','SOURCE IMAGE','position',[370 415 80 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string',sourceimage,'position',[370 395 220 019].*WS,'Fontsize',10); + +% 1.b Transformation matrix + +uicontrol(fg,'style','text','string','transf.','position',[370 360 40 015].*WS,'Fontsize',10); +mancoregvar.hmat_1_1=uicontrol(fg,'style','text','string','1.00','position',[415 360 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_1_2=uicontrol(fg,'style','text','string','0.00','position',[460 360 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_1_3=uicontrol(fg,'style','text','string','0.00','position',[505 360 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_1_4=uicontrol(fg,'style','text','string','0.00','position',[550 360 40 015].*WS,'Fontsize',8); + +mancoregvar.hmat_2_1=uicontrol(fg,'style','text','string','0.00','position',[415 340 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_2_2=uicontrol(fg,'style','text','string','1.00','position',[460 340 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_2_3=uicontrol(fg,'style','text','string','0.00','position',[505 340 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_2_4=uicontrol(fg,'style','text','string','0.00','position',[550 340 40 015].*WS,'Fontsize',8); + +mancoregvar.hmat_3_1=uicontrol(fg,'style','text','string','0.00','position',[415 320 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_3_2=uicontrol(fg,'style','text','string','0.00','position',[460 320 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_3_3=uicontrol(fg,'style','text','string','1.00','position',[505 320 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_3_4=uicontrol(fg,'style','text','string','0.00','position',[550 320 40 015].*WS,'Fontsize',8); + +mancoregvar.hmat_4_1=uicontrol(fg,'style','text','string','0.00','position',[415 300 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_4_2=uicontrol(fg,'style','text','string','0.00','position',[460 300 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_4_3=uicontrol(fg,'style','text','string','0.00','position',[505 300 40 015].*WS,'Fontsize',8); +mancoregvar.hmat_4_4=uicontrol(fg,'style','text','string','1.00','position',[550 300 40 015].*WS,'Fontsize',8); + + +%% 2. Rotation sliders + +mancoregvar.hpitch = uicontrol(fg,'style','slider','position',[430 250 100 019].*WS,'Value',0,... + 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); +mancoregvar.hroll = uicontrol(fg,'style','slider','position',[430 225 100 019].*WS,'Value',0,... + 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); +mancoregvar.hyaw = uicontrol(fg,'style','slider','position',[430 200 100 019].*WS,'Value',0,... + 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); + +uicontrol(fg,'style','text','string','PITCH','position',[370 250 60 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string','ROLL','position',[370 225 60 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string','YAW','position',[370 200 60 019].*WS,'Fontsize',10); + +mancoregvar.hpitch_val=uicontrol(fg,'style','text','string','0','position',[530 250 60 019].*WS,'Fontsize',10); +mancoregvar.hroll_val=uicontrol(fg,'style','text','string','0','position',[530 225 60 019].*WS,'Fontsize',10); +mancoregvar.hyaw_val=uicontrol(fg,'style','text','string','0','position',[530 200 60 019].*WS,'Fontsize',10); + +%% 3. Translation sliders + +mancoregvar.hx = uicontrol(fg,'style','slider','position',[430 175 100 019].*WS,'Value',0,... + 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); +mancoregvar.hy = uicontrol(fg,'style','slider','position',[430 150 100 019].*WS,'Value',0,... + 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); +mancoregvar.hz = uicontrol(fg,'style','slider','position',[430 125 100 019].*WS,'Value',0,... + 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); + +uicontrol(fg,'style','text','string','X','position',[370 175 60 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string','Y','position',[370 150 60 019].*WS,'Fontsize',10); +uicontrol(fg,'style','text','string','Z','position',[370 125 60 019].*WS,'Fontsize',10); + +mancoregvar.hx_val=uicontrol(fg,'style','text','string','0','position',[530 175 60 019].*WS,'Fontsize',10); +mancoregvar.hy_val=uicontrol(fg,'style','text','string','0','position',[530 150 60 019].*WS,'Fontsize',10); +mancoregvar.hz_val=uicontrol(fg,'style','text','string','0','position',[530 125 60 019].*WS,'Fontsize',10); + +%% 4. Source/target display toggle + +mancoregvar.htoggle_off = uicontrol(fg,'style','radiobutton','position',[470 100 040 019].*WS,'Value',1,... + 'Callback','mancoreg_callbacks(''toggle_off'')','string','OFF'); +mancoregvar.htoggle_on = uicontrol(fg,'style','radiobutton','position',[530 100 060 019].*WS,'Value',0,... + 'Callback','mancoreg_callbacks(''toggle_on'')','string','ON'); + +%% 5. "Reset transformation" pushbutton + +mancoregvar.hreset = uicontrol(fg,'style','pushbutton','position',[370 75 220 019].*WS,'String','Reset transformation',... + 'Callback','mancoreg_callbacks(''reset'')'); + +%% 6. "Apply transformation" pushbutton + +mancoregvar.hwrite = uicontrol(fg,'style','pushbutton','position',[370 50 220 019].*WS,'String','Apply transformation',... + 'Callback','mancoreg_callbacks(''apply'')'); + + +%% Fill in "transf." fields + +mancoreg_callbacks('plotmat'); + +return \ No newline at end of file diff --git a/src/mancoreg/mancoreg_callbacks.m b/src/mancoreg/mancoreg_callbacks.m new file mode 100644 index 00000000..25d0454a --- /dev/null +++ b/src/mancoreg/mancoreg_callbacks.m @@ -0,0 +1,252 @@ +function mancoreg_callbacks(op,varargin); +% +% Callback routines for mancoreg.m +% +% Change LOG +% +% Version 1.0.1 +% Radio button cannot be turned off on matlab for linux (6.5.0). Changed to +% two radio buttons for toggle on/off (12.1.2004, JH) +% +% Version 1.0.2 +% Added: Plot of transformation matrix, values are shown next to sliders +% and "reset transformation" button (12.1.2004, JH) +% + + global st mancoregvar; + + +% 'move' +% Update the position of the bottom (source) image according to user settings +%---------------------------------------------------------------------------- + + if strcmp(op,'move'), + + angl_pitch=get(mancoregvar.hpitch,'Value'); + angl_roll=get(mancoregvar.hroll,'Value'); + angl_yaw=get(mancoregvar.hyaw,'Value'); + + dist_x=get(mancoregvar.hx,'Value'); + dist_y=get(mancoregvar.hy,'Value'); + dist_z=get(mancoregvar.hz,'Value'); + + set(mancoregvar.hpitch_val,'string',num2str(angl_pitch)); + set(mancoregvar.hroll_val,'string',num2str(angl_roll)); + set(mancoregvar.hyaw_val,'string',num2str(angl_yaw)); + + set(mancoregvar.hx_val,'string',num2str(dist_x)); + set(mancoregvar.hy_val,'string',num2str(dist_y)); + set(mancoregvar.hz_val,'string',num2str(dist_z)); + + mancoregvar.sourceimage.premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + if (get(mancoregvar.htoggle_on,'value')==0) % source is currently displayed + st.vols{2}.premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + end + + plotmat; + spm_orthviews('redraw'); + + return + end + + +% 'toggle_off' +% Toggles between source and target display in bottom window +%-------------------------------------------------------------------------- + +if strcmp(op,'toggle_off'), + + if (get(mancoregvar.htoggle_off,'value')==0) % Source is to be displayed + + set(mancoregvar.htoggle_off,'value',1); + + else + + set(mancoregvar.htoggle_on,'value',0); + st.vols{2}=mancoregvar.sourceimage; + spm_orthviews('redraw'); + + + end + + return + end + + +% 'toggle_on' +% Toggles between source and target display in bottom window +%-------------------------------------------------------------------------- + +if strcmp(op,'toggle_on'), + + if (get(mancoregvar.htoggle_on,'value')==0) % Source is to be displayed + + set(mancoregvar.htoggle_on,'value',1); + + else + set(mancoregvar.htoggle_off,'value',0); + mancoregvar.sourceimage=st.vols{2}; % Backup current state + st.vols{2}=st.vols{1}; + st.vols{2}.ax=mancoregvar.sourceimage.ax; % These have to stay the same + st.vols{2}.window=mancoregvar.sourceimage.window; + st.vols{2}.area=mancoregvar.sourceimage.area; + spm_orthviews('redraw'); + end + + return + end + +% 'reset' +% Resets transformation matrix +%-------------------------------------------------------------------------- + +if strcmp(op,'reset'), + + set(mancoregvar.hpitch,'Value',0); + set(mancoregvar.hroll,'Value',0); + set(mancoregvar.hyaw,'Value',0); + + set(mancoregvar.hx,'Value',0); + set(mancoregvar.hy,'Value',0); + set(mancoregvar.hz,'Value',0); + + set(mancoregvar.hpitch_val,'string','0'); + set(mancoregvar.hroll_val,'string','0'); + set(mancoregvar.hyaw_val,'string','0'); + + set(mancoregvar.hx_val,'string','0'); + set(mancoregvar.hy_val,'string','0'); + set(mancoregvar.hz_val,'string','0'); + + mancoregvar.sourceimage.premul=spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); + if (get(mancoregvar.htoggle_on,'value')==0) % source is currently displayed + st.vols{2}.premul=spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); + end + + plotmat; + spm_orthviews('redraw'); + + + return + end + + +% 'apply' +% Apply transformation to a selected set of images +%-------------------------------------------------------------------------- + +if strcmp(op,'apply'), + + angl_pitch=get(mancoregvar.hpitch,'Value'); + angl_roll=get(mancoregvar.hroll,'Value'); + angl_yaw=get(mancoregvar.hyaw,'Value'); + + dist_x=get(mancoregvar.hx,'Value'); + dist_y=get(mancoregvar.hy,'Value'); + dist_z=get(mancoregvar.hz,'Value'); + spm_defaults; + mat = spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + + % The following is copied from spm_image.m + if det(mat)<=0 + spm('alert!','This will flip the images',mfilename,0,1); + end; + P = spm_select(Inf, 'image','Images to reorient'); + + + DateFormat = 'yyyy_mm_dd_HH_MM'; + M=mat; %#ok + SavedMat = fullfile(pwd, strcat('ReorientMatrix_', datestr(now, DateFormat), '.mat')); + fprintf(['Saving reorient matrice to ' SavedMat '.\n']); + save(SavedMat,'M', 'P'); + clear M DateFormat SavedMat + + + + %fprintf('Skipping image selection! Preselected images ...\n'); + %load d:\mrdata\functional\prediction\v1_chris\P.mat + + Mats = zeros(4,4,size(P,1)); + + for i=1:size(P,1) + tmp = sprintf('Reading current orientations... %.0f%%.\n', i/size(P,1)*100 ); + fprintf('%s',tmp) + + Mats(:,:,i) = spm_get_space(P(i,:)); + spm_progress_bar('Set',i); + + fprintf('%s',char(sign(tmp)*8)) + end; + + + for i=1:size(P,1) + tmp = sprintf('Reorienting images... %.0f%%.\n', i/size(P,1)*100 ); + fprintf('%s',tmp) + + spm_get_space(P(i,:),mat*Mats(:,:,i)); + + fprintf('%s',char(sign(tmp)*8)) + end; + + + tmp = spm_get_space([st.vols{1}.fname ',' num2str(st.vols{1}.n)]); + if sum((tmp(:)-st.vols{1}.mat(:)).^2) > 1e-8, + spm_image('init',st.vols{1}.fname); + end; + return; + end; + + +% 'plotmat' +% Plot matrix notation of transformation +%-------------------------------------------------------------------------- + +if strcmp(op,'plotmat'), + + plotmat; + return +end + +% None of the op strings matches + +fprintf('WARNING: mancoreg_callbacks.m called with unspecified operation!\n'); + +return; + + + +function plotmat; + +global st mancoregvar; + + angl_pitch=get(mancoregvar.hpitch,'Value'); + angl_roll=get(mancoregvar.hroll,'Value'); + angl_yaw=get(mancoregvar.hyaw,'Value'); + + dist_x=get(mancoregvar.hx,'Value'); + dist_y=get(mancoregvar.hy,'Value'); + dist_z=get(mancoregvar.hz,'Value'); + + premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + + set(mancoregvar.hmat_1_1,'string',sprintf('%2.4g',(premul(1,1)) )); + set(mancoregvar.hmat_1_2,'string',sprintf('%2.4g',(premul(1,2)) )); + set(mancoregvar.hmat_1_3,'string',sprintf('%2.4g',(premul(1,3)) )); + set(mancoregvar.hmat_1_4,'string',sprintf('%2.4g',(premul(1,4)) )); + set(mancoregvar.hmat_2_1,'string',sprintf('%2.4g',(premul(2,1)) )); + set(mancoregvar.hmat_2_2,'string',sprintf('%2.4g',(premul(2,2)) )); + set(mancoregvar.hmat_2_3,'string',sprintf('%2.4g',(premul(2,3)) )); + set(mancoregvar.hmat_2_4,'string',sprintf('%2.4g',(premul(2,4)) )); + set(mancoregvar.hmat_3_1,'string',sprintf('%2.4g',(premul(3,1)) )); + set(mancoregvar.hmat_3_2,'string',sprintf('%2.4g',(premul(3,2)) )); + set(mancoregvar.hmat_3_3,'string',sprintf('%2.4g',(premul(3,3)) )); + set(mancoregvar.hmat_3_4,'string',sprintf('%2.4g',(premul(3,4)) )); + set(mancoregvar.hmat_4_1,'string',sprintf('%2.4g',(premul(4,1)) )); + set(mancoregvar.hmat_4_2,'string',sprintf('%2.4g',(premul(4,2)) )); + set(mancoregvar.hmat_4_3,'string',sprintf('%2.4g',(premul(4,3)) )); + set(mancoregvar.hmat_4_4,'string',sprintf('%2.4g',(premul(4,4)) )); + + + return; + + From 9f382b797eb91fa41c957c84393bd9d3917b246f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 13:06:12 +0200 Subject: [PATCH 05/21] mh fix --- src/getFuncVoxelDims.m | 8 +- src/mancoreg/mancoreg.m | 293 +++++++++++------------ src/spmBatching/bidsSpatialPrepro.m | 64 +++-- src/spmBatching/setBatchCoregistration.m | 13 +- src/spmBatching/setBatchRealign.m | 26 +- src/spmBatching/setBatchSegmentation.m | 11 +- src/unzipImgAndReturnsFullpathName.m | 10 +- 7 files changed, 208 insertions(+), 217 deletions(-) diff --git a/src/getFuncVoxelDims.m b/src/getFuncVoxelDims.m index 15676a17..8417c541 100644 --- a/src/getFuncVoxelDims.m +++ b/src/getFuncVoxelDims.m @@ -1,8 +1,8 @@ function [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) % [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) % - % - + % + % get native resolution to reuse it at normalisation; if ~isempty(opt.funcVoxelDims) % If voxel dimensions is defined in the opt voxDim = opt.funcVoxelDims; % Get the dimension values @@ -19,5 +19,5 @@ % all subjects and sessions opt.funcVoxelDims = voxDim; end - -end \ No newline at end of file + +end diff --git a/src/mancoreg/mancoreg.m b/src/mancoreg/mancoreg.m index 1c499f0f..37c58b1e 100644 --- a/src/mancoreg/mancoreg.m +++ b/src/mancoreg/mancoreg.m @@ -1,180 +1,177 @@ -function mancoreg(targetimage,sourceimage); -% -% Manual coregistration tool -% -% FORMAT mancoreg(targetimage,sourceimage); -% -%---------------------------------------------------------------------------- -% This function displays 2 ortho views of a TARGET and -% a SOURCE image that can be manually coregistered. -% -% The source image (bottom graph) can be manually -% rotated and translated with 6 slider controls. In the source -% graph the source image can be exchanged with the target image -% using a radio button toggle. This is helpful for visual fine control -% of the coregistration. The transformation matrix can be applied -% to a selected set of volumes with the "apply transformation" button. -% If the transformation is to be applied to the original source file -% that file will also need to be selected. If the sourceimage or -% targetimage are not passed the user will be prompted with a file browser. -% -% The code is loosely based on spm_image.m and spm_orthoviews.m -% It requires the m-file with the callback functions for the user -% controls (mancoreg_callbacks.m). -%---------------------------------------------------------------------------- -% JH 10.01.2004 -% modified DSS 10/02/2009 -% -% Change LOG -% -% Version 1.0.1 -% Radio button cannot be turned off on matlab for linux (6.5.0). Changed to -% two radio buttons for toggle on/off (12.1.2004, JH) -% -% Version 1.0.2 -% Added: Plot of transformation matrix, values are shown next to sliders -% and "reset transformation" button (12.1.2004, JH) -% -% Version 1.0.3 -% Added: Made compatible with SPM5 and corrected "Yawn" (altho I like it) - -global st mancoregvar - -%% Make sure we have both image filenames and map images -%---------------------------------------------------------------------------- - -if ~exist('targetimage') - targetimage=spm_select(1,'image','Please select target image') -end - -if ~exist('sourceimage') - sourceimage=spm_select(1,'image','Please select source image') -end; - -targetvol=spm_vol(targetimage); -sourcevol=spm_vol(sourceimage); - - -%% Init graphics window -%---------------------------------------------------------------------------- - -fg = spm_figure('Findwin','Graphics'); -if isempty(fg) - fg=spm_figure('Create','Graphics'); - if isempty(fg), - error('Cant create graphics window'); - end; -else - spm_figure('Clear','Graphics'); -end; -WS = spm('WinScale'); - -htargetstim=spm_orthviews('Image',targetvol,[0.1 0.55 0.45 0.48]); +function mancoreg(targetimage, sourceimage) + % + % Manual coregistration tool + % + % FORMAT mancoreg(targetimage,sourceimage); + % + % ---------------------------------------------------------------------------- + % This function displays 2 ortho views of a TARGET and + % a SOURCE image that can be manually coregistered. + % + % The source image (bottom graph) can be manually + % rotated and translated with 6 slider controls. In the source + % graph the source image can be exchanged with the target image + % using a radio button toggle. This is helpful for visual fine control + % of the coregistration. The transformation matrix can be applied + % to a selected set of volumes with the "apply transformation" button. + % If the transformation is to be applied to the original source file + % that file will also need to be selected. If the sourceimage or + % targetimage are not passed the user will be prompted with a file browser. + % + % The code is loosely based on spm_image.m and spm_orthoviews.m + % It requires the m-file with the callback functions for the user + % controls (mancoreg_callbacks.m). + % ---------------------------------------------------------------------------- + % JH 10.01.2004 + % modified DSS 10/02/2009 + % + % Change LOG + % + % Version 1.0.1 + % Radio button cannot be turned off on matlab for linux (6.5.0). Changed to + % two radio buttons for toggle on/off (12.1.2004, JH) + % + % Version 1.0.2 + % Added: Plot of transformation matrix, values are shown next to sliders + % and "reset transformation" button (12.1.2004, JH) + % + % Version 1.0.3 + % Added: Made compatible with SPM5 and corrected "Yawn" (altho I like it) + + global st mancoregvar + + %% Make sure we have both image filenames and map images + % ---------------------------------------------------------------------------- + + if ~exist('targetimage') + targetimage = spm_select(1, 'image', 'Please select target image'); + end + + if ~exist('sourceimage') + sourceimage = spm_select(1, 'image', 'Please select source image'); + end + + targetvol = spm_vol(targetimage); + sourcevol = spm_vol(sourceimage); + + %% Init graphics window + % ---------------------------------------------------------------------------- + + fg = spm_figure('Findwin', 'Graphics'); + if isempty(fg) + fg = spm_figure('Create', 'Graphics'); + if isempty(fg) + error('Cant create graphics window'); + end + else + spm_figure('Clear', 'Graphics'); + end + WS = spm('WinScale'); + + htargetstim = spm_orthviews('Image', targetvol, [0.1 0.55 0.45 0.48]); spm_orthviews('space'); - spm_orthviews('AddContext',htargetstim); + spm_orthviews('AddContext', htargetstim); -hsourcestim=spm_orthviews('Image',sourcevol,[0.1 0.08 0.45 0.48]); - spm_orthviews('AddContext',hsourcestim); + hsourcestim = spm_orthviews('Image', sourcevol, [0.1 0.08 0.45 0.48]); + spm_orthviews('AddContext', hsourcestim); -spm_orthviews('maxbb'); + spm_orthviews('maxbb'); -mancoregvar.targetimage=st.vols{1}; -mancoregvar.sourceimage=st.vols{2}; + mancoregvar.targetimage = st.vols{1}; + mancoregvar.sourceimage = st.vols{2}; -%% Define and initialise all user controls -%---------------------------------------------------------------------------- + %% Define and initialise all user controls + % ---------------------------------------------------------------------------- -% 1.a Titles and boxes + % 1.a Titles and boxes -uicontrol(fg,'style','text','string','Manual coregistration tool','position',[200 825 200 30].*WS,'Fontsize',16,'backgroundcolor',[1 1 1]); + uicontrol(fg, 'style', 'text', 'string', 'Manual coregistration tool', 'position', [200 825 200 30] .* WS, 'Fontsize', 16, 'backgroundcolor', [1 1 1]); -uicontrol(fg,'style','frame','position',[360 750 240 60].*WS); -uicontrol(fg,'style','frame','position',[360 40 240 410].*WS); + uicontrol(fg, 'style', 'frame', 'position', [360 750 240 60] .* WS); + uicontrol(fg, 'style', 'frame', 'position', [360 40 240 410] .* WS); -uicontrol(fg,'style','text','string','TARGET IMAGE','position',[370 780 80 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string',targetimage,'position',[370 760 220 019].*WS,'Fontsize',10); + uicontrol(fg, 'style', 'text', 'string', 'TARGET IMAGE', 'position', [370 780 80 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', targetimage, 'position', [370 760 220 019] .* WS, 'Fontsize', 10); -uicontrol(fg,'style','text','string','SOURCE IMAGE','position',[370 415 80 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string',sourceimage,'position',[370 395 220 019].*WS,'Fontsize',10); + uicontrol(fg, 'style', 'text', 'string', 'SOURCE IMAGE', 'position', [370 415 80 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', sourceimage, 'position', [370 395 220 019] .* WS, 'Fontsize', 10); -% 1.b Transformation matrix + % 1.b Transformation matrix -uicontrol(fg,'style','text','string','transf.','position',[370 360 40 015].*WS,'Fontsize',10); -mancoregvar.hmat_1_1=uicontrol(fg,'style','text','string','1.00','position',[415 360 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_1_2=uicontrol(fg,'style','text','string','0.00','position',[460 360 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_1_3=uicontrol(fg,'style','text','string','0.00','position',[505 360 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_1_4=uicontrol(fg,'style','text','string','0.00','position',[550 360 40 015].*WS,'Fontsize',8); + uicontrol(fg, 'style', 'text', 'string', 'transf.', 'position', [370 360 40 015] .* WS, 'Fontsize', 10); + mancoregvar.hmat_1_1 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [415 360 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_1_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 360 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_1_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 360 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_1_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 360 40 015] .* WS, 'Fontsize', 8); -mancoregvar.hmat_2_1=uicontrol(fg,'style','text','string','0.00','position',[415 340 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_2_2=uicontrol(fg,'style','text','string','1.00','position',[460 340 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_2_3=uicontrol(fg,'style','text','string','0.00','position',[505 340 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_2_4=uicontrol(fg,'style','text','string','0.00','position',[550 340 40 015].*WS,'Fontsize',8); + mancoregvar.hmat_2_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 340 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_2_2 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [460 340 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_2_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 340 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_2_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 340 40 015] .* WS, 'Fontsize', 8); -mancoregvar.hmat_3_1=uicontrol(fg,'style','text','string','0.00','position',[415 320 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_3_2=uicontrol(fg,'style','text','string','0.00','position',[460 320 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_3_3=uicontrol(fg,'style','text','string','1.00','position',[505 320 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_3_4=uicontrol(fg,'style','text','string','0.00','position',[550 320 40 015].*WS,'Fontsize',8); + mancoregvar.hmat_3_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 320 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_3_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 320 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_3_3 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [505 320 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_3_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 320 40 015] .* WS, 'Fontsize', 8); -mancoregvar.hmat_4_1=uicontrol(fg,'style','text','string','0.00','position',[415 300 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_4_2=uicontrol(fg,'style','text','string','0.00','position',[460 300 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_4_3=uicontrol(fg,'style','text','string','0.00','position',[505 300 40 015].*WS,'Fontsize',8); -mancoregvar.hmat_4_4=uicontrol(fg,'style','text','string','1.00','position',[550 300 40 015].*WS,'Fontsize',8); + mancoregvar.hmat_4_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 300 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_4_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 300 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_4_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 300 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hmat_4_4 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [550 300 40 015] .* WS, 'Fontsize', 8); + %% 2. Rotation sliders -%% 2. Rotation sliders + mancoregvar.hpitch = uicontrol(fg, 'style', 'slider', 'position', [430 250 100 019] .* WS, 'Value', 0, ... + 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); + mancoregvar.hroll = uicontrol(fg, 'style', 'slider', 'position', [430 225 100 019] .* WS, 'Value', 0, ... + 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); + mancoregvar.hyaw = uicontrol(fg, 'style', 'slider', 'position', [430 200 100 019] .* WS, 'Value', 0, ... + 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); -mancoregvar.hpitch = uicontrol(fg,'style','slider','position',[430 250 100 019].*WS,'Value',0,... - 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); -mancoregvar.hroll = uicontrol(fg,'style','slider','position',[430 225 100 019].*WS,'Value',0,... - 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); -mancoregvar.hyaw = uicontrol(fg,'style','slider','position',[430 200 100 019].*WS,'Value',0,... - 'min',-pi,'max',pi,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); + uicontrol(fg, 'style', 'text', 'string', 'PITCH', 'position', [370 250 60 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', 'ROLL', 'position', [370 225 60 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', 'YAW', 'position', [370 200 60 019] .* WS, 'Fontsize', 10); -uicontrol(fg,'style','text','string','PITCH','position',[370 250 60 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string','ROLL','position',[370 225 60 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string','YAW','position',[370 200 60 019].*WS,'Fontsize',10); + mancoregvar.hpitch_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 250 60 019] .* WS, 'Fontsize', 10); + mancoregvar.hroll_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 225 60 019] .* WS, 'Fontsize', 10); + mancoregvar.hyaw_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 200 60 019] .* WS, 'Fontsize', 10); -mancoregvar.hpitch_val=uicontrol(fg,'style','text','string','0','position',[530 250 60 019].*WS,'Fontsize',10); -mancoregvar.hroll_val=uicontrol(fg,'style','text','string','0','position',[530 225 60 019].*WS,'Fontsize',10); -mancoregvar.hyaw_val=uicontrol(fg,'style','text','string','0','position',[530 200 60 019].*WS,'Fontsize',10); + %% 3. Translation sliders -%% 3. Translation sliders + mancoregvar.hx = uicontrol(fg, 'style', 'slider', 'position', [430 175 100 019] .* WS, 'Value', 0, ... + 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); + mancoregvar.hy = uicontrol(fg, 'style', 'slider', 'position', [430 150 100 019] .* WS, 'Value', 0, ... + 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); + mancoregvar.hz = uicontrol(fg, 'style', 'slider', 'position', [430 125 100 019] .* WS, 'Value', 0, ... + 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); -mancoregvar.hx = uicontrol(fg,'style','slider','position',[430 175 100 019].*WS,'Value',0,... - 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); -mancoregvar.hy = uicontrol(fg,'style','slider','position',[430 150 100 019].*WS,'Value',0,... - 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); -mancoregvar.hz = uicontrol(fg,'style','slider','position',[430 125 100 019].*WS,'Value',0,... - 'min',-500,'max',500,'sliderstep',[0.01 0.01],'Callback','mancoreg_callbacks(''move'')'); + uicontrol(fg, 'style', 'text', 'string', 'X', 'position', [370 175 60 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', 'Y', 'position', [370 150 60 019] .* WS, 'Fontsize', 10); + uicontrol(fg, 'style', 'text', 'string', 'Z', 'position', [370 125 60 019] .* WS, 'Fontsize', 10); -uicontrol(fg,'style','text','string','X','position',[370 175 60 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string','Y','position',[370 150 60 019].*WS,'Fontsize',10); -uicontrol(fg,'style','text','string','Z','position',[370 125 60 019].*WS,'Fontsize',10); + mancoregvar.hx_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 175 60 019] .* WS, 'Fontsize', 10); + mancoregvar.hy_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 150 60 019] .* WS, 'Fontsize', 10); + mancoregvar.hz_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 125 60 019] .* WS, 'Fontsize', 10); -mancoregvar.hx_val=uicontrol(fg,'style','text','string','0','position',[530 175 60 019].*WS,'Fontsize',10); -mancoregvar.hy_val=uicontrol(fg,'style','text','string','0','position',[530 150 60 019].*WS,'Fontsize',10); -mancoregvar.hz_val=uicontrol(fg,'style','text','string','0','position',[530 125 60 019].*WS,'Fontsize',10); + %% 4. Source/target display toggle -%% 4. Source/target display toggle + mancoregvar.htoggle_off = uicontrol(fg, 'style', 'radiobutton', 'position', [470 100 040 019] .* WS, 'Value', 1, ... + 'Callback', 'mancoreg_callbacks(''toggle_off'')', 'string', 'OFF'); + mancoregvar.htoggle_on = uicontrol(fg, 'style', 'radiobutton', 'position', [530 100 060 019] .* WS, 'Value', 0, ... + 'Callback', 'mancoreg_callbacks(''toggle_on'')', 'string', 'ON'); -mancoregvar.htoggle_off = uicontrol(fg,'style','radiobutton','position',[470 100 040 019].*WS,'Value',1,... - 'Callback','mancoreg_callbacks(''toggle_off'')','string','OFF'); -mancoregvar.htoggle_on = uicontrol(fg,'style','radiobutton','position',[530 100 060 019].*WS,'Value',0,... - 'Callback','mancoreg_callbacks(''toggle_on'')','string','ON'); + %% 5. "Reset transformation" pushbutton -%% 5. "Reset transformation" pushbutton + mancoregvar.hreset = uicontrol(fg, 'style', 'pushbutton', 'position', [370 75 220 019] .* WS, 'String', 'Reset transformation', ... + 'Callback', 'mancoreg_callbacks(''reset'')'); -mancoregvar.hreset = uicontrol(fg,'style','pushbutton','position',[370 75 220 019].*WS,'String','Reset transformation',... - 'Callback','mancoreg_callbacks(''reset'')'); + %% 6. "Apply transformation" pushbutton -%% 6. "Apply transformation" pushbutton + mancoregvar.hwrite = uicontrol(fg, 'style', 'pushbutton', 'position', [370 50 220 019] .* WS, 'String', 'Apply transformation', ... + 'Callback', 'mancoreg_callbacks(''apply'')'); -mancoregvar.hwrite = uicontrol(fg,'style','pushbutton','position',[370 50 220 019].*WS,'String','Apply transformation',... - 'Callback','mancoreg_callbacks(''apply'')'); + %% Fill in "transf." fields + mancoreg_callbacks('plotmat'); -%% Fill in "transf." fields - -mancoreg_callbacks('plotmat'); - -return \ No newline at end of file + return diff --git a/src/spmBatching/bidsSpatialPrepro.m b/src/spmBatching/bidsSpatialPrepro.m index 5c7b3e7f..5c814ff9 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -13,72 +13,72 @@ function bidsSpatialPrepro(opt) % - assume the anatomical T1w to use for normalization is in the % first session % - the batch is build using dependencies across the different batch modules - + % TO DO % - find a way to paralelize this over subjects % - average T1s across sessions if necessarry - + % Indicate which session the structural data was collected structSession = 1; - + % if input has no opt, load the opt.mat file if nargin < 1 load('opt.mat'); fprintf('opt.mat file loaded \n\n'); end - + % load the subjects/Groups information and the task name [group, opt, BIDS] = getData(opt); - + fprintf(1, 'DOING PREPROCESSING\n'); - + %% Loop through the groups, subjects, and sessions for iGroup = 1:length(group) - + groupName = group(iGroup).name; - + for iSub = 1:group(iGroup).numSub - + matlabbatch = []; % Get the ID of the subject % (i.e SubNumber doesnt have to match the iSub if one subject % is exluded for any reason) subID = group(iGroup).subNumber{iSub}; % Get the subject ID - + printProcessingSubject(groupName, iSub, subID); - + % identify sessions for this subject [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); - + fprintf(1, ' BUILDING SPATIAL JOB : SELECTING ANATOMCAL\n'); % get all T1w images for that subject and anat = spm_BIDS(BIDS, 'data', ... 'sub', subID, ... 'ses', sessions{structSession}, ... 'type', 'T1w'); - + % we assume that the first T1w is the correct one (could be an % issue for dataset with more than one anat = anat{1}; anatImage = unzipImgAndReturnsFullpathName(anat); - + matlabbatch{1}.cfg_basicio.cfg_named_file.name = 'Anatomical'; matlabbatch{1}.cfg_basicio.cfg_named_file.files = { {anatImage} }; - + fprintf(1, ' BUILDING SPATIAL JOB : REALIGN\n'); [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt); fprintf(1, ' BUILDING SPATIAL JOB : COREGISTER\n'); % REFERENCE IMAGE : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') matlabbatch = setBatchCoregistration(matlabbatch); - + fprintf(1, ' BUILDING SPATIAL JOB : SEGMENT ANATOMICAL\n'); % (WITH NEW SEGMENT -DEFAULT SEGMENT IN SPM12) % DATA : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') matlabbatch = setBatchSegmentation(matlabbatch); - + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE FUNCTIONALS\n'); - + for iJob = 5:9 matlabbatch{iJob}.spm.spatial.normalise.write.subj.def(1) = ... cfg_dep('Segment: Forward Deformations', ... @@ -87,7 +87,7 @@ function bidsSpatialPrepro(opt) '.', 'val', '{}', {1}, ... '.', 'val', '{}', {1}), ... substruct('.', 'fordef', '()', {':'})); - + % The following lines are commented out because those parameters % can be set in the spm_my_defaults.m % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.bb = ... @@ -95,9 +95,9 @@ function bidsSpatialPrepro(opt) % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.interp = 4; % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.prefix = ... % spm_get_defaults('normalise.write.prefix'); - + end - + matlabbatch{5}.spm.spatial.normalise.write.subj.resample(1) = ... cfg_dep('Coregister: Estimate: Coregistered Images', ... substruct( ... @@ -106,10 +106,10 @@ function bidsSpatialPrepro(opt) '.', 'val', '{}', {1}, ... '.', 'val', '{}', {1}), ... substruct('.', 'cfiles')); - + % original voxel size at acquisition matlabbatch{5}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE STRUCTURAL fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE STRUCTURAL\n'); matlabbatch{6}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -123,7 +123,7 @@ function bidsSpatialPrepro(opt) '.', 'biascorr', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{6}.spm.spatial.normalise.write.woptions.vox = [1 1 1]; - + % NORMALIZE GREY MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE GREY MATTER\n'); matlabbatch{7}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -137,7 +137,7 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{7}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE WHITE MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE WHITE MATTER\n'); matlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -151,7 +151,7 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{8}.spm.spatial.normalise.write.woptions.vox = voxDim; - + % NORMALIZE CSF MATTER fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE CSF\n'); matlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = ... @@ -165,16 +165,12 @@ function bidsSpatialPrepro(opt) '.', 'c', '()', {':'})); % size 3 allow to run RunQA / original voxel size at acquisition matlabbatch{9}.spm.spatial.normalise.write.woptions.vox = voxDim; - + saveMatlabBatch(matlabbatch, 'spatialPreprocessing', opt, subID); - + spm_jobman('run', matlabbatch); - + end end - -end - - - +end diff --git a/src/spmBatching/setBatchCoregistration.m b/src/spmBatching/setBatchCoregistration.m index e8f20158..c6cd81a6 100644 --- a/src/spmBatching/setBatchCoregistration.m +++ b/src/spmBatching/setBatchCoregistration.m @@ -1,6 +1,6 @@ function matlabbatch = setBatchCoregistration(matlabbatch) - matlabbatch{end+1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; + matlabbatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).name = 'class'; matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).value = 'cfg_files'; @@ -14,7 +14,7 @@ '.', 'val', '{}', {1}); matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).src_output = ... substruct('.', 'files', '{}', {1}); - + % SOURCE IMAGE : DEPENDENCY FROM REALIGNEMENT % ('Realign: Estimate & Reslice: Mean Image') matlabbatch{end}.spm.spatial.coreg.estimate.source(1) = cfg_dep; @@ -33,7 +33,7 @@ '.', 'val', '{}', {1}); matlabbatch{end}.spm.spatial.coreg.estimate.source(1).src_output = ... substruct('.', 'rmean'); - + % OTHER IMAGES : DEPENDENCY FROM REALIGNEMENT ('Realign: Estimate & Reslice: % Realigned Images (Sess 1 to N)') % files %% @@ -57,11 +57,11 @@ '.', 'val', '{}', {1}, ... '.', 'val', '{}', {1}); matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).src_output = ... - substruct(... + substruct( ... '.', 'sess', '()', {iSes}, ... '.', 'cfiles'); end - + % The following lines are commented out because those parameters % can be set in the spm_my_defaults.m % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi'; @@ -69,6 +69,5 @@ % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.tol = ... % [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001]; % matlabbatch{end}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7]; - -end +end diff --git a/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m index 49bf0fc6..67fac0d2 100644 --- a/src/spmBatching/setBatchRealign.m +++ b/src/spmBatching/setBatchRealign.m @@ -1,23 +1,23 @@ function [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt) - matlabbatch{end+1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; - + matlabbatch{end + 1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; + [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); - + sesCounter = 1; - + for iSes = 1:nbSessions - + % get all runs for that subject across all sessions [runs, nbRuns] = getInfo(BIDS, subID, opt, 'Runs', sessions{iSes}); - + for iRun = 1:nbRuns - + % get the filename for this bold run for this task [fileName, subFuncDataDir] = getBoldFilename( ... BIDS, ... subID, sessions{iSes}, runs{iRun}, opt); - + % check that the file with the right prefix exist and we get and % save its voxeldimension prefix = getPrefix('preprocess', opt); @@ -25,12 +25,12 @@ [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); fprintf(1, ' %s\n', files{1}); - + matlabbatch{end}.spm.spatial.realign.estwrite.data{sesCounter} = ... cellstr(files); - + sesCounter = sesCounter + 1; - + end end @@ -46,5 +46,5 @@ % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.interp = 3; % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0]; % matlabbatch{end}.spm.spatial.realign.estwrite.roptions.mask = 1; - -end \ No newline at end of file + +end diff --git a/src/spmBatching/setBatchSegmentation.m b/src/spmBatching/setBatchSegmentation.m index be33fcda..aaf7f341 100644 --- a/src/spmBatching/setBatchSegmentation.m +++ b/src/spmBatching/setBatchSegmentation.m @@ -1,10 +1,10 @@ function matlabbatch = setBatchSegmentation(matlabbatch) - + % define SPM folder spmLocation = spm('dir'); - + % SAVE BIAS CORRECTED IMAGE - matlabbatch{end+1}.spm.spatial.preproc.channel.vols(1) = ... + matlabbatch{end + 1}.spm.spatial.preproc.channel.vols(1) = ... cfg_dep('Named File Selector: Structural(1) - Files', ... substruct( ... '.', 'val', '{}', {1}, ... @@ -15,7 +15,7 @@ matlabbatch{end}.spm.spatial.preproc.channel.biasreg = 0.001; matlabbatch{end}.spm.spatial.preproc.channel.biasfwhm = 60; matlabbatch{end}.spm.spatial.preproc.channel.write = [0 1]; - + % CREATE SEGMENTS IN NATIVE SPACE OF GM,WM AND CSF % (CSF - in case I want to compute TIV later - stefbenet) matlabbatch{end}.spm.spatial.preproc.tissue(1).tpm = ... @@ -48,7 +48,7 @@ matlabbatch{end}.spm.spatial.preproc.tissue(6).ngaus = 2; matlabbatch{end}.spm.spatial.preproc.tissue(6).native = [0 0]; matlabbatch{end}.spm.spatial.preproc.tissue(6).warped = [0 0]; - + % SAVE FORWARD DEFORMATION FIELD FOR NORMALISATION matlabbatch{end}.spm.spatial.preproc.warp.mrf = 1; matlabbatch{end}.spm.spatial.preproc.warp.cleanup = 1; @@ -58,4 +58,3 @@ matlabbatch{end}.spm.spatial.preproc.warp.samp = 3; matlabbatch{end}.spm.spatial.preproc.warp.write = [1 1]; end - diff --git a/src/unzipImgAndReturnsFullpathName.m b/src/unzipImgAndReturnsFullpathName.m index 250710ff..df881a07 100644 --- a/src/unzipImgAndReturnsFullpathName.m +++ b/src/unzipImgAndReturnsFullpathName.m @@ -2,17 +2,17 @@ % unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) % % - + [directory, filename, ext] = spm_fileparts(fullpathImgName); - + if strcmp(ext, '.gz') % unzip nii.gz structural file to be read by SPM fullpathImgName = load_untouch_nii(fullpathImgName); save_untouch_nii(fullpathImgName, fullfile(directory, filename)); [unzippedFullpathImgName] = fullfile(directory, filename); - + else [unzippedFullpathImgName] = fullfile(directory, [filename ext]); - + end -end \ No newline at end of file +end From 20cb472df73e087c37fe8fa6d5c08b83df13627c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 16:55:25 +0200 Subject: [PATCH 06/21] refactor manual coregistration refactor mancoreg refactor mancoreg refacor mancoreg --- src/mancoreg/mancoreg.m | 354 +++++++++++++++++++++++------- src/mancoreg/mancoregCallbacks.m | 254 +++++++++++++++++++++ src/mancoreg/mancoreg_callbacks.m | 252 --------------------- 3 files changed, 532 insertions(+), 328 deletions(-) create mode 100644 src/mancoreg/mancoregCallbacks.m delete mode 100644 src/mancoreg/mancoreg_callbacks.m diff --git a/src/mancoreg/mancoreg.m b/src/mancoreg/mancoreg.m index 37c58b1e..d08e11ff 100644 --- a/src/mancoreg/mancoreg.m +++ b/src/mancoreg/mancoreg.m @@ -1,4 +1,10 @@ +% (C) Copyright 2004-2009 JH +% (C) Copyright 2009_2012 DSS +% (C) Copyright 2012_2019 Remi Gau +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function mancoreg(targetimage, sourceimage) + % mancoreg(targetimage, sourceimage) % % Manual coregistration tool % @@ -20,7 +26,7 @@ function mancoreg(targetimage, sourceimage) % % The code is loosely based on spm_image.m and spm_orthoviews.m % It requires the m-file with the callback functions for the user - % controls (mancoreg_callbacks.m). + % controls (mancoregCallbacks.m). % ---------------------------------------------------------------------------- % JH 10.01.2004 % modified DSS 10/02/2009 @@ -32,22 +38,38 @@ function mancoreg(targetimage, sourceimage) % two radio buttons for toggle on/off (12.1.2004, JH) % % Version 1.0.2 - % Added: Plot of transformation matrix, values are shown next to sliders - % and "reset transformation" button (12.1.2004, JH) + % Added: Plot of transformation matrix, values are shown next to sliders + % and "reset transformation" button (12.1.2004, JH) % % Version 1.0.3 - % Added: Made compatible with SPM5 and corrected "Yawn" (altho I like it) + % Added: Made compatible with SPM5 and corrected "Yawn" (altho I like it) global st mancoregvar + opt.smallFontSize = 8; + opt.largeFontSize = 10; + + opt.smallFontBoxHeight = 15; + opt.largeFontBoxHeight = 19; + + opt.smallFontBoxWidth = 40; + opt.largeFontBoxWidth = 60; + + opt.translationSliderMin = -500; + opt.translationSliderMax = 500; + + opt.rotationSliderMin = -pi; + opt.rotationSliderMax = pi; + + opt.sliderStep = [0.01 0.01]; + %% Make sure we have both image filenames and map images - % ---------------------------------------------------------------------------- - if ~exist('targetimage') + if ~exist('targetimage', 'var') targetimage = spm_select(1, 'image', 'Please select target image'); end - if ~exist('sourceimage') + if ~exist('sourceimage', 'var') sourceimage = spm_select(1, 'image', 'Please select source image'); end @@ -55,7 +77,6 @@ function mancoreg(targetimage, sourceimage) sourcevol = spm_vol(sourceimage); %% Init graphics window - % ---------------------------------------------------------------------------- fg = spm_figure('Findwin', 'Graphics'); if isempty(fg) @@ -66,7 +87,7 @@ function mancoreg(targetimage, sourceimage) else spm_figure('Clear', 'Graphics'); end - WS = spm('WinScale'); + opt.windowScale = spm('WinScale'); htargetstim = spm_orthviews('Image', targetvol, [0.1 0.55 0.45 0.48]); spm_orthviews('space'); @@ -81,97 +102,278 @@ function mancoreg(targetimage, sourceimage) mancoregvar.sourceimage = st.vols{2}; %% Define and initialise all user controls - % ---------------------------------------------------------------------------- - % 1.a Titles and boxes + initTitleAndBoxes(opt, fg, targetimage, sourceimage); + mancoregvar = initTransMat(mancoregvar, opt, fg); + mancoregvar = initRotationSlider(mancoregvar, opt, fg); + mancoregvar = initTranslationSlider(mancoregvar, opt, fg); - uicontrol(fg, 'style', 'text', 'string', 'Manual coregistration tool', 'position', [200 825 200 30] .* WS, 'Fontsize', 16, 'backgroundcolor', [1 1 1]); + % Source/target display toggle - uicontrol(fg, 'style', 'frame', 'position', [360 750 240 60] .* WS); - uicontrol(fg, 'style', 'frame', 'position', [360 40 240 410] .* WS); + mancoregvar.htoggle_off = uicontrol(fg, ... + 'style', 'radiobutton', ... + 'position', ... + [470 100 opt.smallFontBoxWidth * 2 opt.largeFontBoxHeight] .* opt.windowScale, ... + 'Value', 1, ... + 'Callback', 'mancoregCallbacks(''toggle_off'')', ... + 'string', 'OFF'); - uicontrol(fg, 'style', 'text', 'string', 'TARGET IMAGE', 'position', [370 780 80 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', targetimage, 'position', [370 760 220 019] .* WS, 'Fontsize', 10); + mancoregvar.htoggle_on = uicontrol(fg, ... + 'style', 'radiobutton', ... + 'position', ... + [530 100 opt.largeFontBoxWidth opt.largeFontBoxHeight] .* opt.windowScale, ... + 'Value', 0, ... + 'Callback', 'mancoregCallbacks(''toggle_on'')', ... + 'string', 'ON'); - uicontrol(fg, 'style', 'text', 'string', 'SOURCE IMAGE', 'position', [370 415 80 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', sourceimage, 'position', [370 395 220 019] .* WS, 'Fontsize', 10); + % "Reset transformation" pushbutton - % 1.b Transformation matrix + mancoregvar.hreset = uicontrol(fg, ... + 'style', 'pushbutton', ... + 'position', [370 75 220 opt.largeFontBoxHeight] .* opt.windowScale, ... + 'String', 'Reset transformation', ... + 'Callback', 'mancoregCallbacks(''reset'')'); - uicontrol(fg, 'style', 'text', 'string', 'transf.', 'position', [370 360 40 015] .* WS, 'Fontsize', 10); - mancoregvar.hmat_1_1 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [415 360 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_1_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 360 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_1_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 360 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_1_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 360 40 015] .* WS, 'Fontsize', 8); + % "Apply transformation" pushbutton - mancoregvar.hmat_2_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 340 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_2_2 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [460 340 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_2_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 340 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_2_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 340 40 015] .* WS, 'Fontsize', 8); + mancoregvar.hwrite = uicontrol(fg, 'style', 'pushbutton', ... + 'position', [370 50 220 opt.largeFontBoxHeight] .* opt.windowScale, ... + 'String', 'Apply transformation', ... + 'Callback', 'mancoregCallbacks(''apply'')'); - mancoregvar.hmat_3_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 320 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_3_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 320 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_3_3 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [505 320 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_3_4 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [550 320 40 015] .* WS, 'Fontsize', 8); + %% Fill in "transf." fields - mancoregvar.hmat_4_1 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [415 300 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_4_2 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [460 300 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_4_3 = uicontrol(fg, 'style', 'text', 'string', '0.00', 'position', [505 300 40 015] .* WS, 'Fontsize', 8); - mancoregvar.hmat_4_4 = uicontrol(fg, 'style', 'text', 'string', '1.00', 'position', [550 300 40 015] .* WS, 'Fontsize', 8); + mancoregCallbacks('plotmat'); - %% 2. Rotation sliders + return - mancoregvar.hpitch = uicontrol(fg, 'style', 'slider', 'position', [430 250 100 019] .* WS, 'Value', 0, ... - 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); - mancoregvar.hroll = uicontrol(fg, 'style', 'slider', 'position', [430 225 100 019] .* WS, 'Value', 0, ... - 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); - mancoregvar.hyaw = uicontrol(fg, 'style', 'slider', 'position', [430 200 100 019] .* WS, 'Value', 0, ... - 'min', -pi, 'max', pi, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); +end - uicontrol(fg, 'style', 'text', 'string', 'PITCH', 'position', [370 250 60 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', 'ROLL', 'position', [370 225 60 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', 'YAW', 'position', [370 200 60 019] .* WS, 'Fontsize', 10); +function initTitleAndBoxes(opt, fg, targetimage, sourceimage) - mancoregvar.hpitch_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 250 60 019] .* WS, 'Fontsize', 10); - mancoregvar.hroll_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 225 60 019] .* WS, 'Fontsize', 10); - mancoregvar.hyaw_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 200 60 019] .* WS, 'Fontsize', 10); + windowScale = opt.windowScale; + fontSize = opt.largeFontSize; + height = opt.largeFontBoxHeight; - %% 3. Translation sliders + uicontrol(fg, ... + 'style', 'text', ... + 'string', 'Manual coregistration tool', ... + 'position', [200 825 300 30] .* windowScale, ... + 'Fontsize', 16, 'backgroundcolor', [1 1 1]); - mancoregvar.hx = uicontrol(fg, 'style', 'slider', 'position', [430 175 100 019] .* WS, 'Value', 0, ... - 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); - mancoregvar.hy = uicontrol(fg, 'style', 'slider', 'position', [430 150 100 019] .* WS, 'Value', 0, ... - 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); - mancoregvar.hz = uicontrol(fg, 'style', 'slider', 'position', [430 125 100 019] .* WS, 'Value', 0, ... - 'min', -500, 'max', 500, 'sliderstep', [0.01 0.01], 'Callback', 'mancoreg_callbacks(''move'')'); + uicontrol(fg, ... + 'style', 'frame', ... + 'position', [360 550 240 250] .* windowScale); + uicontrol(fg, 'style', 'frame', ... + 'position', [360 40 240 410] .* windowScale); - uicontrol(fg, 'style', 'text', 'string', 'X', 'position', [370 175 60 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', 'Y', 'position', [370 150 60 019] .* WS, 'Fontsize', 10); - uicontrol(fg, 'style', 'text', 'string', 'Z', 'position', [370 125 60 019] .* WS, 'Fontsize', 10); + addTextToUI( ... + fg, 'TARGET IMAGE', ... + [370 760 100 height], opt, fontSize); + addTextToUI( ... + fg, targetimage, ... + [370 700 220 height * 3], opt, fontSize); - mancoregvar.hx_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 175 60 019] .* WS, 'Fontsize', 10); - mancoregvar.hy_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 150 60 019] .* WS, 'Fontsize', 10); - mancoregvar.hz_val = uicontrol(fg, 'style', 'text', 'string', '0', 'position', [530 125 60 019] .* WS, 'Fontsize', 10); + addTextToUI( ... + fg, 'SOURCE IMAGE', ... + [370 415 100 height], opt, fontSize); + addTextToUI( ... + fg, sourceimage, ... + [370 395 220 height], opt, fontSize); - %% 4. Source/target display toggle +end - mancoregvar.htoggle_off = uicontrol(fg, 'style', 'radiobutton', 'position', [470 100 040 019] .* WS, 'Value', 1, ... - 'Callback', 'mancoreg_callbacks(''toggle_off'')', 'string', 'OFF'); - mancoregvar.htoggle_on = uicontrol(fg, 'style', 'radiobutton', 'position', [530 100 060 019] .* WS, 'Value', 0, ... - 'Callback', 'mancoreg_callbacks(''toggle_on'')', 'string', 'ON'); +function mancoregvar = initTransMat(mancoregvar, opt, fg) - %% 5. "Reset transformation" pushbutton + fontSize = opt.smallFontSize; - mancoregvar.hreset = uicontrol(fg, 'style', 'pushbutton', 'position', [370 75 220 019] .* WS, 'String', 'Reset transformation', ... - 'Callback', 'mancoreg_callbacks(''reset'')'); + width = opt.smallFontBoxWidth; + height = opt.smallFontBoxHeight; - %% 6. "Apply transformation" pushbutton + colPosition = 415:45:550; + rowPosition = 360:-20:300; - mancoregvar.hwrite = uicontrol(fg, 'style', 'pushbutton', 'position', [370 50 220 019] .* WS, 'String', 'Apply transformation', ... - 'Callback', 'mancoreg_callbacks(''apply'')'); + addTextToUI( ... + fg, 'transf.', ... + [370 360 width height], opt, opt.largeFontSize); - %% Fill in "transf." fields + for iRow = 1:numel(rowPosition) - mancoreg_callbacks('plotmat'); + for iCol = 1:numel(colPosition) - return + xPos = colPosition(iCol); + yPos = rowPosition(iRow); + fieldName = sprintf('hmat_%i_%i', iRow, iCol); + + stringToUse = '0.00'; + if iRow == iCol + stringToUse = '1.00'; + end + + mancoregvar = addTextToUI( ... + fg, stringToUse, ... + [xPos yPos width height], opt, fontSize, ... + mancoregvar, fieldName); + + end + end + +end + +function mancoregvar = initRotationSlider(mancoregvar, opt, fg) + + windowScale = opt.windowScale; + fontSize = opt.largeFontSize; + height = opt.largeFontBoxHeight; + width = opt.largeFontBoxWidth; + + sliderMin = opt.rotationSliderMin; + sliderMax = opt.rotationSliderMax; + + sliderStep = opt.sliderStep; + + % set sliders + mancoregvar.hpitch = uicontrol(fg, 'style', 'slider', ... + 'position', [430 250 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + mancoregvar.hroll = uicontrol(fg, 'style', 'slider', ... + 'position', [430 225 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + mancoregvar.hyaw = uicontrol(fg, 'style', 'slider', ... + 'position', [430 200 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + + % display text + xPos = 370; + + addTextToUI( ... + fg, 'PITCH', ... + [xPos 250 width height], opt, fontSize); + addTextToUI( ... + fg, 'ROLL', ... + [xPos 225 width height], opt, fontSize); + addTextToUI( ... + fg, 'YAW', ... + [xPos 200 width height], opt, fontSize); + + % display value + xPos = 530; + + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 250 width height], opt, fontSize, ... + mancoregvar, 'hpitch_val'); + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 225 width height], opt, fontSize, ... + mancoregvar, 'hroll_val'); + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 200 width height], opt, fontSize, ... + mancoregvar, 'hyaw_val'); + +end + +function mancoregvar = initTranslationSlider(mancoregvar, opt, fg) + + windowScale = opt.windowScale; + fontSize = opt.largeFontSize; + height = opt.largeFontBoxHeight; + width = opt.largeFontBoxWidth; + + sliderMin = opt.translationSliderMin; + sliderMax = opt.translationSliderMax; + + sliderStep = opt.sliderStep; + + % add sliders + xPos = 430; + + mancoregvar.hx = uicontrol(fg, ... + 'style', 'slider', ... + 'position', [xPos 175 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + mancoregvar.hy = uicontrol(fg, ... + 'style', 'slider', ... + 'position', [xPos 150 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + mancoregvar.hz = uicontrol(fg, ... + 'style', 'slider', ... + 'position', [xPos 125 100 height] .* windowScale, ... + 'Value', 0, ... + 'min', sliderMin, ... + 'max', sliderMax, ... + 'sliderstep', sliderStep, ... + 'Callback', 'mancoregCallbacks(''move'')'); + + % display text + xPos = 370; + + addTextToUI( ... + fg, 'X', ... + [xPos 175 width height], opt, fontSize); + addTextToUI( ... + fg, 'Y', ... + [xPos 150 width height], opt, fontSize); + addTextToUI( ... + fg, 'Z', ... + [xPos 125 width height], opt, fontSize); + + % display value + xPos = 530; + + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 175 width height], opt, fontSize, ... + mancoregvar, 'hx_val'); + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 150 width height], opt, fontSize, ... + mancoregvar, 'hy_val'); + mancoregvar = addTextToUI( ... + fg, '0', ... + [xPos 125 width height], opt, fontSize, ... + mancoregvar, 'hz_val'); + +end + +function mancoregvar = addTextToUI(varargin) + + if numel(varargin) == 7 + [fg, textString, position, opt, fontSize, mancoregvar, fieldName] = deal(varargin{:}); + elseif numel(varargin) == 5 + [fg, textString, position, opt, fontSize] = deal(varargin{:}); + fieldName = []; + end + + handle = uicontrol(fg, ... + 'style', 'text', ... + 'string', textString, ... + 'position', position .* opt.windowScale, ... + 'Fontsize', fontSize); + + if ~isempty(fieldName) + mancoregvar.(fieldName) = handle; + end + +end diff --git a/src/mancoreg/mancoregCallbacks.m b/src/mancoreg/mancoregCallbacks.m new file mode 100644 index 00000000..38856605 --- /dev/null +++ b/src/mancoreg/mancoregCallbacks.m @@ -0,0 +1,254 @@ +% (C) Copyright 2004-2009 JH +% (C) Copyright 2009_2012 DSS +% (C) Copyright 2012_2019 Remi Gau +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function mancoregCallbacks(operation, varargin) + % mancoreg_callbacks(op, varargin) + % + % Callback routines for mancoreg.m + % + % Change LOG + % + % Version 1.0.1 + % Radio button cannot be turned off on matlab for linux (6.5.0). Changed to + % two radio buttons for toggle on/off (12.1.2004, JH) + % + % Version 1.0.2 + % Added: Plot of transformation matrix, values are shown next to sliders + % and "reset transformation" button (12.1.2004, JH) + % + + switch operation + + case 'move' + % Update the position of the bottom (source) image according to user settings + + moveImage(); + + % Toggles between source and target display in bottom window + case 'toggle_off' + toggleOff(); + case 'toggle_on' + toggleOn(); + + case 'reset' + resetTransformationMatrix(); + + case 'apply' + + applyTransformationMatrix(); + + case 'plotmat' + % Plot matrix notation of transformation + + plotMat; + + otherwise + % None of the op strings matches + + fprintf('WARNING: mancoreg_callbacks.m called with unspecified operation!\n'); + + end + +end + +function moveImage() + + global st mancoregvar; + + angl_pitch = get(mancoregvar.hpitch, 'Value'); + angl_roll = get(mancoregvar.hroll, 'Value'); + angl_yaw = get(mancoregvar.hyaw, 'Value'); + + dist_x = get(mancoregvar.hx, 'Value'); + dist_y = get(mancoregvar.hy, 'Value'); + dist_z = get(mancoregvar.hz, 'Value'); + + set(mancoregvar.hpitch_val, 'string', num2str(angl_pitch)); + set(mancoregvar.hroll_val, 'string', num2str(angl_roll)); + set(mancoregvar.hyaw_val, 'string', num2str(angl_yaw)); + + set(mancoregvar.hx_val, 'string', num2str(dist_x)); + set(mancoregvar.hy_val, 'string', num2str(dist_y)); + set(mancoregvar.hz_val, 'string', num2str(dist_z)); + + mancoregvar.sourceimage.premul = ... + spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + if get(mancoregvar.htoggle_on, 'value') == 0 % source is currently displayed + st.vols{2}.premul = ... + spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + end + + plotMat; + spm_orthviews('redraw'); + +end + +function toggleOff() + + global st mancoregvar; + + if get(mancoregvar.htoggle_off, 'value') == 0 % Source is to be displayed + + set(mancoregvar.htoggle_off, 'value', 1); + + else + + set(mancoregvar.htoggle_on, 'value', 0); + st.vols{2} = mancoregvar.sourceimage; + spm_orthviews('redraw'); + + end + +end + +function toggleOn() + + global st mancoregvar; + + if get(mancoregvar.htoggle_on, 'value') == 0 % Source is to be displayed + + set(mancoregvar.htoggle_on, 'value', 1); + + else + set(mancoregvar.htoggle_off, 'value', 0); + mancoregvar.sourceimage = st.vols{2}; % Backup current state + st.vols{2} = st.vols{1}; + st.vols{2}.ax = mancoregvar.sourceimage.ax; % These have to stay the same + st.vols{2}.window = mancoregvar.sourceimage.window; + st.vols{2}.area = mancoregvar.sourceimage.area; + spm_orthviews('redraw'); + end + +end + +function resetTransformationMatrix() + + global st mancoregvar; + + set(mancoregvar.hpitch, 'Value', 0); + set(mancoregvar.hroll, 'Value', 0); + set(mancoregvar.hyaw, 'Value', 0); + + set(mancoregvar.hx, 'Value', 0); + set(mancoregvar.hy, 'Value', 0); + set(mancoregvar.hz, 'Value', 0); + + set(mancoregvar.hpitch_val, 'string', '0'); + set(mancoregvar.hroll_val, 'string', '0'); + set(mancoregvar.hyaw_val, 'string', '0'); + + set(mancoregvar.hx_val, 'string', '0'); + set(mancoregvar.hy_val, 'string', '0'); + set(mancoregvar.hz_val, 'string', '0'); + + mancoregvar.sourceimage.premul = spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); + if get(mancoregvar.htoggle_on, 'value') == 0 % source is currently displayed + st.vols{2}.premul = spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); + end + + plotMat; + spm_orthviews('redraw'); + +end + +function applyTransformationMatrix() + + global st mancoregvar; + + angl_pitch = get(mancoregvar.hpitch, 'Value'); + angl_roll = get(mancoregvar.hroll, 'Value'); + angl_yaw = get(mancoregvar.hyaw, 'Value'); + + dist_x = get(mancoregvar.hx, 'Value'); + dist_y = get(mancoregvar.hy, 'Value'); + dist_z = get(mancoregvar.hz, 'Value'); + spm_defaults; + reorientationMatrix = ... + spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + + % The following is copied from spm_image.m + if det(reorientationMatrix) <= 0 + spm('alert!', 'This will flip the images', mfilename, 0, 1); + end + imagesToReorient = spm_select(Inf, 'image', 'Images to reorient'); + + saveReorientationMatrix(imagesToReorient, reorientationMatrix); + + matricesToChange = zeros(4, 4, size(imagesToReorient, 1)); + + for i = 1:size(imagesToReorient, 1) + tmp = ... + sprintf('Reading current orientations... %.0f%%.\n', i / ... + size(imagesToReorient, 1) * 100); + fprintf('%s', tmp); + + matricesToChange(:, :, i) = spm_get_space(imagesToReorient(i, :)); + spm_progress_bar('Set', i); + + fprintf('%s', char(sign(tmp) * 8)); + end + + for i = 1:size(imagesToReorient, 1) + tmp = ... + sprintf('Reorienting images... %.0f%%.\n', i / size(imagesToReorient, 1) * 100); + fprintf('%s', tmp); + + spm_get_space(imagesToReorient(i, :), reorientationMatrix * matricesToChange(:, :, i)); + + fprintf('%s', char(sign(tmp) * 8)); + end + + tmp = spm_get_space([st.vols{1}.fname ',' num2str(st.vols{1}.n)]); + if sum((tmp(:) - st.vols{1}.mat(:)).^2) > 1e-8 + spm_image('init', st.vols{1}.fname); + end +end + +function plotMat + + global mancoregvar; + + angl_pitch = get(mancoregvar.hpitch, 'Value'); + angl_roll = get(mancoregvar.hroll, 'Value'); + angl_yaw = get(mancoregvar.hyaw, 'Value'); + + dist_x = get(mancoregvar.hx, 'Value'); + dist_y = get(mancoregvar.hy, 'Value'); + dist_z = get(mancoregvar.hz, 'Value'); + + premul = spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); + + for iRow = 1:4 + + for iCol = 1:4 + + fieldName = sprintf('hmat_%i_%i', iRow, iCol); + stringToUse = sprintf('%2.4g', premul(iRow, iCol)); + + set(mancoregvar.(fieldName), 'string', stringToUse); + + end + end + +end + +function saveReorientationMatrix(imagesToReorient, reorientationMatrix) + + dateFormat = 'yyyymmdd_HHMM'; + + filename = fullfile(pwd, strcat('reorientMatrix_', datestr(now, dateFormat))); + + fprintf(['Saving reorient matrice to ' [filename '.mat/json'] '.\n']); + + save([filename '.mat'], 'reorientationMatrix', 'imagesToReorient'); + + json.reorientationMatrix = reorientationMatrix; + json.imagesToReorient = imagesToReorient; + + opts.indent = ' '; + + spm_jsonwrite([filename '.json'], json, opts); + +end diff --git a/src/mancoreg/mancoreg_callbacks.m b/src/mancoreg/mancoreg_callbacks.m deleted file mode 100644 index 25d0454a..00000000 --- a/src/mancoreg/mancoreg_callbacks.m +++ /dev/null @@ -1,252 +0,0 @@ -function mancoreg_callbacks(op,varargin); -% -% Callback routines for mancoreg.m -% -% Change LOG -% -% Version 1.0.1 -% Radio button cannot be turned off on matlab for linux (6.5.0). Changed to -% two radio buttons for toggle on/off (12.1.2004, JH) -% -% Version 1.0.2 -% Added: Plot of transformation matrix, values are shown next to sliders -% and "reset transformation" button (12.1.2004, JH) -% - - global st mancoregvar; - - -% 'move' -% Update the position of the bottom (source) image according to user settings -%---------------------------------------------------------------------------- - - if strcmp(op,'move'), - - angl_pitch=get(mancoregvar.hpitch,'Value'); - angl_roll=get(mancoregvar.hroll,'Value'); - angl_yaw=get(mancoregvar.hyaw,'Value'); - - dist_x=get(mancoregvar.hx,'Value'); - dist_y=get(mancoregvar.hy,'Value'); - dist_z=get(mancoregvar.hz,'Value'); - - set(mancoregvar.hpitch_val,'string',num2str(angl_pitch)); - set(mancoregvar.hroll_val,'string',num2str(angl_roll)); - set(mancoregvar.hyaw_val,'string',num2str(angl_yaw)); - - set(mancoregvar.hx_val,'string',num2str(dist_x)); - set(mancoregvar.hy_val,'string',num2str(dist_y)); - set(mancoregvar.hz_val,'string',num2str(dist_z)); - - mancoregvar.sourceimage.premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); - if (get(mancoregvar.htoggle_on,'value')==0) % source is currently displayed - st.vols{2}.premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); - end - - plotmat; - spm_orthviews('redraw'); - - return - end - - -% 'toggle_off' -% Toggles between source and target display in bottom window -%-------------------------------------------------------------------------- - -if strcmp(op,'toggle_off'), - - if (get(mancoregvar.htoggle_off,'value')==0) % Source is to be displayed - - set(mancoregvar.htoggle_off,'value',1); - - else - - set(mancoregvar.htoggle_on,'value',0); - st.vols{2}=mancoregvar.sourceimage; - spm_orthviews('redraw'); - - - end - - return - end - - -% 'toggle_on' -% Toggles between source and target display in bottom window -%-------------------------------------------------------------------------- - -if strcmp(op,'toggle_on'), - - if (get(mancoregvar.htoggle_on,'value')==0) % Source is to be displayed - - set(mancoregvar.htoggle_on,'value',1); - - else - set(mancoregvar.htoggle_off,'value',0); - mancoregvar.sourceimage=st.vols{2}; % Backup current state - st.vols{2}=st.vols{1}; - st.vols{2}.ax=mancoregvar.sourceimage.ax; % These have to stay the same - st.vols{2}.window=mancoregvar.sourceimage.window; - st.vols{2}.area=mancoregvar.sourceimage.area; - spm_orthviews('redraw'); - end - - return - end - -% 'reset' -% Resets transformation matrix -%-------------------------------------------------------------------------- - -if strcmp(op,'reset'), - - set(mancoregvar.hpitch,'Value',0); - set(mancoregvar.hroll,'Value',0); - set(mancoregvar.hyaw,'Value',0); - - set(mancoregvar.hx,'Value',0); - set(mancoregvar.hy,'Value',0); - set(mancoregvar.hz,'Value',0); - - set(mancoregvar.hpitch_val,'string','0'); - set(mancoregvar.hroll_val,'string','0'); - set(mancoregvar.hyaw_val,'string','0'); - - set(mancoregvar.hx_val,'string','0'); - set(mancoregvar.hy_val,'string','0'); - set(mancoregvar.hz_val,'string','0'); - - mancoregvar.sourceimage.premul=spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); - if (get(mancoregvar.htoggle_on,'value')==0) % source is currently displayed - st.vols{2}.premul=spm_matrix([0 0 0 0 0 0 1 1 1 0 0 0]); - end - - plotmat; - spm_orthviews('redraw'); - - - return - end - - -% 'apply' -% Apply transformation to a selected set of images -%-------------------------------------------------------------------------- - -if strcmp(op,'apply'), - - angl_pitch=get(mancoregvar.hpitch,'Value'); - angl_roll=get(mancoregvar.hroll,'Value'); - angl_yaw=get(mancoregvar.hyaw,'Value'); - - dist_x=get(mancoregvar.hx,'Value'); - dist_y=get(mancoregvar.hy,'Value'); - dist_z=get(mancoregvar.hz,'Value'); - spm_defaults; - mat = spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); - - % The following is copied from spm_image.m - if det(mat)<=0 - spm('alert!','This will flip the images',mfilename,0,1); - end; - P = spm_select(Inf, 'image','Images to reorient'); - - - DateFormat = 'yyyy_mm_dd_HH_MM'; - M=mat; %#ok - SavedMat = fullfile(pwd, strcat('ReorientMatrix_', datestr(now, DateFormat), '.mat')); - fprintf(['Saving reorient matrice to ' SavedMat '.\n']); - save(SavedMat,'M', 'P'); - clear M DateFormat SavedMat - - - - %fprintf('Skipping image selection! Preselected images ...\n'); - %load d:\mrdata\functional\prediction\v1_chris\P.mat - - Mats = zeros(4,4,size(P,1)); - - for i=1:size(P,1) - tmp = sprintf('Reading current orientations... %.0f%%.\n', i/size(P,1)*100 ); - fprintf('%s',tmp) - - Mats(:,:,i) = spm_get_space(P(i,:)); - spm_progress_bar('Set',i); - - fprintf('%s',char(sign(tmp)*8)) - end; - - - for i=1:size(P,1) - tmp = sprintf('Reorienting images... %.0f%%.\n', i/size(P,1)*100 ); - fprintf('%s',tmp) - - spm_get_space(P(i,:),mat*Mats(:,:,i)); - - fprintf('%s',char(sign(tmp)*8)) - end; - - - tmp = spm_get_space([st.vols{1}.fname ',' num2str(st.vols{1}.n)]); - if sum((tmp(:)-st.vols{1}.mat(:)).^2) > 1e-8, - spm_image('init',st.vols{1}.fname); - end; - return; - end; - - -% 'plotmat' -% Plot matrix notation of transformation -%-------------------------------------------------------------------------- - -if strcmp(op,'plotmat'), - - plotmat; - return -end - -% None of the op strings matches - -fprintf('WARNING: mancoreg_callbacks.m called with unspecified operation!\n'); - -return; - - - -function plotmat; - -global st mancoregvar; - - angl_pitch=get(mancoregvar.hpitch,'Value'); - angl_roll=get(mancoregvar.hroll,'Value'); - angl_yaw=get(mancoregvar.hyaw,'Value'); - - dist_x=get(mancoregvar.hx,'Value'); - dist_y=get(mancoregvar.hy,'Value'); - dist_z=get(mancoregvar.hz,'Value'); - - premul=spm_matrix([dist_x dist_y dist_z angl_pitch angl_roll angl_yaw 1 1 1 0 0 0]); - - set(mancoregvar.hmat_1_1,'string',sprintf('%2.4g',(premul(1,1)) )); - set(mancoregvar.hmat_1_2,'string',sprintf('%2.4g',(premul(1,2)) )); - set(mancoregvar.hmat_1_3,'string',sprintf('%2.4g',(premul(1,3)) )); - set(mancoregvar.hmat_1_4,'string',sprintf('%2.4g',(premul(1,4)) )); - set(mancoregvar.hmat_2_1,'string',sprintf('%2.4g',(premul(2,1)) )); - set(mancoregvar.hmat_2_2,'string',sprintf('%2.4g',(premul(2,2)) )); - set(mancoregvar.hmat_2_3,'string',sprintf('%2.4g',(premul(2,3)) )); - set(mancoregvar.hmat_2_4,'string',sprintf('%2.4g',(premul(2,4)) )); - set(mancoregvar.hmat_3_1,'string',sprintf('%2.4g',(premul(3,1)) )); - set(mancoregvar.hmat_3_2,'string',sprintf('%2.4g',(premul(3,2)) )); - set(mancoregvar.hmat_3_3,'string',sprintf('%2.4g',(premul(3,3)) )); - set(mancoregvar.hmat_3_4,'string',sprintf('%2.4g',(premul(3,4)) )); - set(mancoregvar.hmat_4_1,'string',sprintf('%2.4g',(premul(4,1)) )); - set(mancoregvar.hmat_4_2,'string',sprintf('%2.4g',(premul(4,2)) )); - set(mancoregvar.hmat_4_3,'string',sprintf('%2.4g',(premul(4,3)) )); - set(mancoregvar.hmat_4_4,'string',sprintf('%2.4g',(premul(4,4)) )); - - - return; - - From 3d020c99b8dc849f384eaae4fe46307b65da2c42 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 17:14:35 +0200 Subject: [PATCH 07/21] add copyright --- batch.m | 2 ++ demo/batch_download_run.m | 2 ++ getOption.m | 23 +++---------------- miss_hit.cfg | 14 +++++++---- runTests.m | 2 ++ spm_my_defaults.m | 2 ++ src/concatBetaImgTmaps.m | 2 ++ src/convertOnsetTsvToMat.m | 2 ++ src/createAndReturnOnsetFile.m | 2 ++ src/deleteResidualImages.m | 2 ++ src/getBoldFilename.m | 2 ++ src/getBoldFilenameForFFX.m | 2 ++ src/getData.m | 2 ++ src/getFFXdir.m | 2 ++ src/getFuncVoxelDims.m | 2 ++ src/getInfo.m | 2 ++ src/getPrefix.m | 2 ++ src/getRFXdir.m | 2 ++ src/getRealignParamFile.m | 2 ++ src/getSliceOrder.m | 2 ++ src/miss_hit.cfg | 10 -------- src/printProcessingRun.m | 2 ++ src/printProcessingSubject.m | 2 ++ src/reportBIDS.m | 19 +++++++++++++++ src/saveMatlabBatch.m | 2 ++ src/setMvpaSuffix.m | 2 ++ src/specifyContrasts.m | 2 ++ src/spmBatching/bidsCopyRawFolder.m | 2 ++ src/spmBatching/bidsFFX.m | 2 ++ src/spmBatching/bidsRFX.m | 2 ++ src/spmBatching/bidsRealignReslice.m | 2 ++ src/spmBatching/bidsResults.m | 2 ++ src/spmBatching/bidsSTC.m | 2 ++ src/spmBatching/bidsSmoothing.m | 2 ++ src/spmBatching/bidsSpatialPrepro.m | 2 ++ src/spmBatching/setBatchCoregistration.m | 2 ++ src/spmBatching/setBatchRealign.m | 2 ++ src/spmBatching/setBatchRealignReslice.m | 2 ++ src/spmBatching/setBatchSTC.m | 2 ++ src/spmBatching/setBatchSegmentation.m | 2 ++ src/spmBatching/setBatchSmoothing.m | 2 ++ .../setBatchSubjectLevelContrasts.m | 2 ++ src/spmBatching/setBatchSubjectLevelGLMSpec.m | 2 ++ src/unzipImgAndReturnsFullpathName.m | 2 ++ src/utils/checkDependencies.m | 2 ++ src/utils/checkOptions.m | 2 ++ src/utils/getEnvInfo.m | 2 ++ src/utils/getVersion.m | 2 ++ src/utils/inputFileValidation.m | 2 ++ src/utils/isOctave.m | 3 +++ src/utils/printCredits.m | 2 ++ src/utils/setDefaultFields.m | 2 ++ 52 files changed, 129 insertions(+), 34 deletions(-) delete mode 100644 src/miss_hit.cfg create mode 100644 src/reportBIDS.m diff --git a/batch.m b/batch.m index 68b2db57..2ce6c211 100644 --- a/batch.m +++ b/batch.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + % __ ____ ____ _ _ _ % / _)( _ \( _ \ | | / \ | ) % ( (_ )___/ )___/ | |_ / _ \ | \ diff --git a/demo/batch_download_run.m b/demo/batch_download_run.m index f9517cb9..250b5fdb 100644 --- a/demo/batch_download_run.m +++ b/demo/batch_download_run.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 Remi Gau + % This script will download the dataset from the FIL for the block design SPM % tutorial and will run the basic preprocessing, FFX and contrasts on it. % Results might be a bit different from those in the manual as some diff --git a/getOption.m b/getOption.m index 468b2dd4..214426e4 100644 --- a/getOption.m +++ b/getOption.m @@ -1,24 +1,7 @@ -function opt = getOption() - % __ ____ ____ _ _ _ - % / _)( _ \( _ \ | | / \ | ) - % ( (_ )___/ )___/ | |_ / _ \ | \ - % \__)(__) (__) |___||_/ \_||__) - % - % Thank you for using the CPP lap pipeline - version 0.0.3. - % - % Current list of contributors includes - % Mohamed Rezk - % Rémi Gau - % Olivier Collignon - % Ane Gurtubay - % Marco Barilari - % - % Please cite using the following DOI: - % https://doi.org/10.5281/zenodo.3554332 - % - % For bug report, suggestions for improvements or contributions see our github repo: - % https://github.com/cpp-lln-lab/CPP_BIDS_SPM_pipeline +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers +function opt = getOption() + % opt = getOption() % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. diff --git a/miss_hit.cfg b/miss_hit.cfg index aa91fe79..e666df5a 100644 --- a/miss_hit.cfg +++ b/miss_hit.cfg @@ -1,11 +1,17 @@ # styly guide (https://florianschanda.github.io/miss_hit/style_checker.html) line_length: 100 regex_function_name: "[a-z]+(_*([a-zA-Z0-9]){1}[A-Za-z]+)*" # almost anything goes in the root folder -suppress_rule: "copyright_notice" exclude_dir: "lib" +copyright_entity: "JH" +copyright_entity: "DSS" +copyright_entity: "Agah Karakuzu" +copyright_entity: "Olivier Collignon" +copyright_entity: "Mohamed Rezk" +copyright_entity: "Remi Gau" +copyright_entity: "CPP BIDS SPM-pipeline developpers" # metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html) metric "cnest": limit 4 -metric "file_length": limit 300 -metric "cyc": limit 15 -metric "parameters": limit 4 \ No newline at end of file +metric "file_length": limit 400 +metric "cyc": limit 10 +metric "parameters": limit 6 \ No newline at end of file diff --git a/runTests.m b/runTests.m index 43f95a47..37fa7737 100644 --- a/runTests.m +++ b/runTests.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + warning('OFF'); addpath(fullfile(pwd, 'spm12')); diff --git a/spm_my_defaults.m b/spm_my_defaults.m index 1a4e3ed3..ac3ff3d5 100644 --- a/spm_my_defaults.m +++ b/spm_my_defaults.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function spm_my_defaults % This is where we set the defautls we want to use. % These will overide the spm defaults. diff --git a/src/concatBetaImgTmaps.m b/src/concatBetaImgTmaps.m index 83355dec..cfadb125 100644 --- a/src/concatBetaImgTmaps.m +++ b/src/concatBetaImgTmaps.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function concatBetaImgTmaps(funcFWHM, opt, deleteIndBeta, deleteIndTmaps) % concatBetaImgTmaps(funcFWHM, opt, deleteIndBeta, deleteIndTmaps) % diff --git a/src/convertOnsetTsvToMat.m b/src/convertOnsetTsvToMat.m index 4f10c253..689148a8 100644 --- a/src/convertOnsetTsvToMat.m +++ b/src/convertOnsetTsvToMat.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function fullpathOnsetFileName = convertOnsetTsvToMat(opt, tsvFile, isMVPA) %% Converts a tsv file to an onset file suitable for SPM ffx analysis % The scripts extracts the conditions' names, onsets, and durations, and diff --git a/src/createAndReturnOnsetFile.m b/src/createAndReturnOnsetFile.m index 886d7e18..c12a3df6 100644 --- a/src/createAndReturnOnsetFile.m +++ b/src/createAndReturnOnsetFile.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function onsetFileName = createAndReturnOnsetFile(opt, subID, funcFWHM, boldFileName, isMVPA) % onsetFileName = createAndReturnOnsetFile(opt, boldFileName, prefix, isMVPA) % diff --git a/src/deleteResidualImages.m b/src/deleteResidualImages.m index 2f0bc100..490ee7b7 100644 --- a/src/deleteResidualImages.m +++ b/src/deleteResidualImages.m @@ -1,3 +1,5 @@ +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + function deleteResidualImages(ffxDir) delete(fullfile(ffxDir, 'Res_*.nii')); end diff --git a/src/getBoldFilename.m b/src/getBoldFilename.m index 3e26bc6a..8d67c962 100644 --- a/src/getBoldFilename.m +++ b/src/getBoldFilename.m @@ -1,3 +1,5 @@ +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + function [fileName, subFuncDataDir] = getBoldFilename(varargin) % [fileName, subFuncDataDir] = getBoldFilename(BIDS, opt, subID, sessionID, runID) diff --git a/src/getBoldFilenameForFFX.m b/src/getBoldFilenameForFFX.m index 802be92b..c897f88b 100644 --- a/src/getBoldFilenameForFFX.m +++ b/src/getBoldFilenameForFFX.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function [boldFileName, prefix] = getBoldFilenameForFFX(varargin) % [boldFileName, prefix] = getFunctionalFiles(BIDS, opt, subID, funcFWHM, iSes, iRun) % diff --git a/src/getData.m b/src/getData.m index dd51530b..efb908be 100644 --- a/src/getData.m +++ b/src/getData.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function [group, opt, BIDS] = getData(opt, BIDSdir, type) % getData checks that all the options specified by the user in getOptions % and fills the blank for any that might have been missed out. diff --git a/src/getFFXdir.m b/src/getFFXdir.m index bf4fde37..f79e2e9a 100644 --- a/src/getFFXdir.m +++ b/src/getFFXdir.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function ffxDir = getFFXdir(subID, funcFWFM, opt, isMVPA) % ffxDir = getFFXdir(subID, funcFWFM, opt, isMVPA) % diff --git a/src/getFuncVoxelDims.m b/src/getFuncVoxelDims.m index 8417c541..1bd815e3 100644 --- a/src/getFuncVoxelDims.m +++ b/src/getFuncVoxelDims.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) % [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) % diff --git a/src/getInfo.m b/src/getInfo.m index eafc69f8..219d5773 100644 --- a/src/getInfo.m +++ b/src/getInfo.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function varargout = getInfo(BIDS, subID, opt, info, varargin) % for a given BIDS data set, subject identity, and info type, % if info = Sessions, this returns name of the sessions and their number diff --git a/src/getPrefix.m b/src/getPrefix.m index a8c0f758..99759aad 100644 --- a/src/getPrefix.m +++ b/src/getPrefix.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function [prefix, motionRegressorPrefix] = getPrefix(step, opt, funcFWHM) % generates prefix to append to file name to look for diff --git a/src/getRFXdir.m b/src/getRFXdir.m index ddf08c40..3c186dcc 100644 --- a/src/getRFXdir.m +++ b/src/getRFXdir.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function rfxDir = getRFXdir(opt, funcFWHM, conFWHM, contrastName) % rfxDir = getRFXdir(opt, funcFWHM, conFWHM, iStep, iCon) % diff --git a/src/getRealignParamFile.m b/src/getRealignParamFile.m index 44c9c619..cda6fbf4 100644 --- a/src/getRealignParamFile.m +++ b/src/getRealignParamFile.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function realignParamFile = getRealignParamFile(opt, fullpathBoldFileName, funcFWHM) [prefix, motionRegressorPrefix] = getPrefix('FFX', opt, funcFWHM); diff --git a/src/getSliceOrder.m b/src/getSliceOrder.m index c863d825..df74a177 100644 --- a/src/getSliceOrder.m +++ b/src/getSliceOrder.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function sliceOrder = getSliceOrder(opt, verbose) % get the slice order information from the BIDS data set or from getOption % diff --git a/src/miss_hit.cfg b/src/miss_hit.cfg deleted file mode 100644 index d3504bda..00000000 --- a/src/miss_hit.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html) -line_length: 100 -regex_function_name: "[a-z]+(([A-Z0-9]){1}[A-Za-z]+)*" -suppress_rule: "copyright_notice" - -# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html) -metric "cnest": limit 4 -metric "file_length": limit 500 -metric "cyc": limit 15 -metric "parameters": limit 6 \ No newline at end of file diff --git a/src/printProcessingRun.m b/src/printProcessingRun.m index 5a7c9d81..fab736ea 100644 --- a/src/printProcessingRun.m +++ b/src/printProcessingRun.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function printProcessingRun(groupName, iSub, subID, iSes, iRun) fprintf(1, ... diff --git a/src/printProcessingSubject.m b/src/printProcessingSubject.m index 1d654ba8..b8c281ca 100644 --- a/src/printProcessingSubject.m +++ b/src/printProcessingSubject.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function printProcessingSubject(groupName, iSub, subID) fprintf(1, [ ... diff --git a/src/reportBIDS.m b/src/reportBIDS.m new file mode 100644 index 00000000..eb4f6ada --- /dev/null +++ b/src/reportBIDS.m @@ -0,0 +1,19 @@ +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + +function reportBIDS(opt) + + rawDir = opt.dataDir; + + bids.report(rawDir); + + derivativeDir = fullfile(rawDir, '..', 'derivatives', 'SPM12_CPPL'); + + % make derivatives folder if it doesnt exist + if ~exist(derivativeDir, 'dir') + mkdir(derivativeDir); + fprintf('derivatives directory created: %s \n', derivativeDir); + else + fprintf('derivatives directory already exists. \n'); + end + +end diff --git a/src/saveMatlabBatch.m b/src/saveMatlabBatch.m index c8602328..61a067cc 100644 --- a/src/saveMatlabBatch.m +++ b/src/saveMatlabBatch.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function saveMatlabBatch(matlabbatch, batchType, opt, subID) % saveMatlabBatch(batch, batchType, opt, subID) % diff --git a/src/setMvpaSuffix.m b/src/setMvpaSuffix.m index 7e7d6a93..7e57a907 100644 --- a/src/setMvpaSuffix.m +++ b/src/setMvpaSuffix.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function mvpaSuffix = setMvpaSuffix(isMVPA) mvpaSuffix = ''; if isMVPA diff --git a/src/specifyContrasts.m b/src/specifyContrasts.m index a6abf910..f7461015 100644 --- a/src/specifyContrasts.m +++ b/src/specifyContrasts.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function contrasts = specifyContrasts(ffxDir, taskName, opt, isMVPA) % Specifies the first level contrasts % diff --git a/src/spmBatching/bidsCopyRawFolder.m b/src/spmBatching/bidsCopyRawFolder.m index 1eaf2923..52c7ceea 100644 --- a/src/spmBatching/bidsCopyRawFolder.m +++ b/src/spmBatching/bidsCopyRawFolder.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsCopyRawFolder(opt, deleteZippedNii) % This function will copy the subject's folders from the "raw" folder to the % "derivatives" folder, and will copy the dataset description and task json files diff --git a/src/spmBatching/bidsFFX.m b/src/spmBatching/bidsFFX.m index 68b56736..8dad316a 100644 --- a/src/spmBatching/bidsFFX.m +++ b/src/spmBatching/bidsFFX.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsFFX(action, opt, funcFWHM, isMVPA) % bidsFFX(action, funcFWHM, opt, isMVPA) % diff --git a/src/spmBatching/bidsRFX.m b/src/spmBatching/bidsRFX.m index 072630c0..3fd5e542 100644 --- a/src/spmBatching/bidsRFX.m +++ b/src/spmBatching/bidsRFX.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) % This script smooth all con images created at the fisrt level in each % subject, create a mean structural image and mean mask over the diff --git a/src/spmBatching/bidsRealignReslice.m b/src/spmBatching/bidsRealignReslice.m index 35a5a671..cb33eae2 100644 --- a/src/spmBatching/bidsRealignReslice.m +++ b/src/spmBatching/bidsRealignReslice.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsRealignReslice(opt) % bidsRealignReslice(opt) % diff --git a/src/spmBatching/bidsResults.m b/src/spmBatching/bidsResults.m index 0a86cb54..c7cb3d3a 100644 --- a/src/spmBatching/bidsResults.m +++ b/src/spmBatching/bidsResults.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsResults(opt, funcFWHM, conFWHM, isMVPA) % This scripts computes the results for a series of contrast that can be % specified at the run, subject or dataset step level (see contrast specification diff --git a/src/spmBatching/bidsSTC.m b/src/spmBatching/bidsSTC.m index 63db7a58..34472115 100644 --- a/src/spmBatching/bidsSTC.m +++ b/src/spmBatching/bidsSTC.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsSTC(opt) % Performs SLICE TIMING CORRECTION of the functional data. The % script for each subject and can handle multiple sessions and multiple diff --git a/src/spmBatching/bidsSmoothing.m b/src/spmBatching/bidsSmoothing.m index 07d4fa41..314509f3 100644 --- a/src/spmBatching/bidsSmoothing.m +++ b/src/spmBatching/bidsSmoothing.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsSmoothing(funcFWHM, opt) % This scripts performs smoothing to the functional data using a full width % half maximum smoothing kernel of size "mm_smoothing". diff --git a/src/spmBatching/bidsSpatialPrepro.m b/src/spmBatching/bidsSpatialPrepro.m index 5c814ff9..61085b6c 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function bidsSpatialPrepro(opt) % bidsSpatialPrepro(opt) % diff --git a/src/spmBatching/setBatchCoregistration.m b/src/spmBatching/setBatchCoregistration.m index c6cd81a6..ca01595c 100644 --- a/src/spmBatching/setBatchCoregistration.m +++ b/src/spmBatching/setBatchCoregistration.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchCoregistration(matlabbatch) matlabbatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; diff --git a/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m index 67fac0d2..5d9ecd84 100644 --- a/src/spmBatching/setBatchRealign.m +++ b/src/spmBatching/setBatchRealign.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt) matlabbatch{end + 1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; diff --git a/src/spmBatching/setBatchRealignReslice.m b/src/spmBatching/setBatchRealignReslice.m index b5069353..dd08f5ab 100644 --- a/src/spmBatching/setBatchRealignReslice.m +++ b/src/spmBatching/setBatchRealignReslice.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchRealignReslice(BIDS, opt, subID) % identify sessions for this subject diff --git a/src/spmBatching/setBatchSTC.m b/src/spmBatching/setBatchSTC.m index 96dc3660..09a91f04 100644 --- a/src/spmBatching/setBatchSTC.m +++ b/src/spmBatching/setBatchSTC.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchSTC(BIDS, opt, subID) % Slice timing units is in milliseconds to be BIDS compliant and not in slice number % as is more traditionally the case with SPM. diff --git a/src/spmBatching/setBatchSegmentation.m b/src/spmBatching/setBatchSegmentation.m index aaf7f341..5abb8320 100644 --- a/src/spmBatching/setBatchSegmentation.m +++ b/src/spmBatching/setBatchSegmentation.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchSegmentation(matlabbatch) % define SPM folder diff --git a/src/spmBatching/setBatchSmoothing.m b/src/spmBatching/setBatchSmoothing.m index 02695e1d..ff4bb1a4 100644 --- a/src/spmBatching/setBatchSmoothing.m +++ b/src/spmBatching/setBatchSmoothing.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchSmoothing(BIDS, opt, subID, funcFWHM) % creates prefix to look for diff --git a/src/spmBatching/setBatchSubjectLevelContrasts.m b/src/spmBatching/setBatchSubjectLevelContrasts.m index 42c6cf25..69f0564f 100644 --- a/src/spmBatching/setBatchSubjectLevelContrasts.m +++ b/src/spmBatching/setBatchSubjectLevelContrasts.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchSubjectLevelContrasts(opt, subID, funcFWHM, isMVPA) ffxDir = getFFXdir(subID, funcFWHM, opt, isMVPA); diff --git a/src/spmBatching/setBatchSubjectLevelGLMSpec.m b/src/spmBatching/setBatchSubjectLevelGLMSpec.m index a9712581..11d518d1 100644 --- a/src/spmBatching/setBatchSubjectLevelGLMSpec.m +++ b/src/spmBatching/setBatchSubjectLevelGLMSpec.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function matlabbatch = setBatchSubjectLevelGLMSpec(varargin) [BIDS, opt, subID, funcFWHM, isMVPA] = deal(varargin{:}); diff --git a/src/unzipImgAndReturnsFullpathName.m b/src/unzipImgAndReturnsFullpathName.m index df881a07..8b4e63aa 100644 --- a/src/unzipImgAndReturnsFullpathName.m +++ b/src/unzipImgAndReturnsFullpathName.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) % unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) % diff --git a/src/utils/checkDependencies.m b/src/utils/checkDependencies.m index c6962842..a05be61e 100644 --- a/src/utils/checkDependencies.m +++ b/src/utils/checkDependencies.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function checkDependencies() % Checks that that the right dependencies are installed. ALso loads the spm defaults. diff --git a/src/utils/checkOptions.m b/src/utils/checkOptions.m index 72d0777f..a6061c42 100644 --- a/src/utils/checkOptions.m +++ b/src/utils/checkOptions.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function opt = checkOptions(opt) % opt = checkOptions(opt) % diff --git a/src/utils/getEnvInfo.m b/src/utils/getEnvInfo.m index b4a1ae9f..3d99e14c 100644 --- a/src/utils/getEnvInfo.m +++ b/src/utils/getEnvInfo.m @@ -1,3 +1,5 @@ +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + function [OS, GeneratedBy] = getEnvInfo() GeneratedBy(1).name = 'CPP_BIDS_SPM_pipeline'; diff --git a/src/utils/getVersion.m b/src/utils/getVersion.m index 0b439272..f79c8dd6 100644 --- a/src/utils/getVersion.m +++ b/src/utils/getVersion.m @@ -1,3 +1,5 @@ +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + function versionNumber = getVersion() try versionNumber = fileread(fullfile(fileparts(mfilename('fullpath')), ... diff --git a/src/utils/inputFileValidation.m b/src/utils/inputFileValidation.m index 09947010..9c555f4c 100644 --- a/src/utils/inputFileValidation.m +++ b/src/utils/inputFileValidation.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function file = inputFileValidation(dir, prefix, fileName) file2Process = spm_select('FPList', dir, ['^' prefix fileName '$']); diff --git a/src/utils/isOctave.m b/src/utils/isOctave.m index b71f6a0b..5ab9705e 100644 --- a/src/utils/isOctave.m +++ b/src/utils/isOctave.m @@ -1,3 +1,6 @@ +% (C) Copyright 2020 Agah Karakuzu +% (C) Copyright 2020 CPP BIDS SPM-pipeline developpers + function retval = isOctave % Return: true if the environment is Octave. persistent cacheval % speeds up repeated calls diff --git a/src/utils/printCredits.m b/src/utils/printCredits.m index ec8f180c..2fb1090c 100644 --- a/src/utils/printCredits.m +++ b/src/utils/printCredits.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function printCredits() versionNumber = getVersion(); diff --git a/src/utils/setDefaultFields.m b/src/utils/setDefaultFields.m index bf0e6c47..f2d199aa 100644 --- a/src/utils/setDefaultFields.m +++ b/src/utils/setDefaultFields.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function structure = setDefaultFields(structure, fieldsToSet) % structure = setDefaultFields(structure, fieldsToSet) % From 29cbd7b8ec138db3c7318a49b699e269f22f67d9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 17:42:05 +0200 Subject: [PATCH 08/21] refactor bids_RFX --- miss_hit.cfg | 2 +- src/getGrpLevelContrastToCompute.m | 15 ++ src/spmBatching/bidsRFX.m | 249 ++-------------------- src/spmBatching/setBatchFactorialDesign.m | 85 ++++++++ src/spmBatching/setBatchMeanAnatAndMask.m | 99 +++++++++ src/spmBatching/setBatchSmoothConImages.m | 37 ++++ 6 files changed, 249 insertions(+), 238 deletions(-) create mode 100644 src/getGrpLevelContrastToCompute.m create mode 100644 src/spmBatching/setBatchFactorialDesign.m create mode 100644 src/spmBatching/setBatchMeanAnatAndMask.m create mode 100644 src/spmBatching/setBatchSmoothConImages.m diff --git a/miss_hit.cfg b/miss_hit.cfg index e666df5a..de035f72 100644 --- a/miss_hit.cfg +++ b/miss_hit.cfg @@ -13,5 +13,5 @@ copyright_entity: "CPP BIDS SPM-pipeline developpers" # metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html) metric "cnest": limit 4 metric "file_length": limit 400 -metric "cyc": limit 10 +metric "cyc": limit 12 metric "parameters": limit 6 \ No newline at end of file diff --git a/src/getGrpLevelContrastToCompute.m b/src/getGrpLevelContrastToCompute.m new file mode 100644 index 00000000..3774fb51 --- /dev/null +++ b/src/getGrpLevelContrastToCompute.m @@ -0,0 +1,15 @@ +function grpLvlCon = getGrpLevelContrastToCompute(opt, isMVPA) + + model = spm_jsonread(opt.model.univariate.file); + if isMVPA + model = spm_jsonread(opt.model.multivariate.file); + end + + for iStep = 1:length(model.Steps) + if strcmp(model.Steps{iStep}.Level, 'dataset') + grpLvlCon = model.Steps{iStep}.AutoContrasts; + break + end + end + +end \ No newline at end of file diff --git a/src/spmBatching/bidsRFX.m b/src/spmBatching/bidsRFX.m index 3fd5e542..1a0fb057 100644 --- a/src/spmBatching/bidsRFX.m +++ b/src/spmBatching/bidsRFX.m @@ -18,28 +18,27 @@ function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) % the second level analysis % + if nargin < 2 || isempty(funcFWHM) + funcFWHM = 0; + end + + if nargin < 3 || isempty(conFWHM) + conFWHM = 0; + end + % if input has no opt, load the opt.mat file if nargin < 4 load('opt.mat'); fprintf('opt.mat file loaded \n\n'); end - if nargin < 5 + if nargin < 5 || isempty(isMVPA) isMVPA = 0; end % load the subjects/Groups information and the task name [group, opt, ~] = getData(opt); - % Check which level of CON smoothing is desired - if conFWHM == 0 - smoothPrefix = ''; - elseif conFWHM > 0 - smoothPrefix = ['s', num2str(conFWHM)]; - else - error ('Check you Con files'); - end - switch action case 'smoothContrasts' @@ -84,19 +83,7 @@ function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) %% Factorial design specification % Load the list of contrasts of interest for the RFX - % model = spm_jsonread(opt.model.file); - if isMVPA - model = spm_jsonread(opt.model.multivariate.file); - else - model = spm_jsonread(opt.model.univariate.file); - end - - for iStep = 1:length(model.Steps) - if strcmp(model.Steps{iStep}.Level, 'dataset') - grpLvlCon = model.Steps{iStep}.AutoContrasts; - break - end - end + grpLvlCon = getGrpLevelContrastToCompute(opt, isMVPA); % ------ % TODO @@ -107,7 +94,7 @@ function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) fprintf(1, 'BUILDING JOB: Factorial Design Specification'); - matlabbatch = setBatchFactorialDesign(grpLvlCon, group, smoothPrefix, rfxDir); + matlabbatch = setBatchFactorialDesign(grpLvlCon, group, conFWHM, rfxDir); % ------ % TODO @@ -130,7 +117,7 @@ function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) for j = 1:size(grpLvlCon, 1) conName = rmTrialTypeStr(grpLvlCon{j}); matlabbatch{j}.spm.stats.fmri_est.spmmat = ... - { fullfile(rfxDir, conName, 'SPM.mat') }; + { fullfile(rfxDir, conName, 'SPM.mat') }; %#ok<*AGROW> matlabbatch{j}.spm.stats.fmri_est.method.Classical = 1; end @@ -183,215 +170,3 @@ function bidsRFX(action, funcFWHM, conFWHM, opt, isMVPA) function conName = rmTrialTypeStr(conName) conName = strrep(conName, 'trial_type.', ''); end - -function matlabbatch = setBatchMeanAnatAndMask(opt, funcFWHM, isMVPA, rfxDir) - - [group, opt, BIDS] = getData(opt); - - matlabbatch = {}; - - % Create Mean Structural Image - fprintf(1, 'BUILDING JOB: Create Mean Structural Image...'); - - subCounter = 0; - - for iGroup = 1:length(group) - - groupName = group(iGroup).name; - - for iSub = 1:group(iGroup).numSub - - subCounter = subCounter + 1; - - subID = group(iGroup).subNumber{iSub}; - - printProcessingSubject(groupName, iSub, subID); - - %% STRUCTURAL - struct = spm_BIDS(BIDS, 'data', ... - 'sub', subID, ... - 'type', 'T1w'); - % we assume that the first T1w is the correct one (could be an - % issue for data set with more than one - struct = struct{1}; - - [subStrucDataDir, file, ext] = spm_fileparts(struct); - - % get filename of the orginal file (drop the gunzip extension) - if strcmp(ext, '.gz') - fileName = file; - elseif strcmp(ext, '.nii') - fileName = [file ext]; - end - - files = inputFileValidation( ... - subStrucDataDir, ... - [spm_get_defaults('normalise.write.prefix'), ... - spm_get_defaults('deformations.modulate.prefix')], ... - fileName); - - matlabbatch{1}.spm.util.imcalc.input{subCounter, :} = files{1}; - - %% Mask - ffxDir = getFFXdir(subID, funcFWHM, opt, isMVPA); - - files = inputFileValidation(ffxDir, '', 'mask.nii'); - - matlabbatch{2}.spm.util.imcalc.input{subCounter, :} = files{1}; - - end - end - - %% Generate the equation to get the mean of the mask and structural image - % example : if we have 5 subjects, Average equation = '(i1+i2+i3+i4+i5)/5' - nbImg = subCounter; - imgRange = 1:subCounter; - - tmpImg = sprintf('+i%i', imgRange); - tmpImg = tmpImg(2:end); - sumEquation = ['(', tmpImg, ')']; - - % meanStruct_equation = '(i1+i2+i3+i4+i5)/5' - meanStruct_equation = ['(', tmpImg, ')/', num2str(nbImg)]; - - % ------ - % TODO - % not sure this makes sense for the mask as voxels that have no data for one - % subject are excluded anyway !!!! - - % meanMask_equation = '(i1+i2+i3+i4+i5)>0.75*5' - meanMask_equation = strcat(sumEquation, '>0.75*', num2str(nbImg)); - - %% The mean structural will be saved in the RFX folder - matlabbatch{1}.spm.util.imcalc.output = 'meanAnat.nii'; - matlabbatch{1}.spm.util.imcalc.outdir{:} = rfxDir; - matlabbatch{1}.spm.util.imcalc.expression = meanStruct_equation; - matlabbatch{1}.spm.util.imcalc.options.dmtx = 0; - matlabbatch{1}.spm.util.imcalc.options.mask = 0; - matlabbatch{1}.spm.util.imcalc.options.interp = 1; - matlabbatch{1}.spm.util.imcalc.options.dtype = 4; - - %% The mean mask will be saved in the RFX folder - matlabbatch{2}.spm.util.imcalc.output = 'meanMask.nii'; - matlabbatch{2}.spm.util.imcalc.outdir{:} = rfxDir; - matlabbatch{2}.spm.util.imcalc.expression = meanMask_equation; - matlabbatch{2}.spm.util.imcalc.options.dmtx = 0; - matlabbatch{2}.spm.util.imcalc.options.mask = 0; - matlabbatch{2}.spm.util.imcalc.options.interp = 1; - matlabbatch{2}.spm.util.imcalc.options.dtype = 4; - -end - -function matlabbatch = setBatchSmoothConImages(group, funcFWHM, conFWHM, opt, isMVPA) - - counter = 0; - - matlabbatch = {}; - - %% Loop through the groups, subjects, and sessions - for iGroup = 1:length(group) - - groupName = group(iGroup).name; - - for iSub = 1:group(iGroup).numSub - - counter = counter + 1; - - subNumber = group(iGroup).subNumber{iSub}; - - printProcessingSubject(groupName, iSub, subNumber); - - ffxDir = getFFXdir(subNumber, funcFWHM, opt, isMVPA); - - conImg = spm_select('FPlist', ffxDir, '^con*.*nii$'); - matlabbatch{counter}.spm.spatial.smooth.data = cellstr(conImg); - - % Define how much smoothing is required - matlabbatch{counter}.spm.spatial.smooth.fwhm = ... - [conFWHM conFWHM conFWHM]; - matlabbatch{counter}.spm.spatial.smooth.dtype = 0; - matlabbatch{counter}.spm.spatial.smooth.prefix = [ ... - spm_get_defaults('smooth.prefix'), num2str(conFWHM)]; - - end - end - -end - -function matlabbatch = setBatchFactorialDesign(grpLvlCon, group, smoothPrefix, rfxDir) - - con = 0; - - % For each contrast - for j = 1:size(grpLvlCon, 1) - - % the strrep(Session{j}, 'trial_type.', '') is there to remove - % 'trial_type.' because contrasts against baseline are renamed - % at the subject level - conName = rmTrialTypeStr(grpLvlCon{j}); - - con = con + 1; - - % For each group - for iGroup = 1:length(group) - - groupName = group(iGroup).name; - - matlabbatch{j}.spm.stats.factorial_design.des.fd.icell(iGroup).levels = ... - iGroup; %#ok<*AGROW> - - for iSub = 1:group(iGroup).numSub - - subID = group(iGroup).subNumber{iSub}; - - printProcessingSubject(groupName, iSub, subID); - - % FFX directory and load SPM.mat of that subject - ffxDir = getFFXdir(subID, funcFWHM, opt, isMVPA); - load(fullfile(ffxDir, 'SPM.mat')); - - % find which contrast of that subject has the name of the contrast we - % want to bring to the group level - conIdx = find(strcmp({SPM.xCon.name}, conName)); - fileName = sprintf('con_%0.4d.nii', conIdx); - file = inputFileValidation(ffxDir, smoothPrefix, fileName); - - matlabbatch{j}.spm.stats.factorial_design.des.fd.icell(iGroup).scans(iSub, :) = ... - file; - - end - - end - - % GROUP and the number of levels in the group. if 2 groups , - % then number of levels = 2 - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.name = 'GROUP'; - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.levels = 1; - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.dept = 0; - - % 1: Assumes that the variance is not the same across groups - % 0: There is no difference in the variance between groups - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.variance = 1; - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.gmsca = 0; - matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.ancova = 0; - % matlabbatch{j}.spm.stats.factorial_design.cov = []; - matlabbatch{j}.spm.stats.factorial_design.masking.tm.tm_none = 1; - matlabbatch{j}.spm.stats.factorial_design.masking.im = 1; - matlabbatch{j}.spm.stats.factorial_design.masking.em = { ... - fullfile(rfxDir, 'MeanMask.nii')}; - matlabbatch{j}.spm.stats.factorial_design.globalc.g_omit = 1; - matlabbatch{j}.spm.stats.factorial_design.globalm.gmsca.gmsca_no = 1; - matlabbatch{j}.spm.stats.factorial_design.globalm.glonorm = 1; - - % If it exists, issue a warning that it has been overwritten - if exist(fullfile(rfxDir, conName), 'dir') - warning('overwriting directory: %s \n', fullfile(rfxDir, conName)); - rmdir(fullfile(rfxDir, conName), 's'); - end - - mkdir(fullfile(rfxDir, conName)); - matlabbatch{j}.spm.stats.factorial_design.dir = { fullfile(rfxDir, conName) }; - - end - -end diff --git a/src/spmBatching/setBatchFactorialDesign.m b/src/spmBatching/setBatchFactorialDesign.m new file mode 100644 index 00000000..b8fe52b4 --- /dev/null +++ b/src/spmBatching/setBatchFactorialDesign.m @@ -0,0 +1,85 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function matlabbatch = setBatchFactorialDesign(grpLvlCon, group, conFWHM, rfxDir) + + % Check which level of CON smoothing is desired + smoothPrefix = ''; + if conFWHM > 0 + smoothPrefix = ['s', num2str(conFWHM)]; + end + + con = 0; + + % For each contrast + for j = 1:size(grpLvlCon, 1) + + % the strrep(Session{j}, 'trial_type.', '') is there to remove + % 'trial_type.' because contrasts against baseline are renamed + % at the subject level + conName = rmTrialTypeStr(grpLvlCon{j}); + + con = con + 1; + + % For each group + for iGroup = 1:length(group) + + groupName = group(iGroup).name; + + matlabbatch{j}.spm.stats.factorial_design.des.fd.icell(iGroup).levels = ... + iGroup; %#ok<*AGROW> + + for iSub = 1:group(iGroup).numSub + + subID = group(iGroup).subNumber{iSub}; + + printProcessingSubject(groupName, iSub, subID); + + % FFX directory and load SPM.mat of that subject + ffxDir = getFFXdir(subID, funcFWHM, opt, isMVPA); + load(fullfile(ffxDir, 'SPM.mat')); + + % find which contrast of that subject has the name of the contrast we + % want to bring to the group level + conIdx = find(strcmp({SPM.xCon.name}, conName)); + fileName = sprintf('con_%0.4d.nii', conIdx); + file = inputFileValidation(ffxDir, smoothPrefix, fileName); + + matlabbatch{j}.spm.stats.factorial_design.des.fd.icell(iGroup).scans(iSub, :) = ... + file; + + end + + end + + % GROUP and the number of levels in the group. if 2 groups , + % then number of levels = 2 + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.name = 'GROUP'; + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.levels = 1; + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.dept = 0; + + % 1: Assumes that the variance is not the same across groups + % 0: There is no difference in the variance between groups + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.variance = 1; + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.gmsca = 0; + matlabbatch{j}.spm.stats.factorial_design.des.fd.fact.ancova = 0; + % matlabbatch{j}.spm.stats.factorial_design.cov = []; + matlabbatch{j}.spm.stats.factorial_design.masking.tm.tm_none = 1; + matlabbatch{j}.spm.stats.factorial_design.masking.im = 1; + matlabbatch{j}.spm.stats.factorial_design.masking.em = { ... + fullfile(rfxDir, 'MeanMask.nii')}; + matlabbatch{j}.spm.stats.factorial_design.globalc.g_omit = 1; + matlabbatch{j}.spm.stats.factorial_design.globalm.gmsca.gmsca_no = 1; + matlabbatch{j}.spm.stats.factorial_design.globalm.glonorm = 1; + + % If it exists, issue a warning that it has been overwritten + if exist(fullfile(rfxDir, conName), 'dir') + warning('overwriting directory: %s \n', fullfile(rfxDir, conName)); + rmdir(fullfile(rfxDir, conName), 's'); + end + + mkdir(fullfile(rfxDir, conName)); + matlabbatch{j}.spm.stats.factorial_design.dir = { fullfile(rfxDir, conName) }; + + end + +end diff --git a/src/spmBatching/setBatchMeanAnatAndMask.m b/src/spmBatching/setBatchMeanAnatAndMask.m new file mode 100644 index 00000000..669e41ac --- /dev/null +++ b/src/spmBatching/setBatchMeanAnatAndMask.m @@ -0,0 +1,99 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function matlabbatch = setBatchMeanAnatAndMask(opt, funcFWHM, isMVPA, rfxDir) + + [group, opt, BIDS] = getData(opt); + + matlabbatch = {}; + + % Create Mean Structural Image + fprintf(1, 'BUILDING JOB: Create Mean Structural Image...'); + + subCounter = 0; + + for iGroup = 1:length(group) + + groupName = group(iGroup).name; + + for iSub = 1:group(iGroup).numSub + + subCounter = subCounter + 1; + + subID = group(iGroup).subNumber{iSub}; + + printProcessingSubject(groupName, iSub, subID); + + %% STRUCTURAL + struct = spm_BIDS(BIDS, 'data', ... + 'sub', subID, ... + 'type', 'T1w'); + % we assume that the first T1w is the correct one (could be an + % issue for data set with more than one + struct = struct{1}; + + [subStrucDataDir, file, ext] = spm_fileparts(struct); + + % get filename of the orginal file (drop the gunzip extension) + if strcmp(ext, '.gz') + fileName = file; + elseif strcmp(ext, '.nii') + fileName = [file ext]; + end + + files = inputFileValidation( ... + subStrucDataDir, ... + [spm_get_defaults('normalise.write.prefix'), ... + spm_get_defaults('deformations.modulate.prefix')], ... + fileName); + + matlabbatch{1}.spm.util.imcalc.input{subCounter, :} = files{1}; + + %% Mask + ffxDir = getFFXdir(subID, funcFWHM, opt, isMVPA); + + files = inputFileValidation(ffxDir, '', 'mask.nii'); + + matlabbatch{2}.spm.util.imcalc.input{subCounter, :} = files{1}; + + end + end + + %% Generate the equation to get the mean of the mask and structural image + % example : if we have 5 subjects, Average equation = '(i1+i2+i3+i4+i5)/5' + nbImg = subCounter; + imgRange = 1:subCounter; + + tmpImg = sprintf('+i%i', imgRange); + tmpImg = tmpImg(2:end); + sumEquation = ['(', tmpImg, ')']; + + % meanStruct_equation = '(i1+i2+i3+i4+i5)/5' + meanStruct_equation = ['(', tmpImg, ')/', num2str(nbImg)]; + + % ------ + % TODO + % not sure this makes sense for the mask as voxels that have no data for one + % subject are excluded anyway !!!! + + % meanMask_equation = '(i1+i2+i3+i4+i5)>0.75*5' + meanMask_equation = strcat(sumEquation, '>0.75*', num2str(nbImg)); + + %% The mean structural will be saved in the RFX folder + matlabbatch{1}.spm.util.imcalc.output = 'meanAnat.nii'; + matlabbatch{1}.spm.util.imcalc.outdir{:} = rfxDir; + matlabbatch{1}.spm.util.imcalc.expression = meanStruct_equation; + matlabbatch{1}.spm.util.imcalc.options.dmtx = 0; + matlabbatch{1}.spm.util.imcalc.options.mask = 0; + matlabbatch{1}.spm.util.imcalc.options.interp = 1; + matlabbatch{1}.spm.util.imcalc.options.dtype = 4; + + %% The mean mask will be saved in the RFX folder + matlabbatch{2}.spm.util.imcalc.output = 'meanMask.nii'; + matlabbatch{2}.spm.util.imcalc.outdir{:} = rfxDir; + matlabbatch{2}.spm.util.imcalc.expression = meanMask_equation; + matlabbatch{2}.spm.util.imcalc.options.dmtx = 0; + matlabbatch{2}.spm.util.imcalc.options.mask = 0; + matlabbatch{2}.spm.util.imcalc.options.interp = 1; + matlabbatch{2}.spm.util.imcalc.options.dtype = 4; + +end diff --git a/src/spmBatching/setBatchSmoothConImages.m b/src/spmBatching/setBatchSmoothConImages.m new file mode 100644 index 00000000..1f48c6f0 --- /dev/null +++ b/src/spmBatching/setBatchSmoothConImages.m @@ -0,0 +1,37 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function matlabbatch = setBatchSmoothConImages(group, funcFWHM, conFWHM, opt, isMVPA) + + counter = 0; + + matlabbatch = {}; + + %% Loop through the groups, subjects, and sessions + for iGroup = 1:length(group) + + groupName = group(iGroup).name; + + for iSub = 1:group(iGroup).numSub + + counter = counter + 1; + + subNumber = group(iGroup).subNumber{iSub}; + + printProcessingSubject(groupName, iSub, subNumber); + + ffxDir = getFFXdir(subNumber, funcFWHM, opt, isMVPA); + + conImg = spm_select('FPlist', ffxDir, '^con*.*nii$'); + matlabbatch{counter}.spm.spatial.smooth.data = cellstr(conImg); %#ok<*AGROW> + + % Define how much smoothing is required + matlabbatch{counter}.spm.spatial.smooth.fwhm = ... + [conFWHM conFWHM conFWHM]; + matlabbatch{counter}.spm.spatial.smooth.dtype = 0; + matlabbatch{counter}.spm.spatial.smooth.prefix = [ ... + spm_get_defaults('smooth.prefix'), num2str(conFWHM)]; + + end + end + +end From 89210f1fa5f57dae3156f6878e5fa953a2ed6d45 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 17:43:44 +0200 Subject: [PATCH 09/21] mh fix --- src/spmBatching/setBatchFactorialDesign.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spmBatching/setBatchFactorialDesign.m b/src/spmBatching/setBatchFactorialDesign.m index b8fe52b4..4414c800 100644 --- a/src/spmBatching/setBatchFactorialDesign.m +++ b/src/spmBatching/setBatchFactorialDesign.m @@ -1,7 +1,7 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers function matlabbatch = setBatchFactorialDesign(grpLvlCon, group, conFWHM, rfxDir) - + % Check which level of CON smoothing is desired smoothPrefix = ''; if conFWHM > 0 From d824043a921122d5e6201129a4aa181fb6fe4e39 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 18:22:48 +0200 Subject: [PATCH 10/21] add tests for setting batch for segmentation and coregistration --- src/spmBatching/setBatchCoregistration.m | 2 +- tests/test_setBatchCoregistration.m | 86 ++++++++++++++++++++++++ tests/test_setBatchSegmentation.m | 85 +++++++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 tests/test_setBatchCoregistration.m create mode 100644 tests/test_setBatchSegmentation.m diff --git a/src/spmBatching/setBatchCoregistration.m b/src/spmBatching/setBatchCoregistration.m index ca01595c..7402ad6c 100644 --- a/src/spmBatching/setBatchCoregistration.m +++ b/src/spmBatching/setBatchCoregistration.m @@ -1,6 +1,6 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers -function matlabbatch = setBatchCoregistration(matlabbatch) +function matlabbatch = setBatchCoregistration(matlabbatch, sesCounter) matlabbatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; diff --git a/tests/test_setBatchCoregistration.m b/tests/test_setBatchCoregistration.m new file mode 100644 index 00000000..18408d22 --- /dev/null +++ b/tests/test_setBatchCoregistration.m @@ -0,0 +1,86 @@ +function test_suite = test_setBatchCoregistration %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_setBatchCoregistrationBasic() + + spmLocation = spm('dir'); + + addpath(fullfile(spmLocation, 'matlabbatch')) + + for sesCounter = 0:2 + matlabbatch = {}; + matlabbatch = setBatchCoregistration(matlabbatch, sesCounter); + expectedBatch = returnExpectedBatch(sesCounter); + assertEqual(expectedBatch, matlabbatch); + end + +end + + +function expectedBatch = returnExpectedBatch(sesCounter) + + expectedBatch = {}; + + expectedBatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).name = 'class'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).value = 'cfg_files'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).name = 'strtype'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(2).value = 'e'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).sname = ... + 'Named File Selector: Structural(1) - Files'; + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).src_output = ... + substruct('.', 'files', '{}', {1}); + + expectedBatch{end}.spm.spatial.coreg.estimate.source(1) = cfg_dep; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tname = 'Source Image'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).name = 'filter'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).value = 'image'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).name = 'strtype'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(2).value = 'e'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).sname = ... + 'Realign: Estimate & Reslice: Mean Image'; + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {2}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + expectedBatch{end}.spm.spatial.coreg.estimate.source(1).src_output = ... + substruct('.', 'rmean'); + + for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).name = ... + 'filter'; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).value = ... + 'image'; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).name = ... + 'strtype'; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(2).value = ... + 'e'; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).sname = ... + ['Realign: Estimate & Reslice: Realigned Images (Sess ' (iSes) ')']; + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).src_exbranch = ... + substruct( ... + '.', 'val', '{}', {2}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}); + expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).src_output = ... + substruct( ... + '.', 'sess', '()', {iSes}, ... + '.', 'cfiles'); + end + +end \ No newline at end of file diff --git a/tests/test_setBatchSegmentation.m b/tests/test_setBatchSegmentation.m new file mode 100644 index 00000000..3e06ed69 --- /dev/null +++ b/tests/test_setBatchSegmentation.m @@ -0,0 +1,85 @@ +function test_suite = test_setBatchSegmentation %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_setBatchSegmentationBasic() + + spmLocation = spm('dir'); + + addpath(fullfile(spmLocation, 'matlabbatch')) + + matlabbatch = []; + matlabbatch = setBatchSegmentation(matlabbatch); + + expectedBatch = returnExpectedBatch(spmLocation); + + assertEqual(expectedBatch, matlabbatch); + +end + +function expectedBatch = returnExpectedBatch(spmLocation) + + expectedBatch = []; + + expectedBatch{end + 1}.spm.spatial.preproc.channel.vols(1) = ... + cfg_dep('Named File Selector: Structural(1) - Files', ... + substruct( ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'files', '{}', {1})); + expectedBatch{end}.spm.spatial.preproc.channel.biasreg = 0.001; + expectedBatch{end}.spm.spatial.preproc.channel.biasfwhm = 60; + expectedBatch{end}.spm.spatial.preproc.channel.write = [0 1]; + + expectedBatch{end}.spm.spatial.preproc.tissue(1).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',1']}; + expectedBatch{end}.spm.spatial.preproc.tissue(1).ngaus = 1; + expectedBatch{end}.spm.spatial.preproc.tissue(1).native = [1 1]; + expectedBatch{end}.spm.spatial.preproc.tissue(1).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.tissue(2).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',2']}; + expectedBatch{end}.spm.spatial.preproc.tissue(2).ngaus = 1; + expectedBatch{end}.spm.spatial.preproc.tissue(2).native = [1 1]; + expectedBatch{end}.spm.spatial.preproc.tissue(2).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.tissue(3).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',3']}; + expectedBatch{end}.spm.spatial.preproc.tissue(3).ngaus = 2; + expectedBatch{end}.spm.spatial.preproc.tissue(3).native = [1 1]; + expectedBatch{end}.spm.spatial.preproc.tissue(3).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.tissue(4).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',4']}; + expectedBatch{end}.spm.spatial.preproc.tissue(4).ngaus = 3; + expectedBatch{end}.spm.spatial.preproc.tissue(4).native = [0 0]; + expectedBatch{end}.spm.spatial.preproc.tissue(4).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.tissue(5).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',5']}; + expectedBatch{end}.spm.spatial.preproc.tissue(5).ngaus = 4; + expectedBatch{end}.spm.spatial.preproc.tissue(5).native = [0 0]; + expectedBatch{end}.spm.spatial.preproc.tissue(5).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.tissue(6).tpm = ... + {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',6']}; + expectedBatch{end}.spm.spatial.preproc.tissue(6).ngaus = 2; + expectedBatch{end}.spm.spatial.preproc.tissue(6).native = [0 0]; + expectedBatch{end}.spm.spatial.preproc.tissue(6).warped = [0 0]; + + expectedBatch{end}.spm.spatial.preproc.warp.mrf = 1; + expectedBatch{end}.spm.spatial.preproc.warp.cleanup = 1; + expectedBatch{end}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2]; + expectedBatch{end}.spm.spatial.preproc.warp.affreg = 'mni'; + expectedBatch{end}.spm.spatial.preproc.warp.fwhm = 0; + expectedBatch{end}.spm.spatial.preproc.warp.samp = 3; + expectedBatch{end}.spm.spatial.preproc.warp.write = [1 1]; + +end + From 379b3552347c2c5b4d5a5193c03df3b1d619bfd8 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 18:25:06 +0200 Subject: [PATCH 11/21] mh fix --- src/getGrpLevelContrastToCompute.m | 4 +++- tests/test_setBatchCoregistration.m | 19 +++++++++---------- tests/test_setBatchSegmentation.m | 29 ++++++++++++++--------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/getGrpLevelContrastToCompute.m b/src/getGrpLevelContrastToCompute.m index 3774fb51..385959d0 100644 --- a/src/getGrpLevelContrastToCompute.m +++ b/src/getGrpLevelContrastToCompute.m @@ -1,3 +1,5 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + function grpLvlCon = getGrpLevelContrastToCompute(opt, isMVPA) model = spm_jsonread(opt.model.univariate.file); @@ -12,4 +14,4 @@ end end -end \ No newline at end of file +end diff --git a/tests/test_setBatchCoregistration.m b/tests/test_setBatchCoregistration.m index 18408d22..a3428a4c 100644 --- a/tests/test_setBatchCoregistration.m +++ b/tests/test_setBatchCoregistration.m @@ -7,10 +7,10 @@ end function test_setBatchCoregistrationBasic() - + spmLocation = spm('dir'); - - addpath(fullfile(spmLocation, 'matlabbatch')) + + addpath(fullfile(spmLocation, 'matlabbatch')); for sesCounter = 0:2 matlabbatch = {}; @@ -18,14 +18,13 @@ function test_setBatchCoregistrationBasic() expectedBatch = returnExpectedBatch(sesCounter); assertEqual(expectedBatch, matlabbatch); end - -end +end function expectedBatch = returnExpectedBatch(sesCounter) - + expectedBatch = {}; - + expectedBatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).tgt_spec{1}(1).name = 'class'; @@ -40,7 +39,7 @@ function test_setBatchCoregistrationBasic() '.', 'val', '{}', {1}); expectedBatch{end}.spm.spatial.coreg.estimate.ref(1).src_output = ... substruct('.', 'files', '{}', {1}); - + expectedBatch{end}.spm.spatial.coreg.estimate.source(1) = cfg_dep; expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tname = 'Source Image'; expectedBatch{end}.spm.spatial.coreg.estimate.source(1).tgt_spec{1}(1).name = 'filter'; @@ -57,7 +56,7 @@ function test_setBatchCoregistrationBasic() '.', 'val', '{}', {1}); expectedBatch{end}.spm.spatial.coreg.estimate.source(1).src_output = ... substruct('.', 'rmean'); - + for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; @@ -83,4 +82,4 @@ function test_setBatchCoregistrationBasic() '.', 'cfiles'); end -end \ No newline at end of file +end diff --git a/tests/test_setBatchSegmentation.m b/tests/test_setBatchSegmentation.m index 3e06ed69..b568a949 100644 --- a/tests/test_setBatchSegmentation.m +++ b/tests/test_setBatchSegmentation.m @@ -7,22 +7,22 @@ end function test_setBatchSegmentationBasic() - + spmLocation = spm('dir'); - - addpath(fullfile(spmLocation, 'matlabbatch')) - + + addpath(fullfile(spmLocation, 'matlabbatch')); + matlabbatch = []; matlabbatch = setBatchSegmentation(matlabbatch); expectedBatch = returnExpectedBatch(spmLocation); - + assertEqual(expectedBatch, matlabbatch); - + end - + function expectedBatch = returnExpectedBatch(spmLocation) - + expectedBatch = []; expectedBatch{end + 1}.spm.spatial.preproc.channel.vols(1) = ... @@ -42,31 +42,31 @@ function test_setBatchSegmentationBasic() expectedBatch{end}.spm.spatial.preproc.tissue(1).ngaus = 1; expectedBatch{end}.spm.spatial.preproc.tissue(1).native = [1 1]; expectedBatch{end}.spm.spatial.preproc.tissue(1).warped = [0 0]; - + expectedBatch{end}.spm.spatial.preproc.tissue(2).tpm = ... {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',2']}; expectedBatch{end}.spm.spatial.preproc.tissue(2).ngaus = 1; expectedBatch{end}.spm.spatial.preproc.tissue(2).native = [1 1]; expectedBatch{end}.spm.spatial.preproc.tissue(2).warped = [0 0]; - + expectedBatch{end}.spm.spatial.preproc.tissue(3).tpm = ... {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',3']}; expectedBatch{end}.spm.spatial.preproc.tissue(3).ngaus = 2; expectedBatch{end}.spm.spatial.preproc.tissue(3).native = [1 1]; expectedBatch{end}.spm.spatial.preproc.tissue(3).warped = [0 0]; - + expectedBatch{end}.spm.spatial.preproc.tissue(4).tpm = ... {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',4']}; expectedBatch{end}.spm.spatial.preproc.tissue(4).ngaus = 3; expectedBatch{end}.spm.spatial.preproc.tissue(4).native = [0 0]; expectedBatch{end}.spm.spatial.preproc.tissue(4).warped = [0 0]; - + expectedBatch{end}.spm.spatial.preproc.tissue(5).tpm = ... {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',5']}; expectedBatch{end}.spm.spatial.preproc.tissue(5).ngaus = 4; expectedBatch{end}.spm.spatial.preproc.tissue(5).native = [0 0]; expectedBatch{end}.spm.spatial.preproc.tissue(5).warped = [0 0]; - + expectedBatch{end}.spm.spatial.preproc.tissue(6).tpm = ... {[fullfile(spmLocation, 'tpm', 'TPM.nii') ',6']}; expectedBatch{end}.spm.spatial.preproc.tissue(6).ngaus = 2; @@ -80,6 +80,5 @@ function test_setBatchSegmentationBasic() expectedBatch{end}.spm.spatial.preproc.warp.fwhm = 0; expectedBatch{end}.spm.spatial.preproc.warp.samp = 3; expectedBatch{end}.spm.spatial.preproc.warp.write = [1 1]; - -end +end From aefb40a8d41b246e3eda4b0d2b030edf63628c24 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 19:11:45 +0200 Subject: [PATCH 12/21] refactor spatial normalization and add test --- src/spmBatching/bidsSpatialPrepro.m | 87 +---------------- .../setBatchNormalizationSpatialPrepro.m | 81 ++++++++++++++++ src/spmBatching/setBatchNormalize.m | 25 +++++ .../test_setBatchNormalizationSpatialPrepro.m | 96 +++++++++++++++++++ 4 files changed, 203 insertions(+), 86 deletions(-) create mode 100644 src/spmBatching/setBatchNormalizationSpatialPrepro.m create mode 100644 src/spmBatching/setBatchNormalize.m create mode 100644 tests/test_setBatchNormalizationSpatialPrepro.m diff --git a/src/spmBatching/bidsSpatialPrepro.m b/src/spmBatching/bidsSpatialPrepro.m index 61085b6c..cf455ed6 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -81,92 +81,7 @@ function bidsSpatialPrepro(opt) fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE FUNCTIONALS\n'); - for iJob = 5:9 - matlabbatch{iJob}.spm.spatial.normalise.write.subj.def(1) = ... - cfg_dep('Segment: Forward Deformations', ... - substruct( ... - '.', 'val', '{}', {4}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct('.', 'fordef', '()', {':'})); - - % The following lines are commented out because those parameters - % can be set in the spm_my_defaults.m - % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.bb = ... - % [-78 -112 -70 ; 78 76 85]; - % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.interp = 4; - % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.prefix = ... - % spm_get_defaults('normalise.write.prefix'); - - end - - matlabbatch{5}.spm.spatial.normalise.write.subj.resample(1) = ... - cfg_dep('Coregister: Estimate: Coregistered Images', ... - substruct( ... - '.', 'val', '{}', {3}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct('.', 'cfiles')); - - % original voxel size at acquisition - matlabbatch{5}.spm.spatial.normalise.write.woptions.vox = voxDim; - - % NORMALIZE STRUCTURAL - fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE STRUCTURAL\n'); - matlabbatch{6}.spm.spatial.normalise.write.subj.resample(1) = ... - cfg_dep('Segment: Bias Corrected (1)', ... - substruct( ... - '.', 'val', '{}', {4}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct( ... - '.', 'channel', '()', {1}, ... - '.', 'biascorr', '()', {':'})); - % size 3 allow to run RunQA / original voxel size at acquisition - matlabbatch{6}.spm.spatial.normalise.write.woptions.vox = [1 1 1]; - - % NORMALIZE GREY MATTER - fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE GREY MATTER\n'); - matlabbatch{7}.spm.spatial.normalise.write.subj.resample(1) = ... - cfg_dep('Segment: c1 Images', ... - substruct( ... - '.', 'val', '{}', {4}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct( ... - '.', 'tiss', '()', {1}, ... - '.', 'c', '()', {':'})); - % size 3 allow to run RunQA / original voxel size at acquisition - matlabbatch{7}.spm.spatial.normalise.write.woptions.vox = voxDim; - - % NORMALIZE WHITE MATTER - fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE WHITE MATTER\n'); - matlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = ... - cfg_dep('Segment: c2 Images', ... - substruct( ... - '.', 'val', '{}', {4}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct( ... - '.', 'tiss', '()', {2}, ... - '.', 'c', '()', {':'})); - % size 3 allow to run RunQA / original voxel size at acquisition - matlabbatch{8}.spm.spatial.normalise.write.woptions.vox = voxDim; - - % NORMALIZE CSF MATTER - fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE CSF\n'); - matlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = ... - cfg_dep('Segment: c3 Images', ... - substruct( ... - '.', 'val', '{}', {4}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct( ... - '.', 'tiss', '()', {3}, ... - '.', 'c', '()', {':'})); - % size 3 allow to run RunQA / original voxel size at acquisition - matlabbatch{9}.spm.spatial.normalise.write.woptions.vox = voxDim; + matlabbatch = setBatchNormalizationSpatialPrepro(matlabbatch, voxDim); saveMatlabBatch(matlabbatch, 'spatialPreprocessing', opt, subID); diff --git a/src/spmBatching/setBatchNormalizationSpatialPrepro.m b/src/spmBatching/setBatchNormalizationSpatialPrepro.m new file mode 100644 index 00000000..ed543251 --- /dev/null +++ b/src/spmBatching/setBatchNormalizationSpatialPrepro.m @@ -0,0 +1,81 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function matlabbatch = setBatchNormalizationSpatialPrepro(matlabbatch, voxDim) + + jobsToAdd = numel(matlabbatch) + 1; + + for iJob = jobsToAdd:(jobsToAdd + 4) + + deformationField = ... + cfg_dep('Segment: Forward Deformations', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'fordef', '()', {':'})); + + % we set images to be resampled at the voxel size we had at acquisition + matlabbatch = setBatchNormalize(matlabbatch, deformationField, voxDim); + + end + + matlabbatch{jobsToAdd}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Coregister: Estimate: Coregistered Images', ... + substruct( ... + '.', 'val', '{}', {3}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'cfiles')); + + % NORMALIZE STRUCTURAL + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE STRUCTURAL\n'); + matlabbatch{jobsToAdd + 1}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: Bias Corrected (1)', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'channel', '()', {1}, ... + '.', 'biascorr', '()', {':'})); + % size 3 allow to run RunQA / original voxel size at acquisition + matlabbatch{jobsToAdd + 1}.spm.spatial.normalise.write.woptions.vox = [1 1 1]; + + % NORMALIZE GREY MATTER + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE GREY MATTER\n'); + matlabbatch{jobsToAdd + 2}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c1 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {1}, ... + '.', 'c', '()', {':'})); + + % NORMALIZE WHITE MATTER + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE WHITE MATTER\n'); + matlabbatch{jobsToAdd + 3}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c2 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {2}, ... + '.', 'c', '()', {':'})); + + % NORMALIZE CSF MATTER + fprintf(1, ' BUILDING SPATIAL JOB : NORMALIZE CSF\n'); + matlabbatch{jobsToAdd + 4}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c3 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {3}, ... + '.', 'c', '()', {':'})); + +end diff --git a/src/spmBatching/setBatchNormalize.m b/src/spmBatching/setBatchNormalize.m new file mode 100644 index 00000000..4011ff9a --- /dev/null +++ b/src/spmBatching/setBatchNormalize.m @@ -0,0 +1,25 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function matlabbatch = setBatchNormalize(matlabbatch, deformField, voxDim, imgToResample) + + if nargin > 1 && ~isempty(deformField) + matlabbatch{end + 1}.spm.spatial.normalise.write.subj.def(1) = deformField; + end + + if nargin > 2 && ~isempty(voxDim) + matlabbatch{end}.spm.spatial.normalise.write.woptions.vox = voxDim; + end + + if nargin > 3 && ~isempty(imgToResample) + matlabbatch{end}.spm.spatial.normalise.write.subj.resample(1) = imgToResample; + end + + % The following lines are commented out because those parameters + % can be set in the spm_my_defaults.m + % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.bb = ... + % [-78 -112 -70 ; 78 76 85]; + % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.interp = 4; + % matlabbatch{iJob}.spm.spatial.normalise.write.woptions.prefix = ... + % spm_get_defaults('normalise.write.prefix'); + +end diff --git a/tests/test_setBatchNormalizationSpatialPrepro.m b/tests/test_setBatchNormalizationSpatialPrepro.m new file mode 100644 index 00000000..7837a65c --- /dev/null +++ b/tests/test_setBatchNormalizationSpatialPrepro.m @@ -0,0 +1,96 @@ +function test_suite = test_setBatchNormalizationSpatialPrepro %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_setBatchNormalizationSpatialPreproBasic() + + spmLocation = spm('dir'); + + addpath(fullfile(spmLocation, 'matlabbatch')); + + matlabbatch = {}; + voxDim = [3 3 3]; + matlabbatch = setBatchNormalizationSpatialPrepro(matlabbatch, voxDim); + + expectedBatch = returnExpectedBatch(voxDim); + + assertEqual(expectedBatch, matlabbatch); + +end + +function expectedBatch = returnExpectedBatch(voxDim) + + expectedBatch = {}; + + jobsToAdd = numel(expectedBatch) + 1; + + for iJob = jobsToAdd:(jobsToAdd + 4) + expectedBatch{iJob}.spm.spatial.normalise.write.subj.def(1) = ... + cfg_dep('Segment: Forward Deformations', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'fordef', '()', {':'})); %#ok<*AGROW> + + end + + expectedBatch{jobsToAdd}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Coregister: Estimate: Coregistered Images', ... + substruct( ... + '.', 'val', '{}', {3}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'cfiles')); + expectedBatch{jobsToAdd}.spm.spatial.normalise.write.woptions.vox = voxDim; + + expectedBatch{jobsToAdd + 1}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: Bias Corrected (1)', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'channel', '()', {1}, ... + '.', 'biascorr', '()', {':'})); + expectedBatch{jobsToAdd + 1}.spm.spatial.normalise.write.woptions.vox = [1 1 1]; + + expectedBatch{jobsToAdd + 2}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c1 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {1}, ... + '.', 'c', '()', {':'})); + expectedBatch{jobsToAdd + 2}.spm.spatial.normalise.write.woptions.vox = voxDim; + + expectedBatch{jobsToAdd + 3}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c2 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {2}, ... + '.', 'c', '()', {':'})); + expectedBatch{jobsToAdd + 3}.spm.spatial.normalise.write.woptions.vox = voxDim; + + expectedBatch{jobsToAdd + 4}.spm.spatial.normalise.write.subj.resample(1) = ... + cfg_dep('Segment: c3 Images', ... + substruct( ... + '.', 'val', '{}', {4}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct( ... + '.', 'tiss', '()', {3}, ... + '.', 'c', '()', {':'})); + expectedBatch{jobsToAdd + 4}.spm.spatial.normalise.write.woptions.vox = voxDim; + +end From 9ecd6b76b641c16530f5bcf577a6c188c507a893 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 19:36:28 +0200 Subject: [PATCH 13/21] add test for getting group level contrasts --- src/getGrpLevelContrastToCompute.m | 2 +- tests/test_getGrpLevelContrastToCompute.m | 43 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/test_getGrpLevelContrastToCompute.m diff --git a/src/getGrpLevelContrastToCompute.m b/src/getGrpLevelContrastToCompute.m index 385959d0..d909a618 100644 --- a/src/getGrpLevelContrastToCompute.m +++ b/src/getGrpLevelContrastToCompute.m @@ -1,6 +1,6 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers -function grpLvlCon = getGrpLevelContrastToCompute(opt, isMVPA) +function [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt, isMVPA) model = spm_jsonread(opt.model.univariate.file); if isMVPA diff --git a/tests/test_getGrpLevelContrastToCompute.m b/tests/test_getGrpLevelContrastToCompute.m new file mode 100644 index 00000000..4bb1ccdc --- /dev/null +++ b/tests/test_getGrpLevelContrastToCompute.m @@ -0,0 +1,43 @@ +function test_suite = test_getGrpLevelContrastToCompute %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_getGrpLevelContrastToComputeBasic() + + isMVPA = false; + opt.model.univariate.file = fullfile(fileparts(mfilename('fullpath')), ... + 'dummyData', 'model', 'model-visMotionLoc_smdl.json'); + + [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt, isMVPA); + + AutoContrasts = { + 'trial_type.VisMot'; ... + 'trial_type.VisStat'; ... + 'VisMot_gt_VisStat'; ... + 'VisStat_gt_VisMot'}; + + assertEqual(iStep, 2); + assertEqual(grpLvlCon, AutoContrasts); + + %% + isMVPA = true; + opt.model.multivariate.file = fullfile(fileparts(mfilename('fullpath')), ... + 'dummyData', 'model', 'model-vislocalizer_smdl.json'); + + [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt, isMVPA); + + AutoContrasts = { + 'trial_type.VisMot'; ... + 'trial_type.VisStat'; ... + 'VisMot_gt_VisStat'; ... + 'VisStat_gt_VisMot'}; + + assertEqual(iStep, 3); + assertEqual(grpLvlCon, AutoContrasts); + + +end \ No newline at end of file From 03a85d99f39224a2534a076e95089f785746f610 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 19:37:19 +0200 Subject: [PATCH 14/21] mh fix --- tests/test_getGrpLevelContrastToCompute.m | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/test_getGrpLevelContrastToCompute.m b/tests/test_getGrpLevelContrastToCompute.m index 4bb1ccdc..eed1495e 100644 --- a/tests/test_getGrpLevelContrastToCompute.m +++ b/tests/test_getGrpLevelContrastToCompute.m @@ -7,37 +7,36 @@ end function test_getGrpLevelContrastToComputeBasic() - + isMVPA = false; opt.model.univariate.file = fullfile(fileparts(mfilename('fullpath')), ... 'dummyData', 'model', 'model-visMotionLoc_smdl.json'); - + [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt, isMVPA); - + AutoContrasts = { 'trial_type.VisMot'; ... 'trial_type.VisStat'; ... 'VisMot_gt_VisStat'; ... 'VisStat_gt_VisMot'}; - + assertEqual(iStep, 2); assertEqual(grpLvlCon, AutoContrasts); - + %% isMVPA = true; opt.model.multivariate.file = fullfile(fileparts(mfilename('fullpath')), ... 'dummyData', 'model', 'model-vislocalizer_smdl.json'); - + [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt, isMVPA); - + AutoContrasts = { 'trial_type.VisMot'; ... 'trial_type.VisStat'; ... 'VisMot_gt_VisStat'; ... 'VisStat_gt_VisMot'}; - + assertEqual(iStep, 3); assertEqual(grpLvlCon, AutoContrasts); - - -end \ No newline at end of file + +end From 613f8dd8836fdf37d1685c1121a10991b713c527 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 21:12:41 +0200 Subject: [PATCH 15/21] create test for STC batch - remove .gz files from dummy data set --- src/getData.m | 2 +- src/spmBatching/setBatchSTC.m | 6 +- tests/createDummyDataSet.sh | 8 +- ...es-01_T1w.nii.gz => sub-01_ses-01_T1w.nii} | 0 ... sub-01_ses-01_task-vislocalizer_bold.nii} | 0 ...b-01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...b-01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...es-02_T1w.nii.gz => sub-01_ses-02_T1w.nii} | 0 ... sub-01_ses-02_task-vislocalizer_bold.nii} | 0 ...b-01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...b-01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...es-01_T1w.nii.gz => sub-02_ses-01_T1w.nii} | 0 ... sub-02_ses-01_task-vislocalizer_bold.nii} | 0 ...b-02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...b-02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...es-02_T1w.nii.gz => sub-02_ses-02_T1w.nii} | 0 ... sub-02_ses-02_task-vislocalizer_bold.nii} | 0 ...b-02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...b-02_ses-02_task-vismotion_run-2_bold.nii} | 0 ..._T1w.nii.gz => sub-blind01_ses-01_T1w.nii} | 0 ...blind01_ses-01_task-vislocalizer_bold.nii} | 0 ...nd01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nd01_ses-01_task-vismotion_run-2_bold.nii} | 0 ..._T1w.nii.gz => sub-blind01_ses-02_T1w.nii} | 0 ...blind01_ses-02_task-vislocalizer_bold.nii} | 0 ...nd01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nd01_ses-02_task-vismotion_run-2_bold.nii} | 0 ..._T1w.nii.gz => sub-blind02_ses-01_T1w.nii} | 0 ...blind02_ses-01_task-vislocalizer_bold.nii} | 0 ...nd02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nd02_ses-01_task-vismotion_run-2_bold.nii} | 0 ..._T1w.nii.gz => sub-blind02_ses-02_T1w.nii} | 0 ...blind02_ses-02_task-vislocalizer_bold.nii} | 0 ...nd02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nd02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...01_T1w.nii.gz => sub-cat01_ses-01_T1w.nii} | 0 ...b-cat01_ses-01_task-vislocalizer_bold.nii} | 0 ...at01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...at01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...02_T1w.nii.gz => sub-cat01_ses-02_T1w.nii} | 0 ...b-cat01_ses-02_task-vislocalizer_bold.nii} | 0 ...at01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...at01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...01_T1w.nii.gz => sub-cat02_ses-01_T1w.nii} | 0 ...b-cat02_ses-01_task-vislocalizer_bold.nii} | 0 ...at02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...at02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...02_T1w.nii.gz => sub-cat02_ses-02_T1w.nii} | 0 ...b-cat02_ses-02_task-vislocalizer_bold.nii} | 0 ...at02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...at02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...1_T1w.nii.gz => sub-cont01_ses-01_T1w.nii} | 0 ...-cont01_ses-01_task-vislocalizer_bold.nii} | 0 ...nt01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nt01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...2_T1w.nii.gz => sub-cont01_ses-02_T1w.nii} | 0 ...-cont01_ses-02_task-vislocalizer_bold.nii} | 0 ...nt01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nt01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...1_T1w.nii.gz => sub-cont02_ses-01_T1w.nii} | 0 ...-cont02_ses-01_task-vislocalizer_bold.nii} | 0 ...nt02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nt02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...2_T1w.nii.gz => sub-cont02_ses-02_T1w.nii} | 0 ...-cont02_ses-02_task-vislocalizer_bold.nii} | 0 ...nt02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nt02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...1_T1w.nii.gz => sub-cont03_ses-01_T1w.nii} | 0 ...-cont03_ses-01_task-vislocalizer_bold.nii} | 0 ...nt03_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nt03_ses-01_task-vismotion_run-2_bold.nii} | 0 ...2_T1w.nii.gz => sub-cont03_ses-02_T1w.nii} | 0 ...-cont03_ses-02_task-vislocalizer_bold.nii} | 0 ...nt03_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nt03_ses-02_task-vismotion_run-2_bold.nii} | 0 ...1_T1w.nii.gz => sub-ctrl01_ses-01_T1w.nii} | 0 ...-ctrl01_ses-01_task-vislocalizer_bold.nii} | 0 ...rl01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...rl01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...2_T1w.nii.gz => sub-ctrl01_ses-02_T1w.nii} | 0 ...-ctrl01_ses-02_task-vislocalizer_bold.nii} | 0 ...rl01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...rl01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...1_T1w.nii.gz => sub-ctrl02_ses-01_T1w.nii} | 0 ...-ctrl02_ses-01_task-vislocalizer_bold.nii} | 0 ...rl02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...rl02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...2_T1w.nii.gz => sub-ctrl02_ses-02_T1w.nii} | 0 ...-ctrl02_ses-02_task-vislocalizer_bold.nii} | 0 ...rl02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...rl02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...2057_jobs_matlabbatch_SPM12_groupTest.json | 235 ++++++++++++++++++ ...2101_jobs_matlabbatch_SPM12_groupTest.json | 235 ++++++++++++++++++ ...2111_jobs_matlabbatch_SPM12_groupTest.json | 235 ++++++++++++++++++ ...0918_2057_jobs_matlabbatch_SPM12_test.json | 235 ++++++++++++++++++ ...0918_2101_jobs_matlabbatch_SPM12_test.json | 235 ++++++++++++++++++ ...0918_2111_jobs_matlabbatch_SPM12_test.json | 235 ++++++++++++++++++ tests/test_getInfo.m | 2 +- tests/test_inputFileValidation.m | 4 +- tests/test_setBatchSTC.m | 99 ++++++++ 100 files changed, 1522 insertions(+), 9 deletions(-) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/anat/{sub-01_ses-01_T1w.nii.gz => sub-01_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/{sub-01_ses-01_task-vislocalizer_bold.nii.gz => sub-01_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/{sub-01_ses-01_task-vismotion_run-1_bold.nii.gz => sub-01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/{sub-01_ses-01_task-vismotion_run-2_bold.nii.gz => sub-01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/anat/{sub-01_ses-02_T1w.nii.gz => sub-01_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/{sub-01_ses-02_task-vislocalizer_bold.nii.gz => sub-01_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/{sub-01_ses-02_task-vismotion_run-1_bold.nii.gz => sub-01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/{sub-01_ses-02_task-vismotion_run-2_bold.nii.gz => sub-01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/anat/{sub-02_ses-01_T1w.nii.gz => sub-02_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/{sub-02_ses-01_task-vislocalizer_bold.nii.gz => sub-02_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/{sub-02_ses-01_task-vismotion_run-1_bold.nii.gz => sub-02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/{sub-02_ses-01_task-vismotion_run-2_bold.nii.gz => sub-02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/anat/{sub-02_ses-02_T1w.nii.gz => sub-02_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/{sub-02_ses-02_task-vislocalizer_bold.nii.gz => sub-02_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/{sub-02_ses-02_task-vismotion_run-1_bold.nii.gz => sub-02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/{sub-02_ses-02_task-vismotion_run-2_bold.nii.gz => sub-02_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/anat/{sub-blind01_ses-01_T1w.nii.gz => sub-blind01_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/{sub-blind01_ses-01_task-vislocalizer_bold.nii.gz => sub-blind01_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/{sub-blind01_ses-01_task-vismotion_run-1_bold.nii.gz => sub-blind01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/{sub-blind01_ses-01_task-vismotion_run-2_bold.nii.gz => sub-blind01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/anat/{sub-blind01_ses-02_T1w.nii.gz => sub-blind01_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/{sub-blind01_ses-02_task-vislocalizer_bold.nii.gz => sub-blind01_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/{sub-blind01_ses-02_task-vismotion_run-1_bold.nii.gz => sub-blind01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/{sub-blind01_ses-02_task-vismotion_run-2_bold.nii.gz => sub-blind01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/anat/{sub-blind02_ses-01_T1w.nii.gz => sub-blind02_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/{sub-blind02_ses-01_task-vislocalizer_bold.nii.gz => sub-blind02_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/{sub-blind02_ses-01_task-vismotion_run-1_bold.nii.gz => sub-blind02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/{sub-blind02_ses-01_task-vismotion_run-2_bold.nii.gz => sub-blind02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/anat/{sub-blind02_ses-02_T1w.nii.gz => sub-blind02_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/{sub-blind02_ses-02_task-vislocalizer_bold.nii.gz => sub-blind02_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/{sub-blind02_ses-02_task-vismotion_run-1_bold.nii.gz => sub-blind02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/{sub-blind02_ses-02_task-vismotion_run-2_bold.nii.gz => sub-blind02_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/{sub-cat01_ses-01_T1w.nii.gz => sub-cat01_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/{sub-cat01_ses-01_task-vislocalizer_bold.nii.gz => sub-cat01_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/{sub-cat01_ses-01_task-vismotion_run-1_bold.nii.gz => sub-cat01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/{sub-cat01_ses-01_task-vismotion_run-2_bold.nii.gz => sub-cat01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/{sub-cat01_ses-02_T1w.nii.gz => sub-cat01_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/{sub-cat01_ses-02_task-vislocalizer_bold.nii.gz => sub-cat01_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/{sub-cat01_ses-02_task-vismotion_run-1_bold.nii.gz => sub-cat01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/{sub-cat01_ses-02_task-vismotion_run-2_bold.nii.gz => sub-cat01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/{sub-cat02_ses-01_T1w.nii.gz => sub-cat02_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/{sub-cat02_ses-01_task-vislocalizer_bold.nii.gz => sub-cat02_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/{sub-cat02_ses-01_task-vismotion_run-1_bold.nii.gz => sub-cat02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/{sub-cat02_ses-01_task-vismotion_run-2_bold.nii.gz => sub-cat02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/{sub-cat02_ses-02_T1w.nii.gz => sub-cat02_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/{sub-cat02_ses-02_task-vislocalizer_bold.nii.gz => sub-cat02_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/{sub-cat02_ses-02_task-vismotion_run-1_bold.nii.gz => sub-cat02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/{sub-cat02_ses-02_task-vismotion_run-2_bold.nii.gz => sub-cat02_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/{sub-cont01_ses-01_T1w.nii.gz => sub-cont01_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/{sub-cont01_ses-01_task-vislocalizer_bold.nii.gz => sub-cont01_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/{sub-cont01_ses-01_task-vismotion_run-1_bold.nii.gz => sub-cont01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/{sub-cont01_ses-01_task-vismotion_run-2_bold.nii.gz => sub-cont01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/{sub-cont01_ses-02_T1w.nii.gz => sub-cont01_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/{sub-cont01_ses-02_task-vislocalizer_bold.nii.gz => sub-cont01_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/{sub-cont01_ses-02_task-vismotion_run-1_bold.nii.gz => sub-cont01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/{sub-cont01_ses-02_task-vismotion_run-2_bold.nii.gz => sub-cont01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/{sub-cont02_ses-01_T1w.nii.gz => sub-cont02_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/{sub-cont02_ses-01_task-vislocalizer_bold.nii.gz => sub-cont02_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/{sub-cont02_ses-01_task-vismotion_run-1_bold.nii.gz => sub-cont02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/{sub-cont02_ses-01_task-vismotion_run-2_bold.nii.gz => sub-cont02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/{sub-cont02_ses-02_T1w.nii.gz => sub-cont02_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/{sub-cont02_ses-02_task-vislocalizer_bold.nii.gz => sub-cont02_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/{sub-cont02_ses-02_task-vismotion_run-1_bold.nii.gz => sub-cont02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/{sub-cont02_ses-02_task-vismotion_run-2_bold.nii.gz => sub-cont02_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/{sub-cont03_ses-01_T1w.nii.gz => sub-cont03_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/{sub-cont03_ses-01_task-vislocalizer_bold.nii.gz => sub-cont03_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/{sub-cont03_ses-01_task-vismotion_run-1_bold.nii.gz => sub-cont03_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/{sub-cont03_ses-01_task-vismotion_run-2_bold.nii.gz => sub-cont03_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/{sub-cont03_ses-02_T1w.nii.gz => sub-cont03_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/{sub-cont03_ses-02_task-vislocalizer_bold.nii.gz => sub-cont03_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/{sub-cont03_ses-02_task-vismotion_run-1_bold.nii.gz => sub-cont03_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/{sub-cont03_ses-02_task-vismotion_run-2_bold.nii.gz => sub-cont03_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/anat/{sub-ctrl01_ses-01_T1w.nii.gz => sub-ctrl01_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/{sub-ctrl01_ses-01_task-vislocalizer_bold.nii.gz => sub-ctrl01_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/{sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii.gz => sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/{sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii.gz => sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/anat/{sub-ctrl01_ses-02_T1w.nii.gz => sub-ctrl01_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/{sub-ctrl01_ses-02_task-vislocalizer_bold.nii.gz => sub-ctrl01_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/{sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii.gz => sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/{sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii.gz => sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/anat/{sub-ctrl02_ses-01_T1w.nii.gz => sub-ctrl02_ses-01_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/{sub-ctrl02_ses-01_task-vislocalizer_bold.nii.gz => sub-ctrl02_ses-01_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/{sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii.gz => sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/{sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii.gz => sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/anat/{sub-ctrl02_ses-02_T1w.nii.gz => sub-ctrl02_ses-02_T1w.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/{sub-ctrl02_ses-02_task-vislocalizer_bold.nii.gz => sub-ctrl02_ses-02_task-vislocalizer_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/{sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii.gz => sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/{sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii.gz => sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii} (100%) create mode 100644 tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json create mode 100644 tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json create mode 100644 tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json create mode 100644 tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json create mode 100644 tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json create mode 100644 tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json create mode 100644 tests/test_setBatchSTC.m diff --git a/src/getData.m b/src/getData.m index efb908be..866a5269 100644 --- a/src/getData.m +++ b/src/getData.m @@ -114,7 +114,7 @@ case 'T1w' metadata = spm_BIDS(BIDS, 'metadata', ... 'sub', subjects{1}, ... - 'type', [type]); + 'type', type); end if iscell(metadata) diff --git a/src/spmBatching/setBatchSTC.m b/src/spmBatching/setBatchSTC.m index 09a91f04..645f7394 100644 --- a/src/spmBatching/setBatchSTC.m +++ b/src/spmBatching/setBatchSTC.m @@ -53,6 +53,8 @@ prefix = getPrefix('STC', opt); [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); + + runCounter = 1; for iSes = 1:nbSessions @@ -70,8 +72,10 @@ files = inputFileValidation(subFuncDataDir, prefix, fileName); % add the file to the list - matlabbatch{1}.spm.temporal.st.scans{iRun} = cellstr(files); + matlabbatch{1}.spm.temporal.st.scans{runCounter} = cellstr(files); + runCounter = runCounter + 1; + disp(files{1}); end diff --git a/tests/createDummyDataSet.sh b/tests/createDummyDataSet.sh index 7e3e8df2..13b86589 100755 --- a/tests/createDummyDataSet.sh +++ b/tests/createDummyDataSet.sh @@ -26,9 +26,9 @@ do rm $ThisDir/func/* - touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-1_bold.nii.gz - touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-2_bold.nii.gz - touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii.gz + touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-1_bold.nii + touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-2_bold.nii + touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii touch $ThisDir/func/s6wsub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii touch $ThisDir/func/s6rsub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii touch $ThisDir/func/rp_sub-$Subject\_ses-$Ses\_task-vislocalizer_bold.txt @@ -47,7 +47,7 @@ do mkdir $ThisDir/anat - touch $ThisDir/anat/sub-$Subject\_ses-$Ses\_T1w.nii.gz + touch $ThisDir/anat/sub-$Subject\_ses-$Ses\_T1w.nii done diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/anat/sub-01_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/sub-01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/anat/sub-01_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/anat/sub-01_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/anat/sub-01_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/anat/sub-01_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/sub-01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/anat/sub-02_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/anat/sub-02_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/anat/sub-02_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/anat/sub-02_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/sub-02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/anat/sub-02_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/anat/sub-02_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/anat/sub-02_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/anat/sub-02_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/sub-02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/anat/sub-blind01_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/anat/sub-blind01_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/anat/sub-blind01_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/anat/sub-blind01_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/sub-blind01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/anat/sub-blind02_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/anat/sub-blind02_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/anat/sub-blind02_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/anat/sub-blind02_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/anat/sub-blind02_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/anat/sub-blind02_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/anat/sub-blind02_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/anat/sub-blind02_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/anat/sub-ctrl01_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/anat/sub-ctrl01_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/anat/sub-ctrl01_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/anat/sub-ctrl01_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/sub-ctrl01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/anat/sub-ctrl02_ses-01_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/anat/sub-ctrl02_ses-01_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/anat/sub-ctrl02_ses-01_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/anat/sub-ctrl02_ses-01_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/anat/sub-ctrl02_ses-02_T1w.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/anat/sub-ctrl02_ses-02_T1w.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/anat/sub-ctrl02_ses-02_T1w.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/anat/sub-ctrl02_ses-02_T1w.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii.gz rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json new file mode 100644 index 00000000..1c1c2e81 --- /dev/null +++ b/tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "groupTest", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json new file mode 100644 index 00000000..1c1c2e81 --- /dev/null +++ b/tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "groupTest", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json new file mode 100644 index 00000000..1c1c2e81 --- /dev/null +++ b/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "groupTest", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json new file mode 100644 index 00000000..7c811cde --- /dev/null +++ b/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "test", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json new file mode 100644 index 00000000..7c811cde --- /dev/null +++ b/tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "test", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json new file mode 100644 index 00000000..7c811cde --- /dev/null +++ b/tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json @@ -0,0 +1,235 @@ +{ + "matlabbach": { + "test": 1 + }, + "GeneratedBy": { + "name": "CPP_BIDS_SPM_pipeline", + "Version": "v0.0.3", + "Description": "test", + "CodeURL": "" + }, + "OS": { + "name": "GLNXA64", + "platform": { + "name": "Matlab", + "version": "9.2.0.538062 (R2017a)" + }, + "spmVersion": "SPM12 - 7487", + "environmentVariables": { + "keys": [ + "ARCH", + "AUTOMOUNT_MAP", + "BASEMATLABPATH", + "CLUTTER_IM_MODULE", + "COLORTERM", + "CONDA_DEFAULT_ENV", + "CONDA_EXE", + "CONDA_PREFIX", + "CONDA_PROMPT_MODIFIER", + "CONDA_PYTHON_EXE", + "CONDA_SHLVL", + "DBUS_SESSION_BUS_ADDRESS=unix:path", + "DEFAULTS_PATH", + "DESKTOP_SESSION", + "DISPLAY", + "FSLDIR", + "FSLGECUDAQ", + "FSLLOCKDIR", + "FSLMACHINELIST", + "FSLMULTIFILEQUIT", + "FSLOUTPUTTYPE", + "FSLREMOTECALL", + "FSLTCLSH", + "FSLWISH", + "GDMSESSION", + "GJS_DEBUG_OUTPUT", + "GJS_DEBUG_TOPICS", + "GNOME_DESKTOP_SESSION_ID", + "GNOME_SHELL_SESSION_MODE", + "GNOME_TERMINAL_SCREEN", + "GNOME_TERMINAL_SERVICE", + "GPG_AGENT_INFO", + "GTK_IM_MODULE", + "GTK_MODULES", + "HOME", + "HOMEBREW_CELLAR", + "HOMEBREW_PREFIX", + "HOMEBREW_REPOSITORY", + "IM_CONFIG_PHASE", + "INFOPATH", + "KMP_BLOCKTIME", + "KMP_HANDLE_SIGNALS", + "KMP_STACKSIZE", + "LANG", + "LANGUAGE", + "LC_ADDRESS", + "LC_IDENTIFICATION", + "LC_MEASUREMENT", + "LC_MONETARY", + "LC_NAME", + "LC_NUMERIC", + "LC_PAPER", + "LC_TELEPHONE", + "LC_TIME", + "LD_LIBRARY_PATH", + "LESSCLOSE", + "LESSOPEN", + "LOGNAME", + "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", + "MANDATORY_PATH", + "MANPATH", + "MKL_DOMAIN_NUM_THREADS", + "MKL_NUM_THREADS", + "NLSPATH", + "NVM_BIN", + "NVM_CD_FLAGS", + "NVM_DIR", + "OLDPWD", + "OSG_LD_LIBRARY_PATH", + "PAPERSIZE", + "PATH", + "PWD", + "QT4_IM_MODULE", + "QT_ACCESSIBILITY", + "QT_IM_MODULE", + "SESSION_MANAGER", + "SHELL", + "SHLVL", + "SSH_AGENT_PID", + "SSH_AUTH_SOCK", + "TERM", + "TEXTDOMAIN", + "TEXTDOMAINDIR", + "TOOLBOX", + "USER", + "USERNAME", + "VTE_VERSION", + "WINDOWPATH", + "XAUTHORITY", + "XDG_CONFIG_DIRS", + "XDG_CURRENT_DESKTOP", + "XDG_DATA_DIRS", + "XDG_MENU_PREFIX", + "XDG_RUNTIME_DIR", + "XDG_SEAT", + "XDG_SESSION_DESKTOP", + "XDG_SESSION_ID", + "XDG_SESSION_TYPE", + "XDG_VTNR", + "XFILESEARCHPATH", + "XMODIFIERS=@im", + "_", + "_CE_CONDA", + "_CE_M", + "__KMP_REGISTERED_LIB_18839" + ], + "values": [ + "glnxa64", + "", + "", + "xim", + "truecolor", + "base", + "/home/remi/miniconda3/bin/conda", + "/home/remi/miniconda3", + "(base) ", + "/home/remi/miniconda3/bin/python", + "1", + "/run/user/1000/bus", + "/usr/share/gconf/ubuntu.default.path", + "ubuntu", + ":0", + "/usr/local/fsl", + "cuda.q", + "", + "", + "TRUE", + "NIFTI_GZ", + "", + "/usr/local/fsl/bin/fsltclsh", + "/usr/local/fsl/bin/fslwish", + "ubuntu", + "stderr", + "JS ERROR;JS LOG", + "this-is-deprecated", + "ubuntu", + "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", + ":1.1943", + "/run/user/1000/gnupg/S.gpg-agent:0:1", + "ibus", + "gail:atk-bridge", + "/home/remi", + "/home/linuxbrew/.linuxbrew/Cellar", + "/home/linuxbrew/.linuxbrew", + "/home/linuxbrew/.linuxbrew/Homebrew", + "2", + "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", + "1", + "0", + "512k", + "en_US.UTF-8", + "en_US", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "C", + "en_GB.UTF-8", + "en_GB.UTF-8", + "en_GB.UTF-8", + "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", + "/usr/bin/lesspipe %s %s", + "| /usr/bin/lesspipe %s", + "remi", + "00;36:", + "/usr/share/gconf/ubuntu.mandatory.path", + "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", + "", + "", + "/usr/dt/lib/nls/msg/%L/%N.cat", + "/home/remi/.nvm/versions/node/v12.18.2/bin", + "", + "/home/remi/.nvm", + "/usr/local/MATLAB/R2017a", + "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", + "a4", + "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", + "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", + "xim", + "1", + "ibus", + "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", + "/bin/bash", + "2", + "4089", + "/run/user/1000/keyring/ssh", + "dumb", + "im-config", + "/usr/share/locale/", + "/usr/local/MATLAB/R2017a/toolbox", + "remi", + "remi", + "5202", + "2", + "/run/user/1000/gdm/Xauthority", + "/etc/xdg/xdg-ubuntu:/etc/xdg", + "ubuntu:GNOME", + "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", + "gnome-", + "/run/user/1000", + "seat0", + "ubuntu", + "4", + "x11", + "2", + "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", + "ibus", + "/usr/bin/env", + "", + "", + "0x7f4a68823b10-cafe64e5-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/test_getInfo.m b/tests/test_getInfo.m index 01cee547..a944570e 100644 --- a/tests/test_getInfo.m +++ b/tests/test_getInfo.m @@ -56,7 +56,7 @@ function test_getInfoBasic() '_ses-' session, ... '_task-' opt.taskName, ... '_run-' run, ... - '_bold.nii.gz']); + '_bold.nii']); assert(strcmp(filename{1}, FileName)); diff --git a/tests/test_inputFileValidation.m b/tests/test_inputFileValidation.m index 8c3ccacb..29aea063 100644 --- a/tests/test_inputFileValidation.m +++ b/tests/test_inputFileValidation.m @@ -11,11 +11,11 @@ function test_inputFileValidationBasic() directory = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives', ... 'SPM12_CPPL', 'sub-01', 'ses-01', 'func'); prefix = ''; - fileName = 'sub-01_ses-01_task-vislocalizer_bold.nii.gz'; + fileName = 'sub-01_ses-01_task-vislocalizer_bold.nii'; expectedOutput = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives', ... 'SPM12_CPPL', 'sub-01', 'ses-01', 'func', ... - 'sub-01_ses-01_task-vislocalizer_bold.nii.gz'); + 'sub-01_ses-01_task-vislocalizer_bold.nii'); file = inputFileValidation(directory, prefix, fileName); diff --git a/tests/test_setBatchSTC.m b/tests/test_setBatchSTC.m new file mode 100644 index 00000000..e39f0b7b --- /dev/null +++ b/tests/test_setBatchSTC.m @@ -0,0 +1,99 @@ +function test_suite = test_setBatchSTC %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_setBatchSTCEmpty() + + opt.dataDir = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives'); + opt.taskName = 'vislocalizer'; + [~, opt, BIDS] = getData(opt); + + subID = '02'; + matlabbatch = setBatchSTC(BIDS, opt, subID); + + % no slice timing info for this run so nothing should be returned. + assertEqual(matlabbatch, []); + +end + +function test_setBatchSTCForce() + + opt.dataDir = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives'); + opt.taskName = 'vislocalizer'; + % we give it some slice timing value to force slice timing to happen + opt.sliceOrder = 1:5; + opt.STC_referenceSlice = 1.24 / 2; + [~, opt, BIDS] = getData(opt); + + subID = '02'; + matlabbatch = setBatchSTC(BIDS, opt, subID); + + TR = 1.55; + expectedBatch = returnExpectedBatch(opt.sliceOrder, opt.STC_referenceSlice, TR); + + runCounter = 1; + for iSes = 1:2 + fileName = spm_BIDS(BIDS, 'data', ... + 'sub', subID, ... + 'ses', sprintf('0%i', iSes), ... + 'task', opt.taskName, ... + 'type', 'bold'); + expectedBatch{1}.spm.temporal.st.scans{runCounter} = {fileName{1}}; + runCounter = runCounter + 1; + end + + assertEqual(matlabbatch, expectedBatch); + +end + +function test_setBatchSTCBasic() + + opt.dataDir = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives'); + opt.taskName = 'vismotion'; + [~, opt, BIDS] = getData(opt); + + subID = '02'; + matlabbatch = setBatchSTC(BIDS, opt, subID); + + TR = 1.5; + sliceOrder = repmat([ ... + 0.5475, 0, 0.3825, 0.055, 0.4375, 0.11, 0.4925, 0.22, 0.6025, 0.275, 0.6575, ... + 0.3275, 0.71, 0.165], 1, 3)'; + STC_referenceSlice = 0.355; + + expectedBatch = returnExpectedBatch(sliceOrder, STC_referenceSlice, TR); + + runCounter = 1; + for iSes = 1:2 + fileName = spm_BIDS(BIDS, 'data', ... + 'sub', subID, ... + 'ses', sprintf('0%i', iSes), ... + 'task', opt.taskName, ... + 'type', 'bold'); + expectedBatch{1}.spm.temporal.st.scans{runCounter} = ... + {fileName{1}}; + expectedBatch{1}.spm.temporal.st.scans{runCounter + 1} = ... + {fileName{2}}; + runCounter = runCounter + 2; + end + + assertEqual(matlabbatch, expectedBatch); + +end + +function expectedBatch = returnExpectedBatch(sliceOrder, referenceSlice, TR) + + nbSlices = length(sliceOrder); + TA = TR - (TR / nbSlices); + + expectedBatch{1}.spm.temporal.st.nslices = nbSlices; + expectedBatch{1}.spm.temporal.st.tr = TR; + expectedBatch{1}.spm.temporal.st.ta = TA; + expectedBatch{1}.spm.temporal.st.so = sliceOrder; + expectedBatch{1}.spm.temporal.st.refslice = referenceSlice; + +end From e2e0b2bd0a7bce5a48875e994c0ebb6a48c4030b Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 21:31:27 +0200 Subject: [PATCH 16/21] small fix --- demo/batch_download_run.m | 4 ++-- src/spmBatching/bidsSpatialPrepro.m | 4 ++-- src/spmBatching/setBatchCoregistration.m | 4 ++-- src/spmBatching/setBatchRealign.m | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demo/batch_download_run.m b/demo/batch_download_run.m index 250b5fdb..1f7a5187 100644 --- a/demo/batch_download_run.m +++ b/demo/batch_download_run.m @@ -69,7 +69,7 @@ %% Get data % fprintf('%-40s:', 'Downloading dataset...'); % urlwrite(URL, 'MoAEpilot.zip'); -unzip('MoAEpilot.zip', fullfile(WD, 'output')); +% unzip('MoAEpilot.zip', fullfile(WD, 'output')); %% Check dependencies % If toolboxes are not in the MATLAB Directory and needed to be added to @@ -86,7 +86,7 @@ %% Run batches isMVPA = 0; -bidsCopyRawFolder(opt, 1); +% bidsCopyRawFolder(opt, 1); bidsSTC(opt); bidsSpatialPrepro(opt); bidsSmoothing(FWHM, opt); diff --git a/src/spmBatching/bidsSpatialPrepro.m b/src/spmBatching/bidsSpatialPrepro.m index cf455ed6..f80bad1a 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -50,7 +50,7 @@ function bidsSpatialPrepro(opt) printProcessingSubject(groupName, iSub, subID); % identify sessions for this subject - [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); + [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); fprintf(1, ' BUILDING SPATIAL JOB : SELECTING ANATOMCAL\n'); % get all T1w images for that subject and @@ -72,7 +72,7 @@ function bidsSpatialPrepro(opt) fprintf(1, ' BUILDING SPATIAL JOB : COREGISTER\n'); % REFERENCE IMAGE : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') - matlabbatch = setBatchCoregistration(matlabbatch); + matlabbatch = setBatchCoregistration(matlabbatch, nbSessions); fprintf(1, ' BUILDING SPATIAL JOB : SEGMENT ANATOMICAL\n'); % (WITH NEW SEGMENT -DEFAULT SEGMENT IN SPM12) diff --git a/src/spmBatching/setBatchCoregistration.m b/src/spmBatching/setBatchCoregistration.m index 7402ad6c..8cab1761 100644 --- a/src/spmBatching/setBatchCoregistration.m +++ b/src/spmBatching/setBatchCoregistration.m @@ -1,6 +1,6 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers -function matlabbatch = setBatchCoregistration(matlabbatch, sesCounter) +function matlabbatch = setBatchCoregistration(matlabbatch, nbSessions) matlabbatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = cfg_dep; matlabbatch{end}.spm.spatial.coreg.estimate.ref(1).tname = 'Reference Image'; @@ -39,7 +39,7 @@ % OTHER IMAGES : DEPENDENCY FROM REALIGNEMENT ('Realign: Estimate & Reslice: % Realigned Images (Sess 1 to N)') % files %% - for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter + for iSes = 1:nbSessions matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; matlabbatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).name = ... diff --git a/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m index 5d9ecd84..24630f82 100644 --- a/src/spmBatching/setBatchRealign.m +++ b/src/spmBatching/setBatchRealign.m @@ -4,7 +4,7 @@ matlabbatch{end + 1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; - [sessions] = getInfo(BIDS, subID, opt, 'Sessions'); + [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); sesCounter = 1; From 0e6b5b145c8e25a86124d3f32ecc3021b467bdb7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 22:02:51 +0200 Subject: [PATCH 17/21] fix test coregistration --- tests/test_setBatchCoregistration.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_setBatchCoregistration.m b/tests/test_setBatchCoregistration.m index a3428a4c..adaa015a 100644 --- a/tests/test_setBatchCoregistration.m +++ b/tests/test_setBatchCoregistration.m @@ -57,7 +57,7 @@ function test_setBatchCoregistrationBasic() expectedBatch{end}.spm.spatial.coreg.estimate.source(1).src_output = ... substruct('.', 'rmean'); - for iSes = 1:sesCounter - 1 % '-1' because I added 1 extra session to ses_counter + for iSes = 1:sesCounter expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes) = cfg_dep; expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tname = 'Other Images'; expectedBatch{end}.spm.spatial.coreg.estimate.other(iSes).tgt_spec{1}(1).name = ... From 81bb4d8d8a85c91f8680cc89c10b683f7e6051f0 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 22:03:47 +0200 Subject: [PATCH 18/21] mh fix --- src/spmBatching/setBatchSTC.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spmBatching/setBatchSTC.m b/src/spmBatching/setBatchSTC.m index 645f7394..b4ea3830 100644 --- a/src/spmBatching/setBatchSTC.m +++ b/src/spmBatching/setBatchSTC.m @@ -53,7 +53,7 @@ prefix = getPrefix('STC', opt); [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); - + runCounter = 1; for iSes = 1:nbSessions @@ -75,7 +75,7 @@ matlabbatch{1}.spm.temporal.st.scans{runCounter} = cellstr(files); runCounter = runCounter + 1; - + disp(files{1}); end From 060fb636114834e39583cfa68da31f2713b9230c Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 22:34:49 +0200 Subject: [PATCH 19/21] add test getVoxDim --- tests/test_getFuncVoxelDims.m | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/test_getFuncVoxelDims.m diff --git a/tests/test_getFuncVoxelDims.m b/tests/test_getFuncVoxelDims.m new file mode 100644 index 00000000..659fad21 --- /dev/null +++ b/tests/test_getFuncVoxelDims.m @@ -0,0 +1,47 @@ +function test_suite = test_getFuncVoxelDims %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_getFuncVoxelDimsBasic() + + opt.funcVoxelDims = []; + + subFuncDataDir = fullfile(fileparts(mfilename('fullpath')), '..', 'demo', ... + 'output', 'MoAEpilot', 'sub-01', 'func'); + + prefix = ''; + + fileName = 'sub-01_task-auditory_bold.nii'; + + [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); + + expectedVoxDim = [3 3 3]; + assertEqual(voxDim, expectedVoxDim); + + expectedOpt.funcVoxelDims = [3 3 3]; + assertEqual(opt, expectedOpt); + +end + +function test_getFuncVoxelDimsForce() + + opt.funcVoxelDims = [1 1 1]; + + subFuncDataDir = fullfile(fileparts(mfilename('fullpath')), '..', 'demo', ... + 'output', 'MoAEpilot', 'sub-01', 'func'); + + prefix = ''; + + fileName = 'sub-01_task-auditory_bold.nii'; + + voxDim = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); + + expectedVoxDim = [1 1 1]; + assertEqual(voxDim, expectedVoxDim); + + +end \ No newline at end of file From ca9e2cd62fd21e743f4e4b6cdbe2a7513fe83d58 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 22:35:12 +0200 Subject: [PATCH 20/21] change travis to download dummy data --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 58ceeff9..83dd787c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,11 @@ before_install: - make -C spm12/src PLATFORM=octave distclean - make -C spm12/src PLATFORM=octave - make -C spm12/src PLATFORM=octave install + # get data + - mkdir demo/output + - curl http://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip --output demo/output/MoAEpilot.zip + - unzip demo/output/MoAEpilot.zip -d demo/output/ + script: - octave $OCTFLAGS --eval "runTests" From eb31fba87fa8b2b6e54464a940e01d7903212756 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 18 Sep 2020 23:36:18 +0200 Subject: [PATCH 21/21] add test for realign batch - simplify other tests --- src/getData.m | 41 --- src/getSpecificSubjects.m | 45 ++++ src/spmBatching/setBatchRealign.m | 22 +- src/spmBatching/setBatchRealignReslice.m | 27 +- tests/createDummyDataSet.sh | 6 +- .../derivatives/SPM12_CPPL/participants.tsv | 11 +- ...b-01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...b-01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...b-01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...b-01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...b-02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...b-02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...b-02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...b-02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...nd01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nd01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...nd01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nd01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...nd02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...nd02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...nd02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...nd02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...-cat01_ses-01_task-vislocalizer_events.tsv | 3 - ...t01_ses-01_task-vismotion_run-1_events.tsv | 3 - ...t01_ses-01_task-vismotion_run-2_events.tsv | 3 - ...-cat01_ses-02_task-vislocalizer_events.tsv | 3 - ...t01_ses-02_task-vismotion_run-1_events.tsv | 3 - ...t01_ses-02_task-vismotion_run-2_events.tsv | 3 - ...-cat02_ses-01_task-vislocalizer_events.tsv | 3 - ...t02_ses-01_task-vismotion_run-1_events.tsv | 3 - ...t02_ses-01_task-vismotion_run-2_events.tsv | 3 - ...ub-cat02_ses-02_task-vislocalizer_bold.nii | 0 ...ub-cat02_ses-02_task-vislocalizer_bold.nii | 0 ...-cat02_ses-02_task-vislocalizer_events.tsv | 3 - ...cat02_ses-02_task-vismotion_run-1_bold.nii | 0 ...t02_ses-02_task-vismotion_run-1_events.tsv | 3 - ...cat02_ses-02_task-vismotion_run-2_bold.nii | 0 ...t02_ses-02_task-vismotion_run-2_events.tsv | 3 - .../ses-01/anat/sub-cont01_ses-01_T1w.nii | 0 ...b-cont01_ses-01_task-vislocalizer_bold.txt | 0 ...b-cont01_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont01_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont01_ses-01_task-vislocalizer_bold.nii | 0 ...cont01_ses-01_task-vislocalizer_events.tsv | 3 - ...ont01_ses-01_task-vismotion_run-1_bold.nii | 0 ...t01_ses-01_task-vismotion_run-1_events.tsv | 3 - ...ont01_ses-01_task-vismotion_run-2_bold.nii | 0 ...t01_ses-01_task-vismotion_run-2_events.tsv | 3 - .../ses-02/anat/sub-cont01_ses-02_T1w.nii | 0 ...b-cont01_ses-02_task-vislocalizer_bold.txt | 0 ...b-cont01_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont01_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont01_ses-02_task-vislocalizer_bold.nii | 0 ...cont01_ses-02_task-vislocalizer_events.tsv | 3 - ...ont01_ses-02_task-vismotion_run-1_bold.nii | 0 ...t01_ses-02_task-vismotion_run-1_events.tsv | 3 - ...ont01_ses-02_task-vismotion_run-2_bold.nii | 0 ...t01_ses-02_task-vismotion_run-2_events.tsv | 3 - .../ses-01/anat/sub-cont02_ses-01_T1w.nii | 0 ...b-cont02_ses-01_task-vislocalizer_bold.txt | 0 ...b-cont02_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont02_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont02_ses-01_task-vislocalizer_bold.nii | 0 ...cont02_ses-01_task-vislocalizer_events.tsv | 3 - ...ont02_ses-01_task-vismotion_run-1_bold.nii | 0 ...t02_ses-01_task-vismotion_run-1_events.tsv | 3 - ...ont02_ses-01_task-vismotion_run-2_bold.nii | 0 ...t02_ses-01_task-vismotion_run-2_events.tsv | 3 - .../ses-02/anat/sub-cont02_ses-02_T1w.nii | 0 ...b-cont02_ses-02_task-vislocalizer_bold.txt | 0 ...b-cont02_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont02_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont02_ses-02_task-vislocalizer_bold.nii | 0 ...cont02_ses-02_task-vislocalizer_events.tsv | 3 - ...ont02_ses-02_task-vismotion_run-1_bold.nii | 0 ...t02_ses-02_task-vismotion_run-1_events.tsv | 3 - ...ont02_ses-02_task-vismotion_run-2_bold.nii | 0 ...t02_ses-02_task-vismotion_run-2_events.tsv | 3 - .../ses-01/anat/sub-cont03_ses-01_T1w.nii | 0 ...b-cont03_ses-01_task-vislocalizer_bold.txt | 0 ...b-cont03_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont03_ses-01_task-vislocalizer_bold.nii | 0 ...b-cont03_ses-01_task-vislocalizer_bold.nii | 0 ...cont03_ses-01_task-vislocalizer_events.tsv | 3 - ...ont03_ses-01_task-vismotion_run-1_bold.nii | 0 ...t03_ses-01_task-vismotion_run-1_events.tsv | 3 - ...ont03_ses-01_task-vismotion_run-2_bold.nii | 0 ...t03_ses-01_task-vismotion_run-2_events.tsv | 3 - .../ses-02/anat/sub-cont03_ses-02_T1w.nii | 0 ...b-cont03_ses-02_task-vislocalizer_bold.txt | 0 ...b-cont03_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont03_ses-02_task-vislocalizer_bold.nii | 0 ...b-cont03_ses-02_task-vislocalizer_bold.nii | 0 ...cont03_ses-02_task-vislocalizer_events.tsv | 3 - ...ont03_ses-02_task-vismotion_run-1_bold.nii | 0 ...t03_ses-02_task-vismotion_run-1_events.tsv | 3 - ...ont03_ses-02_task-vismotion_run-2_bold.nii | 0 ...t03_ses-02_task-vismotion_run-2_events.tsv | 3 - ...rl01_ses-01_task-vismotion_run-1_bold.nii} | 0 ...rl01_ses-01_task-vismotion_run-2_bold.nii} | 0 ...rl01_ses-02_task-vismotion_run-1_bold.nii} | 0 ...rl01_ses-02_task-vismotion_run-2_bold.nii} | 0 ...rl02_ses-01_task-vismotion_run-1_bold.nii} | 0 ...rl02_ses-01_task-vismotion_run-2_bold.nii} | 0 ...rl02_ses-02_task-vismotion_run-1_bold.nii} | 0 ...rl02_ses-02_task-vismotion_run-2_bold.nii} | 0 ...2111_jobs_matlabbatch_SPM12_groupTest.json | 235 ------------------ ...311_jobs_matlabbatch_SPM12_groupTest.json} | 4 +- ...332_jobs_matlabbatch_SPM12_groupTest.json} | 4 +- ...0918_2057_jobs_matlabbatch_SPM12_test.json | 235 ------------------ ...918_2311_jobs_matlabbatch_SPM12_test.json} | 4 +- ...918_2332_jobs_matlabbatch_SPM12_test.json} | 4 +- tests/test_getData.m | 39 ++- tests/test_getFuncVoxelDims.m | 23 +- tests/test_getInfo.m | 8 +- tests/test_setBatchRealign.m | 38 +++ 116 files changed, 165 insertions(+), 671 deletions(-) create mode 100644 src/getSpecificSubjects.m rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii => sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/rp_sub-cat01_ses-01_task-vislocalizer_bold.txt => sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/s6rsub-cat01_ses-01_task-vislocalizer_bold.nii => sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/s6wsub-cat01_ses-01_task-vislocalizer_bold.nii => sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii => sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii => sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii => sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii => sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/rp_sub-cat01_ses-02_task-vislocalizer_bold.txt => sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/s6rsub-cat01_ses-02_task-vislocalizer_bold.nii => sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/s6wsub-cat01_ses-02_task-vislocalizer_bold.nii => sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii => sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii => sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii => sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii => sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/rp_sub-cat02_ses-01_task-vislocalizer_bold.txt => sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-2_bold.nii} (100%) delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/s6wsub-cat02_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/rp_sub-cont01_ses-01_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6rsub-cont01_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6wsub-cont01_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/rp_sub-cont01_ses-02_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6rsub-cont01_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6wsub-cont01_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/rp_sub-cont02_ses-01_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6rsub-cont02_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6wsub-cont02_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/rp_sub-cont02_ses-02_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6rsub-cont02_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6wsub-cont02_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/rp_sub-cont03_ses-01_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6rsub-cont03_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6wsub-cont03_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/rp_sub-cont03_ses-02_task-vislocalizer_bold.txt delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6rsub-cont03_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6wsub-cont03_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_events.tsv delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii delete mode 100644 tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_events.tsv rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/s6rsub-cat02_ses-01_task-vislocalizer_bold.nii => sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/s6wsub-cat02_ses-01_task-vislocalizer_bold.nii => sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii => sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii => sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii => sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii => sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-2_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-02/func/rp_sub-cat02_ses-02_task-vislocalizer_bold.txt => sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-1_bold.nii} (100%) rename tests/dummyData/derivatives/SPM12_CPPL/{sub-cat02/ses-02/func/s6rsub-cat02_ses-02_task-vislocalizer_bold.nii => sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-2_bold.nii} (100%) delete mode 100644 tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json rename tests/group/{20200918_2057_jobs_matlabbatch_SPM12_groupTest.json => 20200918_2311_jobs_matlabbatch_SPM12_groupTest.json} (99%) rename tests/group/{20200918_2101_jobs_matlabbatch_SPM12_groupTest.json => 20200918_2332_jobs_matlabbatch_SPM12_groupTest.json} (99%) delete mode 100644 tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json rename tests/sub-01/{20200918_2101_jobs_matlabbatch_SPM12_test.json => 20200918_2311_jobs_matlabbatch_SPM12_test.json} (99%) rename tests/sub-01/{20200918_2111_jobs_matlabbatch_SPM12_test.json => 20200918_2332_jobs_matlabbatch_SPM12_test.json} (99%) create mode 100644 tests/test_setBatchRealign.m diff --git a/src/getData.m b/src/getData.m index 866a5269..f57de516 100644 --- a/src/getData.m +++ b/src/getData.m @@ -124,44 +124,3 @@ end end - -function group = getSpecificSubjects(opt, group, iGroup, subjects) - - % if no group or subject was specified we take all of them - if numel(opt.groups) == 1 && ... - strcmp(group(iGroup).name, '') && ... - isempty(opt.subjects{iGroup}) - - group(iGroup).subNumber = subjects; - - % if subject ID were directly specified by users we take those - elseif strcmp(group(iGroup).name, '') && iscellstr(opt.subjects) - - group(iGroup).subNumber = opt.subjects; - - % if group was specified we figure out which subjects to take - elseif ~isempty(opt.subjects{iGroup}) - - idx = opt.subjects{iGroup}; - - % else we take all subjects of that group - elseif isempty(opt.subjects{iGroup}) - - % count how many subjects in that group - idx = sum(~cellfun(@isempty, strfind(subjects, group(iGroup).name))); - idx = 1:idx; - - else - - error('Not sure what to do.'); - - end - - % if only indices were specified we get the subject from that group with that - if exist('idx', 'var') - pattern = [group(iGroup).name '%0' num2str(opt.zeropad) '.0f_']; - temp = strsplit(sprintf(pattern, idx), '_'); - group(iGroup).subNumber = temp(1:end - 1); - end - -end diff --git a/src/getSpecificSubjects.m b/src/getSpecificSubjects.m new file mode 100644 index 00000000..7ff76f1b --- /dev/null +++ b/src/getSpecificSubjects.m @@ -0,0 +1,45 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function group = getSpecificSubjects(opt, group, iGroup, subjects) + + % add a test for ata set with subject only blind02 and we ask for this one + % specifically + + % if no group or subject was specified we take all of them + if numel(opt.groups) == 1 && ... + strcmp(group(iGroup).name, '') && ... + isempty(opt.subjects{iGroup}) + + group(iGroup).subNumber = subjects; + + % if subject ID were directly specified by users we take those + elseif strcmp(group(iGroup).name, '') && iscellstr(opt.subjects) + + group(iGroup).subNumber = opt.subjects; + + % if group was specified we figure out which subjects to take + elseif ~isempty(opt.subjects{iGroup}) + + idx = opt.subjects{iGroup}; + + % else we take all subjects of that group + elseif isempty(opt.subjects{iGroup}) + + % count how many subjects in that group + idx = sum(~cellfun(@isempty, strfind(subjects, group(iGroup).name))); + idx = 1:idx; + + else + + error('Not sure what to do.'); + + end + + % if only indices were specified we get the subject from that group with that + if exist('idx', 'var') + pattern = [group(iGroup).name '%0' num2str(opt.zeropad) '.0f_']; + temp = strsplit(sprintf(pattern, idx), '_'); + group(iGroup).subNumber = temp(1:end - 1); + end + +end diff --git a/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m index 24630f82..69b96556 100644 --- a/src/spmBatching/setBatchRealign.m +++ b/src/spmBatching/setBatchRealign.m @@ -1,15 +1,18 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers function [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt) + % [matlabbatch, voxDim] = setBatchRealign(matlabbatch, BIDS, subID, opt) + % + % to set the batch in the spatial preprocessing pipeline matlabbatch{end + 1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); - sesCounter = 1; - for iSes = 1:nbSessions + allFiles = {}; + % get all runs for that subject across all sessions [runs, nbRuns] = getInfo(BIDS, subID, opt, 'Runs', sessions{iSes}); @@ -23,17 +26,22 @@ % check that the file with the right prefix exist and we get and % save its voxeldimension prefix = getPrefix('preprocess', opt); - files = inputFileValidation(subFuncDataDir, prefix, fileName); + file = inputFileValidation(subFuncDataDir, prefix, fileName); [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); - fprintf(1, ' %s\n', files{1}); + if numel(file) > 1 + errorStruct.identifier = 'setBatchRealignReslice:tooManyFiles'; + errorStruct.message = 'This should only get on file.'; + error(errorStruct); + end - matlabbatch{end}.spm.spatial.realign.estwrite.data{sesCounter} = ... - cellstr(files); + fprintf(1, ' %s\n', file{1}); - sesCounter = sesCounter + 1; + allFiles{end + 1, 1} = file{1}; %#ok<*AGROW> end + + matlabbatch{1}.spm.spatial.realign.estwrite.data{iSes} = allFiles; end % The following lines are commented out because those parameters diff --git a/src/spmBatching/setBatchRealignReslice.m b/src/spmBatching/setBatchRealignReslice.m index dd08f5ab..76cfbc82 100644 --- a/src/spmBatching/setBatchRealignReslice.m +++ b/src/spmBatching/setBatchRealignReslice.m @@ -1,18 +1,20 @@ % (C) Copyright 2019 CPP BIDS SPM-pipeline developpers function matlabbatch = setBatchRealignReslice(BIDS, opt, subID) + % [matlabbatch] = setBatchRealignReslice(matlabbatch, BIDS, subID, opt) + % + % to set the batch in if you want to reslice the images immediatly + % and not continue towards normalization % identify sessions for this subject [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); - prefix = getPrefix('preprocess', opt); - matlabbatch = []; - sesCounter = 1; - for iSes = 1:nbSessions % For each session + allFiles = {}; + % get all runs for that subject across all sessions [runs, nbRuns] = getInfo(BIDS, subID, opt, 'Runs', sessions{iSes}); @@ -24,16 +26,23 @@ subID, sessions{iSes}, runs{iRun}, opt); % check that the file with the right prefix exist - files = inputFileValidation(subFuncDataDir, prefix, fileName); + prefix = getPrefix('preprocess', opt); + file = inputFileValidation(subFuncDataDir, prefix, fileName); - fprintf(1, ' %s\n', files{1}); + if numel(file) > 1 + errorStruct.identifier = 'setBatchRealignReslice:tooManyFiles'; + errorStruct.message = 'This should only get on file.'; + error(errorStruct); + end - matlabbatch{1}.spm.spatial.realign.estwrite.data{sesCounter} = ... - cellstr(files); + fprintf(1, ' %s\n', file{1}); - sesCounter = sesCounter + 1; + allFiles{end + 1, 1} = file{1}; %#ok<*AGROW> end + + matlabbatch{1}.spm.spatial.realign.estwrite.data{iSes} = allFiles; + end matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; diff --git a/tests/createDummyDataSet.sh b/tests/createDummyDataSet.sh index 13b86589..c3684d79 100755 --- a/tests/createDummyDataSet.sh +++ b/tests/createDummyDataSet.sh @@ -7,7 +7,7 @@ StartDir=`pwd` # relative to starting directory StartDir=$StartDir/dummyData/derivatives/SPM12_CPPL mkdir $StartDir -SubList='ctrl01 ctrl02 blind01 blind02 cat01 cat02 cont01 cont02 cont03 01 02' # subject list +SubList='ctrl01 ctrl02 blind01 blind02 01 02' # subject list SesList='01 02' # session list for Subject in $SubList # loop through subjects @@ -29,6 +29,10 @@ do touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-1_bold.nii touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vismotion_run-2_bold.nii touch $ThisDir/func/sub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii + + touch $ThisDir/func/asub-$Subject\_ses-$Ses\_task-vismotion_run-1_bold.nii + touch $ThisDir/func/asub-$Subject\_ses-$Ses\_task-vismotion_run-2_bold.nii + touch $ThisDir/func/s6wsub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii touch $ThisDir/func/s6rsub-$Subject\_ses-$Ses\_task-vislocalizer_bold.nii touch $ThisDir/func/rp_sub-$Subject\_ses-$Ses\_task-vislocalizer_bold.txt diff --git a/tests/dummyData/derivatives/SPM12_CPPL/participants.tsv b/tests/dummyData/derivatives/SPM12_CPPL/participants.tsv index b601658d..0672bef8 100755 --- a/tests/dummyData/derivatives/SPM12_CPPL/participants.tsv +++ b/tests/dummyData/derivatives/SPM12_CPPL/participants.tsv @@ -1,9 +1,6 @@ participant_id Sex Age Educational level Smoker Medication Handedness -sub-blnd01 1 66 14 0 1 30 -sub-blnd02 1 28 16 1 0 12 +sub-01 1 66 14 0 1 30 +sub-02 1 28 16 1 0 12 sub-ctrl01 0 61 16 0 0 18 -sub-ctrl02 1 29 12 0 0 11 -sub-cat01 0 24 12 0 0 23 -sub-cat02 1 56 11 0 1 11 -sub-cont01 1 32 5 1 0 30 -sub-cont02 0 43 3 1 1 20 + + diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/anat/sub-cat01_ses-01_T1w.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/rp_sub-cat01_ses-01_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/rp_sub-cat01_ses-01_task-vislocalizer_bold.txt rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-01/func/asub-01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/s6rsub-cat01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/s6rsub-cat01_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/s6wsub-cat01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/s6wsub-cat01_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-01/ses-02/func/asub-01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-01/func/asub-02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/anat/sub-cat01_ses-02_T1w.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-02/ses-02/func/asub-02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/rp_sub-cat01_ses-02_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/rp_sub-cat01_ses-02_task-vislocalizer_bold.txt rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/s6rsub-cat01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/s6rsub-cat01_ses-02_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-01/func/asub-blind01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/s6wsub-cat01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/s6wsub-cat01_ses-02_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind01/ses-02/func/asub-blind01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-01/func/asub-blind02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/anat/sub-cat02_ses-01_T1w.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/rp_sub-cat02_ses-01_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/rp_sub-cat02_ses-01_task-vislocalizer_bold.txt rename to tests/dummyData/derivatives/SPM12_CPPL/sub-blind02/ses-02/func/asub-blind02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/s6wsub-cat02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/s6wsub-cat02_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/sub-cat02_ses-02_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/anat/sub-cont01_ses-01_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/rp_sub-cont01_ses-01_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/rp_sub-cont01_ses-01_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6rsub-cont01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6rsub-cont01_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6wsub-cont01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/s6wsub-cont01_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/rp_sub-cont01_ses-02_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/rp_sub-cont01_ses-02_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6rsub-cont01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6rsub-cont01_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6wsub-cont01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6wsub-cont01_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/rp_sub-cont02_ses-01_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/rp_sub-cont02_ses-01_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6rsub-cont02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6rsub-cont02_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6wsub-cont02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/s6wsub-cont02_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/rp_sub-cont02_ses-02_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/rp_sub-cont02_ses-02_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6rsub-cont02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6rsub-cont02_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6wsub-cont02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/s6wsub-cont02_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/rp_sub-cont03_ses-01_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/rp_sub-cont03_ses-01_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6rsub-cont03_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6rsub-cont03_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6wsub-cont03_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/s6wsub-cont03_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/rp_sub-cont03_ses-02_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/rp_sub-cont03_ses-02_task-vislocalizer_bold.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6rsub-cont03_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6rsub-cont03_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6wsub-cont03_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/s6wsub-cont03_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_events.tsv deleted file mode 100644 index eef890c1..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 15 VisMot -25 15 VisStat diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_events.tsv deleted file mode 100644 index 899cce33..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -2 2 VisMotUp -4 2 VisMotDown diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_events.tsv b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_events.tsv deleted file mode 100644 index 4b01c47d..00000000 --- a/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_events.tsv +++ /dev/null @@ -1,3 +0,0 @@ -onset duration trial_type -3 2 VisMotDown -6 2 VisMotUp diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/s6rsub-cat02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/s6rsub-cat02_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/s6wsub-cat02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/s6wsub-cat02_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-01/func/asub-ctrl01_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-1_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/asub-ctrl01_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-01/func/sub-cat02_ses-01_task-vismotion_run-2_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/anat/sub-cat02_ses-02_T1w.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/asub-ctrl02_ses-01_task-vismotion_run-2_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/rp_sub-cat02_ses-02_task-vislocalizer_bold.txt b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-1_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/rp_sub-cat02_ses-02_task-vislocalizer_bold.txt rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-1_bold.nii diff --git a/tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/s6rsub-cat02_ses-02_task-vislocalizer_bold.nii b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-2_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cat02/ses-02/func/s6rsub-cat02_ses-02_task-vislocalizer_bold.nii rename to tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/asub-ctrl02_ses-02_task-vismotion_run-2_bold.nii diff --git a/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json deleted file mode 100644 index 1c1c2e81..00000000 --- a/tests/group/20200918_2111_jobs_matlabbatch_SPM12_groupTest.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "matlabbach": { - "test": 1 - }, - "GeneratedBy": { - "name": "CPP_BIDS_SPM_pipeline", - "Version": "v0.0.3", - "Description": "groupTest", - "CodeURL": "" - }, - "OS": { - "name": "GLNXA64", - "platform": { - "name": "Matlab", - "version": "9.2.0.538062 (R2017a)" - }, - "spmVersion": "SPM12 - 7487", - "environmentVariables": { - "keys": [ - "ARCH", - "AUTOMOUNT_MAP", - "BASEMATLABPATH", - "CLUTTER_IM_MODULE", - "COLORTERM", - "CONDA_DEFAULT_ENV", - "CONDA_EXE", - "CONDA_PREFIX", - "CONDA_PROMPT_MODIFIER", - "CONDA_PYTHON_EXE", - "CONDA_SHLVL", - "DBUS_SESSION_BUS_ADDRESS=unix:path", - "DEFAULTS_PATH", - "DESKTOP_SESSION", - "DISPLAY", - "FSLDIR", - "FSLGECUDAQ", - "FSLLOCKDIR", - "FSLMACHINELIST", - "FSLMULTIFILEQUIT", - "FSLOUTPUTTYPE", - "FSLREMOTECALL", - "FSLTCLSH", - "FSLWISH", - "GDMSESSION", - "GJS_DEBUG_OUTPUT", - "GJS_DEBUG_TOPICS", - "GNOME_DESKTOP_SESSION_ID", - "GNOME_SHELL_SESSION_MODE", - "GNOME_TERMINAL_SCREEN", - "GNOME_TERMINAL_SERVICE", - "GPG_AGENT_INFO", - "GTK_IM_MODULE", - "GTK_MODULES", - "HOME", - "HOMEBREW_CELLAR", - "HOMEBREW_PREFIX", - "HOMEBREW_REPOSITORY", - "IM_CONFIG_PHASE", - "INFOPATH", - "KMP_BLOCKTIME", - "KMP_HANDLE_SIGNALS", - "KMP_STACKSIZE", - "LANG", - "LANGUAGE", - "LC_ADDRESS", - "LC_IDENTIFICATION", - "LC_MEASUREMENT", - "LC_MONETARY", - "LC_NAME", - "LC_NUMERIC", - "LC_PAPER", - "LC_TELEPHONE", - "LC_TIME", - "LD_LIBRARY_PATH", - "LESSCLOSE", - "LESSOPEN", - "LOGNAME", - "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", - "MANDATORY_PATH", - "MANPATH", - "MKL_DOMAIN_NUM_THREADS", - "MKL_NUM_THREADS", - "NLSPATH", - "NVM_BIN", - "NVM_CD_FLAGS", - "NVM_DIR", - "OLDPWD", - "OSG_LD_LIBRARY_PATH", - "PAPERSIZE", - "PATH", - "PWD", - "QT4_IM_MODULE", - "QT_ACCESSIBILITY", - "QT_IM_MODULE", - "SESSION_MANAGER", - "SHELL", - "SHLVL", - "SSH_AGENT_PID", - "SSH_AUTH_SOCK", - "TERM", - "TEXTDOMAIN", - "TEXTDOMAINDIR", - "TOOLBOX", - "USER", - "USERNAME", - "VTE_VERSION", - "WINDOWPATH", - "XAUTHORITY", - "XDG_CONFIG_DIRS", - "XDG_CURRENT_DESKTOP", - "XDG_DATA_DIRS", - "XDG_MENU_PREFIX", - "XDG_RUNTIME_DIR", - "XDG_SEAT", - "XDG_SESSION_DESKTOP", - "XDG_SESSION_ID", - "XDG_SESSION_TYPE", - "XDG_VTNR", - "XFILESEARCHPATH", - "XMODIFIERS=@im", - "_", - "_CE_CONDA", - "_CE_M", - "__KMP_REGISTERED_LIB_18839" - ], - "values": [ - "glnxa64", - "", - "", - "xim", - "truecolor", - "base", - "/home/remi/miniconda3/bin/conda", - "/home/remi/miniconda3", - "(base) ", - "/home/remi/miniconda3/bin/python", - "1", - "/run/user/1000/bus", - "/usr/share/gconf/ubuntu.default.path", - "ubuntu", - ":0", - "/usr/local/fsl", - "cuda.q", - "", - "", - "TRUE", - "NIFTI_GZ", - "", - "/usr/local/fsl/bin/fsltclsh", - "/usr/local/fsl/bin/fslwish", - "ubuntu", - "stderr", - "JS ERROR;JS LOG", - "this-is-deprecated", - "ubuntu", - "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", - ":1.1943", - "/run/user/1000/gnupg/S.gpg-agent:0:1", - "ibus", - "gail:atk-bridge", - "/home/remi", - "/home/linuxbrew/.linuxbrew/Cellar", - "/home/linuxbrew/.linuxbrew", - "/home/linuxbrew/.linuxbrew/Homebrew", - "2", - "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", - "1", - "0", - "512k", - "en_US.UTF-8", - "en_US", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "C", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", - "/usr/bin/lesspipe %s %s", - "| /usr/bin/lesspipe %s", - "remi", - "00;36:", - "/usr/share/gconf/ubuntu.mandatory.path", - "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", - "", - "", - "/usr/dt/lib/nls/msg/%L/%N.cat", - "/home/remi/.nvm/versions/node/v12.18.2/bin", - "", - "/home/remi/.nvm", - "/usr/local/MATLAB/R2017a", - "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", - "a4", - "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", - "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", - "xim", - "1", - "ibus", - "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", - "/bin/bash", - "2", - "4089", - "/run/user/1000/keyring/ssh", - "dumb", - "im-config", - "/usr/share/locale/", - "/usr/local/MATLAB/R2017a/toolbox", - "remi", - "remi", - "5202", - "2", - "/run/user/1000/gdm/Xauthority", - "/etc/xdg/xdg-ubuntu:/etc/xdg", - "ubuntu:GNOME", - "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", - "gnome-", - "/run/user/1000", - "seat0", - "ubuntu", - "4", - "x11", - "2", - "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", - "ibus", - "/usr/bin/env", - "", - "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" - ] - } - } -} \ No newline at end of file diff --git a/tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2311_jobs_matlabbatch_SPM12_groupTest.json similarity index 99% rename from tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json rename to tests/group/20200918_2311_jobs_matlabbatch_SPM12_groupTest.json index 1c1c2e81..851a3de7 100644 --- a/tests/group/20200918_2057_jobs_matlabbatch_SPM12_groupTest.json +++ b/tests/group/20200918_2311_jobs_matlabbatch_SPM12_groupTest.json @@ -121,7 +121,7 @@ "_", "_CE_CONDA", "_CE_M", - "__KMP_REGISTERED_LIB_18839" + "__KMP_REGISTERED_LIB_24162" ], "values": [ "glnxa64", @@ -228,7 +228,7 @@ "/usr/bin/env", "", "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" + "0x7f848773bb10-cafed524-libiomp5.so" ] } } diff --git a/tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2332_jobs_matlabbatch_SPM12_groupTest.json similarity index 99% rename from tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json rename to tests/group/20200918_2332_jobs_matlabbatch_SPM12_groupTest.json index 1c1c2e81..851a3de7 100644 --- a/tests/group/20200918_2101_jobs_matlabbatch_SPM12_groupTest.json +++ b/tests/group/20200918_2332_jobs_matlabbatch_SPM12_groupTest.json @@ -121,7 +121,7 @@ "_", "_CE_CONDA", "_CE_M", - "__KMP_REGISTERED_LIB_18839" + "__KMP_REGISTERED_LIB_24162" ], "values": [ "glnxa64", @@ -228,7 +228,7 @@ "/usr/bin/env", "", "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" + "0x7f848773bb10-cafed524-libiomp5.so" ] } } diff --git a/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json deleted file mode 100644 index 7c811cde..00000000 --- a/tests/sub-01/20200918_2057_jobs_matlabbatch_SPM12_test.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "matlabbach": { - "test": 1 - }, - "GeneratedBy": { - "name": "CPP_BIDS_SPM_pipeline", - "Version": "v0.0.3", - "Description": "test", - "CodeURL": "" - }, - "OS": { - "name": "GLNXA64", - "platform": { - "name": "Matlab", - "version": "9.2.0.538062 (R2017a)" - }, - "spmVersion": "SPM12 - 7487", - "environmentVariables": { - "keys": [ - "ARCH", - "AUTOMOUNT_MAP", - "BASEMATLABPATH", - "CLUTTER_IM_MODULE", - "COLORTERM", - "CONDA_DEFAULT_ENV", - "CONDA_EXE", - "CONDA_PREFIX", - "CONDA_PROMPT_MODIFIER", - "CONDA_PYTHON_EXE", - "CONDA_SHLVL", - "DBUS_SESSION_BUS_ADDRESS=unix:path", - "DEFAULTS_PATH", - "DESKTOP_SESSION", - "DISPLAY", - "FSLDIR", - "FSLGECUDAQ", - "FSLLOCKDIR", - "FSLMACHINELIST", - "FSLMULTIFILEQUIT", - "FSLOUTPUTTYPE", - "FSLREMOTECALL", - "FSLTCLSH", - "FSLWISH", - "GDMSESSION", - "GJS_DEBUG_OUTPUT", - "GJS_DEBUG_TOPICS", - "GNOME_DESKTOP_SESSION_ID", - "GNOME_SHELL_SESSION_MODE", - "GNOME_TERMINAL_SCREEN", - "GNOME_TERMINAL_SERVICE", - "GPG_AGENT_INFO", - "GTK_IM_MODULE", - "GTK_MODULES", - "HOME", - "HOMEBREW_CELLAR", - "HOMEBREW_PREFIX", - "HOMEBREW_REPOSITORY", - "IM_CONFIG_PHASE", - "INFOPATH", - "KMP_BLOCKTIME", - "KMP_HANDLE_SIGNALS", - "KMP_STACKSIZE", - "LANG", - "LANGUAGE", - "LC_ADDRESS", - "LC_IDENTIFICATION", - "LC_MEASUREMENT", - "LC_MONETARY", - "LC_NAME", - "LC_NUMERIC", - "LC_PAPER", - "LC_TELEPHONE", - "LC_TIME", - "LD_LIBRARY_PATH", - "LESSCLOSE", - "LESSOPEN", - "LOGNAME", - "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf", - "MANDATORY_PATH", - "MANPATH", - "MKL_DOMAIN_NUM_THREADS", - "MKL_NUM_THREADS", - "NLSPATH", - "NVM_BIN", - "NVM_CD_FLAGS", - "NVM_DIR", - "OLDPWD", - "OSG_LD_LIBRARY_PATH", - "PAPERSIZE", - "PATH", - "PWD", - "QT4_IM_MODULE", - "QT_ACCESSIBILITY", - "QT_IM_MODULE", - "SESSION_MANAGER", - "SHELL", - "SHLVL", - "SSH_AGENT_PID", - "SSH_AUTH_SOCK", - "TERM", - "TEXTDOMAIN", - "TEXTDOMAINDIR", - "TOOLBOX", - "USER", - "USERNAME", - "VTE_VERSION", - "WINDOWPATH", - "XAUTHORITY", - "XDG_CONFIG_DIRS", - "XDG_CURRENT_DESKTOP", - "XDG_DATA_DIRS", - "XDG_MENU_PREFIX", - "XDG_RUNTIME_DIR", - "XDG_SEAT", - "XDG_SESSION_DESKTOP", - "XDG_SESSION_ID", - "XDG_SESSION_TYPE", - "XDG_VTNR", - "XFILESEARCHPATH", - "XMODIFIERS=@im", - "_", - "_CE_CONDA", - "_CE_M", - "__KMP_REGISTERED_LIB_18839" - ], - "values": [ - "glnxa64", - "", - "", - "xim", - "truecolor", - "base", - "/home/remi/miniconda3/bin/conda", - "/home/remi/miniconda3", - "(base) ", - "/home/remi/miniconda3/bin/python", - "1", - "/run/user/1000/bus", - "/usr/share/gconf/ubuntu.default.path", - "ubuntu", - ":0", - "/usr/local/fsl", - "cuda.q", - "", - "", - "TRUE", - "NIFTI_GZ", - "", - "/usr/local/fsl/bin/fsltclsh", - "/usr/local/fsl/bin/fslwish", - "ubuntu", - "stderr", - "JS ERROR;JS LOG", - "this-is-deprecated", - "ubuntu", - "/org/gnome/Terminal/screen/180cc7a4_73a5_4212_b3d1_0ab352012125", - ":1.1943", - "/run/user/1000/gnupg/S.gpg-agent:0:1", - "ibus", - "gail:atk-bridge", - "/home/remi", - "/home/linuxbrew/.linuxbrew/Cellar", - "/home/linuxbrew/.linuxbrew", - "/home/linuxbrew/.linuxbrew/Homebrew", - "2", - "/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info", - "1", - "0", - "512k", - "en_US.UTF-8", - "en_US", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "C", - "en_GB.UTF-8", - "en_GB.UTF-8", - "en_GB.UTF-8", - "/usr/local/MATLAB/R2017a/sys/opengl/lib/glnxa64:/usr/local/MATLAB/R2017a/sys/os/glnxa64:/usr/local/MATLAB/R2017a/bin/glnxa64:/usr/local/MATLAB/R2017a/extern/lib/glnxa64:/usr/local/MATLAB/R2017a/runtime/glnxa64:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/amd64/server", - "/usr/bin/lesspipe %s %s", - "| /usr/bin/lesspipe %s", - "remi", - "00;36:", - "/usr/share/gconf/ubuntu.mandatory.path", - "/home/remi/.nvm/versions/node/v12.18.2/share/man:/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::", - "", - "", - "/usr/dt/lib/nls/msg/%L/%N.cat", - "/home/remi/.nvm/versions/node/v12.18.2/bin", - "", - "/home/remi/.nvm", - "/usr/local/MATLAB/R2017a", - "/usr/local/MATLAB/R2017a/sys/openscenegraph/lib/glnxa64", - "a4", - "/home/remi/miniconda3/bin:/home/remi/miniconda3/condabin:/usr/local/go/bin:/home/remi/.nvm/versions/node/v12.18.2/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/fsl/bin:/home/remi/.local/bin:/home/remi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/remi/github/miss_hit", - "/home/remi/gin/V5_high-res/pilot_1/code/analysis_high-res_localizers/lib/CPP_BIDS_SPM_pipeline/tests", - "xim", - "1", - "ibus", - "local/remi-XPS-15-9570:@/tmp/.ICE-unix/3733,unix/remi-XPS-15-9570:/tmp/.ICE-unix/3733", - "/bin/bash", - "2", - "4089", - "/run/user/1000/keyring/ssh", - "dumb", - "im-config", - "/usr/share/locale/", - "/usr/local/MATLAB/R2017a/toolbox", - "remi", - "remi", - "5202", - "2", - "/run/user/1000/gdm/Xauthority", - "/etc/xdg/xdg-ubuntu:/etc/xdg", - "ubuntu:GNOME", - "/usr/share/ubuntu:/home/remi/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", - "gnome-", - "/run/user/1000", - "seat0", - "ubuntu", - "4", - "x11", - "2", - "/usr/local/MATLAB/R2017a/sys/java/jre/glnxa64/jre/lib/locale/%L/%T/%N%S::/usr/dt/app-defaults/%L/Dt", - "ibus", - "/usr/bin/env", - "", - "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" - ] - } - } -} \ No newline at end of file diff --git a/tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2311_jobs_matlabbatch_SPM12_test.json similarity index 99% rename from tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json rename to tests/sub-01/20200918_2311_jobs_matlabbatch_SPM12_test.json index 7c811cde..d0f8ee47 100644 --- a/tests/sub-01/20200918_2101_jobs_matlabbatch_SPM12_test.json +++ b/tests/sub-01/20200918_2311_jobs_matlabbatch_SPM12_test.json @@ -121,7 +121,7 @@ "_", "_CE_CONDA", "_CE_M", - "__KMP_REGISTERED_LIB_18839" + "__KMP_REGISTERED_LIB_24162" ], "values": [ "glnxa64", @@ -228,7 +228,7 @@ "/usr/bin/env", "", "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" + "0x7f848773bb10-cafed524-libiomp5.so" ] } } diff --git a/tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2332_jobs_matlabbatch_SPM12_test.json similarity index 99% rename from tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json rename to tests/sub-01/20200918_2332_jobs_matlabbatch_SPM12_test.json index 7c811cde..d0f8ee47 100644 --- a/tests/sub-01/20200918_2111_jobs_matlabbatch_SPM12_test.json +++ b/tests/sub-01/20200918_2332_jobs_matlabbatch_SPM12_test.json @@ -121,7 +121,7 @@ "_", "_CE_CONDA", "_CE_M", - "__KMP_REGISTERED_LIB_18839" + "__KMP_REGISTERED_LIB_24162" ], "values": [ "glnxa64", @@ -228,7 +228,7 @@ "/usr/bin/env", "", "", - "0x7f4a68823b10-cafe64e5-libiomp5.so" + "0x7f848773bb10-cafed524-libiomp5.so" ] } } diff --git a/tests/test_getData.m b/tests/test_getData.m index fc508ed8..ab701d7d 100644 --- a/tests/test_getData.m +++ b/tests/test_getData.m @@ -20,50 +20,45 @@ function test_getDataBasic() [group] = getData(opt); assert(isequal(group(1).name, '')); - assert(isequal(group.numSub, 11)); + assert(isequal(group.numSub, 6)); assert(isequal(group.subNumber, ... - { ... - '01' '02' ... - 'blind01' 'blind02' ... - 'cat01' 'cat02' ... - 'cont01' 'cont02' 'cont03' ... - 'ctrl01' 'ctrl02'})); + {'01' '02' 'blind01' 'blind02' 'ctrl01' 'ctrl02'})); %% Get some subjects of some groups - opt.groups = {'cont', 'cat'}; - opt.subjects = {[1 3], 2}; + opt.groups = {'ctrl', 'blind'}; + opt.subjects = {[1 2], 2}; [group] = getData(opt); - assert(isequal(group(1).name, 'cont')); + assert(isequal(group(1).name, 'ctrl')); assert(isequal(group(1).numSub, 2)); - assert(isequal(group(1).subNumber, {'cont01' 'cont03'})); - assert(isequal(group(2).name, 'cat')); + assert(isequal(group(1).subNumber, {'ctrl01' 'ctrl02'})); + assert(isequal(group(2).name, 'blind')); assert(isequal(group(2).numSub, 1)); - assert(isequal(group(2).subNumber, {'cat02'})); + assert(isequal(group(2).subNumber, {'blind02'})); %% Get all subjects of some groups - opt.groups = {'cont', 'cat'}; + opt.groups = {'ctrl', 'blind'}; opt.subjects = {[], []}; [group] = getData(opt); - assert(isequal(group(1).name, 'cont')); - assert(isequal(group(1).numSub, 3)); - assert(isequal(group(1).subNumber, {'cont01' 'cont02' 'cont03'})); - assert(isequal(group(2).name, 'cat')); + assert(isequal(group(1).name, 'ctrl')); + assert(isequal(group(1).numSub, 2)); + assert(isequal(group(1).subNumber, {'ctrl01' 'ctrl02'})); + assert(isequal(group(2).name, 'blind')); assert(isequal(group(2).numSub, 2)); - assert(isequal(group(2).subNumber, {'cat01' 'cat02'})); + assert(isequal(group(2).subNumber, {'blind01' 'blind02'})); %% Get some specified subjects opt.groups = {''}; - opt.subjects = {'01', 'cont01', 'cat02', 'ctrl02', 'blind01'}; + opt.subjects = {'01', 'ctrl02', 'blind02'}; [group] = getData(opt); assert(isequal(group(1).name, '')); - assert(isequal(group(1).numSub, 5)); - assert(isequal(group(1).subNumber, {'01', 'cont01', 'cat02', 'ctrl02', 'blind01'})); + assert(isequal(group(1).numSub, 3)); + assert(isequal(group(1).subNumber, {'01', 'ctrl02', 'blind02'})); %% Only get anat metadata opt.groups = {''}; diff --git a/tests/test_getFuncVoxelDims.m b/tests/test_getFuncVoxelDims.m index 659fad21..4c68bce6 100644 --- a/tests/test_getFuncVoxelDims.m +++ b/tests/test_getFuncVoxelDims.m @@ -9,39 +9,38 @@ function test_getFuncVoxelDimsBasic() opt.funcVoxelDims = []; - + subFuncDataDir = fullfile(fileparts(mfilename('fullpath')), '..', 'demo', ... 'output', 'MoAEpilot', 'sub-01', 'func'); - + prefix = ''; - + fileName = 'sub-01_task-auditory_bold.nii'; - + [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); expectedVoxDim = [3 3 3]; assertEqual(voxDim, expectedVoxDim); - + expectedOpt.funcVoxelDims = [3 3 3]; assertEqual(opt, expectedOpt); - + end function test_getFuncVoxelDimsForce() opt.funcVoxelDims = [1 1 1]; - + subFuncDataDir = fullfile(fileparts(mfilename('fullpath')), '..', 'demo', ... 'output', 'MoAEpilot', 'sub-01', 'func'); - + prefix = ''; - + fileName = 'sub-01_task-auditory_bold.nii'; - + voxDim = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); expectedVoxDim = [1 1 1]; assertEqual(voxDim, expectedVoxDim); - -end \ No newline at end of file +end diff --git a/tests/test_getInfo.m b/tests/test_getInfo.m index a944570e..85d1132d 100644 --- a/tests/test_getInfo.m +++ b/tests/test_getInfo.m @@ -17,7 +17,7 @@ function test_getInfoBasic() %% Get sessions from BIDS opt.taskName = 'vismotion'; - subID = 'cont02'; + subID = 'ctrl01'; info = 'sessions'; [~, opt, BIDS] = getData(opt); sessions = getInfo(BIDS, subID, opt, info); @@ -25,7 +25,7 @@ function test_getInfoBasic() %% Get runs from BIDS opt.taskName = 'vismotion'; - subID = 'cont02'; + subID = 'ctrl01'; info = 'runs'; session = '01'; [~, opt, BIDS] = getData(opt); @@ -34,7 +34,7 @@ function test_getInfoBasic() %% Get runs from BIDS when no run in filename opt.taskName = 'vislocalizer'; - subID = 'cont02'; + subID = 'ctrl01'; info = 'runs'; session = '01'; [~, opt, BIDS] = getData(opt); @@ -43,7 +43,7 @@ function test_getInfoBasic() %% Get filename from BIDS opt.taskName = 'vismotion'; - subID = 'cont02'; + subID = 'ctrl01'; session = '01'; run = '1'; info = 'filename'; diff --git a/tests/test_setBatchRealign.m b/tests/test_setBatchRealign.m new file mode 100644 index 00000000..be122751 --- /dev/null +++ b/tests/test_setBatchRealign.m @@ -0,0 +1,38 @@ +function test_suite = test_setBatchRealign %#ok<*STOUT> + try % assignment of 'localfunctions' is necessary in Matlab >= 2016 + test_functions = localfunctions(); %#ok<*NASGU> + catch % no problem; early Matlab versions can use initTestSuite fine + end + initTestSuite; +end + +function test_setBatchRealignBasic() + + opt.dataDir = fullfile(fileparts(mfilename('fullpath')), 'dummyData', 'derivatives'); + opt.taskName = 'vismotion'; + [~, opt, BIDS] = getData(opt); + + subID = '02'; + matlabbatch = setBatchRealignReslice(BIDS, opt, subID); + + expectedBatch{1}.spm.spatial.realign.estwrite.eoptions.weight = {''}; + + runCounter = 1; + for iSes = 1:2 + fileName = spm_BIDS(BIDS, 'data', ... + 'sub', subID, ... + 'ses', sprintf('0%i', iSes), ... + 'task', opt.taskName, ... + 'type', 'bold'); + + for iFile = 1:numel(fileName) + [pth, nam, ext] = spm_fileparts(fileName{iFile}); + fileName{iFile} = fullfile(pth, ['a' nam ext]); + end + + expectedBatch{1}.spm.spatial.realign.estwrite.data{iSes} = cellstr(fileName); + end + + assertEqual(matlabbatch, expectedBatch); + +end