diffct-mlx 2.2.0__tar.gz → 2.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.
Files changed (128) hide show
  1. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/CHANGELOG.md +36 -1
  2. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/PKG-INFO +13 -1
  3. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/README.md +11 -0
  4. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/__init__.py +6 -1
  5. diffct_mlx-2.3.0/diffct_mlx/conventions.py +83 -0
  6. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/operators.py +80 -22
  7. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/simulate.py +7 -2
  8. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/cases.py +72 -12
  9. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/conf.py +1 -1
  10. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/pyproject.toml +3 -2
  11. diffct_mlx-2.3.0/tests/test_conventions.py +190 -0
  12. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_footprint_amplitude.py +23 -0
  13. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/.github/workflows/docs.yml +0 -0
  14. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/.github/workflows/publish.yml +0 -0
  15. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/.github/workflows/release.yml +0 -0
  16. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/.gitignore +0 -0
  17. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/ATTRIBUTION.md +0 -0
  18. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/LICENSE +0 -0
  19. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/__init__.py +0 -0
  20. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/analytical.py +0 -0
  21. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/constants.py +0 -0
  22. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/differentiable.py +0 -0
  23. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/footprint.py +0 -0
  24. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/geometry.py +0 -0
  25. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/__init__.py +0 -0
  26. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/cone_beam.py +0 -0
  27. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/cone_footprint.py +0 -0
  28. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/fan_beam.py +0 -0
  29. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/fan_footprint.py +0 -0
  30. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/parallel_beam.py +0 -0
  31. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/kernels/parallel_footprint.py +0 -0
  32. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/projectors.py +0 -0
  33. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct/utils.py +0 -0
  34. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/analytical.py +0 -0
  35. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/__init__.py +0 -0
  36. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/_mlx.py +0 -0
  37. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/_torch.py +0 -0
  38. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/__init__.py +0 -0
  39. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/constants.py +0 -0
  40. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/geometry.py +0 -0
  41. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/kernels/__init__.py +0 -0
  42. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/kernels/cone_beam.py +0 -0
  43. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/kernels/fan_beam.py +0 -0
  44. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/kernels/parallel_beam.py +0 -0
  45. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/projectors.py +0 -0
  46. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/backend/metal/utils.py +0 -0
  47. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/calibration.py +0 -0
  48. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/filters.py +0 -0
  49. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/functionals.py +0 -0
  50. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/geometry.py +0 -0
  51. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/orchestration/__init__.py +0 -0
  52. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/orchestration/out_of_core.py +0 -0
  53. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/phantoms/__init__.py +0 -0
  54. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/phantoms/engine.py +0 -0
  55. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/phantoms/shepp_logan.py +0 -0
  56. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/__init__.py +0 -0
  57. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/corrections.py +0 -0
  58. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/data/spectra.npz +0 -0
  59. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/pipeline.py +0 -0
  60. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/physics/spectra.py +0 -0
  61. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/projectors.py +0 -0
  62. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/real_measured_data_helper.py +0 -0
  63. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/rebinning.py +0 -0
  64. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/__init__.py +0 -0
  65. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/_analytic.py +0 -0
  66. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/_core.py +0 -0
  67. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/_solver.py +0 -0
  68. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/asd_pocs.py +0 -0
  69. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/awtv_pocs.py +0 -0
  70. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/dart.py +0 -0
  71. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/fbp.py +0 -0
  72. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/fdk.py +0 -0
  73. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/sart.py +0 -0
  74. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/sirt.py +0 -0
  75. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/solvers.py +0 -0
  76. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/reconstruction_algorithms/tv_pocs.py +0 -0
  77. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/regularizers.py +0 -0
  78. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/diffct_mlx/tv_gradients.py +0 -0
  79. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/Makefile +0 -0
  80. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/_static/.gitkeep +0 -0
  81. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/api.rst +0 -0
  82. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/examples.rst +0 -0
  83. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/fbp_fan_example.rst +0 -0
  84. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/fbp_parallel_example.rst +0 -0
  85. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/fdk_cone_example.rst +0 -0
  86. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/getting_started.rst +0 -0
  87. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/index.rst +0 -0
  88. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/iterative_reco_cone_example.rst +0 -0
  89. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/iterative_reco_fan_example.rst +0 -0
  90. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/docs/source/iterative_reco_parallel_example.rst +0 -0
  91. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/fbp_fan.py +0 -0
  92. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/fbp_parallel.py +0 -0
  93. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/fdk_cone.py +0 -0
  94. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/iterative_reco_cone.py +0 -0
  95. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/iterative_reco_fan.py +0 -0
  96. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/circular_trajectory/iterative_reco_parallel.py +0 -0
  97. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/non_circular_trajectory/iterative_reco_cone.py +0 -0
  98. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/non_circular_trajectory/iterative_reco_fan.py +0 -0
  99. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/non_circular_trajectory/iterative_reco_parallel.py +0 -0
  100. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/examples/plot_trajectory.py +0 -0
  101. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/pytest.ini +0 -0
  102. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/requirements.txt +0 -0
  103. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/__init__.py +0 -0
  104. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/_phantoms.py +0 -0
  105. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/README.md +0 -0
  106. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/__init__.py +0 -0
  107. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/_common.py +0 -0
  108. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/test_bench_cone.py +0 -0
  109. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/test_bench_fan.py +0 -0
  110. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/benchmarks/test_bench_parallel.py +0 -0
  111. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_adjoint_inner_product.py +0 -0
  112. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_cone_projector_autograd.py +0 -0
  113. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_cuda_smoke.py +0 -0
  114. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_diffct_mlx_extensions.py +0 -0
  115. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_fbp_fan_accuracy.py +0 -0
  116. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_fbp_fan_offsets.py +0 -0
  117. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_fbp_parallel_accuracy.py +0 -0
  118. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_fdk_cone_accuracy.py +0 -0
  119. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_fdk_cone_offsets.py +0 -0
  120. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_gradcheck.py +0 -0
  121. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_known_operator_gradflow.py +0 -0
  122. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_metal_kernel_static.py +0 -0
  123. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_quantitative_fdk.py +0 -0
  124. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_ramp_filter_windows.py +0 -0
  125. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_regressions.py +0 -0
  126. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_siddon_centering.py +0 -0
  127. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tests/test_weights.py +0 -0
  128. {diffct_mlx-2.2.0 → diffct_mlx-2.3.0}/tools/generate_spectra.py +0 -0
@@ -9,6 +9,39 @@ and the project follows [Semantic Versioning](https://semver.org/).
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [2.3.0] - 2026-11-25
13
+
14
+ ### Added
15
+
16
+ - `detector_convention=` and `line_integrals=` on `make_*_operator` and
17
+ `make_*_operators`. `detector_convention="centered"` reads `det_center` as
18
+ the geometric panel centre (pixel `i` at `(i − (N−1)/2)·du`) instead of
19
+ the kernel-native `(i − N/2)·du`. `line_integrals="physical"` returns
20
+ `A @ x` in µ·mm, and `A.T` scales alike. Together they reproduce the
21
+ conventions of DiffCT-MLX 1.x and upstream diffct ≥ 2.0. Defaults are
22
+ unchanged. New module `diffct_mlx.conventions` with
23
+ `kernel_detector_center` for direct projector and FBP/FDK calls.
24
+ - `ProjectionOperator.line_integrals` and `.to_physical`; `simulate_scan`
25
+ uses them, so physical-unit operators are not rescaled twice.
26
+
27
+ ### Fixed
28
+
29
+ - The `[cuda]` extra pins `numpy<2.5`. numba-cuda calls `np.row_stack`,
30
+ which numpy 2.5 removed, so a fresh install failed at import.
31
+
32
+ ### Tests
33
+
34
+ - `test_cone_footprint_amplitude_holds_along_the_ray` pins the cone footprint
35
+ amplitude for an object 25 mm off the isocentre along the ray, in the
36
+ SID 500 / SDD 900 geometry. DiffCT-MLX 1.x fails it by about 10 %: it
37
+ weighted each voxel with the cell size at the voxel's own depth instead of
38
+ the true magnification. A centred object hides that error.
39
+
40
+ ### Documentation
41
+
42
+ - README states the detector-pixel convention and how it differs from
43
+ upstream diffct ≥ 2.0, which moved to centred pixels and physical units.
44
+
12
45
  ## [2.2.0] - 2026-11-18
13
46
 
14
47
  ### Fixed
@@ -476,7 +509,9 @@ necessary for the arbitrary-trajectory kernel API:
476
509
  when the detector is not plane-aligned to the voxel axes) and will
477
510
  be tackled in a dedicated follow-up.
478
511
 
479
- [Unreleased]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.1.0...HEAD
512
+ [Unreleased]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.3.0...HEAD
513
+ [2.3.0]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.2.0...v2.3.0
514
+ [2.2.0]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.1.0...v2.2.0
480
515
  [2.1.0]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.0.1...v2.1.0
481
516
  [2.0.1]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/compare/v2.0.0...v2.0.1
482
517
  [2.0.0]: https://github.com/Linda-SophieSchneider/DiffCT-MLX/releases/tag/v2.0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: diffct-mlx
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Differentiable computed tomography with an auto-selecting backend (Torch/CUDA or Apple MLX)
5
5
  Project-URL: Homepage, https://github.com/Linda-SophieSchneider/DiffCT-MLX
6
6
  Project-URL: Upstream, https://github.com/sypsyp97/diffct
@@ -16,6 +16,7 @@ Requires-Python: >=3.9
16
16
  Requires-Dist: numpy
17
17
  Provides-Extra: cuda
18
18
  Requires-Dist: numba-cuda; extra == 'cuda'
19
+ Requires-Dist: numpy<2.5; extra == 'cuda'
19
20
  Requires-Dist: torch; extra == 'cuda'
20
21
  Provides-Extra: mlx
21
22
  Requires-Dist: mlx; extra == 'mlx'
