18 from typing
import Any, Dict
20 from .image_sample_data
import AnnotatedImageSampleData
21 from .local_image_sample
import LocalImageSample
22 from ..network_sample
import NetworkSample
23 from ...annotation
import CoretexImageAnnotation
24 from ....networking
import networkManager, NetworkRequestError
30 Represents the generic image sample\n
31 Contains basic properties and functionality for all image sample classes\n
32 The class has several methods that allow users to access and
33 manipulate image data and annotations, as well as to create new image samples
36 def __init__(self) -> None:
37 NetworkSample.__init__(self)
54 except NetworkRequestError:
59 "data": coretexAnnotation.encode()
62 response = networkManager.post(
"session/save-annotations", parameters)
63 return not response.hasFailed()
84 response = networkManager.post(
"session/save-metadata", parameters)
85 if response.hasFailed():
86 raise NetworkRequestError(response, f
"Failed to upload metadata for sample \"{self.name}\"")
bool saveAnnotation(self, CoretexImageAnnotation coretexAnnotation)
None saveMetadata(self, Dict[str, Any] metadata)
None download(self, bool decrypt=True, bool ignoreCache=False)
None _overwriteSample(self, Path samplePath)
None download(self, bool decrypt=True, bool ignoreCache=False)
None unzip(self, bool ignoreCache=False)
None download(self, bool decrypt=True, bool ignoreCache=False)
None unzip(self, bool ignoreCache=False)