Files
pixelarium/lib/imaging/impl/PixelariumCzi.hpp
T

59 lines
1.3 KiB
C++
Raw Normal View History

2025-09-22 23:13:28 +02:00
#pragma once
2025-09-25 19:25:17 +02:00
#include <memory>
2025-09-22 23:13:28 +02:00
#include <string>
#include "../IPixelariumImage.hpp"
2025-09-25 19:25:17 +02:00
#include "libCZI.h"
2025-09-22 23:13:28 +02:00
namespace pixelarium::imaging
{
2025-09-23 21:57:08 +02:00
struct CziParams : public IImageQuery
{
};
2025-09-22 23:13:28 +02:00
class PixelariumCzi : public IPixelariumImage
{
public:
explicit PixelariumCzi(const std::string& uri);
2025-09-25 19:25:17 +02:00
~PixelariumCzi()
{
if (this->czi_reader_)
this->czi_reader_->Close();
}
2025-09-22 23:13:28 +02:00
// IPixelariumImage member implementations
public:
2025-09-23 21:57:08 +02:00
std::unique_ptr<cv::Mat> TryGetImage() override;
2025-09-22 23:13:28 +02:00
2025-09-23 21:57:08 +02:00
std::unique_ptr<cv::Mat> TryGetImage(const IImageQuery&) override
2025-09-22 23:13:28 +02:00
{
// ToDo: proper error
throw std::runtime_error("Not implemented.");
}
2025-09-23 21:57:08 +02:00
std::vector<std::unique_ptr<cv::Mat>> TryGetImages(const IImageQuery&) override
2025-09-22 23:13:28 +02:00
{
2025-09-23 21:57:08 +02:00
// ToDo: proper error
throw std::runtime_error("Not implemented.");
2025-09-22 23:13:28 +02:00
}
bool Empty() const noexcept override { return this->is_empty_; }
2025-09-25 19:25:17 +02:00
const libCZI::SubBlockStatistics& GetStatistics() const { return this->image_statistics_; }
2025-09-22 23:13:28 +02:00
public:
const static ImageFileType type_{ImageFileType::CZI};
private:
// this should be set by each image getter
// after a new cv::Mat could be instantiated
bool is_empty_{true};
2025-09-25 19:25:17 +02:00
libCZI::SubBlockStatistics image_statistics_;
std::shared_ptr<libCZI::ICZIReader> czi_reader_;
2025-09-22 23:13:28 +02:00
};
} // namespace pixelarium::imaging