67 lines
2.2 KiB
C++
67 lines
2.2 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_GRIDSCANSETTINGS_H
|
|
#define JFJOCH_GRIDSCANSETTINGS_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
class GridScanSettings {
|
|
int64_t n_fast;
|
|
int64_t n_slow;
|
|
int64_t n_elem;
|
|
|
|
float grid_elem_x_um;
|
|
float grid_elem_y_um;
|
|
bool snake_scan;
|
|
bool vertical_scan;
|
|
|
|
[[nodiscard]] int64_t GetElementPosFast_step(int64_t image_number) const;
|
|
[[nodiscard]] int64_t GetElementPosSlow_step(int64_t image_number) const;
|
|
|
|
public:
|
|
GridScanSettings(int64_t n_fast,
|
|
float grid_step_x_um,
|
|
float grid_step_y_um,
|
|
bool snake_raster_scan,
|
|
bool vertical_scan);
|
|
|
|
GridScanSettings& ImageNum(int64_t input);
|
|
|
|
[[nodiscard]] int64_t GetNSlow() const;
|
|
[[nodiscard]] int64_t GetNFast() const;
|
|
[[nodiscard]] int64_t GetNElem() const;
|
|
|
|
[[nodiscard]] float GetGridElemFast_um() const;
|
|
[[nodiscard]] float GetGridElemSlow_um() const;
|
|
[[nodiscard]] bool IsSnakeScan() const;
|
|
[[nodiscard]] bool IsVerticalScan() const;
|
|
|
|
[[nodiscard]] int64_t GetGridSizeX_step() const;
|
|
[[nodiscard]] int64_t GetGridSizeY_step() const;
|
|
|
|
[[nodiscard]] float GetGridSizeX_um() const;
|
|
[[nodiscard]] float GetGridSizeY_um() const;
|
|
|
|
[[nodiscard]] int64_t GetElementPosX_step(int64_t elem_number) const;
|
|
[[nodiscard]] int64_t GetElementPosY_step(int64_t elem_number) const;
|
|
|
|
[[nodiscard]] float GetElementPosX_um(int64_t elem_number) const;
|
|
[[nodiscard]] float GetElementPosY_um(int64_t elem_number) const;
|
|
|
|
[[nodiscard]] float GetGridStepX_um() const;
|
|
[[nodiscard]] float GetGridStepY_um() const;
|
|
|
|
[[nodiscard]] std::vector<double> GetXContainer_m(int64_t max_image_number) const;
|
|
[[nodiscard]] std::vector<double> GetYContainer_m(int64_t max_image_number) const;
|
|
|
|
[[nodiscard]] int64_t Rearrange(int64_t image_number) const;
|
|
[[nodiscard]] std::vector<float> Rearrange(const std::vector<float> &input, float fill_value = -1) const;
|
|
[[nodiscard]] std::vector<int64_t> Rearrange(const std::vector<int64_t> &input, uint64_t fill_value) const;
|
|
};
|
|
|
|
|
|
#endif //JFJOCH_GRIDSCANSETTINGS_H
|