Skip to content

LoadImage will throw an exception under certain circumstances #5227

@macdavid

Description

@macdavid

Describe the bug
The following code in monai.transforms.io.array may throw an exception when track_meta is False:

    img = MetaTensor.ensure_torch_and_prune_meta(img_array, meta_data, self.simple_keys)
    if self.ensure_channel_first:
        img = EnsureChannelFirst()(img)
    if self.image_only:
        return img
    return img, img.meta  # for compatibility purpose

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions