10#include "vsistruct.hpp"
11#include "slideio/drivers/vsi/vsi_api_def.hpp"
12#include "slideio/imagetools/tifftools.hpp"
13#include "slideio/drivers/vsi/dimensions.hpp"
16#pragma warning( push )
17#pragma warning(disable: 4251)
25 class SLIDEIO_VSI_EXPORTS Volume :
public IDimensionOrder
29 m_dimensionOrder[0] = 0;
30 m_dimensionOrder[1] = 1;
32 std::string getName()
const {
return m_name; }
33 void setName(
const std::string& name) { m_name = name; }
35 double getMagnification()
const {
return m_magnification; }
36 void setMagnification(
double magnification) { m_magnification = magnification; }
38 StackType getType()
const {
return m_type; }
39 void setType(StackType type) { m_type = type; }
41 cv::Size getSize()
const {
return m_size; }
42 void setSize(
const cv::Size& size) { m_size = size; }
44 int getBitDepth()
const {
return m_bitDepth; }
45 void setBitDepth(
int bitDepth) { m_bitDepth = bitDepth; }
47 bool hasExternalFile()
const {
return m_hasExternalFile; }
48 void setHasExternalFile(
bool hasExternalFile) { m_hasExternalFile = hasExternalFile; }
50 int getNumAuxVolumes()
const {
return static_cast<int>(m_auxVolumes.size()); }
51 std::shared_ptr<Volume> getAuxVolume(
int index)
const {
return m_auxVolumes[index]; }
52 void addAuxVolume(std::shared_ptr<Volume>& volume) { m_auxVolumes.push_back(volume); }
54 void setIFD(
int ifd) { m_ifd = ifd; }
55 int getIFD()
const {
return m_ifd; }
57 void setDefaultColor(
int color) { m_defaultColor = color; }
58 int getDefaultColor()
const {
return m_defaultColor; }
60 int getDimensionOrder(Dimensions dim)
const override {
return m_dimensionOrder[dimensionIndex(dim)]; }
61 void setDimensionOrder(Dimensions dim,
int value) { m_dimensionOrder[dimensionIndex(dim)] = value; }
63 const Resolution& getResolution()
const {
return m_resolution; }
64 void setResolution(
const Resolution& resolution) { m_resolution = resolution; }
65 void setZResolution(
double res) { m_zResolution = res; }
66 double getZResolution()
const {
return m_zResolution; }
67 void setTResolution(
double res) { m_tResolution = res; }
68 double getTResolution()
const {
return m_tResolution; }
69 void setChannelName(
int channelIndex,
const std::string& channelName);
70 std::string getChannelName(
int channelIndex)
const;
75 void setChannelColor(
int channelIndex, uint8_t r, uint8_t g, uint8_t b);
76 bool hasChannelColor(
int channelIndex)
const;
77 void getChannelColor(
int channelIndex, uint8_t& r, uint8_t& g, uint8_t& b)
const;
81 void setChannelEmissionWavelength(
int channelIndex,
double nm);
82 double getChannelEmissionWavelength(
int channelIndex)
const;
84 const bool isValid()
const {
85 return m_size.height>0 && m_size.width>0;
89 static int dimensionIndex(Dimensions dim) {
90 return static_cast<int>(dim);
94 double m_magnification = 0.;
95 StackType m_type = StackType::UNKNOWN;
98 bool m_hasExternalFile =
false;
100 std::vector<std::shared_ptr<Volume>> m_auxVolumes;
101 int m_defaultColor = 0;
102 int m_dimensionOrder[MAX_DIMENSIONS] = {-1};
103 Resolution m_resolution;
104 double m_zResolution = 0.;
105 double m_tResolution = 0.;
106 std::vector<std::string> m_channelNames;
107 static constexpr uint32_t kNoChannelColor = 0xFFFFFFFFu;
108 std::vector<uint32_t> m_channelColors;
109 std::vector<double> m_channelEmissionWavelengths;
Definition: exceptions.hpp:15