4#ifndef OPENCV_slideio_cvtools_HPP
5#define OPENCV_slideio_cvtools_HPP
7#include <opencv2/core.hpp>
8#include "slideio/imagetools/slideio_imagetools_def.hpp"
9#include "slideio/core/cvslide.hpp"
10#include "slideio/base/slideio_enums.hpp"
16 class SLIDEIO_IMAGETOOLS_EXPORTS CVTools
19 static std::shared_ptr<CVSlide> cvOpenSlide(
const std::string& path,
const std::string& driver);
20 static std::vector<std::string> cvGetDriverIDs();
22 static inline DataType fromOpencvType(
int type)
24 return static_cast<DataType
>(type);
26 static inline int toOpencvType(DataType dt)
28 return static_cast<int>(dt);
31 static inline bool isValidDataType(slideio::DataType dt)
33 return dt <= slideio::DataType::DT_LastValid;
36 static int cvGetDataTypeSize(DataType dt);
37 static int cvTypeFromDataType(DataType dt);
38 static void extractSliceFrom3D(cv::Mat mat3D,
int sliceIndex, cv::OutputArray output);
39 static void extractSliceFromMultidimMatrix(cv::Mat multidimMat,
const std::vector<int>& indices,
40 cv::OutputArray output);
47 static void insertSliceInMultidimMatrix(cv::Mat& multidimMat,
const cv::Mat& sliceMat,
48 const std::vector<int>& indices);
49 static std::string dataTypeToString(DataType dataType);
50 static std::string compressionToString(Compression dataType);
Definition: exceptions.hpp:12