8#include <boost/json.hpp>
10#include "slideio/drivers/vsi/vsi_api_def.hpp"
11#include "slideio/imagetools/tifftools.hpp"
12#include "slideio/drivers/vsi/volume.hpp"
13#include "slideio/drivers/vsi/taginfo.hpp"
16#pragma warning( push )
17#pragma warning(disable: 4251)
28 class SLIDEIO_VSI_EXPORTS VSIFile
31 VSIFile(
const std::string& filePath);
32 std::shared_ptr<vsi::EtsFile> getEtsFile(
int index)
const {
33 return m_etsFiles[index];
35 int getNumEtsFiles()
const {
36 return static_cast<int>(m_etsFiles.size());
38 std::string getRawMetadata()
const;
39 void assignAuxVolumes();
41 int getNumTiffDirectories()
const {
42 return static_cast<int>(m_directories.size());
44 const TiffDirectory& getTiffDirectory(
int index) {
45 return m_directories[index];
47 int getNumVolumes()
const {
48 return static_cast<int>(m_volumes.size());
50 std::shared_ptr<Volume> getVolume(
int index)
const {
51 return m_volumes[index];
53 bool hasMetadata()
const {
54 return !m_metadata.empty();
56 bool expectExternalFiles()
const {
57 return m_expectExternalFiles;
59 bool hasExternalFiles()
const {
60 return !m_etsFiles.empty();
62 void getVolumeMetadataItems(std::list<const TagInfo*>& volumes)
const;
63 static void getImageFrameMetadataItems(
const TagInfo* volume, std::list<const TagInfo*>& frames);
67 void checkExternalFilePresence();
68 static StackType getVolumeStackType(
const TagInfo* volume);
69 void extractVolumesFromMetadata();
70 bool readVolumeHeader(vsi::VSIStream& vsi, vsi::VolumeHeader& volumeHeader);
71 bool readMetadata(VSIStream& vsiStream, std::list<TagInfo>& path);
72 void serializeMetadata(
const TagInfo& tagInfo, boost::json::object& jsonObj)
const;
73 void readVolumeInfo();
74 void readExternalFiles();
75 void readExtendedType(vsi::VSIStream& vsi, TagInfo& tag, std::list<TagInfo>& path);
77 std::vector<std::shared_ptr<vsi::EtsFile>> m_etsFiles;
78 bool m_expectExternalFiles =
false;
79 int m_numChannels = 0;
81 std::string m_filePath;
83 std::vector<TiffDirectory> m_directories;
84 std::vector<std::shared_ptr<Volume>> m_volumes;
Definition: exceptions.hpp:12