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

909 IO factory - develop ITKReader, NibabelReader, LoadImage #893

Merged
merged 45 commits into from
Aug 20, 2020
Merged

909 IO factory - develop ITKReader, NibabelReader, LoadImage #893

merged 45 commits into from
Aug 20, 2020

Conversation

Nic-Ma
Copy link
Contributor

@Nic-Ma Nic-Ma commented Aug 12, 2020

part of #856 #909 .

Description

This PR refactor the image loader of MONAI to support different loaders.
It can support most of common medical image format, so no need to use different loader for different images.
It's just a beginner PR, also need to change NiftiWriter, NiftiSaver, PNGWriter, PNGSaver, Spacing transform, Orientation transform, etc.
I didn't delete LoadNifti, LoadPNG for compatibility and many examples and tests use them.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh --codeformat --coverage.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 12, 2020

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 14, 2020

/black

Copy link
Contributor

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

@Nic-Ma this looks great! 🥇

I added a few suggestions inline that may be helpful.

monai/data/image_reader.py Outdated Show resolved Hide resolved
monai/data/image_reader.py Outdated Show resolved Hide resolved
monai/data/image_reader.py Outdated Show resolved Hide resolved
monai/data/image_reader.py Outdated Show resolved Hide resolved
monai/data/image_reader.py Outdated Show resolved Hide resolved
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 14, 2020

Hi @thewtex ,

Thanks for your review here!
I updated the code according to your comments.
I will try to add more features in this PR and complete it as the first step of the IO factory soon.

Thanks.

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 14, 2020

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 16, 2020

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 17, 2020

/black

@Nic-Ma Nic-Ma changed the title [WIP] 856 Develop IO factory based on ITK 856 IO factory - develop ITKReader, NibabelReader, LoadImage Aug 17, 2020
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

/black

monai/data/image_reader.py Outdated Show resolved Hide resolved
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

Hi @wyli ,

I updated PR according to your comments.
Could you please help review it again?

Thanks.

@aylward
Copy link
Collaborator

aylward commented Aug 20, 2020

Looks good to me! If MONAI starts using Brad G's idea of an "experiment" file (perhaps quite similar to the MONAI global configuration file mentioned in this PR), then that experiment file might also influence which readers are used, but I think it could be easily added and is conceptually consistent with what was done here. Overall, this looks outstanding!!!

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

/black

@Nic-Ma Nic-Ma requested a review from wyli August 20, 2020 16:28
@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

/black

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

/black

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks @Nic-Ma

@Nic-Ma
Copy link
Contributor Author

Nic-Ma commented Aug 20, 2020

Hi @wyli ,

Thanks for your fix for the typehints issue.

@Nic-Ma Nic-Ma merged commit 4666b6c into Project-MONAI:master Aug 20, 2020
@wyli wyli mentioned this pull request Jan 26, 2021
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.

7 participants