loli / medpy

Medical image processing in Python
http://loli.github.io/medpy/
GNU General Public License v3.0
571 stars 138 forks source link

Tests for histogram metrics #28

Closed raamana closed 7 years ago

raamana commented 7 years ago

First of all, great work in producing a nice and useful package. I am trying to use it to build one of my packages: hiwenet.

While trying to write unit tests for my own package, I looked into the tests for this package, and medpy.metric.histogram seems to be missing. Not sure if they were misplaced, or you are yet to get to them.. So this is just to learn more about the amount of testing that has been done already to functions implemented in medpy.metric.histogram..

I forked this package and am gonna try writing few tests myself, and will send a PR when I am done. Let me know if you have any good resources (tests in other packages, or great implementations elsewhere etc).

loli commented 7 years ago

All functions in metric.histogram were tested by hand in various scenarios. Any divergent behaviour is described in the function descriptions. They were furthermore optimized for speed and you can find the comparative run times in the source code comments.

But, as you've discovered, I never got around to write unittests for this part of MedPy. I feel positive that they are error-free, but one can never be sure. If you really write some unittests for these functions, I would be very happy to receive a PR from you!