Skip to content

Commit ae7fa4b

Browse files
authored
[FIX] remove dummies from preproc and not raw when using cli (#1057)
* remove dummies from preproc when using cli * update changelog * octave fix * fix link
1 parent 8d8a32d commit ae7fa4b

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
## [Unreleased]
2323

24-
<!-- **Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v3.0.0...v3.1.0 -->
24+
<!-- **Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v3.0.0...v3.1.0 -->
2525

2626
### Added
2727

@@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5757

5858
### Fixed
5959

60+
* [FIX] remove dummies from preproc dataset and not raw dataset when using CLI (#1057) @Remi-Gau
6061
* [FIX] skip smoothing when running bidspm prepoc in dryRun (#1054) @Remi-Gau
6162
* [FIX] handle phase entity in filename (#1034) @Remi-Gau
6263
* [FIX] fix group level results after contrasts smoothing (#1021) @Remi-Gau
@@ -75,7 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7576

7677
## [3.0.0] - 2022-12-14
7778

78-
**Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v2.3.0...v3.0.0
79+
**Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v2.3.0...v3.0.0
7980

8081
### Changed
8182

@@ -106,7 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
106107

107108
## [2.3.0] - 2022-11-22
108109

109-
**Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v2.2.0...v2.3.0
110+
**Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v2.2.0...v2.3.0
110111

111112
- `bidspm` main function:
112113
- saving options are saved to help with bug report
@@ -141,7 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
141142

142143
## [2.2.0] - 2022-10-29
143144

144-
**Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v2.1.0...v2.2.0
145+
**Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v2.1.0...v2.2.0
145146

146147
### Added
147148

@@ -164,7 +165,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
164165

165166
## [2.1.0] - 2022-07-21
166167

167-
**Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v2.0.0...v2.0.1
168+
**Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v2.0.0...v2.0.1
168169

169170
### Added
170171

@@ -213,7 +214,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
213214

214215
## [2.0.0] - 2022-07-10
215216

216-
**Full Changelog**: https://github.com/cpp-lln-lab/CPP_SPM/compare/v1.1.5...v2.0.0
217+
**Full Changelog**: https://github.com/cpp-lln-lab/bidspm/compare/v1.1.5...v2.0.0
217218

218219
### Added
219220

bidspm.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ function preprocess(args)
274274
end
275275
bidsCopyInputFolder(opt);
276276
if opt.dummy_scans > 0
277-
bidsRemoveDummies(opt, ...
278-
'dummyScans', opt.dummy_scans, ...
277+
tmpOpt = opt;
278+
tmpOpt.dir.input = tmpOpt.dir.preproc;
279+
bidsRemoveDummies(tmpOpt, ...
280+
'dummyScans', tmpOpt.dummy_scans, ...
279281
'force', false);
280282
end
281283
bidsCheckVoxelSize(opt);

src/workflows/preproc/bidsRemoveDummies.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ function bidsRemoveDummies(varargin)
66
%
77
% bidsRemoveDummies(opt, 'dummyScans', someInteger, 'force', false)
88
%
9-
% :type opt: structure
109
% :param opt: Options chosen for the analysis.
1110
% See also: checkOptions
1211
% ``checkOptions()`` and ``loadAndCheckOptions()``.
1312
% :type opt: structure
1413
%
1514
% :param dummyScans: number of volumes to remove
16-
% :type dummyScans: integer >= 0
15+
% :type dummyScans: integer >= 0
1716
%
1817
% :param force: use ``'force', true`` to remove dummy scans even if metadata say
1918
% they have already been removed
20-
% :type force: boolean
19+
% :type force: boolean
2120
%
2221
% EXAMPLE::
2322
%
@@ -69,6 +68,7 @@ function bidsRemoveDummies(varargin)
6968

7069
filter = opt.bidsFilterFile.bold;
7170
filter.ext = '\.nii.*$';
71+
filter.prefix = '';
7272
filter.task = opt.taskName;
7373
filter.desc = '';
7474
filter.space = '';

tests/tests_workflows/preproc/test_bidsRemoveDummies.m

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@
1010

1111
function test_bidsRemoveDummies_basic()
1212

13+
if bids.internal.is_octave()
14+
tmpDir = fullfile(tempname);
15+
else
16+
tmpDir = fullfile(tempname, 'raw');
17+
end
18+
spm_mkdir(tmpDir);
1319
opt = setOptions('MoAE');
14-
bidsRemoveDummies(opt, 'dummyScans', 12, 'force', false);
20+
copyfile(opt.dir.raw, tmpDir);
21+
22+
if bids.internal.is_octave()
23+
tmpDir = fullfile(tmpDir, 'raw');
24+
end
25+
opt.dir.raw = tmpDir;
26+
opt.dir.input = tmpDir;
27+
bidsRemoveDummies(opt, 'dummyScans', 20, 'force', false);
1528

1629
end

0 commit comments

Comments
 (0)