11#include "vsistruct.hpp"
12#include "slideio/drivers/vsi/vsi_api_def.hpp"
13#include "slideio/imagetools/tifftools.hpp"
14#include "slideio/drivers/vsi/dimensions.hpp"
17#pragma warning( push )
18#pragma warning(disable: 4251)
26 class SLIDEIO_VSI_EXPORTS Volume :
public IDimensionOrder
34 std::fill(std::begin(m_dimensionOrder), std::end(m_dimensionOrder),
35 UNSET_DIMENSION_ORDER);
36 m_dimensionOrder[dimensionIndex(Dimensions::X)] = 0;
37 m_dimensionOrder[dimensionIndex(Dimensions::Y)] = 1;
39 std::string getName()
const {
return m_name; }
40 void setName(
const std::string& name) { m_name = name; }
42 double getMagnification()
const {
return m_magnification; }
43 void setMagnification(
double magnification) { m_magnification = magnification; }
45 StackType getType()
const {
return m_type; }
46 void setType(StackType type) { m_type = type; }
48 cv::Size getSize()
const {
return m_size; }
49 void setSize(
const cv::Size& size) { m_size = size; }
51 int getBitDepth()
const {
return m_bitDepth; }
52 void setBitDepth(
int bitDepth) { m_bitDepth = bitDepth; }
54 bool hasExternalFile()
const {
return m_hasExternalFile; }
55 void setHasExternalFile(
bool hasExternalFile) { m_hasExternalFile = hasExternalFile; }
57 int getNumAuxVolumes()
const {
return static_cast<int>(m_auxVolumes.size()); }
58 std::shared_ptr<Volume> getAuxVolume(
int index)
const {
return m_auxVolumes[index]; }
59 void addAuxVolume(std::shared_ptr<Volume>& volume) { m_auxVolumes.push_back(volume); }
61 void setIFD(
int ifd) { m_ifd = ifd; }
62 int getIFD()
const {
return m_ifd; }
64 void setDefaultColor(
int color) { m_defaultColor = color; }
65 int getDefaultColor()
const {
return m_defaultColor; }
67 int getDimensionOrder(Dimensions dim)
const override {
return m_dimensionOrder[dimensionIndex(dim)]; }
68 void setDimensionOrder(Dimensions dim,
int value) { m_dimensionOrder[dimensionIndex(dim)] = value; }
74 const Resolution& getResolution()
const {
return m_resolution; }
75 void setResolution(
double rawX,
double rawY,
const std::string& unit);
76 void setZResolution(
double raw,
const std::string& unit);
77 double getZResolution()
const {
return m_zResolution; }
82 void setTResolution(
double raw,
const std::string& unit);
83 double getTResolution()
const {
return m_tResolution; }
84 void setChannelName(
int channelIndex,
const std::string& channelName);
85 std::string getChannelName(
int channelIndex)
const;
90 void setChannelColor(
int channelIndex, uint8_t r, uint8_t g, uint8_t b);
91 bool hasChannelColor(
int channelIndex)
const;
92 void getChannelColor(
int channelIndex, uint8_t& r, uint8_t& g, uint8_t& b)
const;
96 void setChannelEmissionWavelength(
int channelIndex,
double nm);
97 double getChannelEmissionWavelength(
int channelIndex)
const;
102 void setPlaneTimestamps(
const std::vector<double>& raw,
const std::string& unit);
103 int getPlaneTimestampCount()
const;
104 double getPlaneTimestampByIndex(
int index)
const;
107 void setAcquisitionTime(int64_t epochSeconds) { m_acquisitionTime = epochSeconds; }
108 int64_t getAcquisitionTime()
const {
return m_acquisitionTime; }
110 const bool isValid()
const {
111 return m_size.height>0 && m_size.width>0;
115 static int dimensionIndex(Dimensions dim) {
116 return static_cast<int>(dim);
120 double m_magnification = 0.;
121 StackType m_type = StackType::UNKNOWN;
122 cv::Size m_size = {};
124 bool m_hasExternalFile =
false;
126 std::vector<std::shared_ptr<Volume>> m_auxVolumes;
127 int m_defaultColor = 0;
130 int m_dimensionOrder[MAX_DIMENSIONS];
131 Resolution m_resolution;
132 double m_zResolution = 0.;
133 double m_tResolution = 0.;
134 std::vector<std::string> m_channelNames;
135 static constexpr uint32_t kNoChannelColor = 0xFFFFFFFFu;
136 std::vector<uint32_t> m_channelColors;
137 std::vector<double> m_channelEmissionWavelengths;
138 std::vector<double> m_planeTimestamps;
139 int64_t m_acquisitionTime = 0;
Definition: converter.hpp:18