Skip to content

lazy.utils.resample output dtype #6340

@wyli

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

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