Skip to content
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

Demo fails to calculate wall thickness (ValueError: not enough values to unpack) #14

Open
yaacoo opened this issue Apr 19, 2022 · 4 comments

Comments

@yaacoo
Copy link

yaacoo commented Apr 19, 2022

Hi,
Running the demo pipeline, all of the results CSV files are generated except for the wall thickness.
The error I get is:

1 Traceback (most recent call last): File "short_axis/eval_wall_thickness.py", line 45, in <module> '{0}/wall_thickness_ED'.format(data_dir)) File "/ukbb_cardiac/common/cardiac_utils.py", line 370, in evaluate_wall_thickness aha_axis = determine_aha_coordinate_system(seg, affine) File "/ukbb_cardiac/common/cardiac_utils.py", line 194, in determine_aha_coordinat e_system _, contours, _ = cv2.findContours(cv2.inRange(epi, 1, 1), cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE) ValueError: not enough values to unpack (expected 3, got 2)

Thanks!!

@gustavahlberg
Copy link

I get the same issue. Did you find a solution?

@yaacoo
Copy link
Author

yaacoo commented Jul 1, 2022

No, I have not found a solution..

@iimog
Copy link

iimog commented Jul 6, 2022

In my version of opencv, the cv2.findContours only returns two values (apparently, it used to be three). The first one is no longer returned, but it was ignored anyway. So just removing the first underscore in the seven occurences of

_, contours, _ = cv2.findContours(...

to get

contours, _ = cv2.findContours(...

in common/cardiac_utils.py makes it work for me.

iimog added a commit to BioMeDS/ukbb_cardiac that referenced this issue Aug 31, 2022
@Janner125
Copy link

In my version of opencv, the cv2.findContours only returns two values (apparently, it used to be three). The first one is no longer returned, but it was ignored anyway. So just removing the first underscore in the seven occurences of

_, contours, _ = cv2.findContours(...

to get

contours, _ = cv2.findContours(...

in common/cardiac_utils.py makes it work for me.

hello,iimog!do you konw hou did this work get the 82 traits? I do not know the detils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants