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/.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" 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/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..1f7a5187 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 @@ -67,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 @@ -84,7 +86,7 @@ %% Run batches isMVPA = 0; -bidsCopyRawFolder(opt, 1); +% bidsCopyRawFolder(opt, 1); bidsSTC(opt); bidsSpatialPrepro(opt); bidsSmoothing(FWHM, opt); 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/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 diff --git a/miss_hit.cfg b/miss_hit.cfg index aa91fe79..de035f72 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 12 +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 2fef93d8..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 @@ -12,6 +14,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..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) % @@ -5,15 +7,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/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..f57de516 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. @@ -112,7 +114,7 @@ case 'T1w' metadata = spm_BIDS(BIDS, 'metadata', ... 'sub', subjects{1}, ... - 'type', [type]); + 'type', type); end if iscell(metadata) @@ -122,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/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 new file mode 100644 index 00000000..1bd815e3 --- /dev/null +++ b/src/getFuncVoxelDims.m @@ -0,0 +1,25 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +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 diff --git a/src/getGrpLevelContrastToCompute.m b/src/getGrpLevelContrastToCompute.m new file mode 100644 index 00000000..d909a618 --- /dev/null +++ b/src/getGrpLevelContrastToCompute.m @@ -0,0 +1,17 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function [grpLvlCon, iStep] = 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 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 88215a8e..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); @@ -5,6 +7,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); 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/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/mancoreg/mancoreg.m b/src/mancoreg/mancoreg.m new file mode 100644 index 00000000..d08e11ff --- /dev/null +++ b/src/mancoreg/mancoreg.m @@ -0,0 +1,379 @@ +% (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 + % + % 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 (mancoregCallbacks.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 + + 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', 'var') + targetimage = spm_select(1, 'image', 'Please select target image'); + end + + if ~exist('sourceimage', 'var') + 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 + opt.windowScale = 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 + + initTitleAndBoxes(opt, fg, targetimage, sourceimage); + mancoregvar = initTransMat(mancoregvar, opt, fg); + mancoregvar = initRotationSlider(mancoregvar, opt, fg); + mancoregvar = initTranslationSlider(mancoregvar, opt, fg); + + % Source/target display toggle + + 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'); + + mancoregvar.htoggle_on = uicontrol(fg, ... + 'style', 'radiobutton', ... + 'position', ... + [530 100 opt.largeFontBoxWidth opt.largeFontBoxHeight] .* opt.windowScale, ... + 'Value', 0, ... + 'Callback', 'mancoregCallbacks(''toggle_on'')', ... + 'string', 'ON'); + + % "Reset transformation" pushbutton + + mancoregvar.hreset = uicontrol(fg, ... + 'style', 'pushbutton', ... + 'position', [370 75 220 opt.largeFontBoxHeight] .* opt.windowScale, ... + 'String', 'Reset transformation', ... + 'Callback', 'mancoregCallbacks(''reset'')'); + + % "Apply transformation" pushbutton + + mancoregvar.hwrite = uicontrol(fg, 'style', 'pushbutton', ... + 'position', [370 50 220 opt.largeFontBoxHeight] .* opt.windowScale, ... + 'String', 'Apply transformation', ... + 'Callback', 'mancoregCallbacks(''apply'')'); + + %% Fill in "transf." fields + + mancoregCallbacks('plotmat'); + + return + +end + +function initTitleAndBoxes(opt, fg, targetimage, sourceimage) + + windowScale = opt.windowScale; + fontSize = opt.largeFontSize; + height = opt.largeFontBoxHeight; + + uicontrol(fg, ... + 'style', 'text', ... + 'string', 'Manual coregistration tool', ... + 'position', [200 825 300 30] .* windowScale, ... + 'Fontsize', 16, 'backgroundcolor', [1 1 1]); + + uicontrol(fg, ... + 'style', 'frame', ... + 'position', [360 550 240 250] .* windowScale); + uicontrol(fg, 'style', 'frame', ... + 'position', [360 40 240 410] .* windowScale); + + addTextToUI( ... + fg, 'TARGET IMAGE', ... + [370 760 100 height], opt, fontSize); + addTextToUI( ... + fg, targetimage, ... + [370 700 220 height * 3], opt, fontSize); + + addTextToUI( ... + fg, 'SOURCE IMAGE', ... + [370 415 100 height], opt, fontSize); + addTextToUI( ... + fg, sourceimage, ... + [370 395 220 height], opt, fontSize); + +end + +function mancoregvar = initTransMat(mancoregvar, opt, fg) + + fontSize = opt.smallFontSize; + + width = opt.smallFontBoxWidth; + height = opt.smallFontBoxHeight; + + colPosition = 415:45:550; + rowPosition = 360:-20:300; + + addTextToUI( ... + fg, 'transf.', ... + [370 360 width height], opt, opt.largeFontSize); + + for iRow = 1:numel(rowPosition) + + for iCol = 1:numel(colPosition) + + 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/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 30aee51b..61a067cc 100644 --- a/src/saveMatlabBatch.m +++ b/src/saveMatlabBatch.m @@ -1,4 +1,6 @@ -function saveMatlabBatch(batch, batchType, opt, subID) +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +function saveMatlabBatch(matlabbatch, batchType, opt, subID) % saveMatlabBatch(batch, batchType, opt, subID) % % Also save some basic environnment info @@ -25,12 +27,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/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..1a0fb057 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 @@ -16,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' @@ -82,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 @@ -105,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 @@ -128,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 @@ -181,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/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 ed43cd74..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 @@ -115,6 +117,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 +156,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/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 c6a34665..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". @@ -26,7 +28,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..f80bad1a 100644 --- a/src/spmBatching/bidsSpatialPrepro.m +++ b/src/spmBatching/bidsSpatialPrepro.m @@ -1,11 +1,27 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + 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. + % + % 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 - %% TO DO - % find a way to paralelize this over subjects + % Indicate which session the structural data was collected + structSession = 1; % if input has no opt, load the opt.mat file if nargin < 1 @@ -16,12 +32,6 @@ function bidsSpatialPrepro(opt) % 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 @@ -42,244 +52,36 @@ function bidsSpatialPrepro(opt) % identify sessions for this subject [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); - % get all runs for that subject across all 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); - %% 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 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}); + % REFERENCE IMAGE : DEPENDENCY FROM NAMED FILE SELECTOR ('Anatomical') + matlabbatch = setBatchCoregistration(matlabbatch, nbSessions); - % 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 + 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', ... - 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); @@ -289,84 +91,3 @@ function bidsSpatialPrepro(opt) 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..8cab1761 --- /dev/null +++ b/src/spmBatching/setBatchCoregistration.m @@ -0,0 +1,75 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +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'; + 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: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 = ... + '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/setBatchFactorialDesign.m b/src/spmBatching/setBatchFactorialDesign.m new file mode 100644 index 00000000..4414c800 --- /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/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/src/spmBatching/setBatchRealign.m b/src/spmBatching/setBatchRealign.m new file mode 100644 index 00000000..69b96556 --- /dev/null +++ b/src/spmBatching/setBatchRealign.m @@ -0,0 +1,60 @@ +% (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'); + + for iSes = 1:nbSessions + + allFiles = {}; + + % 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); + file = inputFileValidation(subFuncDataDir, prefix, fileName); + [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName); + + if numel(file) > 1 + errorStruct.identifier = 'setBatchRealignReslice:tooManyFiles'; + errorStruct.message = 'This should only get on file.'; + error(errorStruct); + end + + fprintf(1, ' %s\n', file{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 + % 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 diff --git a/src/spmBatching/setBatchRealignReslice.m b/src/spmBatching/setBatchRealignReslice.m index b5069353..76cfbc82 100644 --- a/src/spmBatching/setBatchRealignReslice.m +++ b/src/spmBatching/setBatchRealignReslice.m @@ -1,16 +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}); @@ -22,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/src/spmBatching/setBatchSTC.m b/src/spmBatching/setBatchSTC.m index 96dc3660..b4ea3830 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. @@ -52,6 +54,8 @@ [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'Sessions'); + runCounter = 1; + for iSes = 1:nbSessions % get all runs for that subject across all sessions @@ -68,7 +72,9 @@ 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}); diff --git a/src/spmBatching/setBatchSegmentation.m b/src/spmBatching/setBatchSegmentation.m new file mode 100644 index 00000000..5abb8320 --- /dev/null +++ b/src/spmBatching/setBatchSegmentation.m @@ -0,0 +1,62 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +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/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 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 new file mode 100644 index 00000000..8b4e63aa --- /dev/null +++ b/src/unzipImgAndReturnsFullpathName.m @@ -0,0 +1,20 @@ +% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers + +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 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) % diff --git a/tests/createDummyDataSet.sh b/tests/createDummyDataSet.sh index 7e3e8df2..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 @@ -26,9 +26,13 @@ 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/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 @@ -47,7 +51,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/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-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/asub-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-vislocalizer_bold.nii.gz 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-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/asub-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-1_bold.nii.gz 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-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-vislocalizer_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-vislocalizer_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-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-02/anat/sub-01_ses-02_T1w.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-02/func/sub-01_ses-02_task-vislocalizer_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-02/func/sub-01_ses-02_task-vislocalizer_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/func/sub-01_ses-02_task-vismotion_run-1_bold.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/func/sub-01_ses-02_task-vismotion_run-1_bold.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-vismotion_run-2_bold.nii.gz 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-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/asub-01_ses-02_task-vismotion_run-1_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-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-02/ses-01/anat/sub-02_ses-01_T1w.nii.gz 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-02/ses-01/func/sub-02_ses-01_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-02/ses-01/func/sub-02_ses-01_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-02/ses-01/func/sub-02_ses-01_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-02/ses-01/func/sub-02_ses-01_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-02/ses-01/func/sub-02_ses-01_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-02/ses-01/func/sub-02_ses-01_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-02/anat/sub-02_ses-02_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-02/anat/sub-02_ses-02_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-02/func/sub-02_ses-02_task-vislocalizer_bold.nii.gz 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-02/ses-02/func/sub-02_ses-02_task-vislocalizer_bold.nii.gz 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-02/ses-02/func/sub-02_ses-02_task-vismotion_run-1_bold.nii.gz 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-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-01/func/asub-02_ses-01_task-vismotion_run-2_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-01/func/sub-02_ses-01_task-vislocalizer_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-01/func/sub-02_ses-01_task-vislocalizer_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-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-blind01/ses-01/anat/sub-blind01_ses-01_T1w.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-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_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-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_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-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.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-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-1_bold.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-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii.gz 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-blind01/ses-01/func/sub-blind01_ses-01_task-vismotion_run-2_bold.nii.gz 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-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii.gz 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-blind01/ses-02/anat/sub-blind01_ses-02_T1w.nii.gz 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-blind01/ses-02/func/sub-blind01_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-blind01/ses-02/func/sub-blind01_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-blind01/ses-02/func/sub-blind01_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-blind01/ses-02/func/sub-blind01_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-blind01/ses-02/func/sub-blind01_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-blind01/ses-02/func/sub-blind01_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-blind02/ses-01/anat/sub-blind02_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-blind02/ses-01/anat/sub-blind02_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-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii.gz 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-blind02/ses-01/func/sub-blind02_ses-01_task-vislocalizer_bold.nii.gz 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-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii.gz 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-blind02/ses-01/func/sub-blind02_ses-01_task-vismotion_run-1_bold.nii.gz 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-blind02/ses-01/func/sub-blind02_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-vislocalizer_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-blind01/ses-01/func/sub-blind01_ses-01_task-vislocalizer_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-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-blind02/ses-02/anat/sub-blind02_ses-02_T1w.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-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_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-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_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-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.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-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-1_bold.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-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii.gz 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-blind02/ses-02/func/sub-blind02_ses-02_task-vismotion_run-2_bold.nii.gz 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-01/anat/sub-cat01_ses-01_T1w.nii.gz 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-01/anat/sub-cat01_ses-01_T1w.nii.gz 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-01/func/rp_sub-cat01_ses-01_task-vislocalizer_bold.txt 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-cat01/ses-01/func/rp_sub-cat01_ses-01_task-vislocalizer_bold.txt 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-cat01/ses-01/func/s6rsub-cat01_ses-01_task-vislocalizer_bold.nii 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-cat01/ses-01/func/s6rsub-cat01_ses-01_task-vislocalizer_bold.nii 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-cat01/ses-01/func/s6wsub-cat01_ses-01_task-vislocalizer_bold.nii 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-cat01/ses-01/func/s6wsub-cat01_ses-01_task-vislocalizer_bold.nii 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-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.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-cat01/ses-01/func/sub-cat01_ses-01_task-vislocalizer_bold.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-cat01/ses-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii.gz 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-01/func/sub-cat01_ses-01_task-vismotion_run-1_bold.nii.gz 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-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii.gz 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-01/func/sub-cat01_ses-01_task-vismotion_run-2_bold.nii.gz 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-cat01/ses-02/anat/sub-cat01_ses-02_T1w.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-cat01/ses-02/anat/sub-cat01_ses-02_T1w.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-cat01/ses-02/func/rp_sub-cat01_ses-02_task-vislocalizer_bold.txt 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-cat01/ses-02/func/rp_sub-cat01_ses-02_task-vislocalizer_bold.txt 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-cat01/ses-02/func/s6rsub-cat01_ses-02_task-vislocalizer_bold.nii 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-cat01/ses-02/func/s6rsub-cat01_ses-02_task-vislocalizer_bold.nii 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-cat01/ses-02/func/s6wsub-cat01_ses-02_task-vislocalizer_bold.nii 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-cat01/ses-02/func/s6wsub-cat01_ses-02_task-vislocalizer_bold.nii 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-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii.gz 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-cat01/ses-02/func/sub-cat01_ses-02_task-vislocalizer_bold.nii.gz 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-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii.gz 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-cat01/ses-02/func/sub-cat01_ses-02_task-vismotion_run-1_bold.nii.gz 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-02/func/sub-cat01_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-vislocalizer_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-blind02/ses-02/func/sub-blind02_ses-02_task-vislocalizer_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-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-cat02/ses-01/anat/sub-cat02_ses-01_T1w.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-cat02/ses-01/func/rp_sub-cat02_ses-01_task-vislocalizer_bold.txt 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-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/sub-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/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_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_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/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_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_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/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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-1_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/sub-cont01_ses-02_task-vismotion_run-2_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/anat/sub-cont02_ses-01_T1w.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vislocalizer_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-1_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-01/func/sub-cont02_ses-01_task-vismotion_run-2_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/anat/sub-cont02_ses-02_T1w.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vislocalizer_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-1_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont02/ses-02/func/sub-cont02_ses-02_task-vismotion_run-2_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/anat/sub-cont03_ses-01_T1w.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vislocalizer_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-1_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-01/func/sub-cont03_ses-01_task-vismotion_run-2_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/anat/sub-cont03_ses-02_T1w.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vislocalizer_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-1_bold.nii.gz 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.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-cont03/ses-02/func/sub-cont03_ses-02_task-vismotion_run-2_bold.nii.gz 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/anat/sub-ctrl01_ses-01_T1w.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/anat/sub-ctrl01_ses-01_T1w.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.gz deleted file mode 100644 index e69de29b..00000000 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-1_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-1_bold.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-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/sub-cat02_ses-01_task-vislocalizer_bold.nii.gz 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-vismotion_run-1_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-cat02/ses-01/func/sub-cat02_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-vislocalizer_bold.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.gz deleted file mode 100644 index e69de29b..00000000 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-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-cat02/ses-01/func/sub-cat02_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-1_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.gz deleted file mode 100644 index e69de29b..00000000 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-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-cat02/ses-02/anat/sub-cat02_ses-02_T1w.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-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.gz deleted file mode 100644 index e69de29b..00000000 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-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.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-ctrl01/ses-02/anat/sub-ctrl01_ses-02_T1w.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.gz deleted file mode 100644 index e69de29b..00000000 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-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-02/func/s6rsub-cat02_ses-02_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-02/func/s6wsub-cat02_ses-02_task-vislocalizer_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-02/func/s6wsub-cat02_ses-02_task-vislocalizer_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-02/func/sub-cat02_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-cat02/ses-02/func/sub-cat02_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-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl01/ses-02/func/sub-ctrl01_ses-02_task-vislocalizer_bold.nii.gz 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_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-cat02/ses-02/func/sub-cat02_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-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.gz 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_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-cat02/ses-02/func/sub-cat02_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-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.gz deleted file mode 100644 index e69de29b..00000000 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-ctrl02/ses-01/anat/sub-ctrl02_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-ctrl02/ses-01/anat/sub-ctrl02_ses-01_T1w.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.gz 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-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-cont01/ses-01/func/rp_sub-cont01_ses-01_task-vislocalizer_bold.txt 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-cont01/ses-01/func/s6rsub-cont01_ses-01_task-vislocalizer_bold.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-cont01/ses-01/func/s6rsub-cont01_ses-01_task-vislocalizer_bold.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-cont01/ses-01/func/s6wsub-cont01_ses-01_task-vislocalizer_bold.nii 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-cont01/ses-01/func/s6wsub-cont01_ses-01_task-vislocalizer_bold.nii 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-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-01/func/sub-ctrl02_ses-01_task-vislocalizer_bold.nii.gz 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.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-cont01/ses-01/func/sub-cont01_ses-01_task-vislocalizer_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-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.gz 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_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-cont01/ses-01/func/sub-cont01_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-2_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.gz 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_bold.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-cont01/ses-01/func/sub-cont01_ses-01_task-vismotion_run-2_bold.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/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.gz deleted file mode 100644 index e69de29b..00000000 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-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-cont01/ses-02/anat/sub-cont01_ses-02_T1w.nii.gz 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-cont01/ses-02/func/rp_sub-cont01_ses-02_task-vislocalizer_bold.txt 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-cont01/ses-02/func/rp_sub-cont01_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-2_bold.nii 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-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii similarity index 100% rename from tests/dummyData/derivatives/SPM12_CPPL/sub-cont01/ses-02/func/s6rsub-cont01_ses-02_task-vislocalizer_bold.nii 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-vislocalizer_bold.nii.gz b/tests/dummyData/derivatives/SPM12_CPPL/sub-ctrl02/ses-02/func/sub-ctrl02_ses-02_task-vislocalizer_bold.nii.gz 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-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-cont01/ses-02/func/s6wsub-cont01_ses-02_task-vislocalizer_bold.nii 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-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.gz 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.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-cont01/ses-02/func/sub-cont01_ses-02_task-vislocalizer_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/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.gz deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/group/20200918_2311_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2311_jobs_matlabbatch_SPM12_groupTest.json new file mode 100644 index 00000000..851a3de7 --- /dev/null +++ b/tests/group/20200918_2311_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_24162" + ], + "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", + "", + "", + "0x7f848773bb10-cafed524-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/group/20200918_2332_jobs_matlabbatch_SPM12_groupTest.json b/tests/group/20200918_2332_jobs_matlabbatch_SPM12_groupTest.json new file mode 100644 index 00000000..851a3de7 --- /dev/null +++ b/tests/group/20200918_2332_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_24162" + ], + "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", + "", + "", + "0x7f848773bb10-cafed524-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/sub-01/20200918_2311_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2311_jobs_matlabbatch_SPM12_test.json new file mode 100644 index 00000000..d0f8ee47 --- /dev/null +++ b/tests/sub-01/20200918_2311_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_24162" + ], + "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", + "", + "", + "0x7f848773bb10-cafed524-libiomp5.so" + ] + } + } +} \ No newline at end of file diff --git a/tests/sub-01/20200918_2332_jobs_matlabbatch_SPM12_test.json b/tests/sub-01/20200918_2332_jobs_matlabbatch_SPM12_test.json new file mode 100644 index 00000000..d0f8ee47 --- /dev/null +++ b/tests/sub-01/20200918_2332_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_24162" + ], + "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", + "", + "", + "0x7f848773bb10-cafed524-libiomp5.so" + ] + } + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..4c68bce6 --- /dev/null +++ b/tests/test_getFuncVoxelDims.m @@ -0,0 +1,46 @@ +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 diff --git a/tests/test_getGrpLevelContrastToCompute.m b/tests/test_getGrpLevelContrastToCompute.m new file mode 100644 index 00000000..eed1495e --- /dev/null +++ b/tests/test_getGrpLevelContrastToCompute.m @@ -0,0 +1,42 @@ +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 diff --git a/tests/test_getInfo.m b/tests/test_getInfo.m index 01cee547..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'; @@ -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_setBatchCoregistration.m b/tests/test_setBatchCoregistration.m new file mode 100644 index 00000000..adaa015a --- /dev/null +++ b/tests/test_setBatchCoregistration.m @@ -0,0 +1,85 @@ +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 + 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 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 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 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 diff --git a/tests/test_setBatchSegmentation.m b/tests/test_setBatchSegmentation.m new file mode 100644 index 00000000..b568a949 --- /dev/null +++ b/tests/test_setBatchSegmentation.m @@ -0,0 +1,84 @@ +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