You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When redactoring an dicom image in dicom_image_radactor_engine.py, the image intensity are rescaled using the function _rescale_dcm_pixel_array(). This function rescales the gray scale to be 0 to 255; however the rescale formula (below) assumes the smallest intensity value of the image array is 0, which is not usually not the case for medical CT images. CT image have negative intensity value.
Describe the bug
When redactoring an dicom image in dicom_image_radactor_engine.py, the image intensity are rescaled using the function _rescale_dcm_pixel_array(). This function rescales the gray scale to be 0 to 255; however the rescale formula (below) assumes the smallest intensity value of the image array is 0, which is not usually not the case for medical CT images. CT image have negative intensity value.
image_2d_scaled = ( np.maximum(image_2d_float, 0) / image_2d_float.max() ) * 255.0
Instead, a more robust formula would be
image_2d_scaled = ( (image_2d_float.max() - image_2d_float) / (image_2d_float.max() - image_2d_float.min()) ) * 255.0
As a consequence of this bug, the scaled image filtered out some text which were in negative intensity, and the text were not detected downstream.
The text was updated successfully, but these errors were encountered: