Replies: 1 comment
-
Hi @wyli , Could you please help share some comments about the Thanks in advance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my objective is to detect pancreas organ from CT images (in .nii format) through YOLO5, as YOLO5 supports .png files, so i did conversion from .nii to .png. As MONAI supports .nii files, After detection few of the .png files of each patients are paked as volume (.nii format) with the following code.
path= '/Trail_folder_waste/masks_final_images/'
for root, dirs, files in os.walk(path):
for dir in dirs:
dir_path_1 = os.path.join(path, dir + '/')
file_names = sorted(glob.glob(dir_path_1 + '*.png'))
print(dir)
reader = sitk.ImageSeriesReader()
reader.SetFileNames(file_names)
vol = reader.Execute()
sitk.WriteImage(vol, f'{dir}.nii.gz')
The obtained .nii files now given to MONAI for semantic segmentation. But I am facing sevaral errors with transforms. Here are the details
At Spacingd: ValueError: theta must be Nx3x3 or Nx4x4, got torch.Size([1, 6, 6]). then I commented Spacingd.
At Orientationd: ValueError: theta must be Nx3x3 or Nx4x4, got torch.Size([1, 6, 6]). Then I commented Orientationd.
At Resized: ValueError: len(spatial_size) must be greater or equal to img spatial dimensions, got spatial_size=3 img=5.
Before to Resized, i used ScaleIntensityd, ScaleIntensityRanged, CropForegroundd,
without Resized: RuntimeError: stack expects each tensor to be equal size, but got [1, 134, 170, 80, 1, 3] at entry 0 and [1, 134, 170, 41, 1, 3] at entry 1.
Please someone help me and thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions