-
Notifications
You must be signed in to change notification settings - Fork 240
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
Saving a Whole Subject #783
Comments
Hi, @justusschock. Thanks for the suggestion.
All file formats supported by ITK or nibabel. It would be the user's responsibility to make the suffix compatible. JSON or YAML would be my choice too.
Looking at the extension? I might have misunderstood the question.
I'm not sure it's worth adding it to the library. It seems useful, but it might not be a common enough need for users. The community hasn't interacted with the post either... |
What I mean: If the API is so that the user passes a directory for loading, for what files would we look? How would we handle YAML/JSON files that are not valid metadata files and what would we do if there are multiple possible files or none of them?
Personally I need this almost all the time when I preprocess my data and then save the preprocessed state. But it's up to you, if you want that added :) |
I also like the Idea, but I can understand fernando, that this is border line, in the sense that it can easily be implemented outside torchio, for you application purpose but it still make things easier for the users, so I vote +1 About several files, I think we should keep it simple and make some choice in the save function : one file for meta info something like I think you also need to add the file path of the saved images in the |
If you both think it would be useful, I'm happy to review your PR! |
🚀 Feature
Hi,
Just wanted to propose to add a mechanism of saving a whole subject to a directory
Motivation
Currently to save a whole subject, I need to iterate over all images, save them individually and then save all the non-image stuff to a separate file as well.
This could be easier with an API like
Subject.save(SAVE_PATH, image_type='nifti|dicom',meta_type='yaml|json')
.The corresponding load function would then be something like
Subject.from_directory(SAVE_PATH)
.Pitch
An easy function
A simple function could look like this (haven't tested this yet):
Note: This specific function has not been tested, but I have something similar in custom code already.
Open questions:
Alternatives
Manually save each image and all the metadata.
Additional context
cc @fepegar :)
The text was updated successfully, but these errors were encountered: