From dcdb5b82e9c8dbcd518c15348905072d34cb3597 Mon Sep 17 00:00:00 2001 From: Chris Bridge Date: Tue, 27 Feb 2024 12:35:13 -0500 Subject: [PATCH] Fix RECTANGLE docstring, CommonZCoordinateValue type --- src/highdicom/ann/content.py | 2 +- src/highdicom/ann/enum.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/highdicom/ann/content.py b/src/highdicom/ann/content.py index 32939dbd..90a75151 100644 --- a/src/highdicom/ann/content.py +++ b/src/highdicom/ann/content.py @@ -373,7 +373,7 @@ def __init__( if coordinates.shape[1] == 3: unique_z_values = np.unique(coordinates[:, 2]) if len(unique_z_values) == 1: - self.CommonZCoordinateValue = unique_z_values[0] + self.CommonZCoordinateValue = unique_z_values.item() coordinates_data = coordinates[:, 0:2].flatten() dimensionality = 2 else: diff --git a/src/highdicom/ann/enum.py b/src/highdicom/ann/enum.py index 8a53d783..5551aa1e 100644 --- a/src/highdicom/ann/enum.py +++ b/src/highdicom/ann/enum.py @@ -87,12 +87,13 @@ class GraphicTypeValues(Enum): """ RECTANGLE = 'RECTANGLE' - """Connected line segments defined by three or more ordered coordinates. + """Connected line segments defined by four ordered coordinates. - The coordinates shall be coplanar and form a closed, rectangular polygon. - The first coordinate is the top left hand corner, the second coordinate is - the top right hand corner, the third coordinate is the bottom right hand - corner, and the forth coordinate is the bottom left hand corner. + The coordinates shall be coplanar and represent a closed, rectangular + polygon. The first coordinate is the top left hand corner, the second + coordinate is the top right hand corner, the third coordinate is the bottom + right hand corner, and the fourth coordinate is the bottom left hand + corner. The edges of the rectangle need not be aligned with the axes of the coordinate system.