Skip to content

Commit

Permalink
fixed a couple bugs with the new DE input parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
akeeler committed Mar 1, 2024
1 parent 3e742ab commit 08531f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions MATLAB/Utilities/DE/DeDecompose.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
% Load calibrated coefficients for transfer functions


[scanner, calibration_pair, model, tolerance,material1,material2] = parse_inputs(varargin{:});
[scanner, calibration_pair, model, tolerance, material1, material2] = parse_inputs(varargin);

% read NIST database (values in TIGRE)
fid = fopen('./../../../Common/data/dual_energy_calibrations.json');
Expand All @@ -46,7 +46,7 @@
calibration_data = jsondecode(str);

if ~isfield(calibration_data, scanner)
error(['Scanner: ', scanner, ' has not calibration data'])
error(['Scanner: ', scanner, ' has no calibration data'])
end
if ~isfield(calibration_data.(scanner),calibration_pair)
error(['Calibration pair of energies: ', calibration_pair, ' not found in the scanner data'])
Expand Down Expand Up @@ -115,6 +115,7 @@
defaults=ones(length(opts),1);

% check if option has been passed as input
nVarargs = length(argin);
for ii=1:2:nVarargs
ind=find(ismember(opts,lower(argin{ii})));
if ~isempty(ind)
Expand Down Expand Up @@ -161,7 +162,7 @@
end
case 'kVh'
if default
kVh=80;
kVh=140;
else
if ~isscalar(val)
error('TIGRE:DEDecompose:InvalidInput','KVh must be a scalar')
Expand All @@ -170,7 +171,7 @@
end
case 'interpolation'
if default
model='linear';
model='nearest';
else
if ~ischar( val)
error('TIGRE:DEDecompose:InvalidInput','Interpolation must be a string')
Expand Down

0 comments on commit 08531f8

Please sign in to comment.