CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
Loading...
Searching...
No Matches
singledic_config.h
Go to the documentation of this file.
1
28#ifndef SINGLEDIC_CONFIG_H
29#define SINGLEDIC_CONFIG_H
30
31#include "config.h"
32#include "parameters.h"
33
34#include <string>
35
36namespace singledic {
37
48public:
51
52 // --- Single-camera identity (Vik: subject / bloc / trial) ---------------
53 std::string subject = "S01";
54 std::string bloc = "bloc1";
55 std::string trial = "001";
56 std::string reftrial = "001";
57
58 // --- Frame window & tracking (Vik: idx_frame_start/end, jump, dir) ------
60 int idx_frame_end = 0;
61 int frame_jump = 1;
63 std::string tracking_dir = "forward";
65 int ncorr_number = 1;
66
67 // --- Saturation bounds (Vik: LIMIT_GRAYSCALE_LOW / HIGH) -----------------
70
71 // --- Bandpass filter cutoffs (Vik: param_filt_im = [low, high]) ----------
72 bool filter_im_mode = false;
73 int param_filt_low = 50;
74 int param_filt_high = 200;
75
76 // --- Step-D feature toggles ---------------------------------------------
80 bool do_matching = false;
81
83 bool write_mat = true;
85 bool write_csv = true;
86
87 SinglediConfig() = default;
88 explicit SinglediConfig(const Config& cfg) : base(cfg) {}
89
90 // ------------------------------------------------------------------------
91 // Path helpers — single-camera layout derived from base.data_path /
92 // base.dic_path. Vik input: <data>/vid/<subject>/<bloc>/<trial>(.mp4|/)
93 // Vik output: <dic>/<subject>/<bloc>/<trial>/
94 // We keep these as overridable sub-paths so callers may point at any layout.
95 // ------------------------------------------------------------------------
96
98 std::string vid_root() const {
99 return base.data_path.empty() ? std::string("vid") : base.data_path + "/vid";
100 }
101
103 std::string inputTrialDir() const {
104 return vid_root() + "/" + subject + "/" + bloc + "/" + trial;
105 }
106
108 std::string inputRefTrialDir() const {
109 return vid_root() + "/" + subject + "/" + bloc + "/" + reftrial;
110 }
111
113 std::string outputTrialDir() const {
114 const std::string root = base.dic_path.empty() ? std::string("analysis") : base.dic_path;
115 return root + "/" + subject + "/" + bloc + "/" + trial;
116 }
117
119 std::string outputBlocDir() const {
120 const std::string root = base.dic_path.empty() ? std::string("analysis") : base.dic_path;
121 return root + "/" + subject + "/" + bloc;
122 }
123
126 std::string roiFile() const { return outputBlocDir() + "/REF_MASK_" + reftrial + ".mat"; }
127
130 std::string seedFile() const {
131 return outputBlocDir() + "/REF_SEED_" + reftrial + "_" + tracking_dir + ".mat";
132 }
133
135 std::string matchingFile(const std::string& ext = ".bin") const {
136 return outputTrialDir() + "/MATCHING2" + reftrial + ext;
137 }
138
140 std::string ncorrStem() const {
141 return outputTrialDir() + "/ncorr" + std::to_string(ncorr_number);
142 }
143
154 bp.baseDataPath = vid_root();
157 bp.subject = subject;
158 bp.material = bloc; // reuse 'material' slot for bloc
159 bp.trial = trial;
160 bp.stereopair = 1; // single camera => single (degenerate) pair
161 bp.phase = tracking_dir; // reuse 'phase' slot for tracking direction
162 bp.reftrial = reftrial;
163 bp.roifile = roiFile();
165 bp.seedfile = seedFile();
166 bp.jump = frame_jump;
170 bp.cam_1 = 1;
171 bp.cam_2 = 1;
172 return bp;
173 }
174};
175
176} // namespace singledic
177
178#endif // SINGLEDIC_CONFIG_H
std::string dic_path
Definition config.h:48
std::string data_path
Definition config.h:47
Wraps a CPPxDIC Config and adds a single-camera sub-path scheme.
std::string seedFile() const
Seed file, shared per bloc, keyed by reference trial and direction.
int limit_grayscale_high
Upper saturation clamp (satur high).
int ncorr_number
ncorr_number tag (1/2) used to name outputs, mirroring forward/backward passes.
std::string reftrial
Reference trial name (shared per bloc).
bool do_matching
If true, run a matching-to-reference-trial pass before tracking (Vik ncorr_matching2ref_single....
cppxdic::BaseParameters toBaseParameters() const
Build a BaseParameters view so existing CPPxDIC helpers (ROIManager, ImageProcessor,...
int param_filt_low
Bandpass low cutoff.
std::string inputTrialDir() const
Directory for the current trial's input (subject/bloc/trial).
int idx_frame_start
First frame to analyse (1-based, MATLAB-style).
bool write_mat
Whether to write a MATLAB-compatible .mat sidecar next to outputs.
std::string bloc
Bloc / block folder name.
std::string outputBlocDir() const
Output directory shared per (subject, bloc) — holds ROI/seed reference files.
std::string ncorrStem() const
ncorr tracking output stem (no extension). Mirrors Vik: ncorr<ncorr_number>
std::string tracking_dir
Tracking direction: "forward" or "backward" (backward flips the sequence).
std::string matchingFile(const std::string &ext=".bin") const
Matching-to-reference cache file. Mirrors Vik: MATCHING2<reftrial>.mat/.bin.
std::string roiFile() const
ROI mask file, shared per bloc and keyed by reference trial.
bool filter_im_mode
Apply bandpass+normalise filtering before DIC.
bool write_csv
Whether to write a CSV of the tracked feature trajectories.
std::string outputTrialDir() const
Output directory for the current trial (subject/bloc/trial under dic_path).
int limit_grayscale_low
Lower saturation clamp (satur low).
std::string inputRefTrialDir() const
Directory for the reference trial's input (subject/bloc/reftrial).
int idx_frame_end
Last frame (0 = "to end of sequence").
SinglediConfig(const Config &cfg)
std::string trial
Current trial name (video stem).
Config base
Underlying engine configuration (owns all DIC/ncorr/viz parameters).
std::string vid_root() const
Root directory that holds per-subject video folders (default "<data>/vid").
int param_filt_high
Bandpass high cutoff.
std::string subject
Subject folder name (e.g. "S01").
Base parameters structure Contains fundamental paths and settings for DIC analysis Equivalent to base...
Definition parameters.h:20
std::string baseResultPath
Definition parameters.h:23
std::string baseDataPath
Definition parameters.h:22
std::string matchingfile
Definition parameters.h:36