Skip to content

Commit 2c474cf

Browse files
committed
fix tests octave
1 parent 1a8e842 commit 2c474cf

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ When you have set up your repo
1414
[![Build Status](https://travis-ci.com/Remi-gau/template_matlab_analysis.svg?branch=master)](https://travis-ci.com/Remi-gau/template_matlab_analysis)
1515
1616
-->
17+
1718
# spm_2_bids
1819

1920
Small code base to help convert the MRI spm output to a valid bids derivatives.

init_spm_2_bids.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
if is_octave
2424

25+
more off;
26+
2527
% Exit if min version is not satisfied
2628
if ~compare_versions(OCTAVE_VERSION, OCTAVE_VER, '>=')
2729
error('Minimum required Octave version: %s', OCTAVE_VER);

lib/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ This code requires:
44

55
- SPM12 for some actions ???
66

7-
- [BIDS-matlab](https://github.com/bids-standard/bids-matlab) from commi
8-
[b7732b0cb](https://github.com/bids-standard/bids-matlab/commit/b7732b0cb2103ee0cfa095ee604bee4086844cad)
9-
or later. In doubt use the `dev` branch of bids-matlab.
7+
- [BIDS-matlab](https://github.com/bids-standard/bids-matlab) ; version 0.1.0

src/defaults/Mapping.m

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,31 +164,30 @@
164164
% map = map.default;
165165
%
166166

167-
prfx_spec = { ...
168-
{ obj.bias_cor }, obj.cfg.segment.bias_corrected; ...
167+
prfx_spec = {{ obj.bias_cor }, obj.cfg.segment.bias_corrected; ...
169168
{ 'c1' }, obj.cfg.segment.gm; ...
170169
{ 'c2' }, obj.cfg.segment.wm; ...
171170
{ 'c3' }, obj.cfg.segment.csf; ...
172171
{ 'iy_' }, obj.cfg.segment.deformation_field.from_mni; ...
173172
{ 'y_' }, obj.cfg.segment.deformation_field.to_mni; ...
174-
{ 'segparam_' }, obj.cfg.segment.param; ...
175-
{ obj.stc, [obj.unwarp, obj.stc]}, obj.cfg.stc; ...
176-
{ 'unwarpparam_' }, obj.cfg.realign_unwarp_param; ...
177-
{ obj.unwarp }, obj.cfg.realign_unwarp; ...
178-
{ 'rp_', ['rp_' obj.stc] }, obj.cfg.real_param; ...
173+
{ 'segparam_' }, obj.cfg.segment.param; ...
174+
{ obj.stc, [obj.unwarp, obj.stc]}, obj.cfg.stc; ...
175+
{ 'unwarpparam_' }, obj.cfg.realign_unwarp_param; ...
176+
{ obj.unwarp }, obj.cfg.realign_unwarp; ...
177+
{ 'rp_', ['rp_' obj.stc] }, obj.cfg.real_param; ...
179178
{ 'mean', ...
180179
['mean' obj.unwarp], ...
181-
['mean' obj.unwarp, obj.stc] }, obj.cfg.mean; ...
180+
['mean' obj.unwarp, obj.stc] }, obj.cfg.mean; ...
182181
{ obj.norm, ...
183182
[obj.norm, obj.bias_cor], ...
184183
[obj.norm, obj.unwarp, obj.stc], ...
185184
[obj.norm, obj.realign, obj.stc], ...
186185
[obj.norm, obj.unwarp], ...
187-
[obj.norm, obj.realign] }, obj.cfg.preproc_norm; ...
188-
{ [obj.norm, 'mean', obj.unwarp] }, obj.cfg.normalized_mean; ...
189-
{ [obj.norm, 'c1'] }, obj.cfg.segment.gm_norm; ...
190-
{ [obj.norm, 'c2'] }, obj.cfg.segment.wm_norm; ...
191-
{ [obj.norm, 'c3'] }, obj.cfg.segment.csf_norm; ...
186+
[obj.norm, obj.realign] }, obj.cfg.preproc_norm; ...
187+
{ [obj.norm, 'mean', obj.unwarp] }, obj.cfg.normalized_mean; ...
188+
{ [obj.norm, 'c1'] }, obj.cfg.segment.gm_norm; ...
189+
{ [obj.norm, 'c2'] }, obj.cfg.segment.wm_norm; ...
190+
{ [obj.norm, 'c3'] }, obj.cfg.segment.csf_norm; ...
192191
{[obj.smooth, obj.norm], ...
193192
[obj.smooth, obj.norm, obj.unwarp, obj.stc], ...
194193
[obj.smooth, obj.norm, obj.realign, obj.stc], ...
@@ -198,8 +197,7 @@
198197
[obj.smooth, obj.unwarp, obj.stc], ...
199198
[obj.smooth, obj.realign, obj.stc], ...
200199
[obj.smooth, obj.unwarp], ...
201-
[obj.smooth, obj.realign]}, obj.cfg.smooth
202-
};
200+
[obj.smooth, obj.realign]}, obj.cfg.smooth};
203201

204202
for i_map = 1:size(prfx_spec, 1)
205203
obj = obj.add_mapping('prefix', prfx_spec{i_map, 1}, ...

tests/test_spm_2_bids.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ function test_spm_2_bids_no_prefix()
9292

9393
function test_spm_2_bids_unknown_prefix()
9494

95+
if is_octave()
96+
return
97+
end
98+
9599
file = 'wtfsub-01_ses-02_T1w.nii';
96100
assertWarning( ...
97101
@()spm_2_bids(file), ...

0 commit comments

Comments
 (0)