Skip to content

Add optional pipeline noise reduction module with Gaussian and CLAHE methods#378

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-noise-reduction-module
Draft

Add optional pipeline noise reduction module with Gaussian and CLAHE methods#378
Copilot wants to merge 4 commits intomainfrom
copilot/add-noise-reduction-module

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

This introduces an optional noise-reduction step for noisy raw/processed images so users can improve segmentation quality by inserting denoising at any pipeline point. The new step is pipeline-compatible and configurable for both simple smoothing and contrast-adaptive enhancement.

  • New pipeline module: pyopia.noise

    • Added ReduceNoise as a pipeline-compatible class.
    • Supports:
      • method='gaussian' for blur-based denoising
      • method='clahe' for adaptive local contrast equalization
    • Configurable input/output keys:
      • image_source selects which image in Pipeline.data to process.
      • output_key allows writing to a chosen key.
      • If output_key is not provided, output now defaults to im_denoised.
  • Method-specific configuration

    • Gaussian: gaussian_sigma
    • CLAHE: clahe_clip_limit, clahe_nbins
    • Invalid method names raise a clear ValueError.
  • Targeted tests added

    • New test module pyopia/tests/test_noise.py covering:
      • Gaussian smoothing behavior
      • CLAHE output constraints
      • Invalid method handling
      • End-to-end use through Pipeline.run_step(...)
      • Default output behavior (im_denoised)
  • Documentation

    • Added a new example under Advanced analysis: docs/notebooks/noise_reduction.md
    • Linked in docs table of contents (docs/_toc.yml)
[steps.noisereduction]
pipeline_class = "pyopia.noise.ReduceNoise"
method = "gaussian"
image_source = "imraw"
output_key = "im_denoised"
gaussian_sigma = 1.0

Copilot AI linked an issue Apr 23, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add a noise reduction module for image processing Add optional pipeline noise reduction module with Gaussian and CLAHE methods Apr 23, 2026
Copilot AI requested a review from nepstad April 23, 2026 12:48
@nepstad
Copy link
Copy Markdown
Collaborator

nepstad commented Apr 23, 2026

@copilot Update default value for output_key to "im_denoised". Add new documentation example under "Advanced analysis".

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot Update default value for output_key to "im_denoised". Add new documentation example under "Advanced analysis".

Implemented in bf94e9b: ReduceNoise now defaults to writing output to im_denoised when output_key is not provided, tests were updated for the new default behavior, and I added a new Advanced analysis documentation page at docs/notebooks/noise_reduction.md (linked from docs/_toc.yml).

Comment thread pyopia/noise.py Outdated
Copilot AI requested a review from nepstad April 23, 2026 13:14
Copy link
Copy Markdown
Collaborator

@ralph-sj ralph-sj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a noise reduction module

3 participants