Skip to content

Commit 9ec4d4a

Browse files
committed
deal source for some wmean* images
1 parent 52be622 commit 9ec4d4a

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

miss_hit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ copyright_entity: "spm_2_bids developers"
1717
# metric for code quality
1818
metric "cnest": limit 5
1919
metric "file_length": limit 500
20-
metric "cyc": limit 13
21-
metric "parameters": limit 5
20+
metric "cyc": limit 16
21+
metric "parameters": limit 6

src/utils/identify_sources.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
end
6262

63-
bf = bids.File(derivatives, 'verbose', verbose);
63+
bf = bids.File(derivatives, 'verbose', verbose, 'use_schema', false);
6464

6565
if prefix_based
6666
if numel(bf.prefix) < 2
@@ -82,6 +82,16 @@
8282
elseif startsWith(bf.prefix, 'rp_a')
8383
bf.prefix = bf.prefix(4:end);
8484

85+
elseif startsWith(bf.prefix, 'mean')
86+
% TODO mean may involve several files from the source (across runs
87+
% and sessions
88+
% prefixes = {
89+
% 'mean'
90+
% 'meanu'
91+
% 'meanua'
92+
% };
93+
return
94+
8595
else
8696
% no idea
8797
return

tests/test_identify_sources.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
initTestSuite;
99
end
1010

11+
function test_identify_sources_mean()
12+
13+
func_file = 'sub-01_task-auditory_bold.nii';
14+
15+
prefix_output = {
16+
'wmeanua', 'sub-01_task-auditory_space-individual_desc-mean_bold.nii'
17+
'wmeanu', 'sub-01_task-auditory_space-individual_desc-mean_bold.nii'
18+
'wmeanau', 'sub-01_task-auditory_space-individual_desc-mean_bold.nii'
19+
};
20+
21+
for i = 1:size(prefix_output, 1)
22+
23+
sources = identify_sources([prefix_output{i, 1} func_file], [], false);
24+
25+
assertEqual(sources, fullfile('sub-01', prefix_output{i, 2}));
26+
27+
end
28+
29+
end
30+
1131
function test_identify_sources_anat()
1232

1333
anat_file = 'sub-01_T1w.nii';
@@ -43,6 +63,7 @@ function test_identify_sources_func()
4363
'swra', 'sub-01_task-auditory_space-IXI549Space_desc-preproc_bold.nii'
4464
'sua', 'sub-01_task-auditory_space-individual_desc-realignUnwarp_bold.nii'
4565
'su', 'sub-01_task-auditory_space-individual_desc-realignUnwarp_bold.nii'
66+
'su', 'sub-01_task-auditory_space-individual_desc-realignUnwarp_bold.nii'
4667
};
4768

4869
for i = 1:size(prefix_output, 1)

0 commit comments

Comments
 (0)