K divisible #3964
Answered
by
wyli
oscarramirezs
asked this question in
Q&A
K divisible
#3964
-
Hi thank you guys for this work; I'm trying to use the function, K divisible in my input data, so that the spatial sizes are divisible by k. but i'm getting the bellow error => RuntimeError: applying transform <monai.transforms.compose.Compose object at 0x0000019132E24310> train_transforms = Compose(
[
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys=["image", "label"]),
Orientationd(keys=["image", "label"], axcodes="RAS"),
DivisiblePad(keys=["image", "label"], k=64, mode=('constant'), method= ("symmetric")),
EnsureTyped(keys=["image", "label"]),
]
)
val_transforms = Compose(
[
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys=["image", "label"]),
Orientationd(keys=["image", "label"], axcodes="RAS"),
EnsureTyped(keys=["image", "label"]),
]
)
check_ds = Dataset(data=train_files, transform=train_transforms)
check_loader = DataLoader(check_ds, batch_size=1)
check_data = first(check_loader)
image, label = (check_data["image"][0][0], check_data["label"][0][0])
print(f"image shape: {image.shape}, label shape: {label.shape}")
plt.figure("check", (12, 6))
plt.title("image")
plt.subplot(1, 2, 1)
plt.title("image")
plt.imshow(image[:, :, 100], cmap="gray")
plt.subplot(1, 2, 2)
plt.title("label")
plt.imshow(label[:, :, 100])
plt.show()
|
Beta Was this translation helpful? Give feedback.
Answered by
wyli
Mar 17, 2022
Replies: 1 comment 3 replies
-
I think that's a typo -- |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
wyli
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that's a typo --
DivisiblePad
->DivisiblePadD
orDivisiblePadDict