@@ -156,6 +157,17 @@ filter itself now accepts `pad_factor` and `sample_spacing`, and
156
157
  > encodes it per data source. One consequence to know: **iterative**
157
158
  > reconstruction of measured (physical) data converges to attenuation *per
158
159
  > voxel*; divide by `case.voxel_spacing` for µ in 1/mm.
160
+ >
161
+ > **Detector convention.** The kernels place detector pixel `i` at
162
+ > `det_center + (i − N/2)·du` (the diffct `dev` line they come from), half a
163
+ > pixel off the geometric panel centre. Upstream diffct ≥ 2.0, DiffCT-MLX 1.x
164
+ > and scanner geometry files use `(i − (N−1)/2)·du` and physical line
165
+ > integrals. To work in that convention, build operators with
166
+ > `detector_convention="centered", line_integrals="physical"`
167
+ > (`make_*_operator` and `make_*_operators`); `A.T` scales alike and stays
168
+ > the exact adjoint, and reconstructions then come out in 1/mm. For direct
169
+ > projector or FBP/FDK calls, `dct.kernel_detector_center(...)` converts a
170
+ > panel-centre `det_center` (shift by `+du/2·u + dv/2·v`).
159
171
 
160
172
  ### Operators, solvers, regularizers, physics & simulation
161
173
 
@@ -131,6 +131,17 @@ filter itself now accepts `pad_factor` and `sample_spacing`, and
131
131
  > encodes it per data source. One consequence to know: **iterative**
132
132
  > reconstruction of measured (physical) data converges to attenuation *per
133
133
  > voxel*; divide by `case.voxel_spacing` for µ in 1/mm.
134
+ >
135
+ > **Detector convention.** The kernels place detector pixel `i` at
136
+ > `det_center + (i − N/2)·du` (the diffct `dev` line they come from), half a
137
+ > pixel off the geometric panel centre. Upstream diffct ≥ 2.0, DiffCT-MLX 1.x
138
+ > and scanner geometry files use `(i − (N−1)/2)·du` and physical line
139
+ > integrals. To work in that convention, build operators with
140
+ > `detector_convention="centered", line_integrals="physical"`
141
+ > (`make_*_operator` and `make_*_operators`); `A.T` scales alike and stays
142
+ > the exact adjoint, and reconstructions then come out in 1/mm. For direct
143
+ > projector or FBP/FDK calls, `dct.kernel_detector_center(...)` converts a
144
+ > panel-centre `det_center` (shift by `+du/2·u + dv/2·v`).
134
145
 
135
146
  ### Operators, solvers, regularizers, physics & simulation
136
147
 
@@ -38,6 +38,8 @@ from .projectors import (
38
38
  cone_backward_footprint,
39
39
  )
40
40
  from . import geometry
41
+ from . import conventions
42
+ from .conventions import kernel_detector_center, line_integral_scale
41
43
  from .geometry import __all__ as _geometry_all
42
44
 
43
45
  # Re-export trajectory generators at top level (mirrors the MLX API).
@@ -200,11 +202,14 @@ from .tv_gradients import (
200
202
  awtv_gradient,
201
203
  )
202
204
 
203
- __version__ = "2.2.0"
205
+ __version__ = "2.3.0"
204
206
 
205
207
  __all__ = [
206
208
  "backend",
207
209
  "geometry",
210
+ "conventions",
211
+ "kernel_detector_center",
212
+ "line_integral_scale",
208
213
  # Projector functions
209
214
  "parallel_forward",
210
215
  "parallel_backward",
@@ -0,0 +1,83 @@
1
+ """Detector and unit conventions of the projectors, and converters between them.
2
+
3
+ The kernels on both backends (Torch/CUDA and MLX/Metal) share the conventions
4
+ of the upstream diffct ``dev`` line they were imported from (v1.3.3.dev0):
5
+
6
+ * **Detector pixels** — pixel ``i`` of an ``N``-pixel row sits at
7
+ ``det_center + (i - N/2) * du * u``. ``det_center`` is therefore the centre of
8
+ pixel ``N/2``, half a pixel off the geometric centre of the panel
9
+ (``"kernel"`` convention).
10
+ * **Line integrals** — returned in voxel units. Multiply by ``voxel_spacing``
11
+ to get physical line integrals (``mu * mm``).
12
+
13
+ Upstream diffct >= 2.0.0, DiffCT-MLX 1.x and scanner geometry files instead
14
+ treat ``det_center`` as the geometric panel centre, with pixel ``i`` at
15
+ ``(i - (N - 1)/2) * du`` (``"centered"`` convention), and return physical
16
+ line integrals. The operator factories take
17
+ ``detector_convention=`` and ``line_integrals=`` to select either convention;
18
+ :func:`kernel_detector_center` does the detector conversion for direct calls
19
+ of the low-level projectors and the analytical FBP/FDK.
20
+ """
21
+
22
+ from __future__ import annotations
23
+
24
+ from typing import Any
25
+
26
+ __all__ = [
27
+ "DETECTOR_CONVENTIONS",
28
+ "LINE_INTEGRAL_UNITS",
29
+ "kernel_detector_center",
30
+ "line_integral_scale",
31
+ ]
32
+
33
+ #: ``"kernel"``: pixel i at (i - N/2)·du (kernel native, diffct dev line).
34
+ #: ``"centered"``: pixel i at (i - (N-1)/2)·du (det_center = panel centre).
35
+ DETECTOR_CONVENTIONS = ("kernel", "centered")
36
+
37
+ #: ``"voxel"``: line integrals in voxel units (kernel native).
38
+ #: ``"physical"``: line integrals in the physical unit of ``voxel_spacing``.
39
+ LINE_INTEGRAL_UNITS = ("voxel", "physical")
40
+
41
+
42
+ def _check(value: str, allowed: tuple[str, ...], name: str) -> str:
43
+ key = str(value).strip().lower()
44
+ if key not in allowed:
45
+ raise ValueError(f"{name} must be one of {allowed}, got {value!r}")
46
+ return key
47
+
48
+
49
+ def kernel_detector_center(
50
+ det_center: Any,
51
+ det_u_vec: Any,
52
+ du: float,
53
+ det_v_vec: Any = None,
54
+ dv: float | None = None,
55
+ *,
56
+ convention: str = "centered",
57
+ ) -> Any:
58
+ """Return the ``det_center`` the kernels need for a given detector convention.
59
+
60
+ ``det_center`` is interpreted in ``convention``. For ``"centered"`` (the
61
+ geometric panel centre, pixel ``i`` at ``(i - (N-1)/2)·du``) the result is
62
+ shifted by ``+du/2`` along ``u`` and, for a 2D detector, ``+dv/2`` along
63
+ ``v``, so the kernels' ``(i - N/2)·du`` grid lands on the same pixel
64
+ centres. For ``"kernel"`` it is returned unchanged.
65
+
66
+ Works for numpy, torch and MLX arrays (plain arithmetic, autograd-safe).
67
+ For a parallel beam pass ``det_origin`` as ``det_center``.
68
+ """
69
+ key = _check(convention, DETECTOR_CONVENTIONS, "detector_convention")
70
+ if key == "kernel":
71
+ return det_center
72
+ shifted = det_center + (0.5 * float(du)) * det_u_vec
73
+ if det_v_vec is not None:
74
+ if dv is None:
75
+ raise ValueError("dv is required when det_v_vec is given")
76
+ shifted = shifted + (0.5 * float(dv)) * det_v_vec
77
+ return shifted
78
+
79
+
80
+ def line_integral_scale(line_integrals: str, voxel_spacing: float) -> float:
81
+ """Factor that turns kernel output (voxel units) into ``line_integrals`` units."""
82
+ key = _check(line_integrals, LINE_INTEGRAL_UNITS, "line_integrals")
83
+ return float(voxel_spacing) if key == "physical" else 1.0
@@ -32,6 +32,7 @@ from __future__ import annotations
32
32
  from typing import Any, Callable, Sequence
33
33
 
34
34
  from .backend import active as _b
35
+ from .conventions import _check, LINE_INTEGRAL_UNITS, kernel_detector_center, line_integral_scale
35
36
  from .projectors import (
36
37
  cone_backward,
37
38
  cone_backward_footprint,
@@ -281,6 +282,7 @@ class ProjectionOperator(LinearOperator):
281
282
  beam: str | None = None,
282
283
  views: Any = None,
283
284
  voxel_spacing: float = 1.0,
285
+ line_integrals: str = "voxel",
284
286
  ):
285
287
  self._forward_fn = forward_fn
286
288
  self._adjoint_fn = adjoint_fn
@@ -289,11 +291,16 @@ class ProjectionOperator(LinearOperator):
289
291
  self.n_views = int(n_views)
290
292
  self.beam = beam
291
293
  self._views = views
292
- #: Physical voxel pitch of the domain grid. The projectors return line
293
- #: integrals in VOXEL units; multiply ``A @ x`` by this to obtain
294
- #: physical line integrals (mu*mm) — e.g. for comparison against
295
- #: measured -log data or for the physics/simulation chain.
294
+ #: Physical voxel pitch of the domain grid.
296
295
  self.voxel_spacing = float(voxel_spacing)
296
+ #: Units of ``A @ x``: ``"voxel"`` (kernel native; multiply by
297
+ #: ``voxel_spacing`` for mu*mm) or ``"physical"`` (already mu*mm).
298
+ self.line_integrals = _check(line_integrals, LINE_INTEGRAL_UNITS, "line_integrals")
299
+
300
+ @property
301
+ def to_physical(self) -> float:
302
+ """Factor that turns ``A @ x`` into physical line integrals (mu*mm)."""
303
+ return self.voxel_spacing if self.line_integrals == "voxel" else 1.0
297
304
 
298
305
  def _forward(self, x: Array) -> Array:
299
306
  return self._forward_fn(x, self._views)
@@ -323,6 +330,7 @@ class ProjectionOperator(LinearOperator):
323
330
  beam=self.beam,
324
331
  views=view_indices,
325
332
  voxel_spacing=self.voxel_spacing,
333
+ line_integrals=self.line_integrals,
326
334
  )
