Skip to content

Why the data shape are different through transform "spacingd. #5935

Closed
@wyli

Description

@wyli

Discussed in #5934

Originally posted by xxsxxsxxs666 February 3, 2023

1675428782920

val_transforms = Compose(
    [
        LoadImaged(keys=["image", "label"]),
        EnsureChannelFirstd(keys=["image", "label"]),
        ScaleIntensityRanged(
            keys=["image"], a_min=-57, a_max=400,
            b_min=0.0, b_max=1.0, clip=True,
        ),
        CropForegroundd(keys=["image", "label"], source_key="image"),  # default: value>0
        Orientationd(keys=["image", "label"], axcodes="RAI"),
        Spacingd(keys=["image", "label"], pixdim=(
            0.35, 0.35, 0.5), mode=("bilinear", "nearest")),  # Now only Sequential_str, How to add spline
    ]
)

The shape and metadata are the same between image and label
image

this problem only happen when I use cachedataset. Nothing went wrong when I use normal dataset.

Metadata

Metadata

Assignees

No one assigned

    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