From 6b2b192fe0769468dc47d7e4f41c335809597832 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 8 Jul 2024 10:34:20 +0200 Subject: [PATCH] [FIX] Remove goodness of fit for dataset level and update container definitions (#1265) * misc fix * rm GoF for dataset level * install java * add zip * update changelog * add unzip * fix tests --- .circleci/config.yml | 1 + CHANGELOG.md | 13 +++++++++++-- Dockerfile | 18 ++++++++++-------- bidspm.def | 17 ++++++++++------- demos/openneuro/Makefile | 2 +- src/batches/stats/setBatchEstimateModel.m | 1 - .../tests_workflows/stats/test_bidsRFX.m | 16 +++++++--------- 7 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57d0f2389..16cd09acb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,6 +202,7 @@ jobs: --space MNI152NLin2009cAsym \ --skip_validation \ --fwhm 0 \ + --participant_label 01 02 \ --verbosity 3 \ --options /options/ds000001.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c37c6551..bfb9e9a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* [ENH] add Apptainer definition #1254 by @Remi-Gau and @monique2208 * [ENH] allow to copy anat only on raw datasets #1181 by @Remi-Gau * [ENH] add option to concatenate runs at subject level to facilite running PPI analysis #1133 by @Remi-Gau * [ENH] allow to run substeps of substeps of the bayesian model selection #1145 by @Remi-Gau @@ -40,7 +41,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* [DOC] change theme and structure of the documentation #1256 @Remi-Gau * [REF] Refactor and update CLI in #1096 @Remi-Gau +* [ENH] {func}`getData` only loads anat data when requested #1257 @Remi-Gau ### Deprecated @@ -50,12 +53,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +* [FIX] update {func}`createDefaultStatsModel` to use proper `GroupBy` at the dataset level #1248 by @d-ni374 +* [FIX] make {func}`getAcquisitionTime` less brittle #1248 by @d-ni374 +* [FIX] fix regular expression in {func}`bidsResults` to identify contrasts #1248 by @d-ni374 +* [FIX] pass analysis level to stats actions when using python CLI #1258 @Remi-Gau +* [FIX] remove goodness of fit from dataset level analysis as it is not supported by the MACS toolbox #1265 by @Remi-Gau +* [FIX] add java and zip to container recipes to allow using nidm results with octave #1265 by @Remi-Gau * [FIX] copy the MACS toolbox to the SPM toolbox folder during the initialisation #1203 by @Remi-Gau -* [FIX] save onsets.mat directly in subject stats folder #1187 by @Remi-Gau +* [FIX] save `onsets.mat` directly in subject stats folder #1187 by @Remi-Gau * [FIX] do not compute subject level contrast when running dataset level #1102 by @Remi-Gau * [FIX] copy `RepetitionTime` in sidecar JSON after running smoothing in #1099 by @Remi-Gau * [FIX] rename results files (csv, tsv, png, nii) of each contrasts #1104 by @Remi-Gau -* [DIX] reslice ROIS before running ROI based analysis to make sure they are at the resolution of the BOLD images in #1110 by @Remi-Gau +* [FIX] reslice ROIS before running ROI based analysis to make sure they are at the resolution of the BOLD images in #1110 by @Remi-Gau ### Security diff --git a/Dockerfile b/Dockerfile index 38adbb223..66b6dc7d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,25 +5,28 @@ ARG DEBIAN_FRONTEND="noninteractive" ## basic OS tools install octave RUN apt-get update -qq && \ apt-get -qq -y --no-install-recommends install \ - build-essential \ - software-properties-common \ apt-utils \ + build-essential \ ca-certificates \ - git \ curl \ - python3 \ - python3-pip \ + default-jre \ fonts-freefont-otf \ ghostscript \ + git \ gnuplot-x11 \ libcurl4-gnutls-dev \ - octave \ liboctave-dev \ + octave \ octave-common \ octave-io \ octave-image \ octave-signal \ - octave-statistics && \ + octave-statistics \ + python3-pip \ + python3 \ + software-properties-common \ + unzip \ + zip && \ apt-get clean && \ rm -rf \ /tmp/hsperfdata* \ @@ -42,7 +45,6 @@ RUN mkdir /opt/spm12 && \ make -C /opt/spm12/src PLATFORM=octave install && \ ln -s /opt/spm12/bin/spm12-octave /usr/local/bin/spm12 - WORKDIR /home/neuro COPY . /home/neuro/bidspm diff --git a/bidspm.def b/bidspm.def index f5f118de8..e4929b0a8 100644 --- a/bidspm.def +++ b/bidspm.def @@ -13,25 +13,28 @@ From: bids/base_validator:1.13.1 %post apt-get -qq update DEBIAN_FRONTEND=noninteractive apt-get --yes --quiet install \ - build-essential \ - software-properties-common \ apt-utils \ + build-essential \ ca-certificates \ - git \ curl \ - python3 \ - python3-pip \ + default-jre \ fonts-freefont-otf \ ghostscript \ + git \ gnuplot-x11 \ libcurl4-gnutls-dev \ - octave \ liboctave-dev \ + octave \ octave-common \ octave-io \ octave-image \ octave-signal \ - octave-statistics && \ + octave-statistics \ + python3-pip \ + python3 \ + software-properties-common \ + unzip \ + zip && \ apt-get clean && \ rm -rf \ /tmp/hsperfdata* \ diff --git a/demos/openneuro/Makefile b/demos/openneuro/Makefile index f60d53e44..5d1fce65e 100644 --- a/demos/openneuro/Makefile +++ b/demos/openneuro/Makefile @@ -23,7 +23,7 @@ data_ds000001: cd inputs/ds000001-fmriprep && datalad get sub-0[1-2]/func/*json -J 12 cd inputs/ds000001-fmriprep && datalad get sub-0[1-2]/anat/*MNI*desc-preproc*.nii.gz -J 12 cd inputs/ds000001-fmriprep && datalad get sub-0[1-2]/func/*MNI*desc-preproc*.nii.gz -J 12 - cd inputs/ds000001-fmriprep && datalad get sub-0[1-2]/func/*MNI*desc-*bold.nii.gz -J 12 + cd inputs/ds000001-fmriprep && datalad get sub-0[1-2]/func/*MNI*desc-*bold.nii.gz -J 12 data_ds000114: mkdir -p inputs diff --git a/src/batches/stats/setBatchEstimateModel.m b/src/batches/stats/setBatchEstimateModel.m index 762385878..bf81c67e3 100644 --- a/src/batches/stats/setBatchEstimateModel.m +++ b/src/batches/stats/setBatchEstimateModel.m @@ -91,7 +91,6 @@ matlabbatch = returnEstimateModelBatch(matlabbatch, spmMatFile, opt); opt.orderBatches.estimate = numel(matlabbatch); - matlabbatch = setBatchGoodnessOfFit(matlabbatch, opt); matlabbatch = setBatchInformationCriteria(matlabbatch, opt, rfxDir); matlabbatch{end + 1}.spm.stats.review.spmmat = spmMatFile; %#ok<*AGROW> diff --git a/tests/tests_slow/tests_workflows/stats/test_bidsRFX.m b/tests/tests_slow/tests_workflows/stats/test_bidsRFX.m index ea3965f48..0e78db53c 100644 --- a/tests/tests_slow/tests_workflows/stats/test_bidsRFX.m +++ b/tests/tests_slow/tests_workflows/stats/test_bidsRFX.m @@ -19,7 +19,7 @@ function test_bidsRFX_rfx() % 2 dummy contrasts % 2 contrasts nbGroupLevelModels = 4; - nbBatchPerModel = 8; + nbBatchPerModel = 7; if bids.internal.is_octave() nbBatchPerModel = 5; end @@ -35,7 +35,7 @@ function test_bidsRFX_rfx() % setBatchEstimateModel creates 3 batches for each model (estimate, review, figure) batchOrder = extendBatchOrder(); - idx = 9:6:(nbGroupLevelModels * nbBatchPerModel); + idx = 9:5:(nbGroupLevelModels * nbBatchPerModel); if bids.internal.is_octave() idx = 9:3:(nbGroupLevelModels * nbBatchPerModel); end @@ -57,7 +57,7 @@ function test_bidsRFX_no_overwrite_smoke_test() matlabbatch = bidsRFX('RFX', opt); - expectedNbBatch = 8; + expectedNbBatch = 7; if bids.internal.is_octave() expectedNbBatch = 5; end @@ -80,14 +80,13 @@ function test_bidsRFX_within_group_ttest() if bids.internal.is_octave() assertEqual(numel(matlabbatch), 10); else - assertEqual(numel(matlabbatch), 16); + assertEqual(numel(matlabbatch), 14); end % creates 1 batch for % - specify % - figure % - estimate - % - MACS: goodness of fit % - MACS: model space % - MACS: information criteria % - review @@ -110,7 +109,7 @@ function test_bidsRFX_within_group_ttest() fileparts(matlabbatch{8}.spm.stats.fmri_est.spmmat{1})); else assertEqual(matlabbatch{3}.spm.stats.factorial_design.dir{1}, ... - fileparts(matlabbatch{11}.spm.stats.fmri_est.spmmat{1})); + fileparts(matlabbatch{10}.spm.stats.fmri_est.spmmat{1})); end end @@ -191,7 +190,7 @@ function test_bidsRFX_several_datasets_level() assertEqual(summary, batchOrder); nbGroupLevelModelsReturned = 1; - nbBatchPerModel = 8; + nbBatchPerModel = 7; if bids.internal.is_octave() nbBatchPerModel = 5; end @@ -250,13 +249,12 @@ function test_bidsRFX_contrast() batchOrder = {}; end extension = {'stats', 'fmri_est'; ... - 'tools', 'MACS'; ... % skip on octave 'tools', 'MACS'; ... 'tools', 'MACS'; ... 'stats', 'review'; ... 'util', 'print'}; if bids.internal.is_octave() - extension(2:4, :) = []; + extension(2:3, :) = []; end batchOrder = cat(1, batchOrder, extension); end