diffct 1.2.11__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diffct-1.2.11 → diffct-1.3.0}/CHANGELOG.md +71 -1
- {diffct-1.2.11 → diffct-1.3.0}/PKG-INFO +1 -1
- {diffct-1.2.11 → diffct-1.3.0}/diffct/differentiable.py +1437 -76
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/api.rst +71 -0
- {diffct-1.2.11 → diffct-1.3.0}/examples/fbp_fan.py +54 -5
- {diffct-1.2.11 → diffct-1.3.0}/examples/fdk_cone.py +74 -5
- {diffct-1.2.11 → diffct-1.3.0}/examples/iterative_reco_cone.py +64 -19
- {diffct-1.2.11 → diffct-1.3.0}/examples/iterative_reco_fan.py +59 -19
- {diffct-1.2.11 → diffct-1.3.0}/pyproject.toml +1 -1
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_adjoint_inner_product.py +131 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_gradcheck.py +73 -0
- {diffct-1.2.11 → diffct-1.3.0}/.github/workflows/docs.yml +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/.github/workflows/release.yml +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/.gitignore +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/LICENSE +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/README.md +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/diffct/__init__.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/Makefile +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/_static/.gitkeep +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/conf.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/examples.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/fbp_fan_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/fbp_parallel_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/fdk_cone_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/getting_started.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/index.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/iterative_reco_cone_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/iterative_reco_fan_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/docs/source/iterative_reco_parallel_example.rst +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/examples/fbp_parallel.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/examples/iterative_reco_parallel.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/pytest.ini +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/requirements.txt +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/README.md +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/__init__.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/_common.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/test_bench_cone.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/test_bench_fan.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/benchmarks/test_bench_parallel.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_cone_projector_autograd.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_cuda_smoke.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_fbp_fan_accuracy.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_fbp_fan_offsets.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_fbp_parallel_accuracy.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_fdk_cone_accuracy.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_fdk_cone_offsets.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_ramp_filter_windows.py +0 -0
- {diffct-1.2.11 → diffct-1.3.0}/tests/test_weights.py +0 -0
|
@@ -7,6 +7,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.0] - 2026-04-14
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Separable-footprint (SF) projector backends** for 2D fan and 3D cone
|
|
14
|
+
beam geometries, following Long-Fessler-Balter (IEEE TMI 2010).
|
|
15
|
+
`FanProjectorFunction` / `FanBackprojectorFunction` now accept
|
|
16
|
+
`backend="siddon"` (default, unchanged) or `backend="sf"`.
|
|
17
|
+
`ConeProjectorFunction` / `ConeBackprojectorFunction` accept
|
|
18
|
+
`backend="siddon"` (default), `"sf_tr"` (trapezoid in transaxial,
|
|
19
|
+
rectangle in axial) or `"sf_tt"` (trapezoid in both directions with
|
|
20
|
+
axial rise/fall from `U_near`/`U_far` across the voxel). Each SF
|
|
21
|
+
backend is implemented as a matched scatter/gather pair of CUDA
|
|
22
|
+
kernels so both forward and adjoint are available — autograd works
|
|
23
|
+
end-to-end for every backend, and the standalone Backprojector
|
|
24
|
+
Function can also be driven in SF mode for iterative reconstruction.
|
|
25
|
+
- **Adjoint inner-product tests** for every new SF backend in
|
|
26
|
+
`tests/test_adjoint_inner_product.py`, plus `torch.autograd.gradcheck`
|
|
27
|
+
coverage in `tests/test_gradcheck.py`. Test count grew from 57 to 66.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **Internal grid-point convention** is now uniformly `x_v = ix - cx`
|
|
31
|
+
(matching `_cone_3d_fdk_backproject_kernel`). The SF kernels use the
|
|
32
|
+
same convention so voxel centers align with where the Siddon/FDK
|
|
33
|
+
paths interpret `d_vol[ix, iy, iz]`.
|
|
34
|
+
- **`_TPB_SF_3D = (4, 4, 4)`** introduced for the 3D SF kernels. SF-TT
|
|
35
|
+
in particular exceeds the 128-register-per-thread budget allowed by
|
|
36
|
+
the default `(8, 8, 8)` launch; the smaller block gives each thread
|
|
37
|
+
~1024 registers and avoids `CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`.
|
|
38
|
+
|
|
39
|
+
### Notes
|
|
40
|
+
- **Raw forward accuracy vs analytical Radon**: on both 2D fan
|
|
41
|
+
(512² Shepp-Logan) and 3D cone (96³ and 128³ 3D Shepp-Logan) phantoms,
|
|
42
|
+
measured against the analytical ellipse / ellipsoid Radon transform,
|
|
43
|
+
the existing Siddon projector with bilinear / trilinear interpolation
|
|
44
|
+
is slightly more accurate (~3% better RMSE, ~15% better max error)
|
|
45
|
+
than SF-TR / SF-TT at the thin-ray sampling level. The classic SF
|
|
46
|
+
advantage reported in Long et al. is over the piecewise-constant DD
|
|
47
|
+
projector; diffct's Siddon uses smooth interpolation, which covers
|
|
48
|
+
most of the gap SF was designed to close.
|
|
49
|
+
- **Full analytical reconstruction (forward + FBP/FDK)**: despite the
|
|
50
|
+
raw-forward result above, in a complete analytical pipeline
|
|
51
|
+
(`FanProjectorFunction` / `ConeProjectorFunction` -> `ramp_filter_1d`
|
|
52
|
+
-> `fan_weighted_backproject` / `cone_weighted_backproject`) SF
|
|
53
|
+
**measurably improves reconstruction quality**. On the 256²
|
|
54
|
+
Shepp-Logan `fbp_fan.py` example the raw MSE drops from
|
|
55
|
+
`0.00216` (Siddon) to `0.00178` (SF-TR), a ~17% improvement.
|
|
56
|
+
On the 128³ `fdk_cone.py` example it drops from `0.00325` (Siddon)
|
|
57
|
+
to `0.00271` (SF-TR), again ~17%. The mechanism is that SF's
|
|
58
|
+
mass-conserving cell-integrated forward pairs more naturally with
|
|
59
|
+
the voxel-driven FBP/FDK gather backprojector than Siddon's
|
|
60
|
+
thin-ray sampling, which feeds extra high-frequency ringing into
|
|
61
|
+
the ramp filter.
|
|
62
|
+
- **Performance**: SF-TR is ~2× and SF-TT ~2.5–4× slower than Siddon for
|
|
63
|
+
cone beam, and ~3× slower than Siddon for fan beam. The extra cost
|
|
64
|
+
comes from voxel-driven scatter with atomic adds (forward) versus
|
|
65
|
+
ray-driven parallelism in Siddon.
|
|
66
|
+
- **Recommendation**: `backend="siddon"` remains the default for
|
|
67
|
+
backward compatibility and raw speed. For **analytical FBP/FDK
|
|
68
|
+
reconstruction** where reconstruction MSE matters more than forward
|
|
69
|
+
runtime, `"sf"` / `"sf_tr"` is a quantifiably better choice — at
|
|
70
|
+
2–3× forward cost you get ~17% lower reconstruction MSE on standard
|
|
71
|
+
phantoms. For **iterative reconstruction with autograd**, either
|
|
72
|
+
backend is valid; SF has the theoretical advantage of exact voxel-
|
|
73
|
+
scale mass conservation on both forward and adjoint, but in practice
|
|
74
|
+
Siddon's smoothing usually helps optimizer convergence. SF-TT's
|
|
75
|
+
axial-trapezoid refinement over SF-TR improves RMSE only by ~0.001
|
|
76
|
+
and is not worth the extra cost for typical cone angles; use SF-TR
|
|
77
|
+
by default and reserve SF-TT for extreme cone-angle research.
|
|
78
|
+
|
|
10
79
|
## [1.2.11] - 2026-04-14
|
|
11
80
|
|
|
12
81
|
### Added
|
|
@@ -217,7 +286,8 @@ Releases 1.2.0 through 1.2.6 and the 1.1.x / 1.0.x lines are tracked on
|
|
|
217
286
|
was introduced in 1.2.10 and does not back-fill detailed notes for earlier
|
|
218
287
|
versions beyond pointers to the GitHub release pages.
|
|
219
288
|
|
|
220
|
-
[Unreleased]: https://github.com/sypsyp97/diffct/compare/v1.
|
|
289
|
+
[Unreleased]: https://github.com/sypsyp97/diffct/compare/v1.3.0...HEAD
|
|
290
|
+
[1.3.0]: https://github.com/sypsyp97/diffct/releases/tag/v1.3.0
|
|
221
291
|
[1.2.11]: https://github.com/sypsyp97/diffct/releases/tag/v1.2.11
|
|
222
292
|
[1.2.10]: https://github.com/sypsyp97/diffct/releases/tag/v1.2.10
|
|
223
293
|
[1.2.9]: https://github.com/sypsyp97/diffct/releases/tag/v1.2.9
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: diffct
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: A CUDA-based library for computed tomography (CT) projection and reconstruction with differentiable operators
|
|
5
5
|
Project-URL: Homepage, https://github.com/sypsyp97/diffct
|
|
6
6
|
Author-email: Yipeng Sun <yipeng.sun@fau.de>
|