Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Feature Extraction Workflow to Modularize Preprocessing, Extraction, and Output Management #43

Open
jjjermiah opened this issue Oct 22, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jjjermiah
Copy link
Contributor

jjjermiah commented Oct 22, 2024

TL;DR

  • Refactor feature extraction pipeline to improve:
    • Modularity: Create reusable components.
    • Separation of Concerns: Decouple responsibilities.
    • Flexibility: Implement a configurable preprocessing pipeline.
    • Usability: Enhance maintainability and extensibility.

The goal is to refactor the existing feature extraction and preprocessing workflow by modularizing it, separating responsibilities, and creating flexible, reusable components. This involves designing a structured preprocessing pipeline, implementing an abstract feature extraction interface, and managing outputs separately. This will improve maintainability, extensibility, and usability across various use cases.

Preprocessing Pipeline
  • Manages a sequence of preprocessing steps (e.g., alignment, cropping).
  • Ensures a streamlined and structured data transformation process.

Modular Steps:

  • Each step (like AlignImages, FlattenImage) is a separate, reusable class.
  • Easy to add, remove, or replace specific preprocessing components.

Configurable:

  • Users can customize the sequence and choice of steps according to their specific needs.
Feature Extraction
  • FeatureExtractor (Abstract Interface):

    • Defines a standard method for extracting features from medical images.
    • Ensures consistent behavior and expectations across different extraction methods.
  • PyRadiomicsFeatureExtractor (Concrete Implementation):

    • Uses PyRadiomics to extract features, following the FeatureExtractor interface.
  • Flexible Integration:

    • The architecture allows for new extractors to be added easily without modifying core logic.
    • Supports diverse extraction needs, facilitating extensibility.
Feature Extraction Manager
  • FeatureExtractionManager:

    • Orchestrates the preprocessing and feature extraction, handling data flow end-to-end.
    • Ensures a smooth, coordinated process by linking preprocessing and extraction stages.
  • Handles Errors and Logging:

    • Centralized management of exceptions, ensuring robustness.
    • Consistent logging for better traceability and debugging.
Output Management
  • OutputManager:

    • A separate component responsible for saving results to files or returning them in-memory.
    • Decouples input/output operations from core processing, promoting a clean separation of concerns.
  • Decoupled I/O:

    • Ensures file operations are not entangled with the core logic, making it easier to test, maintain, and extend.

Summary

This refactor will enhance the maintainability, extensibility, and usability of the feature extraction workflow by creating modular, reusable components and decoupling responsibilities. It will streamline the process, facilitate easy integration of new methods, and provide a more robust, configurable, and testable system.

@jjjermiah jjjermiah added the enhancement New feature or request label Oct 22, 2024
@jjjermiah jjjermiah self-assigned this Oct 22, 2024
@jjjermiah jjjermiah moved this from Todo to In Progress in READII-2-ROQC Pipeline Oct 22, 2024
@strixy16 strixy16 added this to the READII 2.0 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants