From 6205f3fcc68be3d49fa5b47a02a65c21ffc53930 Mon Sep 17 00:00:00 2001 From: Folkert Bleichrodt Date: Mon, 14 Mar 2016 13:18:02 +0100 Subject: Removed regression from opTomo --- matlab/tools/opTomo.m | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'matlab/tools/opTomo.m') diff --git a/matlab/tools/opTomo.m b/matlab/tools/opTomo.m index 33c8565..04b3634 100644 --- a/matlab/tools/opTomo.m +++ b/matlab/tools/opTomo.m @@ -176,12 +176,23 @@ classdef opTomo < opSpot if issparse(x) x = full(x); end + + if isa(x, 'double') + isdouble = true; + x = single(x); + else + isdouble = false; + end % the multiplication y = op.funHandle(op, x, mode); % make sure output is column vector y = y(:); + + if isdouble + y = double(y); + end end % multiply @@ -206,11 +217,7 @@ classdef opTomo < opSpot astra_mex_algorithm('iterate', op.fp_alg_id); % retrieve Matlab array - if isa(x, 'single') - y = astra_mex_data2d('get_single', op.sino_id); - else - y = astra_mex_data2d('get', op.sino_id); - end + y = astra_mex_data2d('get_single', op.sino_id); else % x is passed as a vector, reshape it into a sinogram. x = reshape(x, op.proj_size); @@ -222,11 +229,7 @@ classdef opTomo < opSpot astra_mex_algorithm('iterate', op.bp_alg_id); % retrieve Matlab array - if isa(x, 'single') - y = astra_mex_data2d('get_single', op.vol_id); - else - y = astra_mex_data2d('get', op.vol_id); - end + y = astra_mex_data2d('get_single', op.vol_id); end end % opTomo_intrnl2D -- cgit v1.2.3