From 5c1c98b27a40f21772e0ad94fbd21d7611d7ddb7 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 9 Apr 2020 12:18:05 +0200 Subject: [PATCH] Display more dicom metadata in visualization --- pylidc/Annotation.py | 7 +++++-- pylidc/Scan.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pylidc/Annotation.py b/pylidc/Annotation.py index 225a5e6..08f8a42 100644 --- a/pylidc/Annotation.py +++ b/pylidc/Annotation.py @@ -830,13 +830,16 @@ def visualize_in_scan(self, verbose=True): ax_image.axis('off') # Add the scan info table - ax_scan_info = fig.add_axes([0.1, 0.8, 0.3, 0.1]) + ax_scan_info = fig.add_axes([0.1, 0.76, 0.3, 0.15]) ax_scan_info.set_facecolor('w') scan_info_table = ax_scan_info.table( cellText=[ ['Patient ID:', self.scan.patient_id], ['Slice thickness:', '%.3f mm' % self.scan.slice_thickness], - ['Pixel spacing:', '%.3f mm'%self.scan.pixel_spacing] + ['Pixel spacing:', '%.3f mm'%self.scan.pixel_spacing], + ['Manufacturer:', images[current_slice].Manufacturer], + ['Model name:', images[current_slice].ManufacturerModelName], + ['Convolution kernel:', images[current_slice].ConvolutionKernel], ], loc='center', cellLoc='left' ) diff --git a/pylidc/Scan.py b/pylidc/Scan.py index 63caece..1e718dc 100644 --- a/pylidc/Scan.py +++ b/pylidc/Scan.py @@ -529,12 +529,15 @@ def visualize(self, annotation_groups=None): a.set_visible(False) # flipped on/off by `update` function. arrows.append(a) - ax_scan_info = fig.add_axes([0.1, 0.8, 0.3, 0.1]) # l,b,w,h + ax_scan_info = fig.add_axes([0.1, 0.7, 0.3, 0.15]) # l,b,w,h ax_scan_info.set_facecolor('w') scan_info_table = ax_scan_info.table(cellText=[ ['Patient ID:', self.patient_id], ['Slice thickness:', '%.3f mm' % self.slice_thickness], - ['Pixel spacing:', '%.3f mm' % self.pixel_spacing] + ['Pixel spacing:', '%.3f mm' % self.pixel_spacing], + ['Manufacturer:', images[current_slice].Manufacturer], + ['Model name:', images[current_slice].ManufacturerModelName], + ['Convolution kernel:', images[current_slice].ConvolutionKernel], ], loc='center', cellLoc='left' )