PT Viewing¶
Only PT images with SOP UID " Positron Emission Tomography Image Storage " (1.2.840.10008.5.1.4.1.1.128) supports the Image Plane module which contains Image Position (Patient) and Image Orientation (Patient). Files with "enhanced" SOP Classes such as "Enhanced PET Image Storage" and "Legacy Converted Enhanced PET Image Storage" would need further investigation to import other modules such as Dimension Index Sequence.
Images with SOP UIDs "Secondary Capture Image Storage" and "Multi-frame True Color Secondary Capture Image Storage" are essentially "screenshots" of data/images from PT modality. These are a variety of different secondary capture types. It is important to confirm the SOP Class as that is what defines the content of the object.
While experimenting with series [WB_NAC] and [WB_CTAC], the system encountered KeyError: (0018, 5100). It is missing the Patient Position attribute.
if hasattr(dataset, 'PatientPosition'):
patient_pos = dataset['PatientPosition'].value
self.label_patient_pos.setText(
"Patient Position: %s" % (str(patient_pos)))
The above code has resolved the issue of being unable to display modern PET files in OnkoDICOM, however, the image is sheared upon opening. This is due to an issue in QImages as PySide6 needs to know the number of bytes in each line of an image, otherwise it will assume something. This has led to there being too many bytes in one line. To resolve the issue, the number of bytes for each image needed to be recalculated (only the last 57 122 bytes should be used to form the image).
The following code snippet has fixed the issue:
# PT Viewing Shear Issue Fix
# Convert numpy array data to QImage for PySide6
bytes_per_line = np_pixels.shape[1]
qimage = QtGui.QImage(
np_pixels, np_pixels.shape[1], np_pixels.shape[0], bytes_per_line,
QtGui.QImage.Format_Indexed8)
Updated by Felicina Chau over 3 years ago · 6 revisions