Skip to content

Commit

Permalink
x == y or x == zx in (y, z)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Oct 11, 2023
1 parent 1cc2481 commit 0e4d302
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/highdicom/pr/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/highdicom/sr/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/highdicom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Expand Down

0 comments on commit 0e4d302

Please sign in to comment.