ITKColorNormalization icon indicating copy to clipboard operation
ITKColorNormalization copied to clipboard

Allow Python to catch errors

Open Leengit opened this issue 3 years ago • 2 comments
trafficstars

The current use of itkAssertOrThrowMacro to report errors, such as inputs that cannot be processed, is not caught by a Python try-except block. We want a solution where the Python program can recover from these errors.

Leengit avatar Jun 06 '22 13:06 Leengit

That would be a great feature. I was looking into using ITKColorNormalization in my DP workflows, but I was unable to as it seemed to crash too often, with no simple way to catch these errors, as fair as I remember.

I could test a proposed solution in a typical workflow when it is ready.

andreped avatar Jun 06 '22 17:06 andreped

https://github.com/InsightSoftwareConsortium/ITK/pull/3479 should fix this issue. However, I nonetheless recommend that we use if (!success) { itkGenericExceptionMacro(message); } to replace itkAssertOrThrowMacro(success, message); in ITKColorNormalization code.

Leengit avatar Jul 04 '22 14:07 Leengit