Skip to content

lazy.utils.resample output dtype #6340

Closed
Closed

Description

@wyli

Describe the bug
the output of grid resampling is always float32

with resampler.trace_transform(False): # don't track this transform in `img`
return resampler(img=img, **call_kwargs)

out = _maybe_new_metatensor(img, dtype=torch.float32)

the crop pad 'resampling' should also output float32

img = monai.transforms.crop_or_pad_nd(img, matrix_np, out_spatial_size, mode=call_kwargs["padding_mode"])
img.affine = call_kwargs["dst_affine"]
return img

otherwise collating random transforms of different data types can run into exceptions.

cc @dongyang0122

Activity

  1. self-assigned this
    on Apr 12, 2023
  2. added
    bugSomething isn't working
    on Apr 12, 2023
  3. added 2 commits that reference this issue on Apr 12, 2023
    1ed59df
    cb3ca6f
  4. wyli commented on Apr 14, 2023

    @wyli
    ContributorAuthor

    this is still an issue for the early returning cases

    img.affine = call_kwargs["dst_affine"]
    return img

  5. reopened this on Apr 14, 2023
  6. added a commit that references this issue on Apr 14, 2023
    3633b1c
  7. added a commit that references this issue on Apr 15, 2024
    6b7b1e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions