Skip to content

Commit 498be52

Browse files
committed
The tag value for usinged int is 0
Signed-off-by: M Q <[email protected]>
1 parent cb5ad53 commit 498be52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

monai/deploy/operators/dicom_series_to_volume_operator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ def generate_voxel_data(self, series):
112112
# with the NumPy array returned from the ITK GetArrayViewFromImage on the image
113113
# loaded from the same DICOM series.
114114
vol_data = np.stack([s.get_pixel_array() for s in slices], axis=0)
115-
if slices[0][0x0028,0x0103].value == 1:
115+
# The above get_pixel_array() already considers the PixelRepresentation attribute,
116+
# 0 is unsigned int, 1 is signed int
117+
if slices[0][0x0028,0x0103].value == 0:
116118
vol_data = vol_data.astype(np.uint16)
117119

118120
# For now we support monochrome image only, for which DICOM Photometric Interpretation

0 commit comments

Comments
 (0)