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

Multi-channel Image Dataloaders #976

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

Conversation

aasthajh
Copy link

@aasthajh aasthajh commented Oct 7, 2022

Fixes # .

Description

This is an example highlighting the use of custom dataloaders for multi channel images. Multi channel images are very commonly used in healthcare, this example shows one such use case in microscopy.

Checks

  • Data must be downloaded prior to running the notebook
  • Path to the parent data folder must be provided

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@aasthajh aasthajh changed the title Dataloaders Multi-channel Image Dataloaders Oct 7, 2022
@wyli
Copy link
Contributor

wyli commented Oct 10, 2022

thanks, I think it's a good PyTorch example but it's not really using monai. (any suggestions @Nic-Ma @rijobro @ericspod?)

@aasthajh
Copy link
Author

Would it help to use a MONAI model instead of pytorch ResNext? I had used MONAI ViT with the same dataloaders so I can swap out the model if that helps

@ericspod
Copy link
Member

I think the key contribution here is the dataset class demonstrating how to combine multichannel images. This can be recast using MONAI components (LoadImage) to load files instead of using PIL directly and use our models and other components in the training process which is pretty straight forward. You could use our engine classes as well instead of the regular training loop if you wanted to reduce total code in the notebook.

@aasthajh
Copy link
Author

Thanks Eric, I can replace the non-MONAI components with the MONAI equivalent. Could you please direct me to the engine classes you referred to and any examples for using the same?

@ericspod
Copy link
Member

Thanks Eric, I can replace the non-MONAI components with the MONAI equivalent. Could you please direct me to the engine classes you referred to and any examples for using the same?

The classes are in the monai.engine module. This tutorial and others in the Tutorials repo and in the Model Zoo help explain their use: https://github.com/Project-MONAI/tutorials/blob/main/acceleration/distributed_training/unet_training_workflows.py

@nvahmadi
Copy link
Contributor

nvahmadi commented Sep 8, 2023

I just saw that this PR is still open. It should be noted that in the meantime I worked with @aasthajh to create a multi-channel microscopy tutorial (already merged, see notebook). This tutorial covers the topics proposed in this notebook PR, but is more MONAI native (e.g. using ConcatItemsd transform and DenseNet169 network). Perhaps it makes sense to close this PR, since it is not really necessary anymore? What do you think @aasthajh?

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.

4 participants