Skip to content

Commit

Permalink
Merge branch 'master' into handle_interop_elements
Browse files Browse the repository at this point in the history
  • Loading branch information
sjswerdloff committed Oct 25, 2023
2 parents 9147b5b + c736006 commit e013dc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Model/CalculateImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def scaled_pixmap(np_pixels, window, level, width, height,
:return: pixmap, a QPixmap of the slice
"""

# Rescale pixel arrays
''' The numpy pixel array is converted to a signed int before any additional operations are applied.
This is due to the pydicom.dataset.Dataset.convert_pixel_data() function returning a numpy array of dtype uint16.
The dtype is dependent on the DICOM elements: BitsAllocated and PixelRepresentation.
dtype could theoretically return any combination of unsigned/signed 1, 8, 16, 32, or 64 bit values.
Undefined behaviour when np_pixels is any type other than uint16 or int16. '''
np_pixels = np_pixels.astype(np.int16)
if window != 0 and level != 0:
# Transformation applied to each individual pixel to unique
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ImageLoading.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import logging
import math
import re
import os

from multiprocessing import Queue, Process

import numpy as np
Expand Down

0 comments on commit e013dc9

Please sign in to comment.