Skip to content

Improve STL operator so the enclosing app obj can run repetitively #337

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

Merged
merged 6 commits into from
Sep 14, 2022

Conversation

MMelQin
Copy link
Collaborator

@MMelQin MMelQin commented Aug 31, 2022

In this PR, the STL Conversion has been improved

  • execution of compute will not affect the the object state, and only input data will be transformed to be the output
  • Fix the output to be in_memory STL binary in a try/catch block, so this output will only be available when the operator is a non-leaf node (current limitation on output mapping)
  • STL file is only saved in the app's output folder, if and only if a file path is provided, which is stored as operator private attribute

Changes are also made to the unetr example to demonstrate reusing the same app obj for processing multiple/batch of inputs,

  • __main__ functions have been updated to process a set of subfolders under the app input folder, each containing a DICOM Study/series, to demonstrate batch processing. Example code can be customized to be run with a main loop which gets discrete input with the use of file mon, queue, or other triggers like interrupt handler.

Example output (note, the input DICOM study was duplicated into separate folder, hence the same series instance UID appears in all output folders),

output
├── 1-SelectedSeriesForUNETR_output
│   ├── dicom_seg-DICOMSEG.dcm
│   ├── publish
│   │   ├── 1.2.826.0.1.3680043.2.1125.1.nii.gz
│   │   ├── 1.2.826.0.1.3680043.2.1125.1_seg.nii.gz
│   │   ├── config.meta
│   │   └── config_render.json
│   └── stl
│       └── multi-organs.stl
├── 2-SelectedSeriesForUNETR_output
│   ├── dicom_seg-DICOMSEG.dcm
│   ├── publish
│   │   ├── 1.2.826.0.1.3680043.2.1125.1.nii.gz
│   │   ├── 1.2.826.0.1.3680043.2.1125.1_seg.nii.gz
│   │   ├── config.meta
│   │   └── config_render.json
│   └── stl
│       └── multi-organs.stl
└── 3-SelectedSeriesForUNETR_output
    ├── dicom_seg-DICOMSEG.dcm
    ├── publish
    │   ├── 1.2.826.0.1.3680043.2.1125.1.nii.gz
    │   ├── 1.2.826.0.1.3680043.2.1125.1_seg.nii.gz
    │   ├── config.meta
    │   └── config_render.json
    └── stl
        └── multi-organs.stl

Signed-off-by: M Q [email protected]

@MMelQin MMelQin self-assigned this Aug 31, 2022
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
66.4% 66.4% Duplication

@MMelQin MMelQin added the bug Something isn't working label Aug 31, 2022
@MMelQin MMelQin requested a review from dbericat September 10, 2022 20:25
Copy link
Collaborator

@gigony gigony left a comment

Choose a reason for hiding this comment

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

Thanks Ming! Looks good to me.

@MMelQin
Copy link
Collaborator Author

MMelQin commented Sep 14, 2022

Thanks Ming! Looks good to me.

Thanks @gigony !

@MMelQin MMelQin merged commit 8c37598 into main Sep 14, 2022
@MMelQin MMelQin deleted the mqin/fix_issue_336_STL branch March 17, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] The STL operator throws exception when the enclosing application object is run multiple times
2 participants