Skip to content

Commit

Permalink
Allow Diondo helical scans
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderBiguri committed Oct 25, 2024
1 parent 5feec42 commit 3273b4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion MATLAB/Utilities/IO/Diondo/loadDiondoProjections.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
proj(:,:,ii)=-log(proj(:,:,ii)/single(2^16));
end
geo=rmfield(geo,'whitelevel');
%%
if isfield(geo,'offOrigin')
geo.offOrigin = geo.offOrigin(:,index);
end
angles=angles_to_load;
end

Expand Down
16 changes: 12 additions & 4 deletions MATLAB/Utilities/IO/Diondo/readDiondoGeometry.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@

s = readstruct([file.folder,'\',file.name]);

if ~strcmp(s.ScanParameter.HelixMode,'false')
error("Helix mode reading not implemented")
end

if ~strcmp(s.ScanParameter.Laminography, 'false')
error("Laminography mode reading not implemented")
end


geo.offOrigin = [0;0;0];
geo.offDetector = [0;0];

geo.nDetector = [s.Recon.ProjectionDimX; s.Recon.ProjectionDimY];
geo.dDetector = [s.Recon.ProjectionPixelSizeX; s.Recon.ProjectionPixelSizeY];
geo.sDetector = geo.nDetector.*geo.dDetector;
Expand All @@ -31,14 +33,20 @@

geo.DSD = s.Geometrie.SourceDetectorDist;
geo.DSO = s.Geometrie.SourceObjectDist;
geo.COR = s.Recon.ProjectionCenterOffsetX;
geo.COR = -s.Recon.ProjectionCenterOffsetX*s.Recon.ProjectionPixelSizeX;

if s.Recon.ProjectionCount ~= s.Recon.ProjectionCountPer360deg
warning("Never tested with angles not in 360deg. If it doesnt work please contact [email protected] to help improve this loader");
end
angles=linspace(0,2*pi,s.Recon.ProjectionCount);
angles=-angles(1:end-1);

if ~strcmp(s.ScanParameter.HelixMode,'True')
z_step = -s.ScanParameter.HelixPerStepDistanceZ;
offsetz=linspace(0,z_step*length(angles)-z_step,length(angles));
offsetz = offsetz-offsetz(end)/2;
geo.offOrigin=[zeros(1,length(angles));zeros(1,length(angles));offsetz];
end

height = char(s.Geometrie.Slices.string());
height = height(1:strfind(s.Geometrie.Slices.string,"mm")-2);
Expand Down

0 comments on commit 3273b4a

Please sign in to comment.