-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tuple issue #30
Comments
Hi all I changed the tuple to a list in the image_helper.py around line 88 and now it works again - see below. def find_mask_contours(mask: np.ndarray, approximate_contours: bool):
|
What updates did you make exactly? If you can submit the changes in a pull request I'd be happy to look it over and hopefully get it into the library :) |
So I encountered the same issue and it seems to stem from the opencv-python version I haven't dug into it beyond this since I can freely change versions without drawback, but figured this might help narrow down the issue. |
Thanks @Renal-Of-Loon, perhaps opencv changed datatypes in a more recent version. #35 has the same fix you mentioned @Jkallehauge, we will get that in by Friday this week. Thanks for bring it up! |
Hi rt_Utils authors
Thanks for a great tool !
I had it working fine but made some updates and now I get som format issues ( tuples). I am adding the error message here - hope you can help :)
Skipping empty mask layer
Skipping empty mask layer
Skipping empty mask layer
Skipping empty mask layer
Skipping empty mask layer
Skipping empty mask layer
Traceback (most recent call last):
File "", line 1, in
rtstruct.add_roi(mask=mask_3d_bool, color=json.loads(strct_color1[strnum-1]), name=strct_names1[strnum-1])
File "C:\Users\jeskal\Anaconda3\lib\site-packages\rt_utils\rtstruct.py", line 59, in add_roi
self.ds.ROIContourSequence.append(ds_helper.create_roi_contour(roi_data, self.series_data))
File "C:\Users\jeskal\Anaconda3\lib\site-packages\rt_utils\ds_helper.py", line 144, in create_roi_contour
roi_contour.ContourSequence = create_contour_sequence(roi_data, series_data)
File "C:\Users\jeskal\Anaconda3\lib\site-packages\rt_utils\ds_helper.py", line 157, in create_contour_sequence
contours_coords = get_contours_coords(roi_data, series_data)
File "C:\Users\jeskal\Anaconda3\lib\site-packages\rt_utils\image_helper.py", line 64, in get_contours_coords
contours, _ = find_mask_contours(mask_slice, roi_data.approximate_contours)
File "C:\Users\jeskal\Anaconda3\lib\site-packages\rt_utils\image_helper.py", line 87, in find_mask_contours
contours[i] = [[pos[0][0], pos[0][1]] for pos in contour]
TypeError: 'tuple' object does not support item assignment
The text was updated successfully, but these errors were encountered: