use scirs2_core::error::CoreError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum NdimageError {
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error("Dimension mismatch: {0}")]
DimensionError(String),
#[error("Implementation error: {0}")]
ImplementationError(String),
#[error("Computation error: {0}")]
ComputationError(String),
#[error("Filter error: {0}")]
FilterError(String),
#[error("Interpolation error: {0}")]
InterpolationError(String),
#[error("Measurement error: {0}")]
MeasurementError(String),
#[error("Morphology error: {0}")]
MorphologyError(String),
#[error("Not implemented: {0}")]
NotImplementedError(String),
#[error("Processing error: {0}")]
ProcessingError(String),
#[error("{0}")]
CoreError(#[from] CoreError),
#[error("IO error: {0}")]
IoError(#[from] std::io::Error),
#[error("Shape error: {0}")]
ShapeError(#[from] scirs2_core::ndarray::ShapeError),
#[error("Format error: {0}")]
FormatError(#[from] std::fmt::Error),
#[error("GPU not available: {0}")]
GpuNotAvailable(String),
#[error("Configuration error: {0}")]
ConfigurationError(String),
#[error("Memory error: {0}")]
MemoryError(String),
#[error("Error: {0}")]
Other(String),
}
pub type NdimageResult<T> = std::result::Result<T, NdimageError>;