327
335
 
328
336
 
@@ -351,6 +359,10 @@ def _index(array: Array, views: Any) -> Array:
351
359
  return array if views is None else array[views]
352
360
 
353
361
 
362
+ def _scaled(y: Array, scale: float) -> Array:
363
+ return y if scale == 1.0 else y * scale
364
+
365
+
354
366
  def make_parallel_2d_operator(
355
367
  ray_dir: Array,
356
368
  det_origin: Array,
@@ -361,30 +373,45 @@ def make_parallel_2d_operator(
361
373
  detector_spacing: float = 1.0,
362
374
  voxel_spacing: float = 1.0,
363
375
  projector_mode: str = "footprint",
376
+ detector_convention: str = "kernel",
377
+ line_integrals: str = "voxel",
364
378
  ) -> ProjectionOperator:
365
- """Build an all-view parallel-beam :class:`ProjectionOperator`."""
379
+ """Build an all-view parallel-beam :class:`ProjectionOperator`.
380
+
381
+ ``detector_convention`` selects how ``det_center`` is read: ``"kernel"``
382
+ (default, kernel native: pixel ``i`` at ``(i - N/2)·du``) or ``"centered"``
383
+ (``det_center`` is the geometric panel centre: pixel ``i`` at
384
+ ``(i - (N-1)/2)·du``, as in scanner geometry files, upstream diffct >= 2.0
385
+ and DiffCT-MLX 1.x). ``line_integrals`` selects the units of ``A @ x``:
386
+ ``"voxel"`` (default) or ``"physical"`` (times ``voxel_spacing``, as in
387
+ upstream diffct >= 2.0 and DiffCT-MLX 1.x). ``A.T`` is scaled alike, so it stays the exact adjoint.
388
+ See :mod:`diffct_mlx.conventions`.
389
+ """
366
390
  ny, nx = image_shape
367
391
  forward_op, backward_op = _select_pair("parallel", projector_mode)
392
+ scale = line_integral_scale(line_integrals, voxel_spacing)
368
393
  ray_dir = xp.array(ray_dir)
369
- det_origin = xp.array(det_origin)
370
394
  det_u_vec = xp.array(det_u_vec)
395
+ det_origin = kernel_detector_center(
396
+ xp.array(det_origin), det_u_vec, detector_spacing, convention=detector_convention)
371
397
  n_views = int(ray_dir.shape[0])
372
398
 
373
399
  def fwd(volume: Array, views: Any) -> Array:
374
- return forward_op(
400
+ return _scaled(forward_op(
375
401
  volume, _index(ray_dir, views), _index(det_origin, views), _index(det_u_vec, views),
376
402
  num_detectors=num_detectors, detector_spacing=detector_spacing, voxel_spacing=voxel_spacing,
377
- )
403
+ ), scale)
378
404
 
379
405
  def adj(sino: Array, views: Any) -> Array:
380
- return backward_op(
406
+ return _scaled(backward_op(
381
407
  xp.array(sino, dtype=xp.float32), _index(ray_dir, views), _index(det_origin, views), _index(det_u_vec, views),
382
408
  detector_spacing=detector_spacing, H=ny, W=nx, voxel_spacing=voxel_spacing,
383
- )
409
+ ), scale)
384
410
 
385
411
  return ProjectionOperator(
386
412
  fwd, adj, domain_shape=(ny, nx), range_shape=(n_views, num_detectors),
387
413
  n_views=n_views, beam="parallel", voxel_spacing=voxel_spacing,
414
+ line_integrals=line_integrals,
388
415
  )
389
416
 
390
417
 
@@ -398,30 +425,45 @@ def make_fan_2d_operator(
398
425
  detector_spacing: float = 1.0,
399
426
  voxel_spacing: float = 1.0,
400
427
  projector_mode: str = "footprint",
428
+ detector_convention: str = "kernel",
429
+ line_integrals: str = "voxel",
401
430
  ) -> ProjectionOperator:
402
- """Build an all-view fan-beam :class:`ProjectionOperator`."""
431
+ """Build an all-view fan-beam :class:`ProjectionOperator`.
432
+
433
+ ``detector_convention`` selects how ``det_center`` is read: ``"kernel"``
434
+ (default, kernel native: pixel ``i`` at ``(i - N/2)·du``) or ``"centered"``
435
+ (``det_center`` is the geometric panel centre: pixel ``i`` at
436
+ ``(i - (N-1)/2)·du``, as in scanner geometry files, upstream diffct >= 2.0
437
+ and DiffCT-MLX 1.x). ``line_integrals`` selects the units of ``A @ x``:
438
+ ``"voxel"`` (default) or ``"physical"`` (times ``voxel_spacing``, as in
439
+ upstream diffct >= 2.0 and DiffCT-MLX 1.x). ``A.T`` is scaled alike, so it stays the exact adjoint.
440
+ See :mod:`diffct_mlx.conventions`.
441
+ """
403
442
  ny, nx = image_shape
404
443
  forward_op, backward_op = _select_pair("fan", projector_mode)
444
+ scale = line_integral_scale(line_integrals, voxel_spacing)
405
445
  src_pos = xp.array(src_pos)
406
- det_center = xp.array(det_center)
407
446
  det_u_vec = xp.array(det_u_vec)
447
+ det_center = kernel_detector_center(
448
+ xp.array(det_center), det_u_vec, detector_spacing, convention=detector_convention)
408
449
  n_views = int(src_pos.shape[0])
409
450
 
410
451
  def fwd(volume: Array, views: Any) -> Array:
411
- return forward_op(
452
+ return _scaled(forward_op(
412
453
  volume, _index(src_pos, views), _index(det_center, views), _index(det_u_vec, views),
413
454
  num_detectors=num_detectors, detector_spacing=detector_spacing, voxel_spacing=voxel_spacing,
414
- )
455
+ ), scale)
415
456
 
416
457
  def adj(sino: Array, views: Any) -> Array:
417
- return backward_op(
458
+ return _scaled(backward_op(
418
459
  xp.array(sino, dtype=xp.float32), _index(src_pos, views), _index(det_center, views), _index(det_u_vec, views),
419
460
  detector_spacing=detector_spacing, H=ny, W=nx, voxel_spacing=voxel_spacing,
420
- )
461
+ ), scale)
421
462
 
422
463
  return ProjectionOperator(
423
464
  fwd, adj, domain_shape=(ny, nx), range_shape=(n_views, num_detectors),
424
465
  n_views=n_views, beam="fan", voxel_spacing=voxel_spacing,
466
+ line_integrals=line_integrals,
425
467
  )
426
468
 
427
469
 
@@ -437,32 +479,48 @@ def make_cone_3d_operator(
437
479
  dv: float = 1.0,
438
480
  voxel_spacing: float = 1.0,
439
481
  projector_mode: str = "footprint",
482
+ detector_convention: str = "kernel",
483
+ line_integrals: str = "voxel",
440
484
  ) -> ProjectionOperator:
441
- """Build an all-view cone-beam :class:`ProjectionOperator`."""
485
+ """Build an all-view cone-beam :class:`ProjectionOperator`.
486
+
487
+ ``detector_convention`` selects how ``det_center`` is read: ``"kernel"``
488
+ (default, kernel native: pixel ``i`` at ``(i - N/2)·du``) or ``"centered"``
489
+ (``det_center`` is the geometric panel centre: pixel ``i`` at
490
+ ``(i - (N-1)/2)·du``, as in scanner geometry files, upstream diffct >= 2.0
491
+ and DiffCT-MLX 1.x). ``line_integrals`` selects the units of ``A @ x``:
492
+ ``"voxel"`` (default) or ``"physical"`` (times ``voxel_spacing``, as in
493
+ upstream diffct >= 2.0 and DiffCT-MLX 1.x). ``A.T`` is scaled alike, so it stays the exact adjoint.
494
+ See :mod:`diffct_mlx.conventions`.
495
+ """
442
496
  nz, ny, nx = volume_shape
443
497
  det_u_count, det_v_count = detector_shape
444
498
  forward_op, backward_op = _select_pair("cone", projector_mode)
499
+ scale = line_integral_scale(line_integrals, voxel_spacing)
445
500
  src_pos = xp.array(src_pos)
446
- det_center = xp.array(det_center)
447
501
  det_u_vec = xp.array(det_u_vec)
448
502
  det_v_vec = xp.array(det_v_vec)
503
+ det_center = kernel_detector_center(
504
+ xp.array(det_center), det_u_vec, du, det_v_vec, dv, convention=detector_convention)
449
505
  n_views = int(src_pos.shape[0])
450
506
 
451
507
  def fwd(volume: Array, views: Any) -> Array:
452
- return forward_op(
508
+ return _scaled(forward_op(
453
509
  volume, _index(src_pos, views), _index(det_center, views),
454
510
  _index(det_u_vec, views), _index(det_v_vec, views),
455
511
  det_u=det_u_count, det_v=det_v_count, du=du, dv=dv, voxel_spacing=voxel_spacing,
456
- )
512
+ ), scale)
457
513
 
458
514
  def adj(sino: Array, views: Any) -> Array:
459
- return backward_op(
515
+ return _scaled(backward_op(
460
516
  xp.array(sino, dtype=xp.float32), _index(src_pos, views), _index(det_center, views),
461
517
  _index(det_u_vec, views), _index(det_v_vec, views),
462
518
  D=nz, H=ny, W=nx, du=du, dv=dv, voxel_spacing=voxel_spacing,
463
- )
519
+ ), scale)
464
520
 
465
521
  return ProjectionOperator(
466
522
  fwd, adj, domain_shape=(nz, ny, nx), range_shape=(n_views, det_u_count, det_v_count),
467
523
  n_views=n_views, beam="cone", voxel_spacing=voxel_spacing,
524
+ line_integrals=line_integrals,
468
525
  )
526
+
@@ -272,7 +272,8 @@ def simulate_scan(
272
272
  The projectors return line integrals in VOXEL units; the physics
273
273
  (``exp(-p)`` transmission, beam-hardening nonlinearity) needs PHYSICAL
274
274
  line integrals, so the projection is rescaled by ``voxel_spacing`` first
275
- (taken from the operator's metadata when not given). The returned
275
+ (taken from the operator's metadata when not given; an operator built
276
+ with ``line_integrals="physical"`` is used as is). The returned
276
277
  sinogram is therefore physical (mu*mm) — like real measured -log data —
277
278
  and identical to previous behaviour at ``voxel_spacing = 1``.
278
279
 
@@ -282,7 +283,11 @@ def simulate_scan(
282
283
  if float(I0) <= 0.0:
283
284
  raise ValueError(f"I0 (incident photon count) must be positive, got {I0!r}.")
284
285
  if voxel_spacing is None:
285
- voxel_spacing = float(getattr(operator, "voxel_spacing", 1.0))
286
+ # operator metadata: voxel-unit operators need * voxel_spacing,
287
+ # operators built with line_integrals="physical" are already mu*mm
288
+ voxel_spacing = getattr(operator, "to_physical", None)
289
+ if voxel_spacing is None:
290
+ voxel_spacing = float(getattr(operator, "voxel_spacing", 1.0))
286
291
  if float(voxel_spacing) <= 0.0:
287
292
  raise ValueError(f"voxel_spacing must be positive, got {voxel_spacing!r}.")
288
293
  x = xp.array(phantom, dtype=_b.float32)
@@ -11,6 +11,7 @@ from typing import Any, Callable
11
11
  import numpy as np
12
12
 
13
13
  from ..backend import active as _b
14
+ from ..conventions import kernel_detector_center, line_integral_scale
14
15
 
15
16
  xp = _b.xp
16
17
 
@@ -249,6 +250,32 @@ def _build_leap_style_circular_fov_mask(
249
250
  return np.broadcast_to(radial_keep[None, :, :], (nz, ny, nx)).astype(bool, copy=False)
250
251
 
251
252
 
253
+
254
+ def _finish_operators(forward_single, forward_slice, back_single, back_slice, back_project_all, scale):
255
+ """Attach ``project_slice`` and apply the line-integral unit scale."""
256
+ if scale != 1.0:
257
+ fs, fsl, bs, bsl, ball = forward_single, forward_slice, back_single, back_slice, back_project_all
258
+
259
+ def forward_single(volume, projection_index):
260
+ return fs(volume, projection_index) * scale
261
+
262
+ def forward_slice(volume, start, stop):
263
+ return fsl(volume, start, stop) * scale
264
+
265
+ def back_single(projection, projection_index):
266
+ return bs(projection, projection_index) * scale
267
+
268
+ def back_slice(projection, start, stop):
269
+ return bsl(projection, start, stop) * scale
270
+
271
+ def back_project_all(filtered_sinogram):
272
+ return ball(filtered_sinogram) * scale
273
+
274
+ forward_single.project_slice = forward_slice # type: ignore[attr-defined]
275
+ back_single.project_slice = back_slice # type: ignore[attr-defined]
276
+ return forward_single, back_single, back_project_all
277
+
278
+
252
279
  def make_parallel_2d_operators(
253
280
  ray_dir: Array,
254
281
  det_origin: Array,
@@ -259,8 +286,19 @@ def make_parallel_2d_operators(
259
286
  detector_spacing: float = 1.0,
260
287
  voxel_spacing: float = 1.0,
261
288
  projector_mode: str = "footprint",
289
+ detector_convention: str = "kernel",
290
+ line_integrals: str = "voxel",
262
291
  ) -> tuple[Callable[[Array, int], Array], Callable[[Array, int], Array], Callable[[Array], Array]]:
263
- """Create single-view and all-view parallel-beam projector wrappers."""
292
+ """Create single-view and all-view parallel-beam projector wrappers.
293
+
294
+ ``detector_convention`` and ``line_integrals`` select the detector-pixel
295
+ and line-integral conventions; see
296
+ :func:`diffct_mlx.operators.make_cone_3d_operator` and
297
+ :mod:`diffct_mlx.conventions`. Defaults keep the kernel-native behaviour.
298
+ """
299
+ det_origin = kernel_detector_center(
300
+ det_origin, det_u_vec, detector_spacing, convention=detector_convention)
301
+ scale = line_integral_scale(line_integrals, voxel_spacing)
264
302
  ny, nx = image_shape
265
303
  projector_key = str(projector_mode).strip().lower()
266
304
  if projector_key == "siddon":
@@ -330,9 +368,9 @@ def make_parallel_2d_operators(
330
368
  voxel_spacing=voxel_spacing,
331
369
  )
332
370
 
333
- forward_single.project_slice = forward_slice # type: ignore[attr-defined]
334
- back_single.project_slice = back_slice # type: ignore[attr-defined]
335
- return forward_single, back_single, back_project_all
371
+ return _finish_operators(
372
+ forward_single, forward_slice, back_single, back_slice, back_project_all, scale
373
+ )
336
374
 
337
375
 
338
376
  def make_fan_2d_operators(
@@ -345,8 +383,19 @@ def make_fan_2d_operators(
345
383
  detector_spacing: float = 1.0,
346
384
  voxel_spacing: float = 1.0,
347
385
  projector_mode: str = "footprint",
386
+ detector_convention: str = "kernel",
387
+ line_integrals: str = "voxel",
348
388
  ) -> tuple[Callable[[Array, int], Array], Callable[[Array, int], Array], Callable[[Array], Array]]:
349
- """Create single-view and all-view fan-beam projector wrappers."""
389
+ """Create single-view and all-view fan-beam projector wrappers.
390
+
391
+ ``detector_convention`` and ``line_integrals`` select the detector-pixel
392
+ and line-integral conventions; see
393
+ :func:`diffct_mlx.operators.make_cone_3d_operator` and
394
+ :mod:`diffct_mlx.conventions`. Defaults keep the kernel-native behaviour.
395
+ """
396
+ det_center = kernel_detector_center(
397
+ det_center, det_u_vec, detector_spacing, convention=detector_convention)
398
+ scale = line_integral_scale(line_integrals, voxel_spacing)
350
399
  ny, nx = image_shape
351
400
  projector_key = str(projector_mode).strip().lower()
352
401
  if projector_key == "siddon":
@@ -416,9 +465,9 @@ def make_fan_2d_operators(
416
465
  voxel_spacing=voxel_spacing,
417
466
  )
418
467
 
419
- forward_single.project_slice = forward_slice # type: ignore[attr-defined]
420
- back_single.project_slice = back_slice # type: ignore[attr-defined]
421
- return forward_single, back_single, back_project_all
468
+ return _finish_operators(
469
+ forward_single, forward_slice, back_single, back_slice, back_project_all, scale
470
+ )
422
471
 
423
472
 
424
473
  def make_cone_3d_operators(
@@ -433,8 +482,19 @@ def make_cone_3d_operators(
433
482
  dv: float = 1.0,
434
483
  voxel_spacing: float = 1.0,
435
484
  projector_mode: str = "footprint",
485
+ detector_convention: str = "kernel",
486
+ line_integrals: str = "voxel",
436
487
  ) -> tuple[Callable[[Array, int], Array], Callable[[Array, int], Array], Callable[[Array], Array]]:
437
- """Create single-view and all-view cone-beam projector wrappers."""
488
+ """Create single-view and all-view cone-beam projector wrappers.
489
+
490
+ ``detector_convention`` and ``line_integrals`` select the detector-pixel
491
+ and line-integral conventions; see
492
+ :func:`diffct_mlx.operators.make_cone_3d_operator` and
493
+ :mod:`diffct_mlx.conventions`. Defaults keep the kernel-native behaviour.
494
+ """
495
+ det_center = kernel_detector_center(
496
+ det_center, det_u_vec, du, det_v_vec, dv, convention=detector_convention)
497
+ scale = line_integral_scale(line_integrals, voxel_spacing)
438
498
  nz, ny, nx = volume_shape
439
499
  det_u_count, det_v_count = detector_shape
440
500
  projector_key = str(projector_mode).strip().lower()
@@ -520,9 +580,9 @@ def make_cone_3d_operators(
520
580
  voxel_spacing=voxel_spacing,
521
581
  )
522
582
 
523
- forward_single.project_slice = forward_slice # type: ignore[attr-defined]
524
- back_single.project_slice = back_slice # type: ignore[attr-defined]
525
- return forward_single, back_single, back_project_all
583
+ return _finish_operators(
584
+ forward_single, forward_slice, back_single, back_slice, back_project_all, scale
585
+ )
526
586
 
527
587
 
528
588
  def _quantitative_fdk_operators(src_pos, det_center, det_u_vec, det_v_vec,
@@ -9,7 +9,7 @@
9
9
  project = 'DiffCT-MLX'
10
10
  copyright = '2025-2026, Linda-Sophie Schneider; upstream diffct (c) Yipeng Sun'
11
11
  author = 'Linda-Sophie Schneider'
12
- release = '2.2.0'
12
+ release = '2.3.0'
13
13
 
14
14
  # -- General configuration ---------------------------------------------------
15
15
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "diffct-mlx"
7
- version = "2.2.0"
7
+ version = "2.3.0"
8
8
  description = "Differentiable computed tomography with an auto-selecting backend (Torch/CUDA or Apple MLX)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -30,7 +30,8 @@ dependencies = [
30
30
  ]
31
31
 
32
32
  [project.optional-dependencies]
33
- cuda = ["torch", "numba-cuda"]
33
+ # numba-cuda calls np.row_stack, which numpy 2.5 removed (upstream diffct pins it too)
34
+ cuda = ["torch", "numba-cuda", "numpy<2.5"]
34
35
  mlx = ["mlx"]
35
36
  zarr = ["zarr>=3"] # optional chunked+compressed out-of-core store
36
37