-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make MONAI robust to non-default meta dict names #8411
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,7 @@ def __call__(self, data, reader: ImageReader | None = None): | |
f"loader must return a tuple or list (because image_only=False was used), got {type(data)}." | ||
) | ||
d[key] = data[0] | ||
data[1]['tensor_name'] = key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @atbenmurray ,
Then our
with @slicepaste , @IamTingTing |
||
if not isinstance(data[1], dict): | ||
raise ValueError(f"metadata must be a dict, got {type(data[1])}.") | ||
meta_key = meta_key or f"{key}_{meta_key_postfix}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this part of the code to prevent meta_keys from being modified or deleted?
However, if a meta_key were deleted, the get_meta_dict_name() function would not be able to find the corresponding meta_key.
As for the possibility of meta_keys being modified, we have not found any function that could alter it.
Therefore, the condition here might be overlapping with the original code.
Could you kindly share the reason for adding it?
with @einsyang723 and @slicepaste