|
41 | 41 |
|
42 | 42 | __all__ = [ |
43 | 43 | "paganin_filter", |
| 44 | + "paganin_filter_savu_legacy", |
44 | 45 | ] |
45 | 46 |
|
46 | 47 |
|
@@ -229,3 +230,39 @@ def _reciprocal_coord(pixel_size: float, num_grid: int) -> cp.ndarray: |
229 | 230 | rc = cp.arange(-n, num_grid, 2, dtype=cp.float32) |
230 | 231 | rc *= 2 * math.pi / (n * pixel_size) |
231 | 232 | return rc |
| 233 | + |
| 234 | + |
| 235 | +def paganin_filter_savu_legacy( |
| 236 | + tomo: cp.ndarray, |
| 237 | + pixel_size: float = 1.28, |
| 238 | + distance: float = 1.0, |
| 239 | + energy: float = 53.0, |
| 240 | + ratio_delta_beta: float = 250, |
| 241 | +) -> cp.ndarray: |
| 242 | + """ |
| 243 | + Perform single-material phase retrieval from flats/darks corrected tomographic measurements. For more detailed information, see :ref:`phase_contrast_module`. |
| 244 | + Also see :cite:`Paganin02` and :cite:`paganin2020boosting` for references. The ratio_delta_beta parameter here follows implementation in Savu software. |
| 245 | + The module will be retired in future in favour of paganin_filter. One can rescale parameter ratio_delta_beta / 4*2*pi to achieve the same effect in paganin_filter. |
| 246 | +
|
| 247 | + Parameters |
| 248 | + ---------- |
| 249 | + tomo : cp.ndarray |
| 250 | + 3D array of f/d corrected tomographic projections. |
| 251 | + pixel_size : float |
| 252 | + Detector pixel size (resolution) in micron units. |
| 253 | + distance : float |
| 254 | + Propagation distance of the wavefront from sample to detector in metre units. |
| 255 | + energy : float |
| 256 | + Beam energy in keV. |
| 257 | + ratio_delta_beta : float |
| 258 | + The ratio of delta/beta, where delta is the phase shift and real part of the complex material refractive index and beta is the absorption. |
| 259 | +
|
| 260 | + Returns |
| 261 | + ------- |
| 262 | + cp.ndarray |
| 263 | + The 3D array of Paganin phase-filtered projection images. |
| 264 | + """ |
| 265 | + |
| 266 | + ratio_delta_beta /= 4 * 2 * np.pi # rescaling to conform Savu's ratio value |
| 267 | + |
| 268 | + return paganin_filter(tomo, pixel_size, distance, energy, ratio_delta_beta) |
0 commit comments