SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
zviimageitem.hpp
1// This file is part of slideio project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://slideio.com/license.html.
4#pragma once
5#include "slideio/drivers/zvi/pole_lib.hpp"
6#include "slideio/drivers/zvi/zvipixelformat.hpp"
7#include "slideio/base/slideio_enums.hpp"
8#include <opencv2/opencv.hpp>
9
10namespace slideio
11{
12 class ZVIImageItem
13 {
14 public:
15 ZVIImageItem() = default;
16 void setItemIndex(int itemIndex) { m_ItemIndex = itemIndex; }
17 int getZIndex() const { return m_ZIndex; }
18 int getCIndex() const { return m_CIndex; }
19 int getTIndex() const { return m_TIndex; }
20 int getPositionIndex() const { return m_PositionIndex; }
21 int getSceneIndex() const { return m_SceneIndex; }
22 int getItemIndex() const { return m_ItemIndex; }
23 std::streamoff getDataOffset() const { return m_DataPos; }
24 std::string getChannelName() const { return m_ChannelName; }
25 ZVIPixelFormat getPixelFormat() const { return m_PixelFormat; }
26 int getWidth() const { return m_Width; }
27 int getHeight() const { return m_Height; }
28 int getZSliceCount() const { return m_ZSliceCount; }
29 void setZSliceCount(int depth) { m_ZSliceCount = depth; }
30 DataType getDataType() const { return m_DataType; }
31 int getChannelCount() const { return m_ChannelCount; }
32 void readItemInfo(ole::compound_document& doc);
33 int getTileIndexX() const { return m_TileIndexX; }
34 int getTileIndexY() const { return m_TileIndexY; }
35 void readRaster(ole::compound_document& doc, cv::OutputArray raster) const;
36 int getValidBits() const { return m_ValidBits; }
37 void setCIndex(int cIndex) { m_CIndex = cIndex; }
38
39 // Per-channel display hints carried by the per-item tag stream.
40 // Multichannel Colour is a Windows-style packed BGR int
41 // (0x00BBGGRR); 0 means the file did not assign a color. Wavelength
42 // values are in nanometers; 0 means absent. Reflector is the
43 // microscope filter cube label (e.g. "49 DAPI").
44 int getMultichannelColour() const { return m_MultichannelColour; }
45 double getEmissionWavelength() const { return m_EmissionWavelength; }
46 double getExcitationWavelength() const { return m_ExcitationWavelength; }
47 std::string getReflector() const { return m_Reflector; }
48 private:
49 void setWidth(int width) { m_Width = width; }
50 void setHeight(int height) { m_Height = height; }
51 void setPixelFormat(ZVIPixelFormat pixelFormat);
52 void setZIndex(int zIndex) { m_ZIndex = zIndex; }
53 void setTIndex(int tIndex) { m_TIndex = tIndex; }
54 void setPositionIndex(int positionIndex) { m_PositionIndex = positionIndex; }
55 void setSceneIndex(int sceneIndex) { m_SceneIndex = sceneIndex; }
56 void setDataOffset(std::streamoff pos) { m_DataPos = pos; }
57 void setChannelName(const std::string& name) { m_ChannelName = name; }
58 void setTileIndexX(int index) { m_TileIndexX = index; }
59 void setTileIndexY(int index) { m_TileIndexY = index; }
60 void readContents(ole::compound_document& doc);
61 void readTags(ole::compound_document& doc);
62 void setValidBits(int bits) { m_ValidBits = bits; }
63 private:
64 int m_ChannelCount = 0;
65 int m_Width = 0;
66 int m_Height = 0;
67 int m_ItemIndex = -1;
68 int m_ZIndex = -1;
69 int m_CIndex = -1;
70 int m_TIndex = -1;
71 int m_PositionIndex = -1;
72 int m_SceneIndex = -1;
73 int m_TileIndexX = -1;
74 int m_TileIndexY = -1;
75 int m_ValidBits = 0;
76 std::streamoff m_DataPos = 0;
77 std::string m_ChannelName;
78 ZVIPixelFormat m_PixelFormat = ZVIPixelFormat::PF_UNKNOWN;
79 int m_ZSliceCount = 1;
80 DataType m_DataType = DataType::DT_Unknown;
81 int m_MultichannelColour = 0;
82 double m_EmissionWavelength = 0.0;
83 double m_ExcitationWavelength = 0.0;
84 std::string m_Reflector;
85 };
86
87}
Definition: exceptions.hpp:15