Czi rendering (#10)
* add dimension selector sliders to czi view * version doc & version bump * cosmetic * fix build? * multi-dimension selection enabled in czi view * remove the parameterized reset function of the renderer it is not and is conceptually questionable doc updates & some minor improvements auto-update CZI-view when sliders are moved set initial window size fix windows build and msvc build For reasons I don not comprehend, on Windows, we must include =opencv2/core/mat.hpp= as the very last header in the =CvMatRender.hpp=. If this is at any other position building on Windows, compilation will break w/ all kinds of cryptic errors regarding OpenCV. When building w/ msvc =__PRETTY_FUNCTION__= is not defined. =ILog.hpp= now defines it. This should be revised to only be set when the compiler is msvc. For the time being, it is considered sufficient though.
This commit is contained in:
committed by
Maximilian Kueffner
parent
e60203b57d
commit
1ea83d9d11
@@ -4,19 +4,25 @@
|
||||
#include <string>
|
||||
|
||||
#include "../IPixelariumImage.hpp"
|
||||
#include "utilities/ILog.hpp"
|
||||
#include "libCZI.h"
|
||||
|
||||
namespace pixelarium::imaging
|
||||
{
|
||||
/// @brief An implementation of IImageQuery to work on CZI images.
|
||||
/// @note Check the documentation here https://zeiss.github.io/libczi/pages/mainpage.html#czi-in-a-nutshell
|
||||
struct CziParams : public IImageQuery
|
||||
{
|
||||
|
||||
/// @brief A map providing the start coordinate for each dimension in the CZI
|
||||
std::unordered_map<libCZI::DimensionIndex, int> dimension_map;
|
||||
};
|
||||
|
||||
/// @brief Implements support for .czi-images in the realm of IPixelariumImage
|
||||
class PixelariumCzi : public IPixelariumImage
|
||||
{
|
||||
using Log = pixelarium::utils::log::ILog;
|
||||
public:
|
||||
explicit PixelariumCzi(const std::string& uri);
|
||||
explicit PixelariumCzi(const std::string& uri, const Log& log);
|
||||
~PixelariumCzi()
|
||||
{
|
||||
if (this->czi_reader_)
|
||||
@@ -27,11 +33,7 @@ class PixelariumCzi : public IPixelariumImage
|
||||
public:
|
||||
std::unique_ptr<cv::Mat> TryGetImage() override;
|
||||
|
||||
std::unique_ptr<cv::Mat> TryGetImage(const IImageQuery&) override
|
||||
{
|
||||
// ToDo: proper error
|
||||
throw std::runtime_error("Not implemented.");
|
||||
}
|
||||
std::unique_ptr<cv::Mat> TryGetImage(const IImageQuery&) override;
|
||||
|
||||
std::vector<std::unique_ptr<cv::Mat>> TryGetImages(const IImageQuery&) override
|
||||
{
|
||||
@@ -46,6 +48,9 @@ class PixelariumCzi : public IPixelariumImage
|
||||
public:
|
||||
const static ImageFileType type_{ImageFileType::CZI};
|
||||
|
||||
private:
|
||||
std::unique_ptr<cv::Mat> SubblockToCvMat(int index);
|
||||
|
||||
private:
|
||||
// this should be set by each image getter
|
||||
// after a new cv::Mat could be instantiated
|
||||
@@ -54,5 +59,9 @@ class PixelariumCzi : public IPixelariumImage
|
||||
libCZI::SubBlockStatistics image_statistics_;
|
||||
|
||||
std::shared_ptr<libCZI::ICZIReader> czi_reader_;
|
||||
|
||||
std::unordered_map<libCZI::DimensionIndex, int> dimension_map_;
|
||||
|
||||
const Log& log_;
|
||||
};
|
||||
} // namespace pixelarium::imaging
|
||||
|
||||
Reference in New Issue
Block a user