ROIElement: Remove toString()
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <cmath>
|
||||
#include "ROIAzimuthal.h"
|
||||
#include "JFJochException.h"
|
||||
#include "spdlog/fmt/bundled/format.h"
|
||||
|
||||
ROIAzimuthal::ROIAzimuthal(const std::string &in_name, float in_d_min_A, float in_d_max_A)
|
||||
: ROIElement(in_name) {
|
||||
@@ -49,7 +47,3 @@ ROIConfig ROIAzimuthal::ExportMetadata() const {
|
||||
.azim = ROIConfigAzim{.qmin = qmin, .qmax = qmax}
|
||||
};
|
||||
}
|
||||
|
||||
std::string ROIAzimuthal::toString() const {
|
||||
return fmt::format("Azim Q {:.02f} - {:.02f} A", GetQMin_recipA(), GetQMax_recipA());
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
|
||||
bool CheckROI(int64_t x, int64_t y, float resolution) const override;
|
||||
ROIConfig ExportMetadata() const override;
|
||||
[[nodiscard]] std::string toString() const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "ROIBox.h"
|
||||
#include "spdlog/fmt/bundled/format.h"
|
||||
|
||||
ROIBox::ROIBox(const std::string &in_name, int64_t in_x_min, int64_t in_x_max, int64_t in_y_min, int64_t in_y_max)
|
||||
: ROIElement(in_name) {
|
||||
@@ -67,7 +66,3 @@ ROIConfig ROIBox::ExportMetadata() const {
|
||||
.box = ROIConfigBox{.xmin = x_min, .xmax = x_max, .ymin = y_min, .ymax = y_max}
|
||||
};
|
||||
}
|
||||
|
||||
std::string ROIBox::toString() const {
|
||||
return fmt::format("Box x: {} - {} y: {} - {} pxl", x_min, x_max, y_min, y_max);
|
||||
}
|
||||
@@ -24,7 +24,6 @@ public:
|
||||
|
||||
bool CheckROI(int64_t x, int64_t y, float resolution) const override;
|
||||
ROIConfig ExportMetadata() const override;
|
||||
[[nodiscard]] std::string toString() const override;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_ROIBOX_H
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "ROICircle.h"
|
||||
#include "JFJochException.h"
|
||||
#include "spdlog/fmt/bundled/format.h"
|
||||
|
||||
ROICircle::ROICircle(const std::string &name, float in_x, float in_y, float in_r_pxl)
|
||||
: ROIElement(name), center_x(in_x), center_y(in_y), r_pxl(in_r_pxl), r_pxl_2(in_r_pxl * in_r_pxl) {
|
||||
@@ -40,8 +37,3 @@ bool ROICircle::CheckROI(int64_t x, int64_t y, float resolution) const {
|
||||
float dist_from_center_sq = x_fl * x_fl + y_fl * y_fl;
|
||||
return (dist_from_center_sq <= r_pxl_2);
|
||||
}
|
||||
|
||||
std::string ROICircle::toString() const {
|
||||
return fmt::format("Circle x: {:.1f} y: {:.1f} r: {:.01f} pxl", center_x, center_y, r_pxl);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ public:
|
||||
[[nodiscard]] float GetRadius_pxl() const;
|
||||
bool CheckROI(int64_t x, int64_t y, float resolution) const override;
|
||||
ROIConfig ExportMetadata() const override;
|
||||
[[nodiscard]] std::string toString() const override;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_ROICIRCLE_H
|
||||
|
||||
@@ -21,7 +21,6 @@ public:
|
||||
[[nodiscard]] virtual bool CheckROI(int64_t x, int64_t y, float resolution) const = 0;
|
||||
void MarkROI(std::vector<uint16_t> &v, uint16_t value_to_mark, int64_t xpixel, int64_t ypixel,
|
||||
const std::vector<float> &resolution_map) const;
|
||||
[[nodiscard]] virtual std::string toString() const = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -205,7 +205,6 @@ void JFJochReaderImage::CalcROI(const ROIElement *input) {
|
||||
std::unique_lock ul(roi_mutex);
|
||||
|
||||
if (!input) {
|
||||
roi_description = "";
|
||||
roi = {};
|
||||
return;
|
||||
}
|
||||
@@ -230,7 +229,6 @@ void JFJochReaderImage::CalcROI(const ROIElement *input) {
|
||||
}
|
||||
}
|
||||
}
|
||||
roi_description = input->toString();
|
||||
|
||||
roi = ROIMessage{
|
||||
.sum = roi_val,
|
||||
@@ -280,7 +278,3 @@ std::shared_ptr<JFJochReaderDataset> JFJochReaderImage::CreateMutableDataset() {
|
||||
int32_t JFJochReaderImage::GetAutoContrastValue() const {
|
||||
return auto_foreground;
|
||||
}
|
||||
|
||||
std::string JFJochReaderImage::GetROIDescription() const {
|
||||
return roi_description;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ class JFJochReaderImage {
|
||||
std::unordered_set<int64_t> saturated_pixel;
|
||||
std::unordered_set<int64_t> error_pixel;
|
||||
std::vector<std::pair<int32_t, int32_t>> valid_pixel;
|
||||
std::string roi_description;
|
||||
std::optional<ROIMessage> roi;
|
||||
mutable std::mutex roi_mutex;
|
||||
|
||||
@@ -50,7 +49,6 @@ public:
|
||||
const JFJochReaderDataset &Dataset() const;
|
||||
|
||||
const std::optional<ROIMessage> &GetROI() const;
|
||||
std::string GetROIDescription() const;
|
||||
|
||||
void AddImage(const JFJochReaderImage& other);
|
||||
std::vector<float> GetAzInt1D() const;
|
||||
|
||||
Reference in New Issue
Block a user