Skip to content

Commit 39e65b6

Browse files
committed
mh fix
1 parent 542a68d commit 39e65b6

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

src/defaults/Mapping.m

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
%
88
% - mapping : (n X 1) structure with the following fiels
99
%
10-
% - prefix
11-
% - suffix
12-
% - entities
13-
% - ext
10+
% - prefix
11+
% - suffix
12+
% - entities
13+
% - ext
1414
% - name_spec: structure that must resemble the output of bids.internal.parse_filename
15-
%
15+
%
1616
% - cfg : describes the common properties to be used for several names in the output.
1717
% See ``check_cfg``
18-
%
18+
%
1919
% - list of SPM prefixes from ``get_spm_prefix_list()``
2020
%
2121
% - stc = ''
@@ -27,8 +27,8 @@
2727
% - smooth = ''
2828
%
2929
% (C) Copyright 2021 spm_2_bids developers
30-
31-
%TODO add a print_mapping method to allow easy visualization
30+
31+
% TODO add a print_mapping method to allow easy visualization
3232
% of the input --> output relationship
3333

3434
properties
@@ -61,7 +61,7 @@
6161
%
6262
% map = Mapping(cfg)
6363
%
64-
%
64+
%
6565

6666
if nargin == 1
6767
obj.cfg = cfg;
@@ -91,15 +91,15 @@
9191
% map = add_mapping('prefix', prefix, 'suffix', 'entities', 'ext', 'name_spec')
9292
%
9393

94-
%TODO add possibility to pass "filter" arugment that is a structure
94+
% TODO add possibility to pass "filter" arugment that is a structure
9595
% with shape (allows to chain the output from bids parsing)
9696
%
9797
% filter.prefix
9898
% filter.suffix
9999
% filter.entities
100100
% filter.ext
101-
%
102-
101+
%
102+
103103
p = inputParser;
104104

105105
addParameter(p, 'prefix', obj.default_value);
@@ -163,7 +163,7 @@
163163
%
164164
% map = map.default;
165165
%
166-
166+
167167
prfx_spec = { ...
168168
{ obj.bias_cor }, obj.cfg.segment.bias_corrected; ...
169169
{ 'c1' }, obj.cfg.segment.gm; ...
@@ -217,18 +217,18 @@
217217
addParameter(p, 'prefix', @ischar);
218218

219219
parse(p, varargin{:});
220-
220+
221221
available_mapped_prefixes = {obj.mapping.prefix}';
222-
222+
223223
idx = strcmp(p.Results.prefix, available_mapped_prefixes);
224224

225225
end
226-
226+
227227
function obj = rm_mapping(obj, idx)
228228

229-
obj.mapping(idx) = [];
229+
obj.mapping(idx) = [];
230230

231-
end
231+
end
232232

233233
end
234234
end

src/defaults/check_cfg.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
'mode', 'image'), ...
123123
'suffix', 'xfm');
124124

125-
segment.param = struct('label', 'TBD', 'suffix', 'segparam');
126-
125+
segment.param = struct('label', 'TBD', 'suffix', 'segparam');
126+
127127
fields_to_set.segment = segment;
128128

129129
% Preprocessed data

src/spm_2_bids.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
% :param file: SPM preprocessed filename (can be fullpath);
1111
% for example ``wmsub-01_ses-01_T1w.nii``
1212
% :type file: string
13-
% :param map: optional spm_2_bids map to overwrite the default
13+
% :param map: optional spm_2_bids map to overwrite the default
1414
% map (see Mapping)
1515
% :param map: Mapping object
1616
%
@@ -33,9 +33,9 @@
3333

3434
mapping = map.mapping;
3535
cfg = map.cfg;
36-
36+
3737
use_suffix_as_label = false;
38-
38+
3939
% deal with suffixes modified by SPM
4040
% turns them into prefixes that can be handled by the default mapping
4141
if strfind(file, '_uw.mat') %#ok<*STRIFCND>
@@ -64,13 +64,13 @@
6464

6565
% TODO se if some of the bids-query machinery cannot be kept for identifying
6666
% the right mapping
67-
67+
6868
% look for the right prefix in the mapping
6969
prefix_match = map.find_mapping('prefix', p.prefix);
7070

7171
% TODO implement methods in Mapping to filter by suffix / extention /
7272
% entities
73-
73+
7474
% if any suffix / extention mentioned in the mapping we check for that as well
7575
% if none is mentioned anywhere in the mapping then anything goes
7676
suffix_match = true(size(mapping));
@@ -118,7 +118,7 @@
118118
end
119119

120120
if isempty(spec)
121-
%TODO this warning should probably go in the find_mapping methods
121+
% TODO this warning should probably go in the find_mapping methods
122122
msg = sprintf('Unknown prefix: %s', p.prefix);
123123
warning('spm_2_bids:unknownPrefix', msg); %#ok<SPWRN>
124124
return
@@ -127,7 +127,7 @@
127127
spec = add_fwhm_to_smooth_label(spec, cfg);
128128

129129
spec = adapt_from_label_to_input(spec, p);
130-
130+
131131
if use_suffix_as_label
132132
spec.entities.label = p.suffix;
133133
end

tests/test_spm_2_bids.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
function test_spm_2_bids_suffix()
1212

1313
input_output = {
14-
'sub-01_T1w_seg8.mat', 'sub-01_label-T1w_segparam.mat';
15-
'sub-01_task-auditory_bold_uw.mat', 'sub-01_task-auditory_label-bold_unwarpparam.mat'};
14+
'sub-01_T1w_seg8.mat', 'sub-01_label-T1w_segparam.mat'
15+
'sub-01_task-auditory_bold_uw.mat', 'sub-01_task-auditory_label-bold_unwarpparam.mat'};
1616

1717
for i = 1:numel(size(input_output, 1))
1818

19-
print_here('%s\n', input_output{i,1});
19+
print_here('%s\n', input_output{i, 1});
2020

21-
filename = spm_2_bids(input_output{i,1});
21+
filename = spm_2_bids(input_output{i, 1});
2222

2323
expected = input_output{i, 2};
2424
assertEqual(filename, expected);

0 commit comments

Comments
 (0)