wsi_dicom_annotations/
lib.rs1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4use std::error::Error as StdError;
5use std::path::PathBuf;
6
7mod annotations;
8pub mod metadata;
9
10#[cfg(test)]
11mod annotation_tests;
12#[cfg(test)]
13mod linear_measurement_tests;
14#[cfg(all(test, feature = "parametric-map"))]
15mod parametric_map_tests;
16#[cfg(test)]
17mod pathology_geojson_tests;
18#[cfg(test)]
19mod scheme_tests;
20#[cfg(test)]
21mod test_support;
22
23pub use annotations::*;
24
25#[derive(Debug, thiserror::Error)]
27pub enum Error {
28 #[error("invalid input: {0}")]
30 InvalidInput(String),
31 #[error("unsupported input: {0}")]
33 Unsupported(String),
34 #[error("I/O error at {path}: {source}")]
36 Io {
37 path: PathBuf,
39 #[source]
41 source: std::io::Error,
42 },
43 #[error("DICOM read error at {path}: {source}")]
45 DicomRead {
46 path: PathBuf,
48 #[source]
50 source: Box<dyn StdError + Send + Sync>,
51 },
52 #[error("DICOM write error at {path}: {source}")]
54 DicomWrite {
55 path: PathBuf,
57 #[source]
59 source: Box<dyn StdError + Send + Sync>,
60 },
61}
62
63pub type Result<T> = std::result::Result<T, Error>;