-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
transform documentation enhancements #2721
Comments
Hi @Spenhouet , Thanks for your great feedback! Thanks. |
Hi @Nic-Ma, this is definitely not something I will have time for any time soon but I did hope I could get this going. From the table I included, is there something where I missed the MONAI equivalent? Is the monai.RandKSpaceSpikeNoise the same as the torchio.RandomSpike? What would be preferred here:
|
Hi @Spenhouet ,
So only I think you can make a clear list in this ticket and then submit sub-tickets to track every separate concrete task? Thanks in advance. |
Hi @Nic-Ma,
I'm not sure how sub tickets in GitHub work but I will create and maintain a task list in my original post. In the comments we can discuss necessary and potential steps. I will add everything to the task list which seems decided to me. Everything else should be discussed first. |
|
Hi @Spenhouet , Thanks for your great suggestions! Very valuable feedback for MONAI project. Thanks. |
About Thanks. |
This is a great point. CC @fepegar |
Hi all! Thanks for pinging, @diazandr3s. I have a couple of comments:
|
Two thoughts on these visualizations:
|
@aylward do you know whether itkwidgets work in Google Colab as well? |
@diazandr3s - great point...we are in the process of adding Colab support in collaboration with the NIH/NCI. It does work with Binder and other cloud-based jupyter notebooks, but google changed the jupyter notebook just enough such that itkWidgets and some (many?) other jupyter notebook / jupyter lab widgets don't quite work (they don't crash, but they simply don't appear in a cell). The nice part about these widgets is that they are embedded in the notebooks, and you can use automated cell capturing to generate images and movies. So, it might be possible to automate the image generation for docs and for testing using the same notebook. To capture a view do...
For all of the view options, use
Enjoy. |
Hi @fepegar, first of I would like to thank you for your great library. As I already wrote above I really value the documentation and that it is highly medically relevant.
Having MONAI transform wrappers around torch.io transforms would be an option but this would add torch.io as dependency to MONAI and that is a decision I have no say in but doubt that it is likely. I agree that this seemingly binds "unnecessary" resources but having a single framework instead of multiple is way better for us (and probably many more). Currently there are way to many individual projects on the same topics and combining resources would be the best. But it is how it is. We did see the most potential for our use case in MONAI and therefore went with it. But MONAI doesn't yet provide the same data augmentations as torch.io does why we are still dependent on torch.io. Therefore my wish to close this gap. |
@Spenhouet Thanks for your detailed explanation and kind words. As I said, I'm happy to help! |
Hi @Spenhouet, I think your issue boils down to two main points:
For the latter, I would recommend creating a feature request issue per transform. These can be grouped together in a Github Project if that helps keep things organised. As a small side note, you mentioned renaming some transforms e.g., |
Makes sense. We can also do that. Should we keep this issue open until all individual issues are created? And maybe a project?
MONAI isn't even version 1.0 yet and your are already stopping change for backwards compatibility? I feel like this library needs to undergo a lot of change until it reaches v1. Personally I would prioritize refactoring to a good initial v1 instead of directly starting with a legacy product. Naming is hard but integral. For backward compatibility we can always do something like this: Rand2DElastic = Rand2DElasticDeformation What do you think? |
Agreed. Maybe now is a good time to start introducing @deprecated usage and policies. This was a huge point of discussion with ITK. You can see opinions from various folks here: Your comments on the importance of naming (to reduce learning curve) and suggestion for maintaining backward compatibility is perfect (if deprecation notifications are also provided). |
Visualisations are included, I'm closing this ticket. Please feel free to file additional feature requests, e.g. Project-MONAI/tutorials#436. |
Thanks for the suggestions about visualization ideas.
@ericspod is this the same issue you mentioned before? And I also checked the So I will not show Thanks. |
Hi,
It isn't working in Google CoLab, but should be working otherwise. Can you
please show the type of the data["image"] and data["label"] variables and
their intensity range?
Thanks!
s
…On Mon, Nov 22, 2021 at 12:31 AM Nic Ma ***@***.***> wrote:
Thanks for the suggestion about visualization ideas.
I tried to use itkwidget in jupyter notebook:
view(image=data["image"], label=data["label"])
No image or chart shows, just got a log print:
Viewer(geometries=[], gradient_opacity=0.22, point_sets=[], rendered_image=<itk.itkImagePython.itkImageF3; pro…
@ericspod <https://github.com/ericspod> is this the same issue you
mentioned before?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2721 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACEJLZJQ2ZCIUK3Z6PUS73UNHITNANCNFSM5BYI4GWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Stephen R. Aylward, Ph.D.
Senior Director of Strategic Initiatives
---
Kitware: *Delivering innovative, open source, scientific software.*
|
Hi @aylward , They are PyTorch Tensors and the intensity range is (0.0, 1.0) in my case. Thanks in advance. |
Hi, It looks like you're running this in Jupyter Lab 3, CoLab, Sagemaker, or something other than Jupyter Notebooks, correct? Jupyter Lab 2 works, but compatibility broke in Jupyter Lab 3. Also, pyWidgets in general do not work without modification in CoLab and Sagemaker - Google and Amazon created their own, incompatible kernel communication protocols. We hope to have updated itkWidgets (which derive from pyWidgets) with support for CoLab within 1-2 weeks. The good news is that all seems to be working as expected with Jupyter Notebooks....to generate the image shown below, I did the following:
I'd like to update this script to use MONAI and UNets more succinctly - so that it is a more up-to-date representation of how to use MONAI. I'll create a pull request later in the week with these changes. Hope this helps. Let me know if you have questions/suggestions. Hopefully a 1-2 week for CoLab support is acceptable. @thewtex is the creator of itkWidgets and he is updating them to have CoLab support. Stephen |
I've seen that behaviour in places that aren't compatible as @aylward discussed, I think also in places where it should work but where I'm missing the necessary packages. |
Hi @aylward , Thanks for your detailed sharing. Thanks for your support! |
Thanks for your help and examples, I submitted PR to add Thanks. |
Is your feature request related to a problem? Please describe.
Until now we are using MONAI for our training pipeline and torchio for data augmentations (offline preprocessed).
The data augmentations torchio provides are very medically relevant.
Their documentation, naming of the augmentations and the visual examples are very helpful.
We struggled finding equivalent methods in MONAI and even when we did, we were not certain that these are actually the same methods.
We therefore never bothered using MONAI for data augmentations.
We would like to replace torchio with MONAI to further reduce our dependencies.
Describe the solution you'd like
While this issue is meant as a feature request, I see that it has a wide scope. It is also a question in that I might just not see the equivalents.
Let's see were MONAI currently is. I will to try find the equivalent transforms of both packages.
Having visual examples in the documentation of the transforms would really help.
Other open issues on data augmentations I could find:
I would like to collect all task which are needed for MONAI to match torchio on its documentation and transforms.
The following tasks will be necessary to match torchio:
RandAnisotropy
similar to RandomAnisotropy. This should be implemented with a sequential down and up sampling via Spacing.RandMotion
similar to RandomMotion. See also MRI k-Space Motion Artefact Augmentation: Model Robustness and Task-Specific Uncertainty.RandPatchSwap
similar to RandomSwap. Coordinate with Augmentation Transform | Patch Shuffling (ETA 8/27) #2701 where aRandPatchShuffle
is proposed.RandGhosting
similar to . See also Ghost Artifacts - Why do motion artifacts often form into discrete ghosts?The text was updated successfully, but these errors were encountered: