The size of the proposed random crop ROI is larger than the image size #2256
ramchandracheke
started this conversation in
General
Replies: 1 comment 5 replies
-
Hi @ramchandracheke, your example image had 91 slices in the z-dimension. This is already smaller than the 128 that you've requested of To debug this, why don't you comment out the final min_sizes = (10000, 10000, 10000)
for d in dataset:
shape = d["image"].shape[1:]
for i in range(len(shape)):
if shape[i] < min_sizes[i]:
min_sizes[i] = shape[i]
print(min_sizes) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Thank you for this wonderful project.
File "/home/ramchand/.local/lib/python3.7/site-packages/monai/transforms/utils.py", line 334, in generate_pos_neg_label_crop_centers
raise ValueError("The size of the proposed random crop ROI is larger than the image size.")
ValueError: The size of the proposed random crop ROI is larger than the image size.
RuntimeError: applying transform <monai.transforms.croppad.dictionary.RandCropByPosNegLabeld object at 0x7ffecef93550>
Could you please help me to solve this error. as My image size is variable(no of slices are different in each nifti file.eg. (342, 342, 91) and I am using Unet. (128,128,128). I am using following combination of transform.
Thanks a million!
Beta Was this translation helpful? Give feedback.
All reactions