dicutil.hpp¶
-
namespace util¶
Functions
-
void extract_image(double *img_def_stack, int image_number, int px_hori, int px_vert)¶
Extracts a single image from a stacked image array and stores it in an
Image
object.Takes a specific 2D image (identified by
image_number
) from a 3D image stack (img_def_stack
) and stores its pixel values into thevals
field of the providedutil::Image
structure.- Parameters:
img_def – Pointer to a
util::Image
object that will be populated with the extracted image data.img_def_stack – Pointer to a flat array representing a stack of images stored sequentially (row-major order).
image_number – Index of the image to extract from the stack (0-based).
-
void extract_ss(util::Subset &ss_ref, const int ss_x, const int ss_y, const int px_hori, const int px_vert, const double *img_def)¶
Extracts a square subset of pixels from an image and stores the data in a Subset object.
This function copies a square region of pixel data from the specified starting coordinates (
ss_x
,ss_y
) in the input image into thess_def
structure. The size of the square subset is determined byss_def->size
. Both the pixel values and their corresponding coordinates are stored inss_def
.- Parameters:
ss_x – X-coordinate (column) of the top-left corner of the subset in the image.
ss_y – Y-coordinate (row) of the top-left corner of the subset in the image.
img_def – Pointer to the source image (
util::Image
) from which to extract pixel data.ss_def – Pointer to the destination subset (
util::Subset
) where extracted pixel values and coordinates are stored.
-
void extract_ss_subpx(util::Subset &ss_def, const double subpx_x, const double subpx_y, const Interpolator &interp_def)¶
Extracts a square subset of pixels from an image and stores the data in a Subset object.
This function copies a square region of pixel data from the specified starting coordinates (
ss_x
,ss_y
) in the input image into thess_def
structure. The size of the square subset is determined byss_def->size
. Both the pixel values and their corresponding coordinates are stored inss_def
.- Parameters:
ss_ref – Pointer to the destination subset (
util::Subset
) where extracted pixel info will be storedss_x – X-coordinate (column) of the top-left corner of the subset in the image.
ss_y – Y-coordinate (row) of the top-left corner of the subset in the image.
interp_ref – interpolator for the reference image from which to extract pixel data.
-
int get_num_params(std::string &shape_func)¶
-
SubsetData gen_ss_list(const bool *img_roi, const int ss_step, const int ss_size, const int px_hori, const int px_vert, const bool partial = false)¶
Generates a list of subsets based on the provided image ROI and parameters.
This function creates a list of subsets (defined by their coordinates) from a binary mask (
img_roi
) that indicates the region of interest in the image. The subsets are generated with specified size and step values.- Parameters:
img_roi – Pointer to a binary mask indicating the region of interest in the image.
px_hori – Number of horizontal pixels in the image.
px_vert – Number of vertical pixels in the image.
ss_size – Size of each subset (in pixels).
ss_step – Step size for generating subsets.
- Returns:
A SubsetData object containing the generated subsets and their neighbours.
-
void resize_results(int num_def_img, int num_ss, int num_params, bool at_end)¶
-
void save_to_disk(int img, const util::SaveConfig &saveconf, const util::SubsetData &ssdata, const int num_def_img, const int num_params, const std::vector<std::string> &filenames)¶
-
inline bool is_valid_in_dims(const int px_x, const int px_y, const int px_hori, const int px_vert)¶
-
inline bool is_valid_in_roi(const int px_x, const int px_y, const int px_hori, const int px_vert, const bool *img_roi)¶
-
inline void write_int(std::ofstream &out, int val)¶
-
inline void write_uint8t(std::ofstream &out, int val)¶
-
inline void write_dbl(std::ofstream &out, double val)¶
-
int next_pow2(int n)¶
-
void gen_size_and_step_vector(std::vector<int> &ss_sizes, std::vector<int> &ss_steps, const int ss_size, const int ss_step, const int max_disp)¶
-
void create_progress_bar(indicators::ProgressBar &bar, const std::string &bar_title, const int num_ss)¶
-
void update_progress_bar(indicators::ProgressBar &bar, int i, int num_ss, int &prev_pct)¶
Variables
-
std::vector<int> niter_arr¶
-
std::vector<double> u_arr¶
-
std::vector<double> v_arr¶
-
std::vector<double> p_arr¶
-
std::vector<double> ftol_arr¶
-
std::vector<double> xtol_arr¶
-
std::vector<double> cost_arr¶
-
struct Config¶
Public Members
-
int ss_step¶
-
int ss_size¶
-
int max_iter¶
-
int px_hori¶
-
int px_vert¶
-
int num_def_img¶
-
int num_params¶
-
double precision¶
-
double opt_threshold¶
-
double bf_threshold¶
-
int max_disp¶
-
std::pair<int, int> rg_seed¶
-
std::string corr_crit¶
-
std::string shape_func¶
-
std::string interp_routine¶
-
std::string scan_method¶
-
std::vector<std::string> filenames¶
-
bool fft_mad¶
-
double fft_mad_scale¶
-
unsigned int debug_level¶
-
int ss_step¶
-
struct Image¶
- #include <dicutil.hpp>
Represents an image with pixel data and dimensions.
This struct holds the pixel values of an image along with its dimensions. The pixel data is stored in row-major order.
-
struct PairHash¶
Public Functions
-
inline std::size_t operator()(const std::pair<int, int> &p) const¶
-
inline std::size_t operator()(const std::pair<int, int> &p) const¶
-
struct SaveConfig¶
-
struct Subset¶
- #include <dicutil.hpp>
holds a subset with pixel data and dimensions.
This struct holds the pixel values, coordinates, and dimensions of a square subset.
Public Functions
-
inline Subset(int ss_size)¶
-
inline Subset(int ss_size)¶
-
struct SubsetData¶
-
class Timer¶
-
void extract_image(double *img_def_stack, int image_number, int px_hori, int px_vert)¶