@@ -17,21 +17,21 @@ preprocessing helpers, simulation fixtures, and ndarray APIs.
1717
1818### Overview
1919
20- - ** Image-first API** : Top-level functions operate on ` image::DynamicImage `
21- and return image buffers suitable for saving or further processing .
22- - ** Known- PSF restoration ** : Includes inverse filters, Wiener-family methods ,
23- Richardson-Lucy variants, iterative least-squares methods, constrained
24- solvers, sparse/proximal methods, Krylov methods , and MLE-style solvers.
25- - ** PSF and OTF tooling ** : Provides owned ` Kernel2D ` / ` Kernel3D ` and
26- ` Transfer2D ` / ` Transfer3D ` types, plus PSF generators, support utilities ,
27- and ` psf2otf ` /` otf2psf ` conversions .
28- - ** Blind deconvolution ** : Includes blind Richardson-Lucy, blind maximum
29- likelihood, and parametric blind workflows with PSF constraints .
30- - ** Preprocessing and simulation ** : Edge tapering, apodization, NSR
31- estimation, deterministic blur/noise helpers, and synthetic fixtures are
32- available for testing and examples .
33- - ** ndarray API ** : Public ` nd ` modules expose 2D and 3D array workflows
34- for users who want to bypass ` DynamicImage ` conversion .
20+ - Image API: Top-level functions use ` image::DynamicImage ` and return images
21+ ready to save .
22+ - Known PSF methods: Inverse filters, Wiener, Richardson-Lucy, constrained ,
23+ proximal, Krylov, and MLE-style restoration.
24+ - Blind methods: Blind Richardson-Lucy, blind maximum likelihood , and
25+ parametric PSF estimation.
26+ - PSF and OTF types: ` Kernel2D ` , ` Kernel3D ` , ` Transfer2D ` , ` Transfer3D ` ,
27+ and ` Blur2D ` /` Blur3D ` .
28+ - PSF tools: Gaussian, motion, defocus, microscopy models, support utilities,
29+ and PSF/OTF conversion .
30+ - Preprocessing: Edge tapering, apodization, range normalization, and NSR
31+ estimation.
32+ - Simulation: Deterministic blur, noise, and synthetic fixture generation .
33+ - ndarray support: 2D image arrays and 3D volume workflows.
34+ - Feature flags: ` rayon ` by default; optional ` f16 ` support .
3535
3636### Installation
3737
@@ -44,15 +44,13 @@ cargo add deconvolution
4444deconvolution = " 0.1.0"
4545```
4646
47- The crate uses ` image ` as its image API. Applications that load or save image
48- files directly should also depend on ` image ` :
47+ Image loading: Add ` image ` when your application opens or saves image files.
4948
5049``` bash
5150cargo add image
5251```
5352
54- ` rayon ` is enabled by default and enables the rayon features on ` ndarray ` and ` image `
55- rayon feature flags. Disable default features for a serial build:
53+ Serial build: Disable default features to turn off ` rayon ` .
5654
5755``` toml
5856[dependencies ]
@@ -76,10 +74,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
7674}
7775```
7876
79- ### Image API, Channels, and Policies
77+ ### Image API
8078
81- The known-PSF image API accepts ` image::DynamicImage ` values and supports these
82- ` DynamicImage ` variants:
79+ Supported ` DynamicImage ` variants:
8380
8481- ` ImageLuma8 `
8582- ` ImageLumaA8 `
@@ -92,7 +89,7 @@ The known-PSF image API accepts `image::DynamicImage` values and supports these
9289- ` ImageRgb32F `
9390- ` ImageRgba32F `
9491
95- Configuration enums are shared across algorithm families :
92+ Configuration enums:
9693
9794- ** ` Boundary ` ** : ` Zero ` , ` Replicate ` , ` Reflect ` , ` Symmetric ` , ` Periodic `
9895- ** ` Padding ` ** : ` None ` , ` Same ` , ` Minimal ` , ` NextFastLen ` , ` Explicit2 ` ,
@@ -101,11 +98,13 @@ Configuration enums are shared across algorithm families:
10198 ` PremultipliedAlpha `
10299- ** ` RangePolicy ` ** : ` PreserveInput ` , ` Clamp01 ` , ` ClampNegPos1 ` , ` Unbounded `
103100
104- Use ` ChannelMode::Independent ` for per-channel color restoration,
105- ` ChannelMode::LumaOnly ` when the blur should primarily affect luminance, and
106- ` RangePolicy::PreserveInput ` when working in normal image sample ranges.
101+ Recommended defaults:
107102
108- ### PSFs, OTFs, and Support Utilities
103+ - ` ChannelMode::Independent ` : Per-channel color restoration.
104+ - ` ChannelMode::LumaOnly ` : Luminance-focused restoration.
105+ - ` RangePolicy::PreserveInput ` : Normal image sample ranges.
106+
107+ ### PSF and OTF API
109108
110109Basic PSF generators:
111110
@@ -152,11 +151,11 @@ Optical and microscopy models:
152151- ` otf::spectra::koehler_otf `
153152- ` otf::spectra::defocus_otf `
154153
155- ### Known- PSF Deconvolution Method Families
154+ ### Known PSF Methods
156155
157156#### Spectral and inverse filters
158157
159- Frequency-domain methods for fast known-kernel restoration.
158+ Frequency-domain restoration.
160159
161160- ` naive_inverse_filter `
162161- ` inverse_filter `
@@ -174,11 +173,11 @@ Configuration types:
174173- ` Wiener `
175174- ` UnsupervisedWiener `
176175
177- Each method also exposes a ` _with ` variant for explicit configuration .
176+ Custom configs: Use ` _with ` variants .
178177
179178#### Richardson-Lucy and regularized RL
180179
181- Poisson-style multiplicative restoration with positivity-aware updates .
180+ Poisson-style multiplicative restoration.
182181
183182- ` richardson_lucy `
184183- ` damped_richardson_lucy `
@@ -191,7 +190,7 @@ Configuration types:
191190
192191#### Iterative least-squares methods
193192
194- Residual-update solvers for deterministic restoration workflows .
193+ Residual-update restoration.
195194
196195- ` landweber `
197196- ` van_cittert `
@@ -207,7 +206,7 @@ Configuration types:
207206
208207#### Constrained solvers
209208
210- Bound-aware restoration methods .
209+ Bound-aware restoration.
211210
212211- ` nnls `
213212- ` bvls `
@@ -219,7 +218,7 @@ Configuration types:
219218
220219#### Sparse and proximal methods
221220
222- Proximal-gradient solvers with sparse-basis control .
221+ Proximal-gradient restoration .
223222
224223- ` ista `
225224- ` fista `
@@ -232,7 +231,7 @@ Configuration and model types:
232231
233232#### Krylov and advanced iterative methods
234233
235- Scientific- imaging style iterative families .
234+ Scientific imaging solvers .
236235
237236- ` mrnsd `
238237- ` cgls `
@@ -248,7 +247,7 @@ Configuration types:
248247
249248#### Maximum-likelihood family
250249
251- Microscopy-oriented MLE-style restoration methods .
250+ Microscopy-oriented MLE-style restoration.
252251
253252- ` cmle `
254253- ` gmle `
@@ -262,9 +261,9 @@ Configuration types:
262261
263262### Blind Deconvolution
264263
265- Blind workflows estimate both the restored image and the PSF.
266- Image-facing blind workflows support Gray and GrayAlpha ` DynamicImage ` variants
267- for u8 and u16 samples .
264+ Blind workflows: Estimate both the restored image and the PSF.
265+
266+ Image support: Gray and GrayAlpha ` DynamicImage ` variants for u8 and u16.
268267
269268- ` blind::richardson_lucy `
270269- ` blind::maximum_likelihood `
@@ -293,12 +292,13 @@ Parametric PSF families:
293292- ` Defocus { radius } `
294293- ` OrientedGaussian { sigma_major, sigma_minor, angle_deg } `
295294
296- ### ndarray Workflows
295+ ### ndarray API
296+
297+ Array workflows: Use ` nd ` for 2D arrays and 3D volumes.
298+
299+ f16 support: Enable ` f16 ` to pass ` half::f16 ` arrays into the 2D ndarray API.
297300
298- The public ` nd ` module exposes array-first workflows for users who already work
299- in ndarray or need 3D volumes.
300- Enable the optional ` f16 ` feature to pass ` half::f16 ` arrays into the 2D
301- ndarray API while keeping computation in ` f32 ` .
301+ Computation type: ` f16 ` inputs still compute in ` f32 ` .
302302
3033032D known-PSF methods in ` nd::known_psf ` :
304304
@@ -325,21 +325,22 @@ Blind methods in `nd::blind`:
325325
326326### Preprocessing
327327
328- Preprocessing utilities help reduce ringing and prepare numerical inputs.
328+ Ringing control: Use edge tapering or apodization before frequency-domain
329+ deconvolution.
330+
331+ Numerical prep: Normalize ranges and estimate NSR before restoration.
329332
330333- ` preprocess::apodize `
331334- ` preprocess::apodize::window_edges `
332335- ` preprocess::edgetaper `
333336- ` preprocess::estimate_nsr `
334337- ` preprocess::normalize_range `
335338
336- Use ` edgetaper ` or apodization before frequency-domain deconvolution when
337- strong edge discontinuities create ringing artifacts.
338-
339339### Simulation and Fixtures
340340
341- Simulation utilities are deterministic and useful for tests, examples, and
342- benchmark inputs.
341+ Deterministic: Same input and seed produce the same simulated output.
342+
343+ Fixtures: Synthetic images and volumes for tests, examples, and benchmarks.
343344
344345Blur and degradation:
345346
@@ -362,8 +363,11 @@ Synthetic fixtures:
362363
363364### Optional rayon Integration
364365
365- ` rayon ` is enabled by default. The optional ` f16 ` feature adds ` half::f16 `
366- input/output support for the 2D ndarray API; computation remains in ` f32 ` .
366+ Parallel processing: ` rayon ` is enabled by default.
367+
368+ Serial builds: Disable default features.
369+
370+ Feature flags:
367371
368372``` toml
369373[features ]
@@ -372,12 +376,6 @@ rayon = ["dep:rayon", "ndarray/rayon", "image/rayon"]
372376f16 = [" dep:half" ]
373377```
374378
375- Disable default features for serial builds:
376-
377- ``` bash
378- cargo test --no-default-features
379- ```
380-
381379### Example Programs
382380
383381Image-facing workflows:
@@ -398,7 +396,7 @@ cargo run --example microscopy_volume
398396
399397### Benchmarks and Development
400398
401- Bench families ( ` criterion ` ):
399+ Benchmarks: Criterion benchmark families.
402400
403401- ` spectral `
404402- ` rl `
@@ -413,7 +411,7 @@ cargo bench --bench blind
413411cargo bench --bench volume
414412```
415413
416- Development checks :
414+ Checks :
417415
418416``` bash
419417cargo fmt --all -- --check
@@ -425,18 +423,16 @@ cargo doc --workspace --no-deps --all-features
425423
426424### Limitations and Scope
427425
428- - Known-PSF image-facing algorithms support u8/u16 Gray, GrayAlpha, Rgb, and Rgba
429- ` DynamicImage ` variants, plus 32-bit float Rgb and Rgba images.
430- - Blind image-facing algorithms support u8/u16 Gray and GrayAlpha
431- ` DynamicImage ` variants.
432- - Deconvolution quality depends heavily on the PSF, boundary assumptions, and
433- regularization strength.
434- - Aggressive inverse filtering can amplify noise and ringing; prefer Wiener,
435- damping, TV regularization, edge tapering, or constrained solvers for noisy
436- inputs.
437- - Blind deconvolution is sensitive to initialization and PSF constraints.
426+ - Known PSF images: u8/u16 Gray, GrayAlpha, Rgb, Rgba; 32-bit float Rgb and
427+ Rgba.
428+ - Blind images: u8/u16 Gray and GrayAlpha.
429+ - Quality: Depends heavily on the PSF, boundary assumptions, and regularization
430+ strength.
431+ - Inverse filtering: Can amplify noise and ringing.
432+ - Noisy inputs: Prefer Wiener, damping, TV regularization, edge tapering, or
433+ constrained solvers.
434+ - Blind deconvolution: Sensitive to initialization and PSF constraints.
438435
439436## License
440437
441438deconvolution is licensed under the [ MIT License] ( LICENSE ) , copyright (c) 2026 pbkx.
442-
0 commit comments