Skip to content

Commit

Permalink
[FIX] Remove goodness of fit for dataset level and update container d…
Browse files Browse the repository at this point in the history
…efinitions (#1265)

* misc fix

* rm GoF for dataset level

* install java

* add zip

* update changelog

* add unzip

* fix tests
  • Loading branch information
Remi-Gau authored Jul 8, 2024
1 parent c230335 commit 6b2b192
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 28 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
--space MNI152NLin2009cAsym \
--skip_validation \
--fwhm 0 \
--participant_label 01 02 \
--verbosity 3 \
--options /options/ds000001.json
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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* \
Expand All @@ -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
Expand Down
17 changes: 10 additions & 7 deletions bidspm.def
Original file line number Diff line number Diff line change
Expand Up @@ -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* \
Expand Down
2 changes: 1 addition & 1 deletion demos/openneuro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/batches/stats/setBatchEstimateModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
16 changes: 7 additions & 9 deletions tests/tests_slow/tests_workflows/stats/test_bidsRFX.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b2b192

Please sign in to comment.