in ez_wsi_dicomweb/gcs_image.py [0:0]
def __eq__(self, other: Any) -> bool:
if not isinstance(other, GcsImage):
return False
if self._gcs_uri and other._gcs_uri:
return (
self._gcs_uri == other._gcs_uri
and self._image_resize_dims == other._image_resize_dims
)
if self._gcs_uri and not self.are_image_bytes_loaded:
self._get_gcs_image() # load images from GCS if required.
if other._gcs_uri and not other.are_image_bytes_loaded:
other._get_gcs_image()
if self.width != other.width or self.height != other.height:
return False
# if loaded image bytes never cleared safe to access outside of lock.
return np.array_equal(self._image_bytes, other._image_bytes)