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

[Feature request] Plugin/Module to visualize MONAI Transforms #5711

Closed
diazandr3s opened this issue Dec 12, 2022 · 14 comments
Closed

[Feature request] Plugin/Module to visualize MONAI Transforms #5711

diazandr3s opened this issue Dec 12, 2022 · 14 comments

Comments

@diazandr3s
Copy link
Contributor

Is your feature request related to a problem? Please describe.

There is no tool to visualize the effect of MONAI transforms on a custom dataset.

MONAI Label users will highly benefit from a tool/plugin/module that allows them to visualize the effect of the MONAI transforms applied to their dataset.

I've got lots of questions about which transforms are best to do data augmentation or to preprocess their dataset: window scale intensity, random flipping, random rotation, scaling, affine transform, etc.

The idea of this tool is to facilitate the selection of MONAI transforms that researchers can use here to do data augmentation.

Ideally, researchers can use this plugin with individual transform and/or a set of random transformations (Compose).

Describe the solution you'd like
A MONAI tool/plugin/module that allows users to visualize the effects of the MONAI transforms applied to their dataset.

@diazandr3s diazandr3s changed the title Plugin/Module to visualize MONAI Transforms [Feature request] Plugin/Module to visualize MONAI Transforms Dec 12, 2022
@dzenanz
Copy link
Contributor

dzenanz commented Dec 19, 2022

You could get the feel of some data augmentation transforms by using TorchIO's Slicer plugin. Maybe MONAI could make a similar thing? The easiest thing would be to add MONAI-specific transforms to the exiting plugin code. If the author of the plugin @fepegar doesn't like that, a fork could be made.

@fepegar
Copy link

fepegar commented Dec 19, 2022

I think adding MONAI transforms to the TorchIO extension might make things confusing, so forking would possibly make more sense. But I might be wrong!

@arpinerap
Copy link

I agree with @diazandr3s. Its really hard to manage so huge amount of possibilities in transforms that Monai offer without a graphic interface. TorchIO´s Slicer plugin is a wonderfull tool but with very little options. Developing a good data augmentation strategy without being able to know what transforms exactly do with your images is really hard. Please, reconsider @diazandr3s request, no doubt I´ll be the first user. Thanks in advance!

@dzenanz
Copy link
Contributor

dzenanz commented Dec 28, 2022

If no one else plans to work on this, I could take a crack over the next weeks. @wyli could you assign it to me?

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Dec 29, 2022

Hi @dzenanz ,

Sure, welcome contribution!

Thanks.

@wyli
Copy link
Contributor

wyli commented Jan 4, 2023

given that a monai Compose object could be created from a yaml/json config, e.g.

- _target_: ScaleIntensityRangePercentilesd
keys: "$@input_keys[0]"
lower: 4
upper: 95
b_min: 1
b_max: 10
- _target_: RandScaleIntensityd
keys: "$@input_keys[0]"
prob: 1.0
factors: [5, 10]
- _target_: RandGaussianNoised
keys: "$@input_keys[0]"
prob: 1.0
mean: 10.0
std: 2.0
- _target_: RandCoarseShuffled
keys: "$@input_keys[0]"
prob: 1.0
holes: 2
spatial_size: [10, 13, 18]
max_spatial_size: [14, 30, 57]

is it possible/useful to make a generic slicer plugin visualising a set of transforms in a user-specified config? cc @SachidanandAlle any suggestions for @dzenanz to get started?

visualising multiple image patch samples according to their sampling locations is also interesting

@dzenanz
Copy link
Contributor

dzenanz commented Jan 4, 2023

I created my fork and I am looking at Slicer extension developing docs, so the timing on this suggestion is excellent.

@dzenanz
Copy link
Contributor

dzenanz commented Feb 21, 2023

I will probably need these conversion routines:
2a8c8cd#diff-ca2b9fd231511881f60bf8fc5364948993600f30797edd36c976f013d57738b5R357-R361

@wyli
Copy link
Contributor

wyli commented Feb 24, 2023

@SachidanandAlle put together an initial codebase here: https://github.com/Project-MONAI/SlicerMONAIViz

all contributions are welcomed :)

@dzenanz
Copy link
Contributor

dzenanz commented Feb 24, 2023

This is great! I tried to use it and immediately have some feedback. The images loaded via MonaiViz module have different direction matrix from images drag-dropped into Slicer (RAS vs LPS convention). Those buttons for editing the transform list should have mouse-over hint which explains what each button does. The dictionary flavored transforms should have one argument prefilled: keys, and it should be set to ['image', 'label']. I also have a suggestion about installation docs, but I will do that via a PR.

@dzenanz
Copy link
Contributor

dzenanz commented Feb 24, 2023

PR Project-MONAI/SlicerMONAIViz#1 created.

@dzenanz
Copy link
Contributor

dzenanz commented Feb 24, 2023

Adding tooltips was easy, too. PR: Project-MONAI/SlicerMONAIViz#2.

@wyli
Copy link
Contributor

wyli commented Feb 24, 2023

thank you @SachidanandAlle @dzenanz @diazandr3s -- closing this for now, please file follow-up tickets here https://github.com/Project-MONAI/SlicerMONAIViz/issues.

@wyli wyli closed this as completed Feb 24, 2023
@dzenanz
Copy link
Contributor

dzenanz commented Feb 24, 2023

PR Project-MONAI/SlicerMONAIViz#5 is the last of my initial suggestions. The other PRs implement the other suggestions I raised in #5711 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants