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

Enhancing Modular Architecture and Debugging in BrkRaw: Introduction of New API and App Modules #161

Merged
merged 39 commits into from
Apr 15, 2024

Conversation

dvm-shlee
Copy link
Member

Fixes #142 #146 #155

This pull request represents a significant milestone. It aims to:

  1. Introduce new features to low-API users, enhancing their interaction with the system.
  2. Facilitate a transition to the next development phase by providing a preliminary release of completed components. This approach allows me as developers to gather early feedback and make necessary adjustments moving forward.

Changes proposed in this pull request:

  • Introduced a new 'api' module with the following submodules: 'pvobj', 'analyzer', 'brkobj', 'helper':

    • pvobj: This module handles directories like Study, Scan, and Reco with classes PvDataset, PvScan, and PvReco. It also includes PvFiles, which accepts a list of files to compose a PvObj. Once an instance is created, you can view all content files of the object using <pvobj>.contents and access files directly with <pvobj>.<filename>. For example, after creating a PvScan instance named scanobj, you can directly access method parameters with scanobj.method["PVM_xxxx"]. This functionality is dynamically linked to the files present in the contents (binary files such as fid, 2dseq will be returned as buffer IO).
    • analyzer: This module processes a 'scanobj-level' object to analyze its structure, providing deep insights into the data it contains. This module aids in parsing critical information necessary for image conversion, including dimensions, resolution, frame groups, slices, slicepacks, orientation, and temporal details. Each category of information is analyzed by a dedicated helper module, enhancing the ease of identifying issues during the image conversion process. To improve usability and facilitate troubleshooting, the Analyzer Module is designed to generate warning messages rather than errors when in debug mode. This approach significantly enhances the module's inspection and debugging capabilities.
    • brkobj: This high-level API module provides StudyObj and ScanObj, allowing access to orientation-corrected affine and reshaped data arrays. It also serves as an access point for debugging.
  • Introduced a new 'app' module, which is poised to become the main user interface including both GUI and CLI elements. The 'tonifti' module is currently under active development within 'app'. The app module will support plugins, enabling extensibility by users without affecting the core source code.

  • All Python files within these modules are maintained under 400 lines to enhance readability and maintainability. Each module has dedicated functions, and unit tests will be written to verify each module's functionality.

  • Please note that the current versions of the 'api' and 'app' modules do not yet support command-line interfaces (CLI), and the 'tonifti' method is still under development. To ensure continued functionality, the original 'lib' module and its scripts remain unchanged and will continue to be available. I anticipate deprecating the 'lib' module in version 0.5.0, once all original functionalities have been successfully rebuilt and integrated into the new modules.

@BrkRaw/Bruker

@dvm-shlee dvm-shlee merged commit a55eece into BrkRaw:main Apr 15, 2024
26 checks passed
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.

Convert specific file via CLI
1 participant