ChristophKirst / ClearMap2

ClearMap 2.0 with WobblyStitcher, TubeMap and CellMap
https://christophkirst.github.io/ClearMap2Documentation
GNU General Public License v3.0
103 stars 43 forks source link

LightsheetCorrection - Error on uint16 source array #57

Closed DenizD closed 3 years ago

DenizD commented 3 years ago

Hello all,

I am using LightsheetCorrection functionality in ClearMap.ImageProcessing module. However, when I run the correct_lightsheet function for uint16 array type I am getting an error.

The function I use:

result = ls.correct_lightsheet(source=img, lightsheet_vs_background=0.5, max_bin=2 ** 10)

where my source array (img) has a shape of (5612, 3876, 6) with uint16 type. I do not get this error when I convert my source array (img) to uint8 type

Error is:

Error in `python': free(): invalid size: 0x0000556458f4a1c0 ======= Backtrace: ========= /lib64/libc.so.6(+0x7c619)[0x7f7fb9810619] /home/d734n/.pyxbld/lib.linux-x86_64-3.6/RankCoreCode.cpython-36m-x86_64-linux-gnu.so.reload1(+0x39e82)[0x7f7f8681de82] /home/d734n/.pyxbld/lib.linux-x86_64-3.6/PercentileCode.cpython-36m-x86_64-linux-gnu.so.reload1(+0xeb578)[0x7f7f86715578] /home/d734n/.pyxbld/lib.linux-x86_64-3.6/RankCode.cpython-36m-x86_64-linux-gnu.so.reload1(+0x132660)[0x7f7f86a28660] python(_PyObject_FastCallDict+0x8b)[0x556455cf392b] python(_PyObject_FastCallKeywords+0xaa)[0x556455d74a5a] python(+0x19857e)[0x556455d7a57e] python(_PyEval_EvalFrameDefault+0x10c7)[0x556455da0147] python(PyEval_EvalCodeEx+0x966)[0x556455d758c6] python(+0x1941a6)[0x556455d761a6] python(PyObject_Call+0x3e)[0x556455cf354e] python(_PyEval_EvalFrameDefault+0x19ec)[0x556455da0a6c] python(PyEval_EvalCodeEx+0x329)[0x556455d75289] python(+0x1941a6)[0x556455d761a6] python(PyObject_Call+0x3e)[0x556455cf354e] python(_PyEval_EvalFrameDefault+0x19ec)[0x556455da0a6c] python(+0x1918e4)[0x556455d738e4] python(+0x192771)[0x556455d74771] python(+0x198505)[0x556455d7a505] python(_PyEval_EvalFrameDefault+0x10c7)[0x556455da0147] python(+0x19253b)[0x556455d7453b] python(+0x198505)[0x556455d7a505] python(_PyEval_EvalFrameDefault+0x30a)[0x556455d9f38a] python(+0x19253b)[0x556455d7453b] python(+0x198505)[0x556455d7a505] python(_PyEval_EvalFrameDefault+0x30a)[0x556455d9f38a] python(PyEval_EvalCodeEx+0x329)[0x556455d75289] python(PyEval_EvalCode+0x1c)[0x556455d7601c] python(+0x2163c4)[0x556455df83c4] python(PyRun_FileExFlags+0xa1)[0x556455df87c1] python(PyRun_SimpleFileExFlags+0x1c3)[0x556455df89c3] python(Py_Main+0x613)[0x556455dfc4b3] python(main+0xee)[0x556455cc502e] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f7fb97b5c05] python(+0x1c3e0e)[0x556455da5e0e]

Thank you Best Regards Deniz

DenizD commented 3 years ago

Error actually occurs in the rank_core function in ClearMap/ImageProcessing/Filter/Rank/RankCoreCode.pyx file during memory allocation and free operations

DenizD commented 3 years ago

I am closing this issue since it was my mistake of using wrong "max_bin" parameter