-
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
Image I/O Proposal - Feedback Welcomed #856
Comments
MONAI will be a huge contribution to the community. Thank you for initiating it. A couple of suggestions:
Thanks |
Hi @kayhan-batmanghelich - Thanks for the feedback! You raise several excellent points!
Thanks! |
Hi @aylward , Thanks so much for your great summary! Thanks. |
Hi @Nic-Ma , Thanks for your input to the proposal! It has been great working with you on the working groups, and I think the proposal is coming together well, but the real challenge will be devising a clean implementation! The documentation for Wrapped ITK is available in the Quick Start Guide. Since ITK v5.1, reading and writing images is fairly simple and pythonic:
and then
|
Hi @aylward , Thanks for your sharing! |
Hi, great plan! I have some comments -
More details in #827 (comment). |
Hi @jond01 , Cool, thanks so much for your sharing! Thanks. |
Hi @aylward , I tried to understand the ITK examples and get 2 quick questions:
Thanks. |
Hi @aylward , BTW, I submitted a draft PR to develop the IO APIs: #893.
Do I misunderstand anything? Thanks. |
@Nic-Ma - Great work!!! Matt McCormick ( @thewtex ) is the local ITK guru (and he leads most ITK development, including ITK Python), and he provided the following answers for your two questions:
For meta-data, perhaps we should consider the Python imageio library. It can use the ITK Python wrappings as an IO backend. |
Hi @thewtex, Thanks very much for your explanation, it's much more clear for me now. Thanks. |
Hi @jond01 , Have you faced this issue at this line of MedIO?
The test code is in PR: #893: https://github.com/Project-MONAI/MONAI/pull/893/files#diff-a1e4249922432d53e4bb126d43ab9bcbR64 Thanks. |
I tried to load a Nifti image and check the meta data, even I still can't convert the meta data to dict, I print out several information and found that: Thanks in advance. |
Hey @Nic-Ma, in medio you can get the metadata dictionary (called there header) with array, metadata = medio.read_img('path/to/img.nii.gz', backend='itk', header=True)
print(metadata) # prints also the metadata.header dictionary
It happens in the new version of itk for
My best suggestion, for now, is to use a try-except approach in
The image array in itk is Anyway, the cooperation offer with recognition of contribution is still actual if you are interested. There is still some work and we'll be happy to be involved. |
Hi @jond01 , Thanks very much for your detailed explanation!! Thanks in advance. |
A few clarifications on this commonly encountered, but important set of conventions:
@jond01 sorry this is not more apparent; In fact, these are what the cause of the failure in the metadata conversion. The following works on the spleen nifti data:
We could add this as the To add
For the spleen data, this results in:
|
Hi @thewtex , Thanks for your clarification!
Thanks. |
+1
https://discourse.itk.org/t/importing-image-from-array-and-axis-reorder/1192/5 |
Hi @jond01 , Thanks for your suggestion! I updated the code in the latest commit. Thanks. |
Great, I have added an issue to track this here: InsightSoftwareConsortium/ITK#1957 . We can use these implementations directly, though, until that is out.
👍
Yes, good idea 💡 I added this issue to track this: InsightSoftwareConsortium/ITKPythonPackage#148 I am mostly AFK for the next month, but I will be able to implement these after. |
@Nic-Ma @jond01 implementation is available in InsightSoftwareConsortium/ITK#2039 , please take a look |
several follow-ups were created and sub-tasks completed, I'm closing this ticket. Please create new discussion thread if needed. |
We have posted a draft proposal for Image I/O in MONAI, and we welcome developer and community feedback:
Image I/O Proposal
This is a high-level draft, and significant input and creativity are needed to turn it into something concrete and feasible. Please give us your expert input by adding comments to this issue.
A brief summary of the proposal is
Proposal Goal
Support reading and writing common research image and data file formats: NRRD, Nifti, DICOM (objects), JPG, PNG, TIFF, MetaIO, ... without re-implementation or significant support burden. Additionally, enable a user to override default I/O methods on an experiment-by-experiment basis, e.g., to ensure a specific version of a specific reader is used so the desired, reproducible behavior is achieved for that specific experiment.
Proposal Summary
MONAI should offer an extensible framework for research image I/O and rely on ITK for the default handling of the file formats that it supports.
The text was updated successfully, but these errors were encountered: