danishm / mritopng

A simple python module to make it easy to batch convert DICOM files to PNG images.
MIT License
141 stars 50 forks source link

Use numpy for auto-contrast #24

Closed kshitij12345 closed 5 years ago

kshitij12345 commented 5 years ago

Using existing numpy functions will allow to reduce the code and lead to easier maintenance, without reinventing the wheel.

Haven't extensively benchmarked but the tests run significantly faster on my system (from 2 sec to 25 msec ) using numpy functions. ( Please look at the attached files)

Duration of the test is timed using command stdbuf -oL pytest test_mritopng.py --durations=0 > <filename>

master.log use-numpy.log

kshitij12345 commented 5 years ago

Have renamed the variable as well.