AustralianCancerDataNetwork / pydicer

PYthon Dicom Image ConvertER
https://australiancancerdatanetwork.github.io/pydicer/
Apache License 2.0
20 stars 4 forks source link

#29 python3.9 #79

Closed dalmouiee closed 2 years ago

dalmouiee commented 2 years ago

Hey @pchlap, here're the updates for platipy 0.2.0 reqs pinning and python3.9 for the github action. Thanks! :)

dalmouiee commented 2 years ago

@pchlap, any ideas why the test could be failing now after this pin update? Here's the assertion error from all 3 python versions coming from the test_convert_rt_struct() test:

            assert brainstem.GetSize() == (512, 512, 174)
            assert brainstem.GetSpacing() == (0.9765625, 0.9765625, 2.5)
>           assert sitk.GetArrayFromImage(brainstem).sum() == 11533
E           AssertionError: assert 12450 == 11533
E            +  where 12450 = <built-in method sum of numpy.ndarray object at 0x7ff4eb4bebd0>()
E            +    where <built-in method sum of numpy.ndarray object at 0x7ff4eb4bebd0> = array([[[0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        ...,\n      ... ...,\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0]]], dtype=uint8).sum
E            +      where array([[[0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        ...,\n      ... ...,\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0],\n        [0, 0, 0, ..., 0, 0, 0]]], dtype=uint8) = <function GetArrayFromImage at 0x7ff5058fcdc0>(<SimpleITK.SimpleITK.Image; proxy of <Swig Object of type 'std::vector< itk::simple::Image >::value_type *' at 0x7ff4f184fae0> >)
E            +        where <function GetArrayFromImage at 0x7ff5058fcdc0> = sitk.GetArrayFromImage
pchlap commented 2 years ago

Thanks @dalmouiee, yep I know the issue. By unpinning scikit-image, the masks render slightly differently. The difference is only slight (one voxel in or out) so that why we decided it wasn't an issue. So the test needs to be updated to the new sum (12450 based of the log output ).