Skip to content

Commit f5d7bba

Browse files
committed
add case ecat annotation (method) is missing but user provides it
1 parent 0a926ff commit f5d7bba

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

matlab/ecat2nii.m

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,23 @@
239239
end
240240

241241
else % annotation is blank - no info on method
242-
warning('no reconstruction method information found - invalid BIDS metadata')
243-
info.ReconMethodParameterLabels = {'lower_threshold', 'upper_threshold'};
244-
info.ReconMethodParameterUnits = {'keV', 'keV'};
245-
info.ReconMethodParameterValues = [mh.lwr_true_thres, mh.upr_true_thres];
242+
if isfield(info.ReconMethodName) % user provided
243+
[info.ReconMethodName,i,s] = get_recon_method(deblank(info.ReconMethodName));
244+
if ~isempty(i) && ~isempty(s)
245+
info.ReconMethodParameterLabels = {'iterations', 'subsets', 'lower_threshold', 'upper_threshold'};
246+
info.ReconMethodParameterUnits = {'none', 'none', 'keV', 'keV'};
247+
info.ReconMethodParameterValues = [str2double(i), str2double(s), mh.lwr_true_thres, mh.upr_true_thres];
248+
else % some method without iteration and subset e.g. back projection
249+
info.ReconMethodParameterLabels = {'lower_threshold', 'upper_threshold'};
250+
info.ReconMethodParameterUnits = {'keV', 'keV'};
251+
info.ReconMethodParameterValues = [mh.lwr_true_thres, mh.upr_true_thres];
252+
end
253+
else
254+
warning('no reconstruction method information found - invalid BIDS metadata')
255+
info.ReconMethodParameterLabels = {'lower_threshold', 'upper_threshold'};
256+
info.ReconMethodParameterUnits = {'keV', 'keV'};
257+
info.ReconMethodParameterValues = [mh.lwr_true_thres, mh.upr_true_thres];
258+
end
246259
end
247260

248261
else % no info on method

0 commit comments

Comments
 (0)