Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ docs/package-lock.json
# the .bin into docs/notebooks/data/xcat/ (default path, symlink-friendly).
docs/notebooks/data/

# Pluto cell-output caches written by PlutoSpace / pluto-collab — large
# (tens of MB), regenerated on every run, never tracked.
*.pluto-cache.toml

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
Expand Down
Binary file modified docs/assets/dual_kvp_vmi_projection_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/dual_kvp_vmi_projection_monoplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/dual_kvp_vmi_water_noise_vs_energy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_projection_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_projection_monoplus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_regression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_vs_theoretical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_water_noise_vs_energy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/pcct_vmi_water_roi_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/qrm_thorax_vmi_noise_roi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/qrm_thorax_vmi_vs_theoretical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/qrm_thorax_vmi_water_roi_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/recon_compare_4panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/sinogram_standard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/vmi_regression.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/vmi_vs_theoretical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/vmi_water_roi_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/xcat_fbp_vs_hir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/notebooks/01_five_struct_api.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### A Pluto.jl notebook ###
# v0.19.0
# v0.1.0

using Markdown
using InteractiveUtils

# ╔═╡ 01000003-0000-4000-8000-000000000001
begin
Expand Down Expand Up @@ -47,6 +50,7 @@ detect a GPU backend.
import BasisSimulator as BS

# ╔═╡ 01000003-0000-4000-8000-000000000003
# ╠═╡ show_logs = false
import CairoMakie as CM

# ╔═╡ 01000004-0000-4000-8000-000000000001
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/02_xcat_custom_materials.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.24
# v0.1.0

using Markdown
using InteractiveUtils
Expand Down
7 changes: 5 additions & 2 deletions docs/notebooks/03_dual_kvp_switching_vmi.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### A Pluto.jl notebook ###
# v0.19.0
# v0.1.0

using Markdown
using InteractiveUtils

# ╔═╡ 05000001-0000-4000-8000-000000000001
begin
Expand Down Expand Up @@ -307,7 +310,7 @@ subspace `U[:,2]` with a small separable Gaussian. One knob:
"""

# ╔═╡ 05000007-0000-4000-8000-000000000005
SVD_SIGMA_PX = 1.0; # Gaussian σ (px) for U[:,2]; 0 = passthrough (no denoising)
SVD_SIGMA_PX = 0.0; # Gaussian σ (px) for U[:,2]; 0 = passthrough (no denoising)

# ╔═╡ 05000007-0000-4000-8000-000000000010
# 2-channel joint projection-domain SVD denoise (BS.apply_sino_svd_denoise).
Expand Down
5 changes: 4 additions & 1 deletion docs/notebooks/04_pcct_vmi.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### A Pluto.jl notebook ###
# v0.19.0
# v0.1.0

using Markdown
using InteractiveUtils

# ╔═╡ 06000001-0000-4000-8000-000000000001
begin
Expand Down
5 changes: 4 additions & 1 deletion docs/notebooks/07_qrm_thorax_pure_material_vmi.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### A Pluto.jl notebook ###
# v0.19.0
# v0.1.0

using Markdown
using InteractiveUtils

# ╔═╡ 07010003-0000-4000-8000-000000000001
begin
Expand Down
5 changes: 5 additions & 0 deletions src/BasisSimulator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ include("geometry/affine.jl")
# Reference: CERN/TIGRE/Common/CUDA/Siddon_projection.cu
include("projection/siddon.jl")

# Distance-driven forward projection (CatSim/XCIST DD3, gather form)
# Reference: De Man & Basu 2004; gecatsim DD3Proj_roi_notrans_mm.cpp
# Drop-in replacement for Siddon (same signatures, cm units, Σμ·l output).
include("projection/dd.jl")

# =============================================================================
# Detector (ALL detector effects + noise)
# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/api/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ function reconstruct!(
# Forward project with subset geometry → subset_Ax_buf
ax_view = view(ws.subset_Ax_buf, :, :, 1:n_sub)
fill!(ax_view, zero(T))
siddon_forward_project!(
dd_forward_project!(
ax_view, ws.volume, geom_s;
ws_source_positions = ws.subset_geom_source_positions[s],
ws_detector_centers = ws.subset_geom_detector_centers[s],
Expand Down
2 changes: 1 addition & 1 deletion src/correction/bhc_image_domain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function apply_bhc_image_domain(
# Use geom's recon FOV (no volume_extent override) so this matches Step 3's
# FDK back-projection grid exactly — same physical box on both halves of
# the round-trip.
ξ_gpu = siddon_forward_project(high_atten_μ, geom)
ξ_gpu = dd_forward_project(high_atten_μ, geom)

# Step 3: FDK-reconstruct the error sinogram → error image.
error_image = fdk_reconstruct(ξ_gpu, geom, matrix_size)
Expand Down
2 changes: 1 addition & 1 deletion src/correction/bhc_sinogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ function apply_bhc_two_material(
end
end

p_b_gpu = siddon_forward_project(bone_μ_gpu, geom)
p_b_gpu = dd_forward_project(bone_μ_gpu, geom)

p_s_gpu = similar(sino_water)
copyto!(p_s_gpu, sino_water)
Expand Down
6 changes: 3 additions & 3 deletions src/detector/photon_counting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,15 @@ function pcct_forward_project(

if has_src
copyto!(bt_sub, @view ws_source_spectral[:, :, ts:te])
siddon_fused_spectral_project!(
dd_fused_spectral_project!(
_pilot, _outputs_flat, Int32(n_bins), mask, _proj_geom,
μ_sub, W_sub, Val(TILE_K), Int32(1);
volume_extent=volume_extent,
ws_source_positions=_ws_src, ws_detector_centers=_ws_det,
ws_detector_u=_ws_u, ws_detector_v=_ws_v,
ws_bowtie_spectral=bt_sub)
else
siddon_fused_spectral_project!(
dd_fused_spectral_project!(
_pilot, _outputs_flat, Int32(n_bins), mask, _proj_geom,
μ_sub, W_sub, Val(TILE_K), Int32(1);
volume_extent=volume_extent,
Expand Down Expand Up @@ -636,7 +636,7 @@ function pcct_forward_project(

# Forward project at this energy (native or binned resolution)
fill!(sino_buf, zero(T))
siddon_forward_project!(sino_buf, μ_volume, proj_geom;
dd_forward_project!(sino_buf, μ_volume, proj_geom;
ws_source_positions=_ws_src,
ws_detector_centers=_ws_det,
ws_detector_u=_ws_u,
Expand Down
Loading
Loading