From 0e4d302e73cbb078d4aad2015d55b1c798e8e559 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 9 Oct 2023 18:46:24 +0200 Subject: [PATCH] =?UTF-8?q?`x=20=3D=3D=20y=20or=20x=20=3D=3D=20z`=20?= =?UTF-8?q?=E2=86=92=20`x=20in=20(y,=20z)`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/highdicom/pr/content.py | 5 +---- src/highdicom/sr/templates.py | 4 ++-- src/highdicom/utils.py | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/highdicom/pr/content.py b/src/highdicom/pr/content.py index e69166e4..180ef70f 100644 --- a/src/highdicom/pr/content.py +++ b/src/highdicom/pr/content.py @@ -265,10 +265,7 @@ def __init__( 'that the first and last points are equal, ' 'i.e., that the graphic has a closed contour. ' ) - if ( - units == AnnotationUnitsValues.PIXEL or - units == AnnotationUnitsValues.MATRIX - ): + if units in (AnnotationUnitsValues.PIXEL, AnnotationUnitsValues.MATRIX): if graphic_data.min() < 0.0: raise ValueError('Graphic data must be non-negative.') elif units == AnnotationUnitsValues.DISPLAY: diff --git a/src/highdicom/sr/templates.py b/src/highdicom/sr/templates.py index 42681bf2..405e3dde 100644 --- a/src/highdicom/sr/templates.py +++ b/src/highdicom/sr/templates.py @@ -110,8 +110,8 @@ def _count_roi_items( n_region_in_space_items = 0 for item in group_item.ContentSequence: if (item.name == codes.DCM.ImageRegion and - (item.value_type == ValueTypeValues.SCOORD or - item.value_type == ValueTypeValues.SCOORD3D)): + item.value_type in (ValueTypeValues.SCOORD, + ValueTypeValues.SCOORD3D)): n_image_region_items += 1 if (item.name == codes.DCM.VolumeSurface and item.value_type == ValueTypeValues.SCOORD3D): diff --git a/src/highdicom/utils.py b/src/highdicom/utils.py index 07c9a15f..4458536e 100644 --- a/src/highdicom/utils.py +++ b/src/highdicom/utils.py @@ -121,7 +121,7 @@ def compute_plane_position_tiled_full( slice_index is not None, spacing_between_slices is not None, ) - if not (sum(provided_3d_params) == 0 or sum(provided_3d_params) == 2): + if sum(provided_3d_params) not in (0, 2): raise TypeError( 'None or both of the following parameters need to be provided: ' '"slice_index", "spacing_between_slices"'