4#ifndef OPENCV_slideio_czislide_HPP
5#define OPENCV_slideio_czislide_HPP
6#include "slideio/drivers/czi/czi_api_def.hpp"
7#include "slideio/core/cvslide.hpp"
8#include "slideio/drivers/czi/cziscene.hpp"
9#include "slideio/drivers/czi/czistructs.hpp"
21#pragma warning( push )
22#pragma warning(disable: 4251)
27 class SLIDEIO_CZI_EXPORTS CZISlide :
public CVSlide
29 friend class CZIImageDriver;
31 CZISlide(
const std::string& filePath);
33 virtual ~CZISlide()
override;
34 int getNumScenes()
const override;
35 std::string getFilePath()
const override;
36 std::shared_ptr<CVScene> getScene(
int index)
const override;
37 double getMagnification()
const {
return m_magnification; }
38 Resolution getResolution()
const {
return m_res; }
39 double getZSliceResolution()
const {
return m_resZ;}
40 double getTFrameResolution()
const {
return m_resT;}
41 const CZIChannelInfos& getChannelInfo()
const {
return m_channels; }
42 const std::string& getTitle()
const {
return m_title; }
43 void readBlock(uint64_t pos, uint64_t size, std::vector<unsigned char>& data);;
44 std::shared_ptr<CVScene> getAuxImage(
const std::string& sceneName)
const override;
45 void readFileHeader(FileHeader& fileHeader);
46 void readSubBlocks(uint64_t pos, uint64_t originPos, std::vector<CZISubBlocks>& sceneBlocks, std::vector<uint64_t>& sceneIds);
47 std::shared_ptr<CZIScene> constructScene(uint64_t sceneId,
const CZISubBlocks& blocks);
49 void readAttachments();
52 void readFileHeader();
54 void parseMagnification(tinyxml2::XMLNode* root);
55 void parseMetadataXmL(
const char* xml,
size_t dataSize);
56 void parseResolutions(tinyxml2::XMLNode* root);
57 void parseSizes(tinyxml2::XMLNode* root);
58 void createJpgAttachmentScenes(int64_t dataPosition, int64_t dataSize,
const std::string& name);
59 void parseChannels(tinyxml2::XMLNode* root);
60 void createCZIAttachmentScenes(
const int64_t dataPos, int64_t dataSize,
const std::string& attachmentName);
61 void addAuxiliaryImage(
const std::string& name,
const std::string& type, int64_t position);
63 std::vector<std::shared_ptr<CZIScene>> m_scenes;
64 std::string m_filePath;
65 std::ifstream m_fileStream;
66 uint64_t m_directoryPosition{};
67 uint64_t m_metadataPosition{};
68 uint64_t m_attachmentDirectoryPosition;
81 double m_magnification{};
85 CZIChannelInfos m_channels;
87 std::map<std::string, std::shared_ptr<CVScene >> m_auxImages;
Definition: exceptions.hpp:12