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

Enhancement for API use #111

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

VendenIX
Copy link

I have implemented significant enhancements to the RTUtils library, which originally required file path dependencies for generating and manipulating RTStructs (Radiotherapy Structures). My contribution specifically addresses the limitation of needing file paths, which was not feasible for API-driven environments where direct file system access is restricted or undesirable.

Key Enhancements:

  1. Memory-Based RTStruct Creation:

    • Developed a new method, create_new_from_memory, which allows RTStructs to be created directly from DICOM datasets already loaded into memory using PyDicom. This enhancement is crucial for deploying the library in server environments where DICOM files are received as streams or over network protocols without storing them on disk.
  2. In-Memory RTStruct Saving:

    • Added the save_to_memory function to the RTStruct class. This method facilitates the generation of RTStructs without needing to write to the filesystem. It saves the RTStruct to a BytesIO stream, which can then be used directly within applications or sent over networks, thus enhancing the usability of the library in distributed systems and cloud applications.
  3. API Compatibility:

    • Adjusted the library to be more compatible with web and cloud-based applications by enabling DICOM processing and RTStruct manipulation entirely in memory, aligning with modern microservices architectures and RESTful API practices.

Use Case in API:

Implemented the enhancements in a REST API setting, where DICOM files are retrieved and processed on-the-fly. The updated library handles DICOM files received from HTTP requests, processes them to generate RTStructs, and optionally uploads them to DICOM servers without intermediate disk I/O, demonstrating the library's enhanced functionality in a live server environment.

It would be great to have a feature like this! Thanks!

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.

None yet

1 participant