CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
535 stars 180 forks source link

Wang weights issue from v2.3 to v2.4 #439

Closed francescobrun closed 1 year ago

francescobrun commented 1 year ago

Expected Behavior

Very same projection dataset acquired in "half-beam" mode (i.e. 360 deg rotation and detector offset) and reconstructed with FDK and Wang weights. When upgrading from v2.3 (on the left in the next figure) to v2.4 (on the right) no variations are expected. However, a ring artifact occurs.

image

Specifications

AnderBiguri commented 1 year ago

Hi @francescobrun , thanks for raising this up! Indeed something is off, I will investigate.

AnderBiguri commented 1 year ago

Hi again @francescobrun . Would it be possible for you to provide a script with the right geometry and recon call, but with the TIGRE headPhantom, so I can try to reproduce exactly the effect?

francescobrun commented 1 year ago

Sure! Here it is:

%% Parameters:
ssd       = 650.0/1.614;  % Source-to-sample distance [mm]
sdd       = 650 - ssd;    % Sample-to-detector distance [mm]
px        = 0.062;        % Projections pixel size [mm]
det_col   = 512;
det_row   = 402;
nr_proj   = 720;

cor       = 0.0;         % Center of rotation [mm]
offset_u  = -9.0;        % [mm]
offset_v  = 0.0;         % [mm]
roll_deg  = -0.3;        % [degrees]
pitch_deg = 0.0;         % [degrees]
yaw_deg   = 0.0;         % [degrees]

%% Geometry:

ang_tot   = deg2rad(360.0 - 360.0/nr_proj);
magn      = (ssd + sdd) / ssd;
vol_px    = (px / magn);  
angles    = fliplr(linspace(0,ang_tot,nr_proj));

% TIGRE geometry:
geo.DSD = ssd + sdd;                          % Distance Source Detector      (mm)
geo.DSO = ssd;                                % Distance Source Origin        (mm)
geo.nDetector = [det_col; det_row];           % number of pixels              (px)
geo.dDetector = [px; px];                     % size of each pixel            (mm)
geo.sDetector = geo.nDetector.*geo.dDetector; % total size of the detector    (mm)
out_col = det_col + abs(round((offset_u)/px))*2;
geo.nVoxel = [out_col; out_col; det_row];     % number of voxels              (vx)
geo.sVoxel = geo.nVoxel.*vol_px;              % total size of the image       (mm)
geo.dVoxel = geo.sVoxel./geo.nVoxel;          % size of each voxel            (mm)
geo.offOrigin = [0;0;0];                      % Offset of image from origin   (mm)
geo.offDetector = [offset_u; offset_v];       % Offset of Detector
geo.rotDetector = deg2rad([roll_deg; pitch_deg; yaw_deg]);
geo.COR  = cor*px;
geo.mode = 'cone';
geo.accuracy = 0.5;            % Accuracy of FWD proj          (vx/sample)

%% Generate projections:

head = headPhantom(geo.nVoxel);
projections = Ax(head, geo, angles, 'interpolated');
noise_projections = addCTnoise(projections);

%% FDK reconstruction and display:

rec_FDK = FDK(noise_projections, geo, angles, 'parker', false, 'wang', true);
figure, sliceViewer(rec_FDK);
AnderBiguri commented 1 year ago

Hi @francescobrun !

Using the latest commit in master this seems to not happen, the FDK recon is correct. I assume this was a bug in 2.4 that has since been corrected, so either download the latest master branch, or wait until 2.5, when the error won't be there :)

Thanks for the message!

francescobrun commented 1 year ago

Many thanks for all the efforts you put in this software. TIGRE is indeed a valuable tool for our lab. Thanks again!