-
Notifications
You must be signed in to change notification settings - Fork 12
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
Porting hazen to python 3.9 #143
Conversation
Coverage Report
|
Reminder: OpenCV findContours() changed the number of output arguments between versions... Unhelpful -_- |
tests/resolution/RESOLUTION passes eastkent and philips failing here: These 5 all have rescale_to_byte(), thresh() and find_square() in common. I'm pretty sure find_square is working, otherwise the RESOLUTION test set wouldn't pass. In the eastkent/philips test_data, I think something might be happening with rescale_to_byte() or thresh() which is causing find_square() to output coordinates which don't match the test values. e.g.: I've also noticed that there is a subtle different in the images output between hazen3.6 and hazen3.9: Left = old hazen (3.6) The 3.9 images are smoother when loaded in – are they supposed to look like left or right?! Is the 'shimmer' in the 3.6 images an MR artefact or python artefact? |
Should add, current spatial_resolution results: RESOLUTION eastkent philips: So pretty similar, seemingly indicating numerical/subtle threshold or contrast issue. |
@@ -0,0 +1,47 @@ | |||
name: hazen-3.9-miniforge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this file do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, shouldn't have spread between two places. Bit more context in #142.
Basically, installing some of our libraries (mainly scikit-image) doesnt work on M1 silicon via pip. So instead I made the venv in miniforge (just a smaller version of conda). The environment.yml is the equivalent to our normal requirements.txt.
I specifically made most of it install via pip anyway, so it was easy to see which ones work via pip and which only work via conda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being a bit slow here. But doesn't the dockerisation of Hazen make this issue a moot point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I should have made this comment on the issue when you first raised it.
I just checked and all the resolution tests are failing with your recent commit #866dc22 .
I'm not sure why the appearance of the images changes between Python versions, but it is worrying. Need to see if anyone else can reproduce locally. |
I've just noticed the Git Actions pytest section where it's failing all the spatial_resolution tests, as you say. I think the output is different to the tests I'm running locally on my laptop because the Git Actions test is building the code from requirements.txt with py3.6 and using the old OpenCV version, meaning that my alteration to findContours() is causing it to fail. |
Have discovered that the matplotlib version makes a significant different on how the images are displayed...! See images below, generated using identical python3.9 venvs, only difference is matplotlib versions: Top: matplotlib==3.1.3 (which is used in main hazen version) Matplotlib shouldn't be affecting the values in the underlying dicom pixel_arrays however as it's just for plotting, so the discrepancies in hazen output values is something else. At the moment, I'm pretty sure that the hazen code is behaving consistently between the 3.6 build and my 3.9-miniforge build, but a subtle change in one of the libraries is giving us slightly different results, hence the tests are failing. My feeling is that we just need to update the tests to reflect these slight changes in values. |
Updated requirements.txt to specify mistune version as m2r install was causing error. See: miyakogi/m2r#66 |
December release of scikit-image added arm64 support so hazen install via pip now works on M1 Macs \o/ Thanks to @laurencejackson for additional assistance in OpenSSL installation, required for psycopg2-binary package and killing conda. |
See #142.
Currently, for python3.9, hazen requires conda package management as not all wheels working in pip. hazen can be run in 3.9, but some tools failing because of changes to old libraries, and possibly other issues.
TODO: