Add image preprocessing functionality and update seg.py#10
Add image preprocessing functionality and update seg.py#10OmidChaghaneh wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.pyto re-export selected preprocessing functions (enhance_clahe,enhance_gamma). - Extends
CeusSegwith default visualization parameters (CLAHE clip limit, gamma, per-view width scales, Philips CEUS toggle). - Includes empty
__init__.pymodules 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.
| from .image_preprocessors.enhance_clahe import enhance_clahe | ||
| from .image_preprocessors.enhance_gamma import enhance_gamma |
There was a problem hiding this comment.
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__).
| 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()) |
|
Closed, because this is a commit behind PR #13 |
No description provided.