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 dictionary transform detection #15

Open
dzenanz opened this issue Feb 27, 2023 · 0 comments
Open

Refactor dictionary transform detection #15

dzenanz opened this issue Feb 27, 2023 · 0 comments

Comments

@dzenanz
Copy link
Contributor

dzenanz commented Feb 27, 2023

This piece of code:

if t[-1] == "d": # this is a dictionary transform
# now exclude some transforms whose name happens to end with d
if t not in ["AffineGrid", "Decollated", "RandAffineGrid", "RandDeformGrid"]:
image_key = slicer.util.settingsValue("SlicerMONAIViz/imageKey", "image")
label_key = slicer.util.settingsValue("SlicerMONAIViz/labelKey", "label")
v = f"keys=['{image_key}', '{label_key}']"

could be refactored to use this:
"dictionary": o.__module__.endswith("dictionary"),

That should make it more reliable and future proof.

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

No branches or pull requests

1 participant