SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
svstools.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
6#include "slideio/drivers/svs/svs_api_def.hpp"
7#include "slideio/imagetools/tifftools.hpp"
8#include <opencv2/core.hpp>
9#include <nlohmann/json.hpp>
10#include <string>
11
12namespace slideio
13{
14 class SLIDEIO_SVS_EXPORTS SVSTools
15 {
16 public:
17 // Extracts magnification value from image information string
18 static int extractMagnifiation(const std::string& description);
19 // Extracts resolution value from image information string
20 static double extractResolution(const std::string& description);
21 // Parses an Aperio-format metadata string into a structured JSON tree.
22 // Header lines (before the first '|') become "application" and "image";
23 // subsequent "name = value" tokens become entries under "properties".
24 static nlohmann::json parseAperioMetadata(const std::string& description);
25 // Serializes a TiffDirectory (and its subdirectories) to JSON.
26 static nlohmann::json tiffDirectoryToJson(const TiffDirectory& dir);
27 };
28}
Definition: exceptions.hpp:15