29 Jul
2015
29 Jul
'15
3:51 p.m.
Hi Johnny On 2015-07-29 11:50:59, goettj@gmail.com wrote:
The input image data response to min and max make good 12bit sense, but it is totally beyond me how I am getting 16bit responses for D and E.
Your images are loaded in with dtype uint16, which has range 0 to 65535 (even though your 12-bit max value is 4095). So, when you subtract a value and it goes below 0, wraparound occurs: In [2]: np.array([0, 1, 2], dtype=np.uint16) - 5 Out[2]: array([65531, 65532, 65533], dtype=uint16) One way to solve the problem is to first change the type of your images to np.int32 or np.int64. Regards Stéfan