diff --git a/.github/workflows/check_markdown.yml b/.github/workflows/check_markdown.yml deleted file mode 100644 index 1b997e3d..00000000 --- a/.github/workflows/check_markdown.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Check Markdown - -on: - push: - branches: - - master - pull_request: - branches: '*' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 1 - - - uses: actions/setup-node@v2 - with: - node-version: '10' - - - name: Install dependencies and check markdown - run: | - npm install `cat npm-requirements.txt` - npx remark *.md --frail - npx remark ./docs/ --frail - npx remark ./demos/ --frail - npx remark ./tests/ --frail diff --git a/.github/workflows/miss_hit.yml b/.github/workflows/miss_hit_quality.yml similarity index 86% rename from .github/workflows/miss_hit.yml rename to .github/workflows/miss_hit_quality.yml index 5c5e561d..9ff86d1f 100644 --- a/.github/workflows/miss_hit.yml +++ b/.github/workflows/miss_hit_quality.yml @@ -1,4 +1,4 @@ -name: miss_hit +name: miss_hit_quality on: push: @@ -29,10 +29,6 @@ jobs: python -m pip install --upgrade pip setuptools pip3 install -r requirements.txt - - name: MISS_HIT Code style - run: | - mh_style --process-slx - - name: MISS_HIT Metrics run: | mh_metric --ci diff --git a/.github/workflows/miss_hit_style.yml b/.github/workflows/miss_hit_style.yml new file mode 100644 index 00000000..17e5bdca --- /dev/null +++ b/.github/workflows/miss_hit_style.yml @@ -0,0 +1,35 @@ +name: miss_hit_style + +on: + push: + branches: + - master + pull_request: + branches: '*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 1 + + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip3 install -r requirements.txt + + - name: MISS_HIT Code style + run: | + mh_style + diff --git a/.github/workflows/run_system_tests.yml b/.github/workflows/run_system_tests.yml index 8f0f845e..2761d9c6 100644 --- a/.github/workflows/run_system_tests.yml +++ b/.github/workflows/run_system_tests.yml @@ -56,20 +56,9 @@ jobs: make -C spm12/src PLATFORM=octave install octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'spm12')); savepath();" - - name: Update octave path - run: | - octave $OCTFLAGS --eval "initCppSpm; savepath();" - - - name: Prepare data - run: | - inputs_folder='demos/MoAE/inputs/' - mkdir $inputs_folder - curl http://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip --output $inputs_folder'MoAEpilot.zip' - unzip $inputs_folder'MoAEpilot.zip' -d $inputs_folder - mv $inputs_folder/MoAEpilot $inputs_folder/raw - + - name: Run system tests run: | - cd demos/MoAE - octave $OCTFLAGS --eval "MoAEpilot_run" + cd manualTests/ + octave $OCTFLAGS --eval "systemTestMoAE" diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 3ad370d8..b9f64864 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -78,7 +78,7 @@ jobs: - name: Run tests run: | - octave $OCTFLAGS --eval "runTests" + octave $OCTFLAGS --eval "run_tests" cat test_report.log | grep 0 bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index d520b176..f0a8a647 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ docs/build/* # ignore virtual env cpp_spm/* +env/* # visual studio code stuff .vscode diff --git a/.remarkrc b/.remarkrc deleted file mode 100644 index 201ce70e..00000000 --- a/.remarkrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugins": [ - "preset-lint-consistent", - "preset-lint-markdown-style-guide", - "preset-lint-recommended", - ["lint-no-duplicate-headings", false], - ["lint-list-item-indent", "tab-size"], - ["lint-maximum-line-length", true], - ["lint-maximum-heading-length", false] - ] -} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 88b79e16..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,346 +0,0 @@ -# Contributing - -## Unit testing - -All tests are in the test folder. There is also an empty dummy BIDS dataset that -is partly created using the bash script `createDummyDataSet.sh`. - -## Changelog - - - - diff --git a/README.md b/README.md index ab193907..681cf30e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ This is a set of functions to MRI analysis on a ## Installation -TODO + We strongly recommend using the CPP fMRI analysis template repository (INSERT URL) to use CPP_SPM. @@ -114,6 +114,14 @@ Please see our [documentation](https://cpp-bids-spm.readthedocs.io/en/latest/index.html) for more info. +## Octave compatibility + +The following features do not yet work with Octave: + +- anatomicalQA +- functionalQA +- slice_display toolbox + ## Contributing Feel free to open issues to report a bug and ask for improvements. @@ -125,6 +133,18 @@ or you get stuck: it is more likely we did not do good enough a job at explaining things. So do not hesitate to open an issue, just to ask for clarification. +### Style guidelines + +These are some of the guidelines we try to follow. + +We use `camelCase` to name functions and variables for the vast majority of the +code in this repository. + +Scripts names in general and as well functions related to the demos use a +`snake_case`. + +Constant are written in `UPPERCASE`. + ## Contributors Thanks goes to these wonderful people diff --git a/demos/MoAE/dowload_MoAE_ds.m b/demos/MoAE/download_moae_ds.m similarity index 90% rename from demos/MoAE/dowload_MoAE_ds.m rename to demos/MoAE/download_moae_ds.m index f0be3cf9..03fc0621 100644 --- a/demos/MoAE/dowload_MoAE_ds.m +++ b/demos/MoAE/download_moae_ds.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 Remi Gau - -function dowload_MoAE_ds(downloadData) +function download_moae_ds(downloadData) + % + % (C) Copyright 2021 Remi Gau if downloadData diff --git a/demos/MoAE/MoAE_create_roi_extract_data.m b/demos/MoAE/moae_create_roi_extract_data.m similarity index 98% rename from demos/MoAE/MoAE_create_roi_extract_data.m rename to demos/MoAE/moae_create_roi_extract_data.m index 22e0a5be..accf97bd 100644 --- a/demos/MoAE/MoAE_create_roi_extract_data.m +++ b/demos/MoAE/moae_create_roi_extract_data.m @@ -6,7 +6,7 @@ % we are going to extract the value from. % -run MoAE_run.m; +run moae_run.m; subLabel = '01'; diff --git a/demos/MoAE/MoAE_getOption.m b/demos/MoAE/moae_get_option.m similarity index 96% rename from demos/MoAE/MoAE_getOption.m rename to demos/MoAE/moae_get_option.m index e36f9976..40110173 100644 --- a/demos/MoAE/MoAE_getOption.m +++ b/demos/MoAE/moae_get_option.m @@ -1,8 +1,9 @@ -% (C) Copyright 2019 Remi Gau - -function opt = MoAE_getOption() +function opt = moae_get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % (C) Copyright 2019 Remi Gau opt = []; diff --git a/demos/MoAE/MoAE_run.m b/demos/MoAE/moae_run.m similarity index 80% rename from demos/MoAE/MoAE_run.m rename to demos/MoAE/moae_run.m index bee7d73d..4d4d71b0 100644 --- a/demos/MoAE/MoAE_run.m +++ b/demos/MoAE/moae_run.m @@ -18,18 +18,17 @@ run ../../initCppSpm.m; %% Set options -opt = MoAE_getOption(); +opt = moae_get_option(); -dowload_MoAE_ds(downloadData); +download_moae_ds(downloadData); %% Run batches reportBIDS(opt); bidsCopyRawFolder(opt, 1); % In case you just want to run segmentation and skull stripping - -bidsSegmentSkullStrip(opt); - +% bidsSegmentSkullStrip(opt); +% % NOTE: skull stripping is also included in 'bidsSpatialPrepro' bidsSTC(opt); @@ -37,13 +36,17 @@ bidsSpatialPrepro(opt); % The following do not run on octave for now (because of spmup) -% anatomicalQA(opt); -% bidsResliceTpmToFunc(opt); -% functionalQA(opt); +anatomicalQA(opt); +bidsResliceTpmToFunc(opt); +functionalQA(opt); bidsSmoothing(FWHM, opt); -% The following crash on Travis CI +% The following crash on CI +WD = pwd; bidsFFX('specifyAndEstimate', opt, FWHM); +cd(WD); bidsFFX('contrasts', opt, FWHM); +cd(WD); bidsResults(opt, FWHM); +cd(WD); diff --git a/demos/MoAE/MoAE_slice_display.m b/demos/MoAE/moae_slice_display.m similarity index 96% rename from demos/MoAE/MoAE_slice_display.m rename to demos/MoAE/moae_slice_display.m index bf370a0c..a0662caa 100644 --- a/demos/MoAE/MoAE_slice_display.m +++ b/demos/MoAE/moae_slice_display.m @@ -1,7 +1,6 @@ % (C) Copyright 2021 Remi Gau -run MoAE_run.m; -run MoAE_create_roi_extract_data.m; +run moae_create_roi_extract_data.m; close all; diff --git a/demos/MoAE/options/options_task-auditory.json b/demos/MoAE/options/options_task-auditory.json index 00982156..198477b0 100644 --- a/demos/MoAE/options/options_task-auditory.json +++ b/demos/MoAE/options/options_task-auditory.json @@ -1,19 +1,12 @@ { - "STC_referenceSlice": [], "anatReference": { "type": "T1w", - "session": 1 + "session": "" }, - "contrastList": [], - "dataDir": "/home/remi/github/CPP_SPM/demos/MoAE/output/MoAEpilot", - "derivativesDir": "/home/remi/github/CPP_SPM/demos/MoAE/derivatives/default", - "funcVoxelDims": [], - "groups": [""], + "dataDir": "./inputs/raw", + "derivativesDir": "./outputs/", "model": { - "file": "/home/remi/github/CPP_SPM/demos/MoAE/models/model-MoAE_smdl.json" - }, - "realign": { - "useUnwarp": true + "file": "./models/model-MoAE_smdl.json" }, "result": { "Steps": { @@ -41,9 +34,7 @@ "skullstrip": { "threshold": 0.75 }, - "sliceOrder": [], "space": "MNI", - "subjects": [[]], "taskName": "auditory", "useFieldmaps": true, "zeropad": 2 diff --git a/demos/MoAE/options/options_task-auditory_space-individual.json b/demos/MoAE/options/options_task-auditory_space-individual.json index 346b482b..4abd8a40 100644 --- a/demos/MoAE/options/options_task-auditory_space-individual.json +++ b/demos/MoAE/options/options_task-auditory_space-individual.json @@ -1,15 +1,12 @@ { - "STC_referenceSlice": [], "anatReference": { "type": "T1w", - "session": 1 + "session": "" }, - "contrastList": [], - "dataDir": "/home/remi/github/CPP_SPM/demos/MoAE/output/MoAEpilot", - "derivativesDir": "/home/remi/github/CPP_SPM/demos/MoAE/derivatives/native", - "funcVoxelDims": [], + "dataDir": "./inputs/raw", + "derivativesDir": "./outputs/", "model": { - "file": "/home/remi/github/CPP_SPM/demos/MoAE/models/model-MoAE_smdl.json" + "file": "./models/model-MoAE_smdl.json" }, "realign": { "useUnwarp": true @@ -40,7 +37,6 @@ "skullstrip": { "threshold": 0.75 }, - "sliceOrder": [], "space": "individual", "taskName": "auditory", "useFieldmaps": true, diff --git a/demos/MoAE/options/options_task-auditory_unwarp-0.json b/demos/MoAE/options/options_task-auditory_unwarp-0.json index 009b8147..8430077f 100644 --- a/demos/MoAE/options/options_task-auditory_unwarp-0.json +++ b/demos/MoAE/options/options_task-auditory_unwarp-0.json @@ -1,15 +1,12 @@ { - "STC_referenceSlice": [], "anatReference": { "type": "T1w", - "session": 1 + "session": "" }, - "contrastList": [], - "dataDir": "/home/remi/github/CPP_SPM/demos/MoAE/output/MoAEpilot", - "derivativesDir": "/home/remi/github/CPP_SPM/demos/MoAE/derivatives/unwarp-0", - "funcVoxelDims": [], + "dataDir": "./inputs/raw", + "derivativesDir": "./outputs/", "model": { - "file": "/home/remi/github/CPP_SPM/demos/MoAE/models/model-MoAE_smdl.json" + "file": "./models/model-MoAE_smdl.json" }, "realign": { "useUnwarp": false @@ -40,7 +37,6 @@ "skullstrip": { "threshold": 0.75 }, - "sliceOrder": [], "space": "MNI", "taskName": "auditory", "useFieldmaps": true, diff --git a/demos/MoAE/options/options_task-auditory_unwarp-0_space-individual.json b/demos/MoAE/options/options_task-auditory_unwarp-0_space-individual.json index 6dd7198f..2d1a17e5 100644 --- a/demos/MoAE/options/options_task-auditory_unwarp-0_space-individual.json +++ b/demos/MoAE/options/options_task-auditory_unwarp-0_space-individual.json @@ -1,15 +1,12 @@ { - "STC_referenceSlice": [], "anatReference": { "type": "T1w", - "session": 1 + "session": "" }, - "contrastList": [], - "dataDir": "/home/remi/github/CPP_SPM/demos/MoAE/output/MoAEpilot", - "derivativesDir": "/home/remi/github/CPP_SPM/demos/MoAE/derivatives/unwarp-0_native", - "funcVoxelDims": [], + "dataDir": "./inputs/raw", + "derivativesDir": "./outputs/", "model": { - "file": "/home/remi/github/CPP_SPM/demos/MoAE/models/model-MoAE_smdl.json" + "file": "./models/model-MoAE_smdl.json" }, "realign": { "useUnwarp": false @@ -40,7 +37,6 @@ "skullstrip": { "threshold": 0.75 }, - "sliceOrder": [], "space": "individual", "taskName": "auditory", "useFieldmaps": true, diff --git a/demos/MoAE/return_normalized_anat_file.m b/demos/MoAE/return_normalized_anat_file.m index b6a3627f..785543dc 100644 --- a/demos/MoAE/return_normalized_anat_file.m +++ b/demos/MoAE/return_normalized_anat_file.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 Remi Gau - function [anat_normalized_file, anatRange] = return_normalized_anat_file(opt, subLabel) + % + % (C) Copyright 2021 Remi Gau [BIDS, opt] = getData(opt); [~, anatDataDir] = getAnatFilename(BIDS, subLabel, opt); diff --git a/demos/spm_face_rep/dowload_convert_face_rep_ds.m b/demos/face_repetition/download_convert_face_rep_ds.m similarity index 98% rename from demos/spm_face_rep/dowload_convert_face_rep_ds.m rename to demos/face_repetition/download_convert_face_rep_ds.m index a57bc975..72a901f7 100644 --- a/demos/spm_face_rep/dowload_convert_face_rep_ds.m +++ b/demos/face_repetition/download_convert_face_rep_ds.m @@ -1,12 +1,11 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - -function dowload_convert_face_rep_ds() +function download_convert_face_rep_ds() % - % downloads the fare repetition dataset from SPM and convert it to BIDS + % downloads the face repetition dataset from SPM and convert it to BIDS % % Adapted from its counterpart for MoAE % % + % (C) Copyright 2020 CPP_SPM developers subject = 'sub-01'; task_name = 'face repetition'; diff --git a/demos/spm_face_rep/face_rep_anat.m b/demos/face_repetition/face_rep_anat.m similarity index 79% rename from demos/spm_face_rep/face_rep_anat.m rename to demos/face_repetition/face_rep_anat.m index 0df75713..eac2850b 100644 --- a/demos/spm_face_rep/face_rep_anat.m +++ b/demos/face_repetition/face_rep_anat.m @@ -1,7 +1,5 @@ % (C) Copyright 2019 Remi Gau - -% This script will download the face repetition dataset from the FIL -% and will run the basic preprocessing, FFX and contrasts on it. +% % % This show how an anat only workflow would look like % @@ -22,7 +20,7 @@ %% Removes previous analysis, gets data and converts it to BIDS if downloadData - dowload_convert_face_rep_ds(); + download_convert_face_rep_ds(); end diff --git a/demos/spm_face_rep/face_rep_func.m b/demos/face_repetition/face_rep_func.m similarity index 94% rename from demos/spm_face_rep/face_rep_func.m rename to demos/face_repetition/face_rep_func.m index 5a104a5b..b8817171 100644 --- a/demos/spm_face_rep/face_rep_func.m +++ b/demos/face_repetition/face_rep_func.m @@ -1,5 +1,5 @@ % (C) Copyright 2019 Remi Gau - +% % This script will download the face repetition dataset from the FIL % and will run the basic preprocessing, FFX and contrasts on it. % @@ -24,12 +24,12 @@ run ../../initCppSpm.m; %% Set options -opt = FaceRep_getOption(); +opt = face_rep_get_option(); %% Removes previous analysis, gets data and converts it to BIDS if downloadData - dowload_convert_face_rep_ds(); + download_convert_face_rep_ds(); end diff --git a/demos/spm_face_rep/FaceRep_getOption.m b/demos/face_repetition/face_rep_get_option.m similarity index 85% rename from demos/spm_face_rep/FaceRep_getOption.m rename to demos/face_repetition/face_rep_get_option.m index 660accd7..ea0293e3 100644 --- a/demos/spm_face_rep/FaceRep_getOption.m +++ b/demos/face_repetition/face_rep_get_option.m @@ -1,8 +1,9 @@ -% (C) Copyright 2020 Remi Gau - -function opt = FaceRep_getOption() +function opt = face_rep_get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % (C) Copyright 2020 Remi Gau opt = []; diff --git a/demos/spm_face_rep/FaceRep_getOptionResults.m b/demos/face_repetition/face_rep_get_option_results.m similarity index 90% rename from demos/spm_face_rep/FaceRep_getOptionResults.m rename to demos/face_repetition/face_rep_get_option_results.m index 541fc08a..8b36c80c 100644 --- a/demos/spm_face_rep/FaceRep_getOptionResults.m +++ b/demos/face_repetition/face_rep_get_option_results.m @@ -1,8 +1,8 @@ -% (C) Copyright 2021 Remi Gau +function opt = face_rep_get_option_results() + % + % (C) Copyright 2021 Remi Gau -function opt = FaceRep_getOptionResults() - - opt = FaceRep_getOption(); + opt = face_rep_get_option(); opt.model.file = fullfile( ... fileparts(mfilename('fullpath')), ... diff --git a/demos/spm_face_rep/face_rep_resolution.m b/demos/face_repetition/face_rep_resolution.m similarity index 84% rename from demos/spm_face_rep/face_rep_resolution.m rename to demos/face_repetition/face_rep_resolution.m index 3e2ec99e..38461e17 100644 --- a/demos/spm_face_rep/face_rep_resolution.m +++ b/demos/face_repetition/face_rep_resolution.m @@ -1,6 +1,5 @@ % (C) Copyright 2019 Remi Gau - -% adapted from face_rep_fun +% % % runs preprocessing with different final spatial resolution in MNI space % @@ -17,12 +16,12 @@ %% Set options -opt = FaceRep_getOptionResults(); +opt = face_rep_get_option_results(); %% Removes previous analysis, gets data and converts it to BIDS if downloadData - dowload_convert_face_rep_ds(); + download_convert_face_rep_ds(); end @@ -42,6 +41,10 @@ 'derivatives', ... ['cpp_spm-res' num2str(iResolution)]), 'cpath'); + % create a new BIDS model json file + % this way the GLM output will be store in a different directory for each + % resolution as the name of the GLM directory is based on the name of the + % model in the BIDS model content = spm_jsonread(opt.model.file); content.Name = [content.Name, ' resolution - ', num2str(iResolution)]; @@ -52,6 +55,7 @@ spm_jsonwrite(newModel, content, struct('indent', ' ')); + % run analysis bidsCopyRawFolder(opt, 1); bidsSTC(opt); diff --git a/demos/spm_face_rep/face_rep_roi_analysis.m b/demos/face_repetition/face_rep_roi_analysis.m similarity index 92% rename from demos/spm_face_rep/face_rep_roi_analysis.m rename to demos/face_repetition/face_rep_roi_analysis.m index dc8b8af3..4799bd3c 100644 --- a/demos/spm_face_rep/face_rep_roi_analysis.m +++ b/demos/face_repetition/face_rep_roi_analysis.m @@ -1,11 +1,12 @@ % (C) Copyright 2019 Remi Gau - +% % creates a ROI in MNI space from the proba atlas % creates its equivalent in subject space +% run face_rep_anat.m; -opt = FaceRep_getOption(); +opt = face_rep_get_option(); opt.roi.atlas = 'wang'; opt.roi.name = {'V1v', 'V1d'}; diff --git a/demos/spm_face_rep/models/model-faceRepetition_smdl.json b/demos/face_repetition/models/model-faceRepetition_smdl.json similarity index 100% rename from demos/spm_face_rep/models/model-faceRepetition_smdl.json rename to demos/face_repetition/models/model-faceRepetition_smdl.json diff --git a/demos/lesiondetection/batchLesion.m b/demos/lesion_detection/batch_lesion.m similarity index 85% rename from demos/lesiondetection/batchLesion.m rename to demos/lesion_detection/batch_lesion.m index 7e66dc7c..87de2b2b 100644 --- a/demos/lesiondetection/batchLesion.m +++ b/demos/lesion_detection/batch_lesion.m @@ -1,4 +1,4 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers +% (C) Copyright 2021 CPP_SPM developers clear; clc; diff --git a/demos/lesiondetection/Lesion_getOption.m b/demos/lesion_detection/lesion_get_option.m similarity index 81% rename from demos/lesiondetection/Lesion_getOption.m rename to demos/lesion_detection/lesion_get_option.m index 04e97c78..2da9718f 100644 --- a/demos/lesiondetection/Lesion_getOption.m +++ b/demos/lesion_detection/lesion_get_option.m @@ -1,6 +1,4 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - -function opt = Lesion_getOption() +function opt = lesion_get_option() % % Returns a structure that contains the options chosen by the user to run the source processing % batch workflow @@ -10,6 +8,8 @@ % opt = Lesion_getOption() % % :returns: - :optSource: (struct) + % + % (C) Copyright 2021 CPP_SPM developers % The directory where the data are located opt.dataDir = '/home/remi/gin/CVI-Datalad/data'; diff --git a/demos/miss_hit.cfg b/demos/miss_hit.cfg index 25947f2d..007bd432 100644 --- a/demos/miss_hit.cfg +++ b/demos/miss_hit.cfg @@ -1,12 +1 @@ -# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html) -line_length: 100 -regex_function_name: "[a-zA-Z0-9]+(_*([a-zA-Z0-9]){1}[A-Za-z]+)*" # almost anything goes in the root folder -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 400 -metric "cyc": limit 12 -metric "parameters": limit 6 \ No newline at end of file +regex_function_name: "[a-z0-9]+(_[a-z0-9]+)*" \ No newline at end of file diff --git a/demos/openneuro/ds000001_getOption.m b/demos/openneuro/ds000001_get_option.m similarity index 93% rename from demos/openneuro/ds000001_getOption.m rename to demos/openneuro/ds000001_get_option.m index b468ef5b..8d9daa1b 100644 --- a/demos/openneuro/ds000001_getOption.m +++ b/demos/openneuro/ds000001_get_option.m @@ -1,8 +1,9 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - -function opt = ds000001_getOption() +function opt = ds000001_get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 1 opt = []; diff --git a/demos/openneuro/ds000001_run.m b/demos/openneuro/ds000001_run.m index 8e1ce6fc..a0d11fab 100644 --- a/demos/openneuro/ds000001_run.m +++ b/demos/openneuro/ds000001_run.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers % runDs00014 @@ -12,7 +12,7 @@ run ../../initCppSpm.m; %% Set options -opt = ds000001_getOption(); +opt = ds000001_get_option(); reportBIDS(opt); diff --git a/demos/openneuro/ds000114_getOption.m b/demos/openneuro/ds000114_get_option.m similarity index 94% rename from demos/openneuro/ds000114_getOption.m rename to demos/openneuro/ds000114_get_option.m index 5797314e..caf9fd1c 100644 --- a/demos/openneuro/ds000114_getOption.m +++ b/demos/openneuro/ds000114_get_option.m @@ -1,8 +1,10 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - -function opt = ds000114_getOption() +function opt = ds000114_get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 1 opt = []; diff --git a/demos/openneuro/ds000114_run.m b/demos/openneuro/ds000114_run.m index 56f61cfd..f3d8dd1d 100644 --- a/demos/openneuro/ds000114_run.m +++ b/demos/openneuro/ds000114_run.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers % runDs00014 @@ -12,7 +12,7 @@ run ../../initCppSpm.m; %% Set options -opt = ds000114_getOption(); +opt = ds000114_get_option(); %% Run batches diff --git a/demos/openneuro/ds001168_getOption.m b/demos/openneuro/ds001168_get_option.m similarity index 88% rename from demos/openneuro/ds001168_getOption.m rename to demos/openneuro/ds001168_get_option.m index 6a6ebfb4..ce65ee10 100644 --- a/demos/openneuro/ds001168_getOption.m +++ b/demos/openneuro/ds001168_get_option.m @@ -1,8 +1,10 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - -function opt = ds001168_getOption() +function opt = ds001168_get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 1 opt = []; diff --git a/demos/openneuro/ds001168_run.m b/demos/openneuro/ds001168_run.m index 701c88c1..695b3b6d 100644 --- a/demos/openneuro/ds001168_run.m +++ b/demos/openneuro/ds001168_run.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers % runDs001168 @@ -11,7 +11,7 @@ run ../../initCppSpm.m; %% Set options -opt = ds001168_getOption(); +opt = ds001168_get_option(); %% Run batches diff --git a/demos/vismotion/batch.m b/demos/vismotion/batch.m index ce2ef814..b88ef07b 100644 --- a/demos/vismotion/batch.m +++ b/demos/vismotion/batch.m @@ -1,4 +1,4 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers +% (C) Copyright 2019 CPP_SPM developers clear; clc; @@ -9,7 +9,7 @@ run ../../initCppSpm.m; %% Run batches -opt = getOption(); +opt = get_option(); reportBIDS(opt); diff --git a/demos/vismotion/getOption.m b/demos/vismotion/get_option.m similarity index 84% rename from demos/vismotion/getOption.m rename to demos/vismotion/get_option.m index dca50692..1671e4f7 100644 --- a/demos/vismotion/getOption.m +++ b/demos/vismotion/get_option.m @@ -1,9 +1,11 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - -function opt = getOption() - % opt = getOption() +function opt = get_option() + % % returns a structure that contains the options chosen by the user to run % slice timing correction, pre-processing, FFX, RFX. + % + % opt = get_option() + % + % (C) Copyright 2019 CPP_SPM developers if nargin < 1 opt = []; @@ -17,8 +19,7 @@ opt.derivativesDir = '/home/remi/Documents'; % specify the model file that contains the contrasts to compute - opt.model.file = ... - '/home/remi/github/CPP_BIDS_SPM_pipeline/demos/vismotion/models/model-visMotionLoc_smdl.json'; + opt.model.file = './vismotion/models/model-visMotionLoc_smdl.json'; % specify the result to compute % Contrasts.Name has to match one of the contrast defined in the model json file diff --git a/docs/README.md b/docs/README.md index 4f1ca4e7..add9f199 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,8 +3,8 @@ ## Set up virtual environment ```bash -virtualenv -p python3 cpp_spm -source cpp_spm/bin/activate +virtualenv -p /usr/bin/python3 env +source env/bin/activate pip install -r requirements.txt ``` diff --git a/docs/source/batches.rst b/docs/source/batches.rst index 9da85ccb..86076033 100644 --- a/docs/source/batches.rst +++ b/docs/source/batches.rst @@ -7,25 +7,35 @@ List of functions to set SPM batches. .. automodule:: src.batches +.. autofunction:: setBatch3Dto4D .. autofunction:: setBatchComputeVDM +.. autofunction:: setBatchContrasts .. autofunction:: setBatchCoregistrationFmap .. autofunction:: setBatchCoregistrationFuncToAnat .. autofunction:: setBatchCoregistration .. autofunction:: setBatchCreateVDMs +.. autofunction:: setBatchEstimateModel .. autofunction:: setBatchFactorialDesign +.. autofunction:: setBatchGroupLevelContrasts .. autofunction:: setBatchImageCalculation +.. autofunction:: setBatchLesionAbnormalitiesDetection +.. autofunction:: setBatchLesionOverlapMap +.. autofunction:: setBatchLesionSegmentation .. autofunction:: setBatchMeanAnatAndMask .. autofunction:: setBatchNormalizationSpatialPrepro .. autofunction:: setBatchNormalize +.. autofunction:: setBatchPrintFigure .. autofunction:: setBatchRealign .. autofunction:: setBatchReslice +.. autofunction:: setBatchResults .. autofunction:: setBatchSaveCoregistrationMatrix .. autofunction:: setBatchSegmentation .. autofunction:: setBatchSelectAnat .. autofunction:: setBatchSkullStripping .. autofunction:: setBatchSmoothConImages +.. autofunction:: setBatchSmoothingFunc .. autofunction:: setBatchSmoothing .. autofunction:: setBatchSTC .. autofunction:: setBatchSubjectLevelContrasts -.. autofunction:: setBatchSubjectLevelGLMSpec - \ No newline at end of file +.. autofunction:: setBatchSubjectLevelGLMSpec +.. autofunction:: setBatchSubjectLevelResults \ No newline at end of file diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index d9855ed0..de47e77f 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -47,38 +47,6 @@ Template proposal .. autofunction:: templateFunction ----- - -Numpy template --------------- - -See more information `here -`_ - -:: - - function [argout] = templateFunction(argin1, argin2, argin3) - % - % Short description of what the function does goes here. - % - % y = templateFunction(argin1, argin2, argin3) - % - % Parameters: - % argin1: The first input value - % - % argin2: The second input value - % - % argin3: The third input value - % - % Returns: - % The output value - - % The code goes below - - end - -.. autofunction:: templateFunctionNumpy - ---- Google template diff --git a/docs/source/demos.rst b/docs/source/demos.rst new file mode 100644 index 00000000..31b2d9e4 --- /dev/null +++ b/docs/source/demos.rst @@ -0,0 +1,11 @@ +Demos +===== + +:: + + demos/ + ├── face_repetition + ├── lesion_detection + ├── MoAE + ├── openneuro + └── vismotion \ No newline at end of file diff --git a/docs/source/function_description.rst b/docs/source/function_description.rst index 10745525..efa37956 100644 --- a/docs/source/function_description.rst +++ b/docs/source/function_description.rst @@ -16,7 +16,6 @@ List of functions in the ``src`` folder. .. autofunction:: getPrefix .. autofunction:: getRealignParamFile .. autofunction:: getSliceOrder -.. autofunction:: getSpecificSubjects .. autofunction:: setDerivativesDir .. autofunction:: unzipImgAndReturnsFullpathName @@ -25,7 +24,6 @@ Subject level model .. automodule:: src.subject_level -.. autofunction:: concatBetaImgTmaps .. autofunction:: convertOnsetTsvToMat .. autofunction:: createAndReturnOnsetFile .. autofunction:: deleteResidualImages @@ -62,15 +60,26 @@ Utility functions .. automodule:: src.utils .. autofunction:: checkDependencies +.. autofunction:: cleanCrash .. autofunction:: createDataDictionary +.. autofunction:: createDerivativeDir +.. autofunction:: createGlmDirName .. autofunction:: getEnvInfo +.. autofunction:: getSubjectList .. autofunction:: getVersion .. autofunction:: isOctave .. autofunction:: loadAndCheckOptions +.. autofunction:: manageWorkersPool +.. autofunction:: printBatchName .. autofunction:: printCredits .. autofunction:: printProcessingRun .. autofunction:: printProcessingSubject +.. autofunction:: printWorklowName +.. autofunction:: removeSpmPrefix +.. autofunction:: rmTrialTypeStr .. autofunction:: saveMatlabBatch .. autofunction:: saveOptions -.. autofunction:: setDefaultFields +.. autofunction:: setFields +.. autofunction:: setGraphicWindow .. autofunction:: validationInputFile +.. autofunction:: writeDatasetDescription \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index aafb80c3..5c2de617 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,10 +11,11 @@ Welcome to CPP SPM BIDS pipeline documentation! :caption: Content set_up - workflows - QA defaults + demos + workflows batches + QA function_description method_section_boilerplate mancoreg @@ -22,7 +23,7 @@ Welcome to CPP SPM BIDS pipeline documentation! contributing This pipeline contains a set of functions to run fMRI analysis on a -[BIDS data set](https://bids.neuroimaging.io/) using SPM12. +`BIDS data set `_ using SPM12. This can perform: diff --git a/docs/source/mancoreg.rst b/docs/source/mancoreg.rst index 5dacf6f9..1460a2a6 100644 --- a/docs/source/mancoreg.rst +++ b/docs/source/mancoreg.rst @@ -5,7 +5,7 @@ Manual coregistration tools ---- -.. automodule:: src.mancoreg +.. automodule:: lib.mancoreg .. autofunction:: mancoreg .. autofunction:: mancoregCallbacks diff --git a/docs/source/workflows.rst b/docs/source/workflows.rst index 06ffadd8..29cfe6d0 100644 --- a/docs/source/workflows.rst +++ b/docs/source/workflows.rst @@ -103,6 +103,13 @@ Compute results =============== .. autofunction:: bidsResults +.. autofunction:: bidsConcatBetaTmaps + +Region of interest analysis +=========================== + +.. autofunction:: bidsRoiBasedGLM +.. autofunction:: bidsCreateROI Other ===== diff --git a/initCppSpm.m b/initCppSpm.m index c4bdd80f..0ef52513 100644 --- a/initCppSpm.m +++ b/initCppSpm.m @@ -1,6 +1,8 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function initCppSpm() + % + % adds the relevant folders to the path + % + % (C) Copyright 2021 CPP_SPM developers global CPP_SPM_INITIALIZED diff --git a/manualTests/miss_hit.cfg b/manualTests/miss_hit.cfg new file mode 100644 index 00000000..684e5239 --- /dev/null +++ b/manualTests/miss_hit.cfg @@ -0,0 +1 @@ +regex_function_name: "(test(_unit){0,1}_[a-z]+|[a-z]+)(([A-Z]){1}[A-Za-z0-9]+)*" diff --git a/manualTests/test_bidsSegmentSkullStrip.m b/manualTests/test_bidsSegmentSkullStrip.m deleted file mode 100644 index f10ea4b2..00000000 --- a/manualTests/test_bidsSegmentSkullStrip.m +++ /dev/null @@ -1,29 +0,0 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - -function test_suite = test_bidsSegmentSkullStrip %#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_bidsSegmentSkullStripBasic() - - % smoke test - - % directory with this script becomes the current directory - opt.dataDir = fullfile( ... - fileparts(mfilename('fullpath')), ... - '..', 'demos', 'MoAE', 'output', 'MoAEpilot'); - % task to analyze - opt.taskName = 'auditory'; - opt = checkOptions(opt); - - %% Run batches - checkDependencies(); - reportBIDS(opt); - bidsCopyRawFolder(opt, 1); - bidsSegmentSkullStrip(opt); - -end diff --git a/manualTests/systemTestDS114.m b/manualTests/test_ds114.m similarity index 99% rename from manualTests/systemTestDS114.m rename to manualTests/test_ds114.m index b9dfb487..b9c18231 100644 --- a/manualTests/systemTestDS114.m +++ b/manualTests/test_ds114.m @@ -1,5 +1,5 @@ % (C) Copyright 2019 Remi Gau - +% % Script to run to check that the whole pipeline works fine with different % options encoded in json files % diff --git a/manualTests/systemTestMoAE.m b/manualTests/test_moae.m similarity index 65% rename from manualTests/systemTestMoAE.m rename to manualTests/test_moae.m index a2b87437..62892cd9 100644 --- a/manualTests/systemTestMoAE.m +++ b/manualTests/test_moae.m @@ -1,5 +1,5 @@ % (C) Copyright 2019 Remi Gau - +% % Script to run to check that the whole pipeline works fine with different % options encoded in json files % @@ -17,6 +17,8 @@ % Smoothing to apply FWHM = 6; +downloadData = true; + % URL of the data set to download URL = 'http://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip'; @@ -24,24 +26,11 @@ WD = fullfile(fileparts(mfilename('fullpath')), '..', 'demos', 'MoAE'); cd(WD); -% we add all the subfunctions that are in the sub directories -addpath(genpath(fullfile(WD, '..', '..', 'src'))); -addpath(genpath(fullfile(WD, '..', '..', 'lib'))); - -%% Get data -fprintf('%-10s:', 'Downloading dataset...'); -urlwrite(URL, 'MoAEpilot.zip'); -fprintf(1, ' Done\n\n'); - -fprintf('%-10s:', 'Unzipping dataset...'); -unzip('MoAEpilot.zip', fullfile(WD, 'output')); -fprintf(1, ' Done\n\n'); +run ../../initCppSpm.m; -checkDependencies(); +dowload_moae_ds(downloadData); %% Set up -delete(fullfile(pwd, 'options_task-*date-*.json')); - optionsFilesList = { ... 'options_task-auditory.json'; ... 'options_task-auditory_unwarp-0.json'; ... @@ -53,7 +42,7 @@ fprintf(1, repmat('\n', 1, 5)); - optionJsonFile = optionsFilesList{iOption}; + optionJsonFile = fullfile(WD, 'options', optionsFilesList{iOption}); opt = loadAndCheckOptions(optionJsonFile); %% Run batches @@ -66,17 +55,23 @@ bidsSpatialPrepro(opt); - % The following do not run on octave for now (because of spmup) - anatomicalQA(opt); + % Some of the following do not run on octave for now (because of spmup) + % Crashes in CI + % anatomicalQA(opt); + bidsResliceTpmToFunc(opt); - functionalQA(opt); + + % Crashes in CI + % functionalQA(opt); bidsSmoothing(FWHM, opt); + bidsSegmentSkullStrip(opt); + % The following crash on Travis CI - bidsFFX('specifyAndEstimate', opt, FWHM); - bidsFFX('contrasts', opt, FWHM); - bidsResults(opt, FWHM); + % bidsFFX('specifyAndEstimate', opt, FWHM); + % bidsFFX('contrasts', opt, FWHM); + % bidsResults(opt, FWHM); cd(WD); diff --git a/manualTests/test_setBatchCoregistrationFmap.m b/manualTests/test_setBatchCoregistrationFmap.m index eaa1f88c..4d055052 100644 --- a/manualTests/test_setBatchCoregistrationFmap.m +++ b/manualTests/test_setBatchCoregistrationFmap.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchCoregistrationFmap %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/manualTests/test_setBatchCreateVDMs.m b/manualTests/test_setBatchCreateVDMs.m index 314008e5..e87e6350 100644 --- a/manualTests/test_setBatchCreateVDMs.m +++ b/manualTests/test_setBatchCreateVDMs.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchCreateVDMs %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/miss_hit.cfg b/miss_hit.cfg index bce4b86c..3c2173ce 100644 --- a/miss_hit.cfg +++ b/miss_hit.cfg @@ -1,14 +1,18 @@ # 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]+)*" + +regex_function_name: "[a-z]+([a-zA-Z0-9]){1}[a-zA-Z0-9]+" +regex_script_name: "[a-z0-9]+(_[a-z0-9]+)*" + 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 developers" +copyright_entity: "CPP_SPM developers" tab_width: 2 diff --git a/npm-requirements.txt b/npm-requirements.txt deleted file mode 100644 index 061f9ade..00000000 --- a/npm-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -remark-cli@5.0.0 -remark-lint@6.0.2 -remark-preset-lint-recommended@3.0.2 -remark-preset-lint-markdown-style-guide@2.1.2 -remark-preset-lint-consistent - diff --git a/requirements.txt b/requirements.txt index 992d0ece..578e596a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ Sphinx sphinxcontrib-matlabdomain sphinxcontrib-napoleon sphinx_rtd_theme -miss_hit==0.9.15 \ No newline at end of file +miss_hit==0.9.20 \ No newline at end of file diff --git a/runTests.m b/run_tests.m similarity index 91% rename from runTests.m rename to run_tests.m index f1e02a48..98dc6821 100644 --- a/runTests.m +++ b/run_tests.m @@ -1,4 +1,4 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers +% (C) Copyright 2019 CPP_SPM developers warning('OFF'); diff --git a/src/QA/anatomicalQA.m b/src/QA/anatomicalQA.m index c147602d..3e689e8c 100644 --- a/src/QA/anatomicalQA.m +++ b/src/QA/anatomicalQA.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function anatomicalQA(opt) % % Computes several metrics for anatomical image. @@ -11,6 +9,7 @@ function anatomicalQA(opt) % :param opt: Options chosen for the analysis. See ``checkOptions()``. % :type opt: structure % + % (C) Copyright 2020 CPP_SPM developers if isOctave() warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.'); diff --git a/src/QA/functionalQA.m b/src/QA/functionalQA.m index fa356499..f74ff38c 100644 --- a/src/QA/functionalQA.m +++ b/src/QA/functionalQA.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function functionalQA(opt) % % For functional data, QA consists in getting temporal SNR and then @@ -23,6 +21,8 @@ function functionalQA(opt) % - the tissue probability maps have been generated in the "native" space of each subject % (using ``bidsSpatialPrepro()`` or ``bidsSegmentSkullStrip()``) and have been % resliced to the dimension of the functional with ``bidsResliceTpmToFunc()`` + % + % (C) Copyright 2020 CPP_SPM developers if isOctave() warning('\nfunctionalQA is not yet supported on Octave. This step will be skipped.'); diff --git a/src/batches/setBatch3Dto4D.m b/src/batches/setBatch3Dto4D.m index 90e761bb..d9811282 100644 --- a/src/batches/setBatch3Dto4D.m +++ b/src/batches/setBatch3Dto4D.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatch3Dto4D(matlabbatch, volumesList, RT, outputName, dataType) % % Set the batch for 3D to 4D conversion @@ -31,6 +29,7 @@ % - 16: FLOAT32 - single prec. float % - 64: FLOAT64 - double prec. float % + % (C) Copyright 2020 CPP_SPM developers if nargin < 5 || isempty(dataType) dataType = 0; diff --git a/src/batches/setBatchComputeVDM.m b/src/batches/setBatchComputeVDM.m index 00321ae4..dddf02bb 100644 --- a/src/batches/setBatchComputeVDM.m +++ b/src/batches/setBatchComputeVDM.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchComputeVDM(matlabbatch, fmapType, refImage) % % Short description of what the function does goes here. @@ -21,6 +19,8 @@ % % adapted from spmup get_FM_workflow.m (@ commit % 198c980d6d7520b1a996f0e56269e2ceab72cc83) + % + % (C) Copyright 2020 CPP_SPM developers switch lower(fmapType) case 'phasediff' diff --git a/src/batches/setBatchContrasts.m b/src/batches/setBatchContrasts.m index ea047235..89162fe7 100644 --- a/src/batches/setBatchContrasts.m +++ b/src/batches/setBatchContrasts.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchContrasts(matlabbatch, spmMatFile, consess) % % Short description of what the function does goes here. @@ -17,6 +15,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers printBatchName('contrasts specification'); diff --git a/src/batches/setBatchCoregistration.m b/src/batches/setBatchCoregistration.m index 8fb4d51f..5efa1477 100644 --- a/src/batches/setBatchCoregistration.m +++ b/src/batches/setBatchCoregistration.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchCoregistration(matlabbatch, ref, src, other) % % Set the batch for coregistering the source images into the reference image @@ -21,6 +19,7 @@ % % matlabbatch = setBatchCoregistrationGeneral(matlabbatch, ref, src, other) % + % (C) Copyright 2020 CPP_SPM developers printBatchName('coregistration'); diff --git a/src/batches/setBatchCoregistrationFmap.m b/src/batches/setBatchCoregistrationFmap.m index cdf5ab90..2d1bcab7 100644 --- a/src/batches/setBatchCoregistrationFmap.m +++ b/src/batches/setBatchCoregistrationFmap.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchCoregistrationFmap(matlabbatch, BIDS, opt, subLabel) % % Set the batch for the coregistration of field maps @@ -18,9 +16,10 @@ % % :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job % - % TODO % - implement for 'phase12', 'fieldmap', 'epi' + % + % (C) Copyright 2020 CPP_SPM developers printBatchName('coregister fieldmaps data to functional'); diff --git a/src/batches/setBatchCoregistrationFuncToAnat.m b/src/batches/setBatchCoregistrationFuncToAnat.m index b9bc7dfa..70b4761a 100644 --- a/src/batches/setBatchCoregistrationFuncToAnat.m +++ b/src/batches/setBatchCoregistrationFuncToAnat.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchCoregistrationFuncToAnat(matlabbatch, BIDS, opt, subLabel) % % Set the batch for corregistering the functional images to the @@ -21,17 +19,18 @@ % % :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job % + % (C) Copyright 2020 CPP_SPM developers printBatchName('coregister functional data to anatomical'); matlabbatch{end + 1}.spm.spatial.coreg.estimate.ref(1) = ... - cfg_dep('Named File Selector: Anatomical(1) - Files', ... - substruct( ... - '.', 'val', '{}', {opt.orderBatches.selectAnat}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}, ... - '.', 'val', '{}', {1}), ... - substruct('.', 'files', '{}', {1})); + cfg_dep('Named File Selector: Anatomical(1) - Files', ... + substruct( ... + '.', 'val', '{}', {opt.orderBatches.selectAnat}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}, ... + '.', 'val', '{}', {1}), ... + substruct('.', 'files', '{}', {1})); % SOURCE IMAGE : DEPENDENCY FROM REALIGNEMENT % Mean Image diff --git a/src/batches/setBatchCreateVDMs.m b/src/batches/setBatchCreateVDMs.m index 54f4a08e..9851ed7f 100644 --- a/src/batches/setBatchCreateVDMs.m +++ b/src/batches/setBatchCreateVDMs.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchCreateVDMs(matlabbatch, BIDS, opt, subID) % % Short description of what the function does goes here. @@ -22,6 +20,8 @@ % % TODO % - implement for 'phase12', 'fieldmap', 'epi' + % + % (C) Copyright 2020 CPP_SPM developers printBatchName('create voxel displacement map'); diff --git a/src/batches/setBatchEstimateModel.m b/src/batches/setBatchEstimateModel.m index 719e284e..de0ff6bf 100644 --- a/src/batches/setBatchEstimateModel.m +++ b/src/batches/setBatchEstimateModel.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchEstimateModel(matlabbatch, opt, grpLvlCon) % % Short description of what the function does goes here. @@ -15,6 +13,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers switch nargin diff --git a/src/batches/setBatchFactorialDesign.m b/src/batches/setBatchFactorialDesign.m index ec5c9262..c063e68b 100644 --- a/src/batches/setBatchFactorialDesign.m +++ b/src/batches/setBatchFactorialDesign.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchFactorialDesign(matlabbatch, opt, funcFWHM, conFWHM) % % Short description of what the function does goes here. @@ -19,6 +17,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers printBatchName('specify group level fmri model'); diff --git a/src/batches/setBatchGroupLevelContrasts.m b/src/batches/setBatchGroupLevelContrasts.m index 5d83966c..f6346c4c 100644 --- a/src/batches/setBatchGroupLevelContrasts.m +++ b/src/batches/setBatchGroupLevelContrasts.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchGroupLevelContrasts(matlabbatch, grpLvlCon, rfxDir) + % + % (C) Copyright 2019 CPP_SPM developers printBatchName('group level contrast estimation'); diff --git a/src/batches/setBatchImageCalculation.m b/src/batches/setBatchImageCalculation.m index 771aee1e..e350d6b6 100644 --- a/src/batches/setBatchImageCalculation.m +++ b/src/batches/setBatchImageCalculation.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchImageCalculation(matlabbatch, input, output, outDir, expression) % % Set a batch for a image calculation @@ -21,6 +19,7 @@ % % :returns: - :matlabbatch: % + % (C) Copyright 2020 CPP_SPM developers printBatchName('image calculation'); diff --git a/src/batches/setBatchLesionAbnormalitiesDetection.m b/src/batches/setBatchLesionAbnormalitiesDetection.m index cf906292..8ea61493 100755 --- a/src/batches/setBatchLesionAbnormalitiesDetection.m +++ b/src/batches/setBatchLesionAbnormalitiesDetection.m @@ -1,17 +1,17 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - -function matlabbatch = setBatchLesionAbnormalities(matlabbatch, BIDS, opt, subLabel) +function matlabbatch = setBatchLesionAbnormalitiesDetection(matlabbatch, BIDS, opt, subLabel) % % Creates a batch to detect lesion abnormalities % % USAGE:: % - % matlabbatch = setBatchLesionAbnormalities(matlabbatch, BIDS, opt, subLabel) + % matlabbatch = setBatchLesionAbnormalitiesDetection(matlabbatch, BIDS, opt, subLabel) % % :param matlabbatch: list of SPM batches % :type matlabbatch: structure % % :returns: - :matlabbatch: (structure) + % + % (C) Copyright 2021 CPP_SPM developers printBatchName('Lesion abnormalities'); diff --git a/src/batches/setBatchLesionOverlapMap.m b/src/batches/setBatchLesionOverlapMap.m index 01c7af5e..3f7dfc37 100755 --- a/src/batches/setBatchLesionOverlapMap.m +++ b/src/batches/setBatchLesionOverlapMap.m @@ -1,5 +1,3 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchLesionOverlapMap(matlabbatch, BIDS, opt, subLabel) % % Creates a batch for the lesion overlap map @@ -12,6 +10,8 @@ % :type matlabbatch: structure % % :returns: - :matlabbatch: (structure) + % + % (C) Copyright 2021 CPP_SPM developers printBatchName('Lesion overlap map'); diff --git a/src/batches/setBatchLesionSegmentation.m b/src/batches/setBatchLesionSegmentation.m index 8a0a7e22..858cea1d 100755 --- a/src/batches/setBatchLesionSegmentation.m +++ b/src/batches/setBatchLesionSegmentation.m @@ -1,5 +1,3 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchLesionSegmentation(matlabbatch, BIDS, opt, subLabel) % % Creates a batch to segment the anatomical image for lesion detection @@ -12,6 +10,8 @@ % :type matlabbatch: structure % % :returns: - :matlabbatch: (structure) + % + % (C) Copyright 2021 CPP_SPM developers printBatchName('Lesion segmentation'); diff --git a/src/batches/setBatchMeanAnatAndMask.m b/src/batches/setBatchMeanAnatAndMask.m index 41839db5..cb661973 100644 --- a/src/batches/setBatchMeanAnatAndMask.m +++ b/src/batches/setBatchMeanAnatAndMask.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchMeanAnatAndMask(matlabbatch, opt, funcFWHM, outputDir) % % Creates batxh to create mean anatomical image and a group mask @@ -18,6 +16,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers [BIDS, opt] = getData(opt); diff --git a/src/batches/setBatchNormalizationSpatialPrepro.m b/src/batches/setBatchNormalizationSpatialPrepro.m index effe07e1..918ae121 100644 --- a/src/batches/setBatchNormalizationSpatialPrepro.m +++ b/src/batches/setBatchNormalizationSpatialPrepro.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchNormalizationSpatialPrepro(matlabbatch, opt, voxDim) % % Short description of what the function does goes here. @@ -17,6 +15,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers jobsToAdd = numel(matlabbatch) + 1; diff --git a/src/batches/setBatchNormalize.m b/src/batches/setBatchNormalize.m index 4416d37d..5af36e79 100644 --- a/src/batches/setBatchNormalize.m +++ b/src/batches/setBatchNormalize.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchNormalize(matlabbatch, deformField, voxDim, imgToResample) % % Short description of what the function does goes here. @@ -19,6 +17,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers if nargin > 1 && ~isempty(deformField) matlabbatch{end + 1}.spm.spatial.normalise.write.subj.def(1) = deformField; diff --git a/src/batches/setBatchPrintFigure.m b/src/batches/setBatchPrintFigure.m index fbdac056..2f6fb363 100644 --- a/src/batches/setBatchPrintFigure.m +++ b/src/batches/setBatchPrintFigure.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchPrintFigure(matlabbatch, figureName) % % template to creae new setBatch functions @@ -14,6 +12,8 @@ % :type figureName: string % % :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job + % + % (C) Copyright 2020 CPP_SPM developers if spm('CmdLine', true) diff --git a/src/batches/setBatchRealign.m b/src/batches/setBatchRealign.m index a911aa12..f04d6e63 100644 --- a/src/batches/setBatchRealign.m +++ b/src/batches/setBatchRealign.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [matlabbatch, voxDim] = setBatchRealign(varargin) % % Set the batch for realign / realign and reslice / realign and unwarp @@ -25,9 +23,12 @@ % % :returns: - :matlabbatch: (structure) (dimension) % - :voxDim: (array) (dimension) - - % TODO: - % make which image is resliced more consistent 'which = []' + % + % TODO:: + % + % make which image is resliced more consistent 'which = []' + % + % (C) Copyright 2020 CPP_SPM developers if numel(varargin) < 5 [matlabbatch, BIDS, opt, subLabel] = deal(varargin{:}); diff --git a/src/batches/setBatchReslice.m b/src/batches/setBatchReslice.m index 97a08d94..534a4f92 100644 --- a/src/batches/setBatchReslice.m +++ b/src/batches/setBatchReslice.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchReslice(matlabbatch, referenceImg, sourceImages, interp) % % Set the batch for reslicing source images to the reference image resolution @@ -18,6 +16,7 @@ % % :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job % + % (C) Copyright 2020 CPP_SPM developers printBatchName('reslicing'); diff --git a/src/batches/setBatchResults.m b/src/batches/setBatchResults.m index 84b73eab..4e4cf24b 100644 --- a/src/batches/setBatchResults.m +++ b/src/batches/setBatchResults.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchResults(matlabbatch, result) % % Outputs the typical matlabbatch to compute the results for a given contrast @@ -21,6 +19,8 @@ % :returns: - :matlabbatch: (structure) % % + % (C) Copyright 2019 CPP_SPM developers + result.outputNameStructure.sub = result.label; result.outputNameStructure.desc = result.Contrasts.Name; result.outputNameStructure.p = num2str(result.Contrasts.p); diff --git a/src/batches/setBatchSTC.m b/src/batches/setBatchSTC.m index 0d4d9658..462493a0 100644 --- a/src/batches/setBatchSTC.m +++ b/src/batches/setBatchSTC.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSTC(matlabbatch, BIDS, opt, subLabel) % % Creates batch for slice timing correction @@ -30,6 +28,7 @@ % If not specified this function will take the mid-volume time point as reference % to do the slice timing correction % + % (C) Copyright 2019 CPP_SPM developers % get slice order sliceOrder = getSliceOrder(opt, 1); diff --git a/src/batches/setBatchSaveCoregistrationMatrix.m b/src/batches/setBatchSaveCoregistrationMatrix.m index ab9fb872..2af36499 100644 --- a/src/batches/setBatchSaveCoregistrationMatrix.m +++ b/src/batches/setBatchSaveCoregistrationMatrix.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSaveCoregistrationMatrix(matlabbatch, BIDS, opt, subLabel) % % Short description of what the function does goes here. @@ -19,6 +17,7 @@ % % :returns: - :matlabbatch: % + % (C) Copyright 2020 CPP_SPM developers printBatchName('saving coregistration matrix'); diff --git a/src/batches/setBatchSegmentation.m b/src/batches/setBatchSegmentation.m index 395cc588..2b86fe4b 100644 --- a/src/batches/setBatchSegmentation.m +++ b/src/batches/setBatchSegmentation.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSegmentation(matlabbatch, opt, imageToSegment) % % Creates a batch to segment the anatomical image @@ -16,6 +14,7 @@ % % :returns: :matlabbatch: (structure) % + % (C) Copyright 2020 CPP_SPM developers printBatchName('Segmentation anatomical image'); diff --git a/src/batches/setBatchSelectAnat.m b/src/batches/setBatchSelectAnat.m index e8e11bd1..b934ce5f 100644 --- a/src/batches/setBatchSelectAnat.m +++ b/src/batches/setBatchSelectAnat.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSelectAnat(matlabbatch, BIDS, opt, subLabel) % % Creates a batch to set an anatomical image @@ -26,6 +24,8 @@ % - session to select the anat from = opt.anatReference.session (default = 1) % % We assume that the first anat of that type is the "correct" one + % + % (C) Copyright 2020 CPP_SPM developers printBatchName('selecting anatomical image'); diff --git a/src/batches/setBatchSkullStripping.m b/src/batches/setBatchSkullStripping.m index 52166108..db416ea3 100644 --- a/src/batches/setBatchSkullStripping.m +++ b/src/batches/setBatchSkullStripping.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSkullStripping(matlabbatch, BIDS, opt, subLabel) % % Creates a batch to compute a brain mask based on the tissue probability maps @@ -33,6 +31,8 @@ % Any voxel with p(grayMatter) + p(whiteMatter) + p(CSF) > threshold % will be included in the skull stripping mask. % + % + % (C) Copyright 2020 CPP_SPM developers printBatchName('skull stripping'); diff --git a/src/batches/setBatchSmoothConImages.m b/src/batches/setBatchSmoothConImages.m index 9e8d6dd0..f92b5a06 100644 --- a/src/batches/setBatchSmoothConImages.m +++ b/src/batches/setBatchSmoothConImages.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSmoothConImages(matlabbatch, opt, funcFWHM, conFWHM) % % Creates a batch to smooth all the con images of all subjects @@ -21,6 +19,7 @@ % % :returns: - :matlabbatch: % + % (C) Copyright 2019 CPP_SPM developers printBatchName('smoothing contrast images'); diff --git a/src/batches/setBatchSmoothing.m b/src/batches/setBatchSmoothing.m index f0e353de..349077bc 100644 --- a/src/batches/setBatchSmoothing.m +++ b/src/batches/setBatchSmoothing.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSmoothing(matlabbatch, images, FWHM, prefix) % % Small wrapper to create smoothing batch @@ -20,6 +18,7 @@ % :returns: - :matlabbatch: (structure) % % + % (C) Copyright 2019 CPP_SPM developers printBatchName('smoothing images'); diff --git a/src/batches/setBatchSmoothingFunc.m b/src/batches/setBatchSmoothingFunc.m index 3baf0487..e2aea02c 100644 --- a/src/batches/setBatchSmoothingFunc.m +++ b/src/batches/setBatchSmoothingFunc.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSmoothingFunc(matlabbatch, BIDS, opt, subID, funcFWHM) % % Short description of what the function does goes here. @@ -22,6 +20,7 @@ % :returns: - :matlabbatch: (structure) % % + % (C) Copyright 2019 CPP_SPM developers printBatchName('smoothing functional images'); diff --git a/src/batches/setBatchSubjectLevelContrasts.m b/src/batches/setBatchSubjectLevelContrasts.m index 593d4973..7791b17c 100644 --- a/src/batches/setBatchSubjectLevelContrasts.m +++ b/src/batches/setBatchSubjectLevelContrasts.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSubjectLevelContrasts(matlabbatch, opt, subLabel, funcFWHM) % % Short description of what the function does goes here. @@ -19,6 +17,7 @@ % % :returns: - :matlabbatch: % + % (C) Copyright 2019 CPP_SPM developers printBatchName('subject level contrasts specification'); diff --git a/src/batches/setBatchSubjectLevelGLMSpec.m b/src/batches/setBatchSubjectLevelGLMSpec.m index 65688901..70fd2795 100644 --- a/src/batches/setBatchSubjectLevelGLMSpec.m +++ b/src/batches/setBatchSubjectLevelGLMSpec.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSubjectLevelGLMSpec(varargin) % % Short description of what the function does goes here. @@ -18,6 +16,7 @@ % :returns: - :argout1: (type) (dimension) % - :argout2: (type) (dimension) % + % (C) Copyright 2019 CPP_SPM developers [matlabbatch, BIDS, opt, subLabel, funcFWHM] = deal(varargin{:}); diff --git a/src/batches/setBatchSubjectLevelResults.m b/src/batches/setBatchSubjectLevelResults.m index ff2638d3..7a73cd55 100644 --- a/src/batches/setBatchSubjectLevelResults.m +++ b/src/batches/setBatchSubjectLevelResults.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchSubjectLevelResults(varargin) % % Short description of what the function does goes here. @@ -23,6 +21,7 @@ % % :returns: - :matlabbatch: (structure) % + % (C) Copyright 2019 CPP_SPM developers [matlabbatch, opt, subLabel, funcFWHM, iStep, iCon] = deal(varargin{:}); diff --git a/src/defaults/checkOptions.m b/src/defaults/checkOptions.m index e5bb94e1..878184df 100644 --- a/src/defaults/checkOptions.m +++ b/src/defaults/checkOptions.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function opt = checkOptions(opt) % % Check the option inputs and add any missing field with some defaults @@ -19,10 +17,12 @@ % - :opt: the option structure with missing values filled in by the defaults. % % REQUIRED FIELDS: + % % - ``opt.taskName`` % - ``opt.dataDir`` % % IMPORTANT OPTIONS (with their defaults): + % % - ``opt.groups = {''}`` - group of subjects to analyze % - ``opt.subjects = {[]}`` - suject to run in each group % space where we conduct the analysis @@ -37,6 +37,7 @@ % model to speficy and the contrasts to compute. % % OTHER OPTIONS (with their defaults): + % % - ``opt.zeropad = 2`` - number of zeros used for padding subject numbers, in case % subjects should be fetched by their number ``1`` and not their label ``O1'``. % - ``opt.query`` - a structure used to specify other options to only run analysis on @@ -51,17 +52,21 @@ % at normalization. % - ``opt.STC_referenceSlice = []`` - reference slice for the slice timing correction. % If left emtpy the mid-volume acquisition time point will be selected at run time. - % - ``opt.sliceOrder = []`` - To be used if SPM can't extract slice info. NOT RECOMMENDED: + % - ``opt.sliceOrder = []`` - To be used if SPM can't extract slice info. NOT RECOMMENDED, % if you know the order in which slices were acquired, you should be able to recompute % slice timing and add it to the json files in your BIDS data set. - % - ``opt.glmQA.do = true;`` - If set to ``true```the residual images of a + % - ``opt.glm.roibased.do`` + % - ``opt.glm.QA.do = true`` - If set to ``true`` the residual images of a % GLM at the subject levels will be used to estimate if there is any remaining structure % in the GLM residuals (the power spectra are not flat) that could indicate % the subject level results are likely confounded (see - % ``plot_power_spectra_of_GLM_residuals``) and 'Accurate autocorrelation modeling - % substantially improves fMRI reliability' - % _https://www.nature.com/articles/s41467-019-09230-w.pdf + % ``plot_power_spectra_of_GLM_residuals`` and `Accurate autocorrelation modeling + % substantially improves fMRI reliability + % `_ for more info. + % + % % + % (C) Copyright 2019 CPP_SPM developers fieldsToSet = setDefaultOption(); diff --git a/src/defaults/createDefaultModel.m b/src/defaults/createDefaultModel.m index 0de2252f..9a541612 100644 --- a/src/defaults/createDefaultModel.m +++ b/src/defaults/createDefaultModel.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function opt = createDefaultModel(BIDS, opt) % % Creates a default model json file. @@ -49,6 +47,7 @@ % % createDefaultModel(BIDS, opt); % + % (C) Copyright 2020 CPP_SPM developers % TODO deal with the Transformations and Convolve fields diff --git a/src/defaults/datasetDescriptionDefaults.m b/src/defaults/datasetDescriptionDefaults.m index a9bc50bf..86d51462 100644 --- a/src/defaults/datasetDescriptionDefaults.m +++ b/src/defaults/datasetDescriptionDefaults.m @@ -1,6 +1,7 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function datasetDescription = datasetDescriptionDefaults() + % + % + % (C) Copyright 2020 CPP_SPM developers datasetDescription.Name = 'cpp_spm outputs'; datasetDescription.BIDSVersion = '1.4.1'; diff --git a/src/defaults/miss_hit.cfg b/src/defaults/miss_hit.cfg index 636a9186..a9f91c98 100644 --- a/src/defaults/miss_hit.cfg +++ b/src/defaults/miss_hit.cfg @@ -1,10 +1 @@ -# 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 -copyright_entity: "CPP BIDS SPM-pipeline developpers" - -# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html) -metric "cnest": limit 4 -metric "file_length": limit 400 -metric "cyc": limit 12 -metric "parameters": limit 6 \ No newline at end of file diff --git a/src/defaults/returnDefaultResultsStructure.m b/src/defaults/returnDefaultResultsStructure.m index 96cbeb08..7d1eaa21 100644 --- a/src/defaults/returnDefaultResultsStructure.m +++ b/src/defaults/returnDefaultResultsStructure.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function results = returnDefaultResultsStructure() + % + % (C) Copyright 2019 CPP_SPM developers Contrasts = struct( ... 'Name', '', ... diff --git a/src/defaults/returnEmptyModel.m b/src/defaults/returnEmptyModel.m index 3148a97f..d4664741 100644 --- a/src/defaults/returnEmptyModel.m +++ b/src/defaults/returnEmptyModel.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function content = returnEmptyModel() % % Creates the content of a basic model.json file for GLM analysis with @@ -22,6 +20,7 @@ % filename = fullfile(pwd, 'models', 'model-empty_smdl.json') % spm_jsonwrite(filename, content, jsonOptions); % + % (C) Copyright 2020 CPP_SPM developers content.Name = ' '; content.Description = ' '; diff --git a/src/defaults/spm_my_defaults.m b/src/defaults/spm_my_defaults.m index 43b67496..eac7591e 100644 --- a/src/defaults/spm_my_defaults.m +++ b/src/defaults/spm_my_defaults.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function spm_my_defaults() % % Short description of what the function does goes here. @@ -15,6 +13,8 @@ function spm_my_defaults() % When "not enough" information is specified in the batch files, SPM falls % back on the defaults to fill in the blanks. This allows to make the % script simpler. + % + % (C) Copyright 2019 CPP_SPM developers global defaults diff --git a/src/fieldmaps/getBlipDirection.m b/src/fieldmaps/getBlipDirection.m index 33bbb2db..1d8660db 100644 --- a/src/fieldmaps/getBlipDirection.m +++ b/src/fieldmaps/getBlipDirection.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function blipDir = getBlipDirection(metadata) % % Gets the total read out time of a sequence. @@ -15,6 +13,7 @@ % % Used to create the voxel dsiplacement map (VDM) from the fieldmap % + % (C) Copyright 2020 CPP_SPM developers blipDir = 1; diff --git a/src/fieldmaps/getMetadataFromIntendedForFunc.m b/src/fieldmaps/getMetadataFromIntendedForFunc.m index 29d8ee57..1bfeb148 100644 --- a/src/fieldmaps/getMetadataFromIntendedForFunc.m +++ b/src/fieldmaps/getMetadataFromIntendedForFunc.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [totalReadoutTime, blipDir] = getMetadataFromIntendedForFunc(BIDS, fmapMetadata) % % Gets metadata of the associated bold file: @@ -26,6 +24,8 @@ % % - if there are several func file for this fmap and they have different % characteristic this may require creating a VDM for each + % + % (C) Copyright 2020 CPP_SPM developers for iFile = 1:size(fmapMetadata.IntendedFor) diff --git a/src/fieldmaps/getTotalReadoutTime.m b/src/fieldmaps/getTotalReadoutTime.m index f9f2122a..46c5c5c1 100644 --- a/src/fieldmaps/getTotalReadoutTime.m +++ b/src/fieldmaps/getTotalReadoutTime.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function totalReadoutTime = getTotalReadoutTime(metadata) % % Gets the total read out time of a sequence. @@ -15,6 +13,7 @@ % % Used to create the voxel dsiplacement map (VDM) from the fieldmap % + % (C) Copyright 2020 CPP_SPM developers totalReadoutTime = ''; diff --git a/src/fieldmaps/getVdmFile.m b/src/fieldmaps/getVdmFile.m index 2c96416e..51bb36c0 100644 --- a/src/fieldmaps/getVdmFile.m +++ b/src/fieldmaps/getVdmFile.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function vdmFile = getVdmFile(BIDS, opt, boldFilename) % % returns the voxel displacement map associated with a given bold file @@ -17,6 +15,7 @@ % % :returns: - :vdmFile: (string) % + % (C) Copyright 2020 CPP_SPM developers vdmFile = ''; diff --git a/src/getAnatFilename.m b/src/getAnatFilename.m index 880f6838..f0b2dd37 100644 --- a/src/getAnatFilename.m +++ b/src/getAnatFilename.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [anatImage, anatDataDir] = getAnatFilename(BIDS, subLabel, opt) % % Get the filename and the directory of an anat file for a given session and run. @@ -21,6 +19,7 @@ % :returns: - :anatImage: (string) % - :anatDataDir: (string) % + % (C) Copyright 2020 CPP_SPM developers anatSuffix = opt.anatReference.type; anatSession = opt.anatReference.session; diff --git a/src/getBoldFilename.m b/src/getBoldFilename.m index 302856b4..243e6495 100644 --- a/src/getBoldFilename.m +++ b/src/getBoldFilename.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [boldFileName, subFuncDataDir] = getBoldFilename(varargin) % % Get the filename and the directory of a bold file for a given session / @@ -28,6 +26,7 @@ % - :subFuncDataDir: (string) % % + % (C) Copyright 2020 CPP_SPM developers [BIDS, subID, sessionID, runID, opt] = deal(varargin{:}); diff --git a/src/getData.m b/src/getData.m index 7277c20f..fd60aec6 100644 --- a/src/getData.m +++ b/src/getData.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [BIDS, opt] = getData(opt, BIDSdir, type) % % Reads the specified BIDS data set and updates the list of subjects to analyze. @@ -27,6 +25,8 @@ % IMPORTANT NOTE: if you specify the type variable for T1w then you must % make sure that the T1w.json is also present in the anat folder because % of the way the bids.query function works at the moment + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 2 || (exist('BIDSdir', 'var') && isempty(BIDSdir)) % The directory where the derivatives are located diff --git a/src/getFuncVoxelDims.m b/src/getFuncVoxelDims.m index 296398fc..bb38ab19 100644 --- a/src/getFuncVoxelDims.m +++ b/src/getFuncVoxelDims.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [voxDim, opt] = getFuncVoxelDims(opt, subFuncDataDir, prefix, fileName) % % Short description of what the function does goes here. @@ -22,6 +20,7 @@ % % % + % (C) Copyright 2020 CPP_SPM developers % get native resolution to reuse it at normalisation; if ~isempty(opt.funcVoxelDims) % If voxel dimensions is defined in the opt diff --git a/src/getInfo.m b/src/getInfo.m index 0ea7af07..c2ca3aed 100644 --- a/src/getInfo.m +++ b/src/getInfo.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function varargout = getInfo(BIDS, subLabel, opt, info, varargin) % % Wrapper function to fetch specific info in a BIDS structure returned by @@ -9,7 +7,7 @@ % % varargout = getInfo(BIDS, subLabel, opt, info, varargin) % - % If info = ``sessions`, this returns name of the sessions and their number:: + % If info = ``sessions``, this returns name of the sessions and their number:: % % [sessions, nbSessions] = getInfo(BIDS, subID, opt, 'sessions') % @@ -47,6 +45,7 @@ % :param type: datatype (``bold``, ``events``, ``physio``) % :type type: string % + % (C) Copyright 2020 CPP_SPM developers varargout = {}; %#ok<*NASGU> diff --git a/src/getMeanFuncFilename.m b/src/getMeanFuncFilename.m index b9057cc6..bea6ea44 100644 --- a/src/getMeanFuncFilename.m +++ b/src/getMeanFuncFilename.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [meanImage, meanFuncDir] = getMeanFuncFilename(BIDS, subLabel, opt) % % Get the filename and the directory of an mean functional file. @@ -18,6 +16,7 @@ % :returns: - :meanImage: (string) % - :meanFuncDir: (string) % + % (C) Copyright 2020 CPP_SPM developers sessions = getInfo(BIDS, subLabel, opt, 'Sessions'); runs = getInfo(BIDS, subLabel, opt, 'Runs', sessions{1}); diff --git a/src/getPrefix.m b/src/getPrefix.m index 5c8c334b..ef334d9b 100644 --- a/src/getPrefix.m +++ b/src/getPrefix.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [prefix, motionRegressorPrefix] = getPrefix(step, opt, funcFWHM) % % Generates prefix to append to file name to look for @@ -19,6 +17,7 @@ % - :motionRegressorPrefix: % % + % (C) Copyright 2020 CPP_SPM developers if nargin < 3 funcFWHM = 0; diff --git a/src/getRealignParamFile.m b/src/getRealignParamFile.m index d5cc6111..e049ce9b 100644 --- a/src/getRealignParamFile.m +++ b/src/getRealignParamFile.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function realignParamFile = getRealignParamFile(fullpathBoldFileName, prefix) % % Short description of what the function does goes here. @@ -18,6 +16,8 @@ % % :returns: - :argout1: (type) (dimension) % - :argout2: (type) (dimension) + % + % (C) Copyright 2020 CPP_SPM developers [funcDataDir, boldFileName] = spm_fileparts(fullpathBoldFileName); diff --git a/src/getSliceOrder.m b/src/getSliceOrder.m index 8cc2f553..1d2e1037 100644 --- a/src/getSliceOrder.m +++ b/src/getSliceOrder.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function sliceOrder = getSliceOrder(opt, verbose) % % Get the slice order information from the BIDS metadata or from the ``opt`` @@ -25,6 +23,7 @@ % % See also: ``bidsSTC`` % + % (C) Copyright 2020 CPP_SPM developers if nargin < 2 verbose = false; diff --git a/src/group_level/getGrpLevelContrastToCompute.m b/src/group_level/getGrpLevelContrastToCompute.m index 52ec91ad..d7bedf6d 100644 --- a/src/group_level/getGrpLevelContrastToCompute.m +++ b/src/group_level/getGrpLevelContrastToCompute.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function [grpLvlCon, iStep] = getGrpLevelContrastToCompute(opt) % % Returns the autocontrast part of the dataset step of the BIDS model @@ -14,6 +12,7 @@ % :returns: - :grpLvlCon: % - :iStep: % + % (C) Copyright 2019 CPP_SPM developers model = spm_jsonread(opt.model.file); diff --git a/src/group_level/getRFXdir.m b/src/group_level/getRFXdir.m index 7a96acba..a54e58b9 100644 --- a/src/group_level/getRFXdir.m +++ b/src/group_level/getRFXdir.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function rfxDir = getRFXdir(opt, funcFWHM, conFWHM) % % Sets the name the group level analysis directory and creates it if it does not exist @@ -21,6 +19,7 @@ % % :returns: :rfxDir: (string) Fullpath of the group level directory % + % (C) Copyright 2019 CPP_SPM developers glmDirName = createGlmDirName(opt, funcFWHM); diff --git a/src/reports/copyFigures.m b/src/reports/copyFigures.m index 04bcce9f..6a939581 100644 --- a/src/reports/copyFigures.m +++ b/src/reports/copyFigures.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function copyFigures(BIDS, opt, subLabel) % % Copy the figures from spatial preprocessing into a separate folder. @@ -16,6 +14,7 @@ function copyFigures(BIDS, opt, subLabel) % :type subLabel: string % % + % (C) Copyright 2019 CPP_SPM developers imgNb = copyGraphWindownOutput(opt, subLabel, 'realign'); diff --git a/src/reports/copyGraphWindownOutput.m b/src/reports/copyGraphWindownOutput.m index a7821cd0..825043db 100644 --- a/src/reports/copyGraphWindownOutput.m +++ b/src/reports/copyGraphWindownOutput.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function imgNb = copyGraphWindownOutput(opt, subID, action, imgNb) % % Looks into the current directory for an ``spm_.*imgNb.png`` file and moves it into @@ -23,6 +21,7 @@ % % :returns: :imgNb: (integer) number of the next image to get. % + % (C) Copyright 2019 CPP_SPM developers if nargin < 4 || isempty(imgNb) imgNb = 1; diff --git a/src/reports/reportBIDS.m b/src/reports/reportBIDS.m index 4c617840..e0943d19 100644 --- a/src/reports/reportBIDS.m +++ b/src/reports/reportBIDS.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function reportBIDS(opt) % % Prints out a human readable description of a BIDS data set. @@ -16,6 +14,8 @@ function reportBIDS(opt) % % - save output in the derivatires folder % derivativeDir = fullfile(rawDir, '..', 'derivatives', 'cpp_spm'); + % + % (C) Copyright 2020 CPP_SPM developers bids.report(opt.dataDir); diff --git a/src/results/returnName.m b/src/results/returnName.m index 8fcc2ffb..12fb43d1 100644 --- a/src/results/returnName.m +++ b/src/results/returnName.m @@ -1,6 +1,8 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function name = returnName(result) + % + % To help naming of files generated when computing results of a given contrast + % + % (C) Copyright 2019 CPP_SPM developers name = sprintf('%s_p-%0.3f_k-%i_MC-%s', ... result.Contrasts.Name, ... diff --git a/src/results/setMontage.m b/src/results/setMontage.m index 23e949d1..0507d67f 100644 --- a/src/results/setMontage.m +++ b/src/results/setMontage.m @@ -1,11 +1,11 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function montage = setMontage(result) - + % % TO DO % - adapt so that the background image is in MNI only if opt.space is MNI % - add possibility to easily select mean functional or the anatomical: % - at the group level or subject level + % + % (C) Copyright 2019 CPP_SPM developers montage.background = {result.Output.montage.background}; montage.orientation = result.Output.montage.orientation; diff --git a/src/setDerivativesDir.m b/src/setDerivativesDir.m index b0cf3183..7b27b581 100644 --- a/src/setDerivativesDir.m +++ b/src/setDerivativesDir.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function opt = setDerivativesDir(opt) % % Sets the derivatives folder and the directory where to save the SPM jobs. @@ -17,34 +15,36 @@ % - :opt: structure or json filename containing the options. See % ``checkOptions()`` and ``loadAndCheckOptions()``. % - % Examples: - % % opt.dataDir = '/home/remi/data'; - % % opt.taskName = 'testTask'; - % % opt = setDerivativesDir(opt); - % % - % % disp(opt.derivativesDir) - % %|| '/home/remi/data/../derivatives/cpp_spm' - % % - % % disp(opt.opt.jobsDir) - % %|| '/home/remi/data/../derivatives/cpp_spm/JOBS/testTask + % Examples:: + % + % opt.dataDir = '/home/remi/data'; + % opt.taskName = 'testTask'; + % opt = setDerivativesDir(opt); + % + % disp(opt.derivativesDir) + % '/home/remi/data/../derivatives/cpp_spm' + % + % disp(opt.opt.jobsDir) + % '/home/remi/data/../derivatives/cpp_spm/JOBS/testTask + % + % opt.dataDir = '/home/remi/data'; + % opt.dataDir = '/home/remi/otherFolder'; + % opt.taskName = 'testTask'; + % opt = setDerivativesDir(opt); + % + % disp(opt.derivativesDir) + % '/home/remi/otherFolder/derivatives/cpp_spm' % - % % opt.dataDir = '/home/remi/data'; - % % opt.dataDir = '/home/remi/otherFolder'; - % % opt.taskName = 'testTask'; - % % opt = setDerivativesDir(opt); - % % - % % disp(opt.derivativesDir) - % %|| '/home/remi/otherFolder/derivatives/cpp_spm' + % opt.dataDir = '/home/remi/data'; + % opt.dataDir = '/home/remi/derivatives/preprocessing'; + % opt.taskName = 'testTask'; + % opt = setDerivativesDir(opt); % - % % opt.dataDir = '/home/remi/data'; - % % opt.dataDir = '/home/remi/derivatives/preprocessing'; - % % opt.taskName = 'testTask'; - % % opt = setDerivativesDir(opt); - % % - % % disp(opt.derivativesDir) - % %|| '/home/remi/otherFolder/derivatives/preprocessing' + % disp(opt.derivativesDir) + % '/home/remi/otherFolder/derivatives/preprocessing' % % + % (C) Copyright 2020 CPP_SPM developers if ~isfield(opt, 'derivativesDir') || isempty(opt.derivativesDir) opt.derivativesDir = fullfile(opt.dataDir, '..', 'derivatives', 'cpp_spm'); diff --git a/src/setStatsDir.m b/src/setStatsDir.m index 48aa4072..637f1420 100644 --- a/src/setStatsDir.m +++ b/src/setStatsDir.m @@ -1,6 +1,10 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function opt = setStatsDir(opt) + % + % USAGE:: + % + % opt = setStatsDir(opt) + % + % (C) Copyright 2021 CPP_SPM developers opt = setDerivativesDir(opt); diff --git a/src/subject_level/convertOnsetTsvToMat.m b/src/subject_level/convertOnsetTsvToMat.m index c561f122..3076428e 100644 --- a/src/subject_level/convertOnsetTsvToMat.m +++ b/src/subject_level/convertOnsetTsvToMat.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function fullpathOnsetFileName = convertOnsetTsvToMat(opt, tsvFile) % % Converts an events.tsv file to an onset file suitable for SPM subject level @@ -16,8 +14,9 @@ % :param tsvFile: % :type tsvFile: string % - % :returns: - :fullpathOnsetFileName: (string) name of the output `.mat` file. + % :returns: :fullpathOnsetFileName: (string) name of the output ``.mat`` file. % + % (C) Copyright 2019 CPP_SPM developers % [pth, file, ext] = spm_fileparts(tsvFile); diff --git a/src/subject_level/createAndReturnOnsetFile.m b/src/subject_level/createAndReturnOnsetFile.m index 73e50eed..92a22ad6 100644 --- a/src/subject_level/createAndReturnOnsetFile.m +++ b/src/subject_level/createAndReturnOnsetFile.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function onsetFileName = createAndReturnOnsetFile(opt, subID, tsvFile, funcFWHM) % % For a given events.tsv file it creates a .mat file that can directly be used @@ -20,9 +18,10 @@ % GLM. Necessary for the GLM directory. % :type funcFWHM: float % - % :returns: - :onsetFileName: (string) fullpath name of the file created. - % Removes any prefix. + % :returns: :onsetFileName: (string) fullpath name of the file created. + % % + % (C) Copyright 2019 CPP_SPM developers onsetFileName = convertOnsetTsvToMat(opt, tsvFile); diff --git a/src/subject_level/deleteResidualImages.m b/src/subject_level/deleteResidualImages.m index a6b10bf4..59838998 100644 --- a/src/subject_level/deleteResidualImages.m +++ b/src/subject_level/deleteResidualImages.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function deleteResidualImages(ffxDir) % % USAGE:: @@ -9,6 +7,7 @@ function deleteResidualImages(ffxDir) % :param ffxDir: % :type ffxDir: string % + % (C) Copyright 2020 CPP_SPM developers delete(fullfile(ffxDir, 'Res_*.nii')); delete(fullfile(ffxDir, 'res4d.nii*')); diff --git a/src/subject_level/getBoldFilenameForFFX.m b/src/subject_level/getBoldFilenameForFFX.m index 117ed609..b53b6f3e 100644 --- a/src/subject_level/getBoldFilenameForFFX.m +++ b/src/subject_level/getBoldFilenameForFFX.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [boldFileName, prefix] = getBoldFilenameForFFX(varargin) % % Gets the filename for this bold run for this task for the FFX setup @@ -26,6 +24,7 @@ % - :prefix: (srting) % % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt, subID, funcFWHM, iSes, iRun] = deal(varargin{:}); diff --git a/src/subject_level/getFFXdir.m b/src/subject_level/getFFXdir.m index cad5cb71..677ec0cd 100644 --- a/src/subject_level/getFFXdir.m +++ b/src/subject_level/getFFXdir.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function ffxDir = getFFXdir(subLabel, funcFWFM, opt) % % Sets the name the FFX directory and creates it if it does not exist @@ -17,6 +15,7 @@ % % :returns: - :ffxDir: (string) % + % (C) Copyright 2019 CPP_SPM developers glmDirName = createGlmDirName(opt, funcFWFM); diff --git a/src/subject_level/specifyContrasts.m b/src/subject_level/specifyContrasts.m index 811c6e27..7b2e5854 100644 --- a/src/subject_level/specifyContrasts.m +++ b/src/subject_level/specifyContrasts.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function contrasts = specifyContrasts(ffxDir, taskName, opt) % % Specifies the first level contrasts @@ -30,6 +28,8 @@ % Sn(1) R4 % Sn(1) R5 % Sn(1) R6 + % + % (C) Copyright 2019 CPP_SPM developers load(fullfile(ffxDir, 'SPM.mat')); diff --git a/src/templates/bidsTemplateWorkflow.m b/src/templates/bidsTemplateWorkflow.m index 39721e4c..2294c51b 100644 --- a/src/templates/bidsTemplateWorkflow.m +++ b/src/templates/bidsTemplateWorkflow.m @@ -1,8 +1,7 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function bidsTemplateWorkflow(opt) % % + % (C) Copyright 2021 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'workflow name'); diff --git a/src/templates/setBatchTemplate.m b/src/templates/setBatchTemplate.m index 7a7536b6..f17b0d03 100644 --- a/src/templates/setBatchTemplate.m +++ b/src/templates/setBatchTemplate.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function matlabbatch = setBatchTemplate(matlabbatch, BIDS, opt, subID, info, varargin) % % template to creae new setBatch functions @@ -12,6 +10,8 @@ % :type matlabbatch: % % :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job + % + % (C) Copyright 2020 CPP_SPM developers printBatchName('name for this batch'); diff --git a/src/templates/templateFunction.m b/src/templates/templateFunction.m index 6897f2f2..c80726d3 100644 --- a/src/templates/templateFunction.m +++ b/src/templates/templateFunction.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [argout1, argout2] = templateFunction(argin1, argin2, argin3) % % Short description of what the function does goes here. @@ -23,6 +21,8 @@ % % - item 1 % - item 2 + % + % (C) Copyright 2020 CPP_SPM developers % The code goes below diff --git a/src/templates/templateFunctionExample.m b/src/templates/templateFunctionExample.m index 941690b5..d0bd6970 100644 --- a/src/templates/templateFunctionExample.m +++ b/src/templates/templateFunctionExample.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function templateFunctionExample() % This function illustrates a documentation test defined for MOdox. % Other than that it does absolutely nothinghort description of what @@ -36,6 +34,8 @@ function templateFunctionExample() % % % % tests end here because test indentation has ended + % + % (C) Copyright 2020 CPP_SPM developers % The code goes below diff --git a/src/templates/templateGetOption.m b/src/templates/templateGetOption.m index 4946a976..797a3540 100644 --- a/src/templates/templateGetOption.m +++ b/src/templates/templateGetOption.m @@ -1,8 +1,9 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function opt = templateGetOption() + % % returns a structure that contains the options chosen by the user to return % the different workflows + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 1 opt = []; diff --git a/src/unzipImgAndReturnsFullpathName.m b/src/unzipImgAndReturnsFullpathName.m index b8a4d6eb..0f4681c8 100644 --- a/src/unzipImgAndReturnsFullpathName.m +++ b/src/unzipImgAndReturnsFullpathName.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function unzippedFullpathImgName = unzipImgAndReturnsFullpathName(fullpathImgName) % % Unzips an image if necessary @@ -18,6 +16,7 @@ % - make it work on several images % % + % (C) Copyright 2020 CPP_SPM developers [directory, filename, ext] = spm_fileparts(fullpathImgName); diff --git a/src/utils/checkDependencies.m b/src/utils/checkDependencies.m index 2dd645ce..dfb09d5b 100644 --- a/src/utils/checkDependencies.m +++ b/src/utils/checkDependencies.m @@ -1,20 +1,14 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function checkDependencies() % - % Checks that that the right dependencies are installed: - % - SPM - % - Nifti tools - % Also loads the spm defaults. + % Checks that that the right dependencies are installeda and + % loads the spm defaults. % % USAGE:: % % checkDependencies() % - % .. TODO: - % - refactor in a several sub functions to cehck each dependency - % - need to check other dependencies (bids-matlab, spmup) % + % (C) Copyright 2019 CPP_SPM developers fprintf('Checking dependencies\n'); diff --git a/src/utils/cleanCrash.m b/src/utils/cleanCrash.m index c8cce61d..ebc44640 100644 --- a/src/utils/cleanCrash.m +++ b/src/utils/cleanCrash.m @@ -1,15 +1,14 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function cleanCrash() % % Removes any files left over from a previous unfinished run of the pipeline, - % like any *.png imgages + % like any ``*.png`` imgages % % USAGE:: % % cleanCrash() % % + % (C) Copyright 2020 CPP_SPM developers files = {'spm.*.png'}; diff --git a/src/utils/createDataDictionary.m b/src/utils/createDataDictionary.m index 973b1c0d..f7073d11 100644 --- a/src/utils/createDataDictionary.m +++ b/src/utils/createDataDictionary.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function createDataDictionary(subFuncDataDir, fileName, nbColums) % % Short description of what the function does goes here. @@ -15,6 +13,7 @@ function createDataDictionary(subFuncDataDir, fileName, nbColums) % :param nbColums: Number of extra columns to add as censoring regressors. % :type nbColums: integer % + % (C) Copyright 2020 CPP_SPM developers namecColumns = { ... 'trans_x', ... diff --git a/src/utils/createDerivativeDir.m b/src/utils/createDerivativeDir.m index dd947ac0..2f4b7fef 100644 --- a/src/utils/createDerivativeDir.m +++ b/src/utils/createDerivativeDir.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function createDerivativeDir(opt) % % Creates the derivative folder if it does not exist. @@ -11,6 +9,7 @@ function createDerivativeDir(opt) % :param opt: Options chosen for the analysis. See ``checkOptions()``. % :type opt: structure % + % (C) Copyright 2019 CPP_SPM developers if ~exist(opt.derivativesDir, 'dir') mkdir(opt.derivativesDir); diff --git a/src/utils/createGlmDirName.m b/src/utils/createGlmDirName.m index 8406337f..43e5dcd9 100644 --- a/src/utils/createGlmDirName.m +++ b/src/utils/createGlmDirName.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function glmDirName = createGlmDirName(opt, FWHM) + % + % (C) Copyright 2021 CPP_SPM developers glmDirName = ['task-', opt.taskName, ... '_space-' opt.space, ... diff --git a/src/utils/getEnvInfo.m b/src/utils/getEnvInfo.m index 6d54cf54..0f8734ba 100644 --- a/src/utils/getEnvInfo.m +++ b/src/utils/getEnvInfo.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function [OS, GeneratedBy] = getEnvInfo() % % Gets information about the environement and operating system to help generate @@ -12,6 +10,7 @@ % :returns: :OS: (structure) (dimension) % :GeneratedBy: (structure) (dimension) % + % (C) Copyright 2020 CPP_SPM developers GeneratedBy(1).name = 'cpp_spm'; GeneratedBy(1).Version = getVersion(); diff --git a/src/utils/getSubjectList.m b/src/utils/getSubjectList.m index 75d05ef1..9bb2a3ae 100644 --- a/src/utils/getSubjectList.m +++ b/src/utils/getSubjectList.m @@ -1,5 +1,3 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function opt = getSubjectList(BIDS, opt) % % Returns the subjects to analyze in ``opt.subjects`` @@ -38,6 +36,8 @@ % % opt.groups = {''}; % opt.subjects = {'01', 'cont01', 'cat02', 'ctrl02', 'blind01'}; + % + % (C) Copyright 2021 CPP_SPM developers allSubjects = bids.query(BIDS, 'subjects'); diff --git a/src/utils/getVersion.m b/src/utils/getVersion.m index a0ef2b7a..f3471a6a 100644 --- a/src/utils/getVersion.m +++ b/src/utils/getVersion.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function versionNumber = getVersion() % % Reads the version number of the pipeline from the txt file in the root of the @@ -11,6 +9,7 @@ % % :returns: :versionNumber: (string) Use semantic versioning format (like v0.1.0) % + % (C) Copyright 2020 CPP_SPM developers try versionNumber = fileread(fullfile(fileparts(mfilename('fullpath')), ... diff --git a/src/utils/isOctave.m b/src/utils/isOctave.m index 5fe03b9f..a0c14fa7 100644 --- a/src/utils/isOctave.m +++ b/src/utils/isOctave.m @@ -1,6 +1,3 @@ -% (C) Copyright 2020 Agah Karakuzu -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function retval = isOctave() % % Returns true if the environment is Octave. @@ -11,6 +8,8 @@ % % :returns: :retval: (boolean) % + % (C) Copyright 2020 Agah Karakuzu + % (C) Copyright 2020 CPP_SPM developers persistent cacheval % speeds up repeated calls diff --git a/src/utils/loadAndCheckOptions.m b/src/utils/loadAndCheckOptions.m index 72df76b5..5ee90829 100644 --- a/src/utils/loadAndCheckOptions.m +++ b/src/utils/loadAndCheckOptions.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function opt = loadAndCheckOptions(optionJsonFile) % % Loads the json file provided describing the options of an analysis. It then checks @@ -23,6 +21,8 @@ % .. TODO % % - add test for when the input is a structure. + % + % (C) Copyright 2020 CPP_SPM developers if nargin < 1 || isempty(optionJsonFile) optionJsonFile = spm_select('FPList', ... diff --git a/src/utils/manageWorkersPool.m b/src/utils/manageWorkersPool.m index b5a8c08b..76a1f3e6 100644 --- a/src/utils/manageWorkersPool.m +++ b/src/utils/manageWorkersPool.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function manageWorkersPool(action, opt) % % Check matlab version and opens pool of workers for parallel work. @@ -19,6 +17,7 @@ function manageWorkersPool(action, opt) % opt.parallelize.nbWorkers = 3; % opt.parallelize.killOnExit = true; % + % (C) Copyright 2020 CPP_SPM developers if ~opt.parallelize.do opt.parallelize.nbWorkers = 1; diff --git a/src/utils/printBatchName.m b/src/utils/printBatchName.m index 32471cfe..8d103b6d 100644 --- a/src/utils/printBatchName.m +++ b/src/utils/printBatchName.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function printBatchName(batchName) + % + % (C) Copyright 2019 CPP_SPM developers fprintf(1, '\n BUILDING JOB: %s\n', lower(batchName)); diff --git a/src/utils/printCredits.m b/src/utils/printCredits.m index 5e3cb4d7..d1122a28 100644 --- a/src/utils/printCredits.m +++ b/src/utils/printCredits.m @@ -1,10 +1,11 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function printCredits() + % + % TODO: use the .zenodo.json to load contributors + % + % (C) Copyright 2019 CPP_SPM developers versionNumber = getVersion(); - % TODO: use the .zenodo.json to load contributors contributors = { ... 'Mohamed Rezk', ... 'Remi Gau', ... diff --git a/src/utils/printProcessingRun.m b/src/utils/printProcessingRun.m index 29769001..7ac315cb 100644 --- a/src/utils/printProcessingRun.m +++ b/src/utils/printProcessingRun.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function printProcessingRun(groupName, iSub, subID, iSes, iRun) + % + % (C) Copyright 2019 CPP_SPM developers fprintf(1, ... [ ... diff --git a/src/utils/printProcessingSubject.m b/src/utils/printProcessingSubject.m index a0668d42..d7131e87 100644 --- a/src/utils/printProcessingSubject.m +++ b/src/utils/printProcessingSubject.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function printProcessingSubject(iSub, subLabel) + % + % (C) Copyright 2019 CPP_SPM developers fprintf(1, [ ... ' PROCESSING SUBJECT No.: %i ' ... diff --git a/src/utils/printWorklowName.m b/src/utils/printWorklowName.m index 9b4155fd..395c08b8 100644 --- a/src/utils/printWorklowName.m +++ b/src/utils/printWorklowName.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function printWorklowName(workflowName) + % + % (C) Copyright 2019 CPP_SPM developers fprintf(1, '\n\n\nWORKFLOW: %s\n\n', upper(workflowName)); diff --git a/src/utils/removeSpmPrefix.m b/src/utils/removeSpmPrefix.m index 0ea6e3c4..cb5a2ba2 100644 --- a/src/utils/removeSpmPrefix.m +++ b/src/utils/removeSpmPrefix.m @@ -1,6 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function image = removeSpmPrefix(image, prefix) + % + % (C) Copyright 2019 CPP_SPM developers basename = spm_file(image, 'basename'); tmp = spm_file(image, 'basename', basename(length(prefix) + 1:end)); diff --git a/src/utils/rmTrialTypeStr.m b/src/utils/rmTrialTypeStr.m index 82116dd6..cc5063c5 100644 --- a/src/utils/rmTrialTypeStr.m +++ b/src/utils/rmTrialTypeStr.m @@ -1,5 +1,6 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers function conName = rmTrialTypeStr(conName) + % + % (C) Copyright 2019 CPP_SPM developers conName = strrep(conName, 'trial_type.', ''); diff --git a/src/utils/saveMatlabBatch.m b/src/utils/saveMatlabBatch.m index 7d6c7ff0..82212ff4 100644 --- a/src/utils/saveMatlabBatch.m +++ b/src/utils/saveMatlabBatch.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function saveMatlabBatch(matlabbatch, batchType, opt, subID) % % Also save some basic environnment info. @@ -18,6 +16,7 @@ function saveMatlabBatch(matlabbatch, batchType, opt, subID) % :type subID: string % % + % (C) Copyright 2019 CPP_SPM developers if nargin < 4 || isempty(subID) subID = 'group'; diff --git a/src/utils/saveOptions.m b/src/utils/saveOptions.m index 0334f275..df3964c0 100644 --- a/src/utils/saveOptions.m +++ b/src/utils/saveOptions.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function saveOptions(opt) % % Short description of what the function does goes here. @@ -11,6 +9,7 @@ function saveOptions(opt) % :param opt: Options chosen for the analysis. See ``checkOptions()``. % :type opt: structure % + % (C) Copyright 2020 CPP_SPM developers optionDir = fullfile(pwd, 'cfg'); [~, ~, ~] = mkdir(optionDir); diff --git a/src/utils/setFields.m b/src/utils/setFields.m index 907dcb7a..a82a0d87 100644 --- a/src/utils/setFields.m +++ b/src/utils/setFields.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function structure = setFields(structure, fieldsToSet, overwrite) % % Recursively loop through the fields of a target ``structure`` and sets the values @@ -22,6 +20,7 @@ % :returns: - :structure: (structure) % % + % (C) Copyright 2020 CPP_SPM developers if isempty(fieldsToSet) return @@ -68,6 +67,8 @@ function structure = setFieldToIfNotPresent(structure, fieldName, value) if ~isfield(structure, fieldName) - structure.(fieldName) = value; + for i = 1:numel(structure) + structure(i).(fieldName) = value; + end end end diff --git a/src/utils/setGraphicWindow.m b/src/utils/setGraphicWindow.m index 2d75a2c6..943cc27d 100644 --- a/src/utils/setGraphicWindow.m +++ b/src/utils/setGraphicWindow.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function [interactiveWindow, graphWindow, cmdLine] = setGraphicWindow() % % Short description of what the function does goes here. @@ -19,6 +17,7 @@ % :returns: - :argout1: (type) (dimension) % - :argout2: (type) (dimension) % + % (C) Copyright 2019 CPP_SPM developers interactiveWindow = []; graphWindow = []; diff --git a/src/utils/validationInputFile.m b/src/utils/validationInputFile.m index 10cf7aec..23b7dbdd 100644 --- a/src/utils/validationInputFile.m +++ b/src/utils/validationInputFile.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function files = validationInputFile(dir, fileNamePattern, prefix) % % Looks for file name pattern in a given directory and returns all the files @@ -41,6 +39,7 @@ % % tissueProbaMaps = validationInputFile(anatDataDir, anatImage, 'c[12]'); % % + % (C) Copyright 2019 CPP_SPM developers % try to guess directory in case a fullpath filename was given if isempty(dir) diff --git a/src/utils/writeDatasetDescription.m b/src/utils/writeDatasetDescription.m index c7641e28..7699c682 100644 --- a/src/utils/writeDatasetDescription.m +++ b/src/utils/writeDatasetDescription.m @@ -1,6 +1,6 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function writeDatasetDescription(opt) + % + % (C) Copyright 2020 CPP_SPM developers oldDatasetDescription = spm_jsonread(fullfile(opt.derivativesDir, 'dataset_description.json')); @@ -8,7 +8,7 @@ function writeDatasetDescription(opt) if isfield(oldDatasetDescription, 'DatasetDOI') newDatasetDescription.SourceDatasets{1}.DOI = ... - oldDatasetDescription.DatasetDOI; + oldDatasetDescription.DatasetDOI; end spm_jsonwrite( ... diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index dc757327..ed11cc87 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) % % Make 4D images of beta and t-maps for the MVPA. :: @@ -15,6 +13,7 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) % :param deleteIndTmaps: decide to delete t-maps % :type funcFWHM: (boolean) % + % (C) Copyright 2019 CPP_SPM developers % delete individual Beta and tmaps if nargin < 3 diff --git a/src/workflows/bidsCopyRawFolder.m b/src/workflows/bidsCopyRawFolder.m index fb75608d..230eeb98 100644 --- a/src/workflows/bidsCopyRawFolder.m +++ b/src/workflows/bidsCopyRawFolder.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function bidsCopyRawFolder(opt, deleteZippedNii, modalitiesToCopy, unZip) % % Copies the folders from the ``raw`` folder to the @@ -25,6 +23,7 @@ function bidsCopyRawFolder(opt, deleteZippedNii, modalitiesToCopy, unZip) % :param unZip: % :type unZip: boolean % + % (C) Copyright 2019 CPP_SPM developers %% input variables default values diff --git a/src/workflows/bidsCreateROI.m b/src/workflows/bidsCreateROI.m index 2349c503..07127220 100644 --- a/src/workflows/bidsCreateROI.m +++ b/src/workflows/bidsCreateROI.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function bidsCreateROI(opt) + % + % (C) Copyright 2021 CPP_SPM developers if nargin < 1 opt = []; @@ -9,7 +9,7 @@ function bidsCreateROI(opt) [BIDS, opt] = setUpWorkflow(opt, 'create ROI'); opt.dir.roi = [opt.derivativesDir '-roi']; - spm_mkdir(fullfile(opt.roiDir, 'group')); + spm_mkdir(fullfile(opt.dir.roi, 'group')); opt.jobsDir = fullfile(opt.dir.roi, 'JOBS', opt.taskName); @@ -31,7 +31,7 @@ function bidsCreateROI(opt) if any(strcmp(opt.roi.space, 'individual')) roiList = spm_select('FPlist', ... - fullfile(opt.roiDir, 'group'), ... + fullfile(opt.dir.roi, 'group'), ... '^space-.*_mask.nii$'); for iSub = 1:numel(opt.subjects) @@ -60,7 +60,7 @@ function bidsCreateROI(opt) spm_mkdir(opt.dir.roi, ['sub-' subLabel], 'roi'); roiList = spm_select('FPlist', ... - fullfile(opt.roiDir, 'group'), ... + fullfile(opt.dir.roi, 'group'), ... '^wspace.*_mask.nii.*$'); for iROI = 1:size(roiList, 1) diff --git a/src/workflows/bidsCreateVDM.m b/src/workflows/bidsCreateVDM.m index 461ed2fe..c235682c 100644 --- a/src/workflows/bidsCreateVDM.m +++ b/src/workflows/bidsCreateVDM.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsCreateVDM(opt) % % Creates the voxel displacement maps from the fieldmaps of a BIDS @@ -20,6 +18,7 @@ function bidsCreateVDM(opt) % Inspired from spmup ``spmup_BIDS_preprocess`` (@ commit 198c980d6d7520b1a99) % (URL missing) % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'create voxel displacement map'); diff --git a/src/workflows/bidsFFX.m b/src/workflows/bidsFFX.m index 5765e289..ceee4257 100644 --- a/src/workflows/bidsFFX.m +++ b/src/workflows/bidsFFX.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsFFX(action, opt, funcFWHM) % % - builds the subject level fMRI model and estimates it. @@ -27,14 +25,15 @@ function bidsFFX(action, opt, funcFWHM) % For unsmoothed data ``funcFWHM = 0``, for smoothed data ``funcFWHM = ... mm``. % In this way we can make multiple ffx for different smoothing degrees. % - + % (C) Copyright 2020 CPP_SPM developers + if opt.glm.roibased.do - message = sprintf(... - ['The option opt.glm.roibased.do is set to true.\n', ... - ' Change the option to false to use this workflow or\n', ... - ' use the bidsRoiBasedGLM workflow to run roi based GLM.']); - error(message); - end + message = sprintf( ... + ['The option opt.glm.roibased.do is set to true.\n', ... + ' Change the option to false to use this workflow or\n', ... + ' use the bidsRoiBasedGLM workflow to run roi based GLM.']); + error(message); + end [BIDS, opt] = setUpWorkflow(opt, 'subject level GLM'); diff --git a/src/workflows/bidsLesionSegmentation.m b/src/workflows/bidsLesionSegmentation.m index 627cba8e..af0fb8da 100755 --- a/src/workflows/bidsLesionSegmentation.m +++ b/src/workflows/bidsLesionSegmentation.m @@ -1,5 +1,3 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function bidsLesionSegmentation(opt) % % Performs segmentation to detect lesions of anatomical image. @@ -14,6 +12,7 @@ function bidsLesionSegmentation(opt) % % Segmentation will be performed using the information provided in the BIDS data set. % + % (C) Copyright 2021 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'lesion segmentation'); diff --git a/src/workflows/bidsRFX.m b/src/workflows/bidsRFX.m index a735c538..96bc3153 100644 --- a/src/workflows/bidsRFX.m +++ b/src/workflows/bidsRFX.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsRFX(action, opt, funcFWHM, conFWHM) % % - smooths all contrast images created at the subject level @@ -30,6 +28,7 @@ function bidsRFX(action, opt, funcFWHM, conFWHM) % - case ``RFX``: Mean Struct, MeanMask, Factorial design specification and % estimation, Contrast estimation % + % (C) Copyright 2020 CPP_SPM developers if nargin < 4 || isempty(funcFWHM) funcFWHM = 0; diff --git a/src/workflows/bidsRealignReslice.m b/src/workflows/bidsRealignReslice.m index d2dd05bf..0b90bb8d 100644 --- a/src/workflows/bidsRealignReslice.m +++ b/src/workflows/bidsRealignReslice.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsRealignReslice(opt) % % Realigns and reslices the functional data of a given task. @@ -14,6 +12,7 @@ function bidsRealignReslice(opt) % % Assumes that ``bidsSTC()`` has already been run. % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'realign and reslice'); diff --git a/src/workflows/bidsRealignUnwarp.m b/src/workflows/bidsRealignUnwarp.m index 5ec1c452..c56387a6 100644 --- a/src/workflows/bidsRealignUnwarp.m +++ b/src/workflows/bidsRealignUnwarp.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsRealignUnwarp(opt) % % Realigns and unwarps the functional data of a given task. @@ -17,6 +15,7 @@ function bidsRealignUnwarp(opt) % If the ``bidsCreateVDM()`` workflow has been run before the voxel displacement % maps will be used unless ``opt.useFieldmaps`` is set to ``false``. % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'realign and unwarp'); diff --git a/src/workflows/bidsResliceTpmToFunc.m b/src/workflows/bidsResliceTpmToFunc.m index 788c971f..3394c54f 100644 --- a/src/workflows/bidsResliceTpmToFunc.m +++ b/src/workflows/bidsResliceTpmToFunc.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsResliceTpmToFunc(opt) % % Reslices the tissue probability map (TPMs) from the segmentation to the mean @@ -20,6 +18,7 @@ function bidsResliceTpmToFunc(opt) % as the computation of the tSNR by ``spmup`` requires the TPMs to have the same dimension % as the functional. % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'reslicing tissue probability maps to functional dimension'); diff --git a/src/workflows/bidsResults.m b/src/workflows/bidsResults.m index 08497bc6..ae744de4 100644 --- a/src/workflows/bidsResults.m +++ b/src/workflows/bidsResults.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsResults(opt, funcFWHM, conFWHM) % % Computes the results for a series of contrast that can be @@ -20,6 +18,7 @@ function bidsResults(opt, funcFWHM, conFWHM) % images (Gaussian kernel size). % :type conFWHM: scalar % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'computing GLM results'); diff --git a/src/workflows/bidsRoiBasedGLM.m b/src/workflows/bidsRoiBasedGLM.m index fdc02688..948a5a96 100644 --- a/src/workflows/bidsRoiBasedGLM.m +++ b/src/workflows/bidsRoiBasedGLM.m @@ -1,15 +1,18 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function bidsRoiBasedGLM(opt) % + % Will run a GLM within a ROI using MarsBar. + % + % Will compute the percent signal change and the time course of the events + % or blocks of contrast specified in the BIDS model. % - + % (C) Copyright 2021 CPP_SPM developers + if ~opt.glm.roibased.do - message = sprintf(... - ['The option opt.glm.roibased.do is set to false.\n', ... - ' Change the option to true to use this workflow or\n', ... - ' use the bidsFFX workflow to run whole brain GLM.']); - error(message); + message = sprintf( ... + ['The option opt.glm.roibased.do is set to false.\n', ... + ' Change the option to true to use this workflow or\n', ... + ' use the bidsFFX workflow to run whole brain GLM.']); + error(message); end funcFWHM = 0; diff --git a/src/workflows/bidsSTC.m b/src/workflows/bidsSTC.m index 58aaf908..76c19eb5 100644 --- a/src/workflows/bidsSTC.m +++ b/src/workflows/bidsSTC.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function bidsSTC(opt) % % Performs the slie timing correction of the functional data. @@ -29,6 +27,7 @@ function bidsSTC(opt) % % See the documentation for more information about slice timing correction. % + % (C) Copyright 2019 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'slice timing correction'); diff --git a/src/workflows/bidsSegmentSkullStrip.m b/src/workflows/bidsSegmentSkullStrip.m index d990bba3..978e2b0c 100644 --- a/src/workflows/bidsSegmentSkullStrip.m +++ b/src/workflows/bidsSegmentSkullStrip.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsSegmentSkullStrip(opt) % % Segments and skullstrips the anatomical image. @@ -12,6 +10,7 @@ function bidsSegmentSkullStrip(opt) % ``checkOptions()`` and ``loadAndCheckOptions()``. % :type opt: structure % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'segmentation and skulltripping'); diff --git a/src/workflows/bidsSmoothing.m b/src/workflows/bidsSmoothing.m index 05f52964..ceaa5710 100644 --- a/src/workflows/bidsSmoothing.m +++ b/src/workflows/bidsSmoothing.m @@ -1,5 +1,3 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers - function bidsSmoothing(funcFWHM, opt) % % This performs smoothing to the functional data using a full width @@ -7,7 +5,7 @@ function bidsSmoothing(funcFWHM, opt) % % USAGE:: % - % bidsSmoothing(funcFWHM, [opt]) + % bidsSmoothing(funcFWHM, [opt]) % % :param funcFWHM: How much smoothing was applied to the functional % data in the preprocessing (Gaussian kernel size). @@ -15,6 +13,8 @@ function bidsSmoothing(funcFWHM, opt) % :param opt: structure or json filename containing the options. See % ``checkOptions()`` and ``loadAndCheckOptions()``. % :type opt: structure + % + % (C) Copyright 2020 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'smoothing functional data'); diff --git a/src/workflows/bidsSpatialPrepro.m b/src/workflows/bidsSpatialPrepro.m index e3a4948d..b144192c 100644 --- a/src/workflows/bidsSpatialPrepro.m +++ b/src/workflows/bidsSpatialPrepro.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function bidsSpatialPrepro(opt) % % Performs spatial preprocessing of the functional and structural data. @@ -37,6 +35,7 @@ function bidsSpatialPrepro(opt) % % - average T1s across sessions if necessarry % + % (C) Copyright 2019 CPP_SPM developers [BIDS, opt] = setUpWorkflow(opt, 'spatial preprocessing'); diff --git a/src/workflows/saveAndRunWorkflow.m b/src/workflows/saveAndRunWorkflow.m index d6972712..e652ca6e 100644 --- a/src/workflows/saveAndRunWorkflow.m +++ b/src/workflows/saveAndRunWorkflow.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function saveAndRunWorkflow(matlabbatch, batchName, opt, subLabel) % % Saves the SPM matlabbatch and runs it @@ -17,6 +15,8 @@ function saveAndRunWorkflow(matlabbatch, batchName, opt, subLabel) % :type opt: structure % :param subID: subject ID % :type subID: string + % + % (C) Copyright 2019 CPP_SPM developers if nargin < 4 subLabel = []; diff --git a/src/workflows/setUpWorkflow.m b/src/workflows/setUpWorkflow.m index d79ffb29..85fd5e85 100644 --- a/src/workflows/setUpWorkflow.m +++ b/src/workflows/setUpWorkflow.m @@ -1,5 +1,3 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers - function [BIDS, opt] = setUpWorkflow(opt, workflowName) % % Calls some common functions to: @@ -24,6 +22,7 @@ % - :opt: options checked % - :group: % + % (C) Copyright 2019 CPP_SPM developers opt = loadAndCheckOptions(opt); diff --git a/tests/README.md b/tests/README.md index dfeb791c..9a2931f3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,57 +7,27 @@ If you are not sure what unit and integration tests are, check the excellent chapter about that in the [Turing way](https://the-turing-way.netlify.app/reproducible-research/testing.html). -## How to run the tests - -### Install MoxUnit - -You need to install -[MOxUnit for matlab and octave](https://github.com/MOxUnit/MOxUnit) to run the -tests. - -Note the install procedure will require you to have -[git](https://git-scm.com/downloads) installed on your computer. If you don't, -you can always download the MoxUnit code with this -[link](https://github.com/MOxUnit/MOxUnit/archive/master.zip). - -Run the following from a terminal in the folder where you want to install -MOxUnit. The `make install` command will find Matlab / Octave on your system and -make sure it plays nice with MoxUnit. - -NOTE: only type in the terminal what is after the `$` sign: - -```bash -# get the code for MOxUnit with git -git clone https://github.com/MOxUnit/MOxUnit.git -# enter the newly created folder and set up MoxUnit -cd MOxUnit -make install -``` - -If you want to check the code coverage on your computer, you can also install -[MOcov for matlab and octave](https://github.com/MOcov/MOcov). Note that this is -also part of the continuous integration of the bids-matlab, so you don't need to -do this. - -To run the tests, make sure the `tests/utils` folder has bee added to the Matlab -/ Octave path +See +[HERE](https://github.com/cpp-lln-lab/.github/blob/main/CONTRIBUTING.md#how-to-run-the-tests) +for general information on how to run the tests. ## Add helper functions to the path -There are a some help functions you need to add to the Matlab / Octave path to run the tests: +There are a some help functions you need to add to the Matlab / Octave path to +run the tests: ``` addpath(fullfile('tests', 'utils')) ``` -### Install the test data +## Install the test data You need to run a bash script to create some empty data files: From within the `tests` folder. ``` -sh createDummyDataSet.sh +sh createDummyDataSet.sh ``` ### Run the tests @@ -72,50 +42,16 @@ moxunit_runtests tests moxunit_runtests tests -verbose ``` -## Adding more tests - -You can use the following function template to write more tests. - -```matlab -function test_suite = test_functionToTest() - % This top function is necessary for mox unit to run tests. - % DO NOT CHANGE IT except to adapt the name of the function. - 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 +## Adding tests -function test_function_to_test_basic() +See +[HERE](https://github.com/cpp-lln-lab/.github/blob/main/CONTRIBUTING.md#adding-more-tests) +to add more tests - %% set up +### Style guidelines +#### Filenames - %% data to test against +- unit tests names: test*unit*\* - - %% test - % assertTrue( ); - % assertFalse( ); - % assertEqual( ); - -end - - -function test_function_to_test_other_usecase() - - %% set up - - - %% data to test against - - - %% test - % assertTrue( ); - % assertFalse( ); - % assertEqual( ); - -end - -``` +- other tests names: test\_\* diff --git a/tests/miss_hit.cfg b/tests/miss_hit.cfg index d4c4fc66..684e5239 100644 --- a/tests/miss_hit.cfg +++ b/tests/miss_hit.cfg @@ -1,9 +1 @@ -# style guide (https://florianschanda.github.io/miss_hit/style_checker.html) -line_length: 100 regex_function_name: "(test(_unit){0,1}_[a-z]+|[a-z]+)(([A-Z]){1}[A-Za-z0-9]+)*" - -# 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 5 \ No newline at end of file diff --git a/tests/test_bidsCopyRawFolder.m b/tests/test_bidsCopyRawFolder.m index a86801ad..b9d6fb4d 100644 --- a/tests/test_bidsCopyRawFolder.m +++ b/tests/test_bidsCopyRawFolder.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_bidsCopyRawFolder %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_checkOptions.m b/tests/test_checkOptions.m index 071e62bf..383c71f0 100644 --- a/tests/test_checkOptions.m +++ b/tests/test_checkOptions.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_checkOptions %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_createAndReturnOnsetFile.m b/tests/test_createAndReturnOnsetFile.m index d013bc70..6c10563f 100644 --- a/tests/test_createAndReturnOnsetFile.m +++ b/tests/test_createAndReturnOnsetFile.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_createAndReturnOnsetFile %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_createDefaultModel.m b/tests/test_createDefaultModel.m index bf08364d..e508f1ba 100644 --- a/tests/test_createDefaultModel.m +++ b/tests/test_createDefaultModel.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_createDefaultModel %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getAnatFilename.m b/tests/test_getAnatFilename.m index 05098182..94e9de88 100644 --- a/tests/test_getAnatFilename.m +++ b/tests/test_getAnatFilename.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getAnatFilename %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getBoldFilename.m b/tests/test_getBoldFilename.m index ee3aa79a..4a84d601 100644 --- a/tests/test_getBoldFilename.m +++ b/tests/test_getBoldFilename.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getBoldFilename %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getBoldFilenameForFFX.m b/tests/test_getBoldFilenameForFFX.m index 63675f46..a6bd762c 100644 --- a/tests/test_getBoldFilenameForFFX.m +++ b/tests/test_getBoldFilenameForFFX.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getBoldFilenameForFFX %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getData.m b/tests/test_getData.m index 6cbd66c4..7a2cbe68 100644 --- a/tests/test_getData.m +++ b/tests/test_getData.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getData %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getFFXdir.m b/tests/test_getFFXdir.m index 1e0c4005..28734ca8 100644 --- a/tests/test_getFFXdir.m +++ b/tests/test_getFFXdir.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getFFXdir %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getMeanFuncFilename.m b/tests/test_getMeanFuncFilename.m index c5bf35ef..5e7de78d 100644 --- a/tests/test_getMeanFuncFilename.m +++ b/tests/test_getMeanFuncFilename.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getMeanFuncFilename %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getRFXdir.m b/tests/test_getRFXdir.m index c59f51a9..2fb709d1 100644 --- a/tests/test_getRFXdir.m +++ b/tests/test_getRFXdir.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getRFXdir %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_getRealignParamFile.m b/tests/test_getRealignParamFile.m index a71a9070..2c4fd28e 100644 --- a/tests/test_getRealignParamFile.m +++ b/tests/test_getRealignParamFile.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getRealignParamFile %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_loadAndCheckOptions.m b/tests/test_loadAndCheckOptions.m index c06e2bb8..624063e8 100644 --- a/tests/test_loadAndCheckOptions.m +++ b/tests/test_loadAndCheckOptions.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_loadAndCheckOptions %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 @@ -109,3 +109,14 @@ function test_loadAndCheckOptionsFromSeveralFiles() assertEqual(opt, expectedOptions); end + +function test_loadAndCheckOptionsMoAE() + + jsonContent = setOptions('MoAE'); + + optionJsonFile = fullfile(pwd, 'cfg', 'options_task-auditory.json'); + spm_jsonwrite(optionJsonFile, jsonContent); + + opt = loadAndCheckOptions(optionJsonFile); + +end diff --git a/tests/test_modelFiles.m b/tests/test_modelFiles.m index 1a80e561..6024012b 100644 --- a/tests/test_modelFiles.m +++ b/tests/test_modelFiles.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_modelFiles %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_saveMatlabBatch.m b/tests/test_saveMatlabBatch.m index af8327e7..94d956a8 100644 --- a/tests/test_saveMatlabBatch.m +++ b/tests/test_saveMatlabBatch.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_saveMatlabBatch %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatch3Dto4D.m b/tests/test_setBatch3Dto4D.m index 53d3eded..cd21d71f 100644 --- a/tests/test_setBatch3Dto4D.m +++ b/tests/test_setBatch3Dto4D.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatch3Dto4D %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchComputeVDM.m b/tests/test_setBatchComputeVDM.m index 1f46e1a5..0efe5e5e 100644 --- a/tests/test_setBatchComputeVDM.m +++ b/tests/test_setBatchComputeVDM.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchComputeVDM %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchCoregistrationFuncToAnat.m b/tests/test_setBatchCoregistrationFuncToAnat.m index 45589a53..a789212e 100644 --- a/tests/test_setBatchCoregistrationFuncToAnat.m +++ b/tests/test_setBatchCoregistrationFuncToAnat.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchCoregistrationFuncToAnat %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchFactorialDesign.m b/tests/test_setBatchFactorialDesign.m index 7be5aff5..e5fcd5ba 100644 --- a/tests/test_setBatchFactorialDesign.m +++ b/tests/test_setBatchFactorialDesign.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchFactorialDesign %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchImageCalculation.m b/tests/test_setBatchImageCalculation.m index bc21e0db..0e70d94c 100644 --- a/tests/test_setBatchImageCalculation.m +++ b/tests/test_setBatchImageCalculation.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchImageCalculation %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchMeanAnatAndMask.m b/tests/test_setBatchMeanAnatAndMask.m index af30e028..6b15f9fd 100644 --- a/tests/test_setBatchMeanAnatAndMask.m +++ b/tests/test_setBatchMeanAnatAndMask.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchMeanAnatAndMask %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchNormalizationSpatialPrepro.m b/tests/test_setBatchNormalizationSpatialPrepro.m index 7abcf8f6..cb505861 100644 --- a/tests/test_setBatchNormalizationSpatialPrepro.m +++ b/tests/test_setBatchNormalizationSpatialPrepro.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchNormalizationSpatialPrepro %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchRealign.m b/tests/test_setBatchRealign.m index 7ead8b76..cc48d55c 100644 --- a/tests/test_setBatchRealign.m +++ b/tests/test_setBatchRealign.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchRealign %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchResults.m b/tests/test_setBatchResults.m index 4efd602e..490577ae 100644 --- a/tests/test_setBatchResults.m +++ b/tests/test_setBatchResults.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchResults %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSTC.m b/tests/test_setBatchSTC.m index 39435854..85817da4 100644 --- a/tests/test_setBatchSTC.m +++ b/tests/test_setBatchSTC.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSTC %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSaveCoregistrationMatrix.m b/tests/test_setBatchSaveCoregistrationMatrix.m index 9492e226..b21575b0 100644 --- a/tests/test_setBatchSaveCoregistrationMatrix.m +++ b/tests/test_setBatchSaveCoregistrationMatrix.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSaveCoregistrationMatrix %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSegmentation.m b/tests/test_setBatchSegmentation.m index 7304369b..91872c4d 100644 --- a/tests/test_setBatchSegmentation.m +++ b/tests/test_setBatchSegmentation.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSegmentation %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSelectAnat.m b/tests/test_setBatchSelectAnat.m index 7edda8c1..083a9c32 100644 --- a/tests/test_setBatchSelectAnat.m +++ b/tests/test_setBatchSelectAnat.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSelectAnat %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSkullStripping.m b/tests/test_setBatchSkullStripping.m index 788e0875..921c227f 100644 --- a/tests/test_setBatchSkullStripping.m +++ b/tests/test_setBatchSkullStripping.m @@ -1,4 +1,4 @@ -% (C) Copyright 2019 CPP BIDS SPM-pipeline developers +% (C) Copyright 2019 CPP_SPM developers function test_suite = test_setBatchSkullStripping %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSmoothConImages.m b/tests/test_setBatchSmoothConImages.m index 7a3364c9..98357b9c 100644 --- a/tests/test_setBatchSmoothConImages.m +++ b/tests/test_setBatchSmoothConImages.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSmoothConImages %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSmoothing.m b/tests/test_setBatchSmoothing.m index ec5f0e2d..f1016267 100644 --- a/tests/test_setBatchSmoothing.m +++ b/tests/test_setBatchSmoothing.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSmoothing %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSmoothingFunc.m b/tests/test_setBatchSmoothingFunc.m index de198f1d..564f93ed 100644 --- a/tests/test_setBatchSmoothingFunc.m +++ b/tests/test_setBatchSmoothingFunc.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSmoothingFunc %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSubjectLevelContrasts.m b/tests/test_setBatchSubjectLevelContrasts.m index 7995a8ab..e2d3c548 100644 --- a/tests/test_setBatchSubjectLevelContrasts.m +++ b/tests/test_setBatchSubjectLevelContrasts.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSubjectLevelContrasts %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSubjectLevelGLMSpec.m b/tests/test_setBatchSubjectLevelGLMSpec.m index 410a9599..94347c23 100644 --- a/tests/test_setBatchSubjectLevelGLMSpec.m +++ b/tests/test_setBatchSubjectLevelGLMSpec.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSubjectLevelGLMSpec %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setBatchSubjectLevelResults.m b/tests/test_setBatchSubjectLevelResults.m index b8f4d636..6ca6d728 100644 --- a/tests/test_setBatchSubjectLevelResults.m +++ b/tests/test_setBatchSubjectLevelResults.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setBatchSubjectLevelResults %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_setFields.m b/tests/test_setFields.m index dceeb75b..04412fd3 100644 --- a/tests/test_setFields.m +++ b/tests/test_setFields.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_setFields %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_cleanCrash.m b/tests/test_unit_cleanCrash.m index ae8cbfbe..55deacc7 100644 --- a/tests/test_unit_cleanCrash.m +++ b/tests/test_unit_cleanCrash.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_cleanCrash %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_copyGraphWindownOutput.m b/tests/test_unit_copyGraphWindownOutput.m index b0698f7b..27d603e3 100644 --- a/tests/test_unit_copyGraphWindownOutput.m +++ b/tests/test_unit_copyGraphWindownOutput.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_copyGraphWindownOutput %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_createDataDictionary.m b/tests/test_unit_createDataDictionary.m index ba1aeecf..f9bbe888 100644 --- a/tests/test_unit_createDataDictionary.m +++ b/tests/test_unit_createDataDictionary.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_createDataDictionary %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_createGlmDirName.m b/tests/test_unit_createGlmDirName.m index c99b3fec..67765e2d 100644 --- a/tests/test_unit_createGlmDirName.m +++ b/tests/test_unit_createGlmDirName.m @@ -1,4 +1,4 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers +% (C) Copyright 2021 CPP_SPM developers function test_suite = test_unit_createGlmDirName %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getFuncVoxelDims.m b/tests/test_unit_getFuncVoxelDims.m index 2e70c5d5..929e0195 100644 --- a/tests/test_unit_getFuncVoxelDims.m +++ b/tests/test_unit_getFuncVoxelDims.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_getFuncVoxelDims %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getGrpLevelContrastToCompute.m b/tests/test_unit_getGrpLevelContrastToCompute.m index 5947e431..368ca7a8 100644 --- a/tests/test_unit_getGrpLevelContrastToCompute.m +++ b/tests/test_unit_getGrpLevelContrastToCompute.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_getGrpLevelContrastToCompute %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getInfo.m b/tests/test_unit_getInfo.m index ec5198ca..6e948881 100644 --- a/tests/test_unit_getInfo.m +++ b/tests/test_unit_getInfo.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_getInfo %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getPrefix.m b/tests/test_unit_getPrefix.m index 27e2e50f..619a9e91 100644 --- a/tests/test_unit_getPrefix.m +++ b/tests/test_unit_getPrefix.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_getPrefix %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getSliceOrder.m b/tests/test_unit_getSliceOrder.m index 379e0ab1..543c141e 100644 --- a/tests/test_unit_getSliceOrder.m +++ b/tests/test_unit_getSliceOrder.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_getSliceOrder %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_getSubjectList.m b/tests/test_unit_getSubjectList.m index 880c1d89..fd9a0c8e 100644 --- a/tests/test_unit_getSubjectList.m +++ b/tests/test_unit_getSubjectList.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_getSubjectList %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_manageWorkersPool.m b/tests/test_unit_manageWorkersPool.m index b7c6c6f8..159ae73a 100644 --- a/tests/test_unit_manageWorkersPool.m +++ b/tests/test_unit_manageWorkersPool.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_manageWorkersPool %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_returnDefaultResultsStructure.m b/tests/test_unit_returnDefaultResultsStructure.m index 8ef9ec10..6e7df827 100644 --- a/tests/test_unit_returnDefaultResultsStructure.m +++ b/tests/test_unit_returnDefaultResultsStructure.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_returnDefaultResultsStructure %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_returnEmptyModel.m b/tests/test_unit_returnEmptyModel.m index cb006589..2b8525bb 100644 --- a/tests/test_unit_returnEmptyModel.m +++ b/tests/test_unit_returnEmptyModel.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_returnEmptyModel %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_setDerivativesDir.m b/tests/test_unit_setDerivativesDir.m index 4df4a2cc..6cf46f8c 100644 --- a/tests/test_unit_setDerivativesDir.m +++ b/tests/test_unit_setDerivativesDir.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_setDerivativesDir %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_specifyContrasts.m b/tests/test_unit_specifyContrasts.m index 373a13c5..01332c50 100644 --- a/tests/test_unit_specifyContrasts.m +++ b/tests/test_unit_specifyContrasts.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_specifyContrasts %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_unit_validationInputFile.m b/tests/test_unit_validationInputFile.m index 29ad4135..d76c0537 100644 --- a/tests/test_unit_validationInputFile.m +++ b/tests/test_unit_validationInputFile.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_unit_validationInputFile %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_utils.m b/tests/test_utils.m index ec276918..38efe2b1 100644 --- a/tests/test_utils.m +++ b/tests/test_utils.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_utils %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/test_writeDatasetDescription.m b/tests/test_writeDatasetDescription.m index a88804f7..af922521 100644 --- a/tests/test_writeDatasetDescription.m +++ b/tests/test_writeDatasetDescription.m @@ -1,4 +1,4 @@ -% (C) Copyright 2020 CPP BIDS SPM-pipeline developers +% (C) Copyright 2020 CPP_SPM developers function test_suite = test_writeDatasetDescription %#ok<*STOUT> try % assignment of 'localfunctions' is necessary in Matlab >= 2016 diff --git a/tests/utils/defaultOptions.m b/tests/utils/defaultOptions.m index 5c7211f8..d258de43 100644 --- a/tests/utils/defaultOptions.m +++ b/tests/utils/defaultOptions.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function expectedOptions = defaultOptions(taskName) + % + % (C) Copyright 2021 CPP_SPM developers expectedOptions.sliceOrder = []; expectedOptions.STC_referenceSlice = []; diff --git a/tests/utils/setOptions.m b/tests/utils/setOptions.m index 9e12acb8..6717eb29 100644 --- a/tests/utils/setOptions.m +++ b/tests/utils/setOptions.m @@ -1,6 +1,6 @@ -% (C) Copyright 2021 CPP BIDS SPM-pipeline developers - function opt = setOptions(task, subLabel) + % + % (C) Copyright 2021 CPP_SPM developers thisDir = fileparts(mfilename('fullpath')); @@ -15,6 +15,9 @@ opt.taskName = 'auditory'; + opt.result.Steps.Contrasts(1).Name = 'listening'; + opt.result.Steps.Contrasts(2).Name = 'listening_inf_baseline'; + else opt.taskName = task; diff --git a/version.txt b/version.txt index 81fd7ba0..60453e69 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.2.0 \ No newline at end of file +v1.0.0 \ No newline at end of file