Skip to content

Add image preprocessing functionality and update seg.py#10

Closed
OmidChaghaneh wants to merge 1 commit into
mainfrom
29-ceus-bug-report-gui-cannot-load-saved-nifti-voi
Closed

Add image preprocessing functionality and update seg.py#10
OmidChaghaneh wants to merge 1 commit into
mainfrom
29-ceus-bug-report-gui-cannot-load-saved-nifti-voi

Conversation

@OmidChaghaneh

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds lightweight image-preprocessing exports and extends the segmentation data object with visualization-related defaults, aligning the data model with expected UI/visualization settings.

Changes:

  • Adds src/image_preprocessing/functions.py to re-export selected preprocessing functions (enhance_clahe, enhance_gamma).
  • Extends CeusSeg with default visualization parameters (CLAHE clip limit, gamma, per-view width scales, Philips CEUS toggle).
  • Includes empty __init__.py modules to ensure packages are importable.

Reviewed changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/image_preprocessing/functions.py Adds re-exports for selected preprocessing functions.
src/data_objs/seg.py Introduces visualization default attributes on CeusSeg.
src/image_preprocessing/init.py Package marker (empty).
src/image_preprocessing/image_preprocessors/init.py Subpackage marker (empty).
src/init.py Top-level package marker (empty).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +2
from .image_preprocessors.enhance_clahe import enhance_clahe
from .image_preprocessors.enhance_gamma import enhance_gamma

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

src/image_preprocessing/options.get_im_preproc_funcs() already discovers preprocessing functions dynamically from image_preprocessors/, but this new functions.py file hard-codes and re-exports only enhance_clahe and enhance_gamma. This creates two competing “sources of truth” for available preprocessors and is likely to drift as more plugins are added.

Consider either removing this module and relying on the existing plugin discovery, or updating it to expose all preprocessors in a single, consistent way (e.g., via get_im_preproc_funcs() or an explicit, complete __all__).

Suggested change
from .image_preprocessors.enhance_clahe import enhance_clahe
from .image_preprocessors.enhance_gamma import enhance_gamma
from .options import get_im_preproc_funcs
# Discover all available image preprocessing functions using the existing
# plugin mechanism and expose them as module-level attributes. This keeps
# a single source of truth for available preprocessors.
_PREPROCESSOR_FUNCS = get_im_preproc_funcs()
# Make each discovered preprocessor directly importable from this module,
# e.g. `from .functions import enhance_clahe`.
globals().update(_PREPROCESSOR_FUNCS)
# Export all discovered preprocessors.
__all__ = sorted(_PREPROCESSOR_FUNCS.keys())

Copilot uses AI. Check for mistakes.
@OmidChaghaneh OmidChaghaneh self-assigned this Apr 2, 2026
@davidspector67

Copy link
Copy Markdown
Contributor

Closed, because this is a commit behind PR #13

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.

3 participants