|
CPPxDIC
C++ Digital Image Correlation library for fingertip 3D reconstruction
|
DataSerializer - Abstract base class for format-agnostic DIC data I/O. More...
Namespaces | |
| namespace | detail |
| namespace | input |
| namespace | log |
| namespace | stepsABC |
Classes | |
| struct | BaseParameters |
| Base parameters structure Contains fundamental paths and settings for DIC analysis Equivalent to base_parameters struct in Matlab. More... | |
| class | BinarySerializer |
| struct | CalibrationData |
| Calibration data. More... | |
| struct | CuncorrDicConfig |
| Tunables mirrored onto cuncorr::SessionConfig. More... | |
| struct | CuncorrDicInfo |
| Which backend actually ran. More... | |
| class | DataSerializer |
| struct | DeformationResult |
| Deformation result structure Contains all computed deformation and strain measures. More... | |
| struct | DeformData |
| Deformation data. More... | |
| struct | DeformGradient |
| Deformation gradient tensor. More... | |
| class | DelaunayTriangulation |
| DelaunayTriangulation class Provides Delaunay triangulation utilities using CGAL. More... | |
| struct | DIC2DPairResults |
| DIC 2D Pair Results Equivalent to MATLAB's DIC2DpairResults. More... | |
| struct | DIC3Dcombined |
| DIC 3D Combined Results Equivalent to MATLAB's DIC3Dcombined This represents stitched results from multiple stereo pairs. More... | |
| struct | DIC3DpairResults |
| DIC 3D Pair Results (Individual stereo pair) Equivalent to MATLAB's DIC3DpairResults This represents the 3D reconstruction for a single stereo pair. More... | |
| struct | DIC3DPPresults |
| DIC 3D Post-Processing Results Equivalent to MATLAB's DIC3DPPresults. More... | |
| struct | DICConstants |
| DIC constants Global constants used throughout the DIC analysis. More... | |
| struct | DICInfo |
| DIC Info structure (parameters) Matches MATLAB ncorrInfo structure. More... | |
| struct | DispData |
| Displacement data. More... | |
| struct | DistortionData |
| Distortion data. More... | |
| struct | DLTCalibrationData |
| struct | FrameDeformationResult |
| Frame-based deformation result Contains deformation results for all frames. More... | |
| class | ImageProcessor |
| ImageProcessor class Provides image preprocessing operations for DIC analysis. More... | |
| class | JsonSerializer |
| class | MatReader |
| MatReader class Provides utilities for reading MAT files. More... | |
| class | MatSerializer |
| class | MatWriter |
| MatWriter class Provides utilities for writing MAT files with proper xDIC structure. More... | |
| struct | Point3DFrame |
| 3D Points per frame More... | |
| struct | Points2D |
| 2D Points per frame More... | |
| struct | ProtocolFileData |
| struct | ProtocolInfo |
| Protocol information structure Contains trial condition information from protocol MAT file. More... | |
| struct | RBMData |
| Rigid Body Motion (RBM) data. More... | |
| class | ROIManager |
| ROIManager class Manages ROI masks and seed points for DIC analysis. More... | |
| struct | SeedPoint |
| Seed point structure Stores seed points in both pixel world (pw) and subset world (sw) coordinates. More... | |
| struct | StepAnalysisInfo |
| Step Analysis parameters (for high strain analysis) More... | |
| struct | StepAnalysisParams |
| Step analysis parameters structure Contains high strain analysis settings. More... | |
| class | StepDWorkflow |
| StepDWorkflow class Implements the complete 2D DIC analysis workflow Equivalent to stepD_2DDIC.m in Matlab. More... | |
| struct | StepParameters |
| Step parameters structure for DIC analysis Contains DIC-specific parameters like radius, spacing, cutoff Equivalent to step1_parameters, step2_parameters, step1_2_parameters in Matlab. More... | |
| struct | StrainTensor |
| Strain tensor. More... | |
| struct | SubjectTrial |
| A single (subject, trial) row, e.g. More... | |
| struct | VisData |
| Visualization data container Holds filtered and processed data ready for export. More... | |
| class | Visualization |
| Visualization manager class Handles loading, filtering, and exporting DIC results. More... | |
Typedefs | |
| typedef CGAL::Exact_predicates_inexact_constructions_kernel | K |
| typedef CGAL::Triangulation_vertex_base_with_info_2< size_t, K > | Vb |
| typedef CGAL::Triangulation_data_structure_2< Vb > | Tds |
| typedef CGAL::Delaunay_triangulation_2< K, Tds > | Delaunay |
| typedef K::Point_2 | Point_2 |
Enumerations | |
| enum class | ExportFormat { VTK , PLY , CSV } |
| Visualization export formats. More... | |
Functions | |
| bool | cuncorr_cuda_available () |
| True if cuNCorr was built with CUDA and a device is present at runtime. | |
| ncorr::DIC_analysis_output | run_cuncorr_dic (const std::vector< ncorr::Image2D > &imgs, const ncorr::ROI2D &roi, const CuncorrDicConfig &cfg, CuncorrDicInfo *info=nullptr) |
Run cuNCorr in sequence mode (fixed reference = imgs[0], warm-start each frame) over the stack against the full-resolution roi. | |
| std::vector< double > | computeFaceIsotropyIndex (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices) |
| Compute isotropy index for triangular faces. | |
| double | computeSingleFaceIsotropyIndex (const Eigen::Vector3d &v0, const Eigen::Vector3d &v1, const Eigen::Vector3d &v2) |
| Compute isotropy index for a single triangle. | |
| int | matlab_replacebadcorr (ncorr::DIC_analysis_output &data, double level_corr_coef=1.0, double sigma_spatial=1.0, double sigma_temporal=2.0, double shrink_factor=0.9) |
| Replaces badly correlated displacement data with spatiotemporally filtered values. | |
| std::vector< cv::Mat > | matlab_imgaussfilt3 (const std::vector< cv::Mat > &volume, double sigma_spatial, double sigma_temporal) |
| Applies a 3D Gaussian filter (spatial + temporal) to a volume of 2D fields. | |
| cv::Mat | matlab_shrink_mask (const cv::Mat &mask, double factor) |
| Shrinks a binary mask by a scale factor around its centroid. | |
| FrameDeformationResult | computeTriSurfaceDeformation (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices_ref, const std::vector< std::vector< Eigen::Vector3d > > &vertices_def, bool cumulative=true) |
| Compute deformation and strain for triangular surface elements. | |
| DeformationResult | computeSingleFrameDeformation (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices_ref, const std::vector< Eigen::Vector3d > &vertices_cur) |
| Compute deformation for a single frame. | |
| DIC3Dcombined | stitchPairsSimple (const std::vector< DIC3DpairResults > &all_pairs) |
| Simple append-based stitching for multiple stereo pairs. | |
| DIC3Dcombined | stitchPairsGeometric (const std::vector< DIC3DpairResults > &all_pairs, const std::vector< int > &pair_order, bool pair_forced=false) |
| Geometric stitching with overlap removal and boundary zipping Matches MATLAB's DIC3DsurfaceStitch.m with geometric stitching enabled. | |
| void | setStitchRayAccel (bool enabled) |
| Enable/disable the AABB-hierarchy prefilter used by the overlap-removal ray casts. | |
| bool | stitchRayAccel () |
| Current state of the ray-cast prefilter (see setStitchRayAccel). | |
| std::vector< int > | computeMeshBoundary (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices) |
| Compute boundary edges of a triangular mesh Matches MATLAB: patchBoundary(F, V) | |
| std::vector< double > | computeEdgeLengths (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices) |
| Compute edge lengths for all triangles Matches MATLAB: patchEdgeLengths(F, V) | |
| std::pair< std::vector< bool >, std::vector< bool > > | removeOverlapSurfaces (const std::vector< int > &faces1, const std::vector< int > &faces2, const std::vector< Eigen::Vector3d > &vertices1, const std::vector< Eigen::Vector3d > &vertices2, double min_gap, bool pair_forced=false) |
| Remove overlapping regions from two surfaces Matches MATLAB: removeOverlapSurface_temp_2018_10_30(F1, F2, V1, V2, [], [], minGap, pairforced) | |
| std::vector< std::vector< int > > | groupBoundaryEdges (const std::vector< int > &boundary_edges) |
| Group boundary edges into connected components. | |
| std::vector< int > | edgeListToCurve (const std::vector< int > &edges) |
| Convert an unordered list of edges into an ordered curve of vertex indices. | |
| std::vector< int > | zipBoundaryCurves (const std::vector< int > &curve1, const std::vector< int > &curve2, const std::vector< Eigen::Vector3d > &V_combined) |
| Zip two boundary curves together by creating a triangle strip. | |
| std::vector< bool > | findAllBoundaryFaces (const std::vector< int > &faces, const std::vector< int > &boundary_edges) |
| Remove faces where all 3 edges are on the boundary (degenerate boundary triangles). | |
| std::vector< std::vector< double > > | filterTime (const std::vector< std::vector< double > > &data, double freq_filt=10.0, double freq_acq=50.0) |
| Apply temporal Butterworth low-pass filter to displacement data. | |
| std::tuple< std::vector< std::vector< double > >, std::vector< std::vector< double > >, std::vector< std::vector< double > > > | filterTime3D (const std::vector< std::vector< double > > &disp_x, const std::vector< std::vector< double > > &disp_y, const std::vector< std::vector< double > > &disp_z, double freq_filt=10.0, double freq_acq=50.0) |
| Apply temporal filtering to 3D displacement vectors. | |
| std::string | trim (const std::string &s) |
| Trim leading/trailing whitespace (spaces, tabs, CR, LF). | |
| std::vector< int > | parseTrialList (const std::string &spec) |
| Parse a comma/space-separated list of integer trial IDs. | |
| std::vector< int > | readTrialsFile (const std::string &path) |
| Read a trials file: one trial ID per line. | |
| std::vector< SubjectTrial > | readSubjectTrialCsv (const std::string &path) |
| Read subject_trial.csv (header "subject,trial") into rows, skipping the header line and any blank/comment lines. | |
| int | slurmArrayTaskId () |
| Resolve SLURM_ARRAY_TASK_ID from the environment. | |
| static nlohmann::json | points3dToJson (const Point3DFrame &pts) |
| static Point3DFrame | points3dFromJson (const nlohmann::json &j) |
| static nlohmann::json | deformGradientToJson (const DeformGradient &F) |
| static nlohmann::json | strainTensorToJson (const StrainTensor &E) |
| static nlohmann::json | deformDataToJson (const DeformData &deform) |
| template<typename T > | |
| void | writePOD (std::ofstream &ofs, const T &value) |
| template<typename T > | |
| void | readPOD (std::ifstream &ifs, T &value) |
| template<typename T > | |
| void | writeVector (std::ofstream &ofs, const std::vector< T > &vec) |
| template<typename T > | |
| void | readVector (std::ifstream &ifs, std::vector< T > &vec) |
| void | writeString (std::ofstream &ofs, const std::string &str) |
| void | readString (std::ifstream &ifs, std::string &str) |
| template<typename T > | |
| void | writeVector2D (std::ofstream &ofs, const std::vector< std::vector< T > > &vec) |
| template<typename T > | |
| void | readVector2D (std::ifstream &ifs, std::vector< std::vector< T > > &vec) |
| void | writePoints3D (std::ofstream &ofs, const Point3DFrame &pts) |
| void | readPoints3D (std::ifstream &ifs, Point3DFrame &pts) |
| void | writeDispData (std::ofstream &ofs, const DispData &disp) |
| void | readDispData (std::ifstream &ifs, DispData &disp) |
| void | writeCalibrationData (std::ofstream &ofs, const CalibrationData &calib) |
| void | readCalibrationData (std::ifstream &ifs, CalibrationData &calib) |
| void | writeDistortionData (std::ofstream &ofs, const DistortionData &dist) |
| void | writeStringMap (std::ofstream &ofs, const std::map< std::string, std::string > &map) |
| void | readDistortionData (std::ifstream &ifs, DistortionData &dist) |
| void | readStringMap (std::ifstream &ifs, std::map< std::string, std::string > &map) |
| static matvar_t * | createEmptyCharVar (const char *name=nullptr) |
| static std::vector< Eigen::Vector3d > | computeVertexNormals (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices) |
| static double | rayTriangleHit (const Eigen::Vector3d &O, const Eigen::Vector3d &D, const Eigen::Vector3d &A, const Eigen::Vector3d &B, const Eigen::Vector3d &C, double eps) |
| static std::vector< Eigen::Vector3d > | raySetTriangleIntersect (const std::vector< Eigen::Vector3d > &origins, const std::vector< Eigen::Vector3d > &dirs, const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices, double eps=1e-6) |
| static std::vector< double > | computeRaySurfaceDistance (const std::vector< Eigen::Vector3d > &V1, const std::vector< Eigen::Vector3d > &N1, const std::vector< int > &F2, const std::vector< Eigen::Vector3d > &V2) |
| static double | meanFiniteEdgeLength (const std::vector< int > &faces, const std::vector< Eigen::Vector3d > &vertices) |
| static std::vector< int > | applyFaceMask (const std::vector< int > &F, const std::vector< bool > &CT) |
| static bool | removeFacesContainingVertex (const std::vector< int > &F, std::vector< bool > &CT, int v_remove) |
| static std::vector< int > | filterFaces (const std::vector< int > &faces, const std::vector< bool > &keep) |
| template<typename T > | |
| static std::vector< T > | filterByMask (const std::vector< T > &data, const std::vector< bool > &keep) |
| static std::vector< std::vector< int > > | buildFaceAdjacency (const std::vector< int > &faces, size_t n_faces) |
| Build face adjacency map from triangle connectivity For each face, find all faces that share at least one vertex. | |
| static std::vector< std::array< double, 3 > > | computeFaceCentroids (const Point3DFrame &points, const std::vector< int > &faces, size_t n_faces) |
| Compute face centroids from vertices and faces. | |
| static double | computeAverageResolution (const std::vector< std::array< double, 3 > > ¢roids, const std::vector< std::vector< int > > &adjacency) |
| Compute average resolution (spacing) of face centroids. | |
| static std::vector< std::vector< std::pair< int, int > > > | findKNearestByHops (const std::vector< std::vector< int > > &adjacency, int k) |
| Find k-nearest neighbors for each face using BFS on adjacency graph. | |
| static void | designButterworth4 (double Wn, std::vector< double > &b, std::vector< double > &a) |
| Design 4th order Butterworth low-pass filter coefficients Equivalent to MATLAB's [B,A] = butter(4, Wn) | |
| static std::vector< double > | filtfilt (const std::vector< double > &b, const std::vector< double > &a, const std::vector< double > &x) |
| Apply zero-phase filtering (equivalent to MATLAB's filtfilt) Filters forward and backward to eliminate phase distortion. | |
| static void | fillMissingLinear (std::vector< double > &data) |
| Fill missing values (NaN) with linear interpolation Equivalent to MATLAB's fillmissing(d,'linear',1,'EndValues','nearest') | |
Variables | |
| static size_t | scalar_dims [2] = {1, 1} |
| static bool | g_stitch_ray_bvh = false |
DataSerializer - Abstract base class for format-agnostic DIC data I/O.
Implementation of visualization module for DIC results.
Temporal Filtering Implementation Port of MATLAB myfilterTime.m and filtfilt.
Surface Stitching Implementation for Multi-Pair 3D Reconstruction Based on Matlab's DIC3DsurfaceStitch.m.
Strain Computation Implementation Direct port of MATLAB triSurfaceDeformation_rewrited.m.
Implementation of StepC stereovision / DLT calibration.
Implementation of MASK + Seed setup for xDIC stepsABC.
ROI and Seed Point Manager for CPPXDIC Implementation of ROI/seed loading and coordinate transformations Based on MATLAB draw_ref_roi.m, draw_ref_seed.m, and map_*.m functions.
MAT File Writer for CPPXDIC Implementation of MAT file writing in xDIC format Produces MATLAB v7.3 (HDF5) compatible output.
MAT File Reader Implementation.
Image processing utilities for CPPXDIC Implementation of saturation and filtering operations Based on MATLAB satur.m and filter_like_ben.m.
Face Isotropy Index Implementation Port of MATLAB faceIsotropyIndex.m.
Implementation of binary serialization for DIC structures.
Delaunay Triangulation Implementation using CGAL.
DataSerializer implementations for mat, bin, and json formats.
Visualization module for DIC results Exports 3D mesh data with deformation/strain fields for visualization Equivalent to MATLAB's plot_singleTrial_map and anim8_rewrited functions.
Trial / (subject, trial) selection helpers for CPPXDIC drivers.
Temporal Filtering for CPPXDIC Port of MATLAB myfilterTime.m.
Surface Stitching for Multi-Pair 3D Reconstruction.
Strain Computation for CPPXDIC Port of MATLAB triSurfaceDeformation_rewrited.m Based on Triangular Cosserat Point Elements (TCPE)
StepC: stereovision / DLT calibration.
MASK + Seed setup for the xDIC stepsABC tool.
Step D: 2D DIC Analysis Workflow for CPPXDIC Complete implementation of stepD_2DDIC from Matlab xDIC Handles the full 2D DIC analysis pipeline.
ROI and Seed Point Manager for CPPXDIC Handles ROI loading/creation and seed point management Equivalent to draw_ref_roi.m, draw_ref_seed.m, and related functions in Matlab xDIC.
Parameter structures for CPPXDIC Encapsulates parameters to avoid passing many arguments between functions Equivalent to parameter structures in Matlab stepD_2DDIC.m.
MATLAB-equivalent functions for DIC processing.
MAT File Writer for CPPXDIC Handles writing DIC results to MATLAB v7.3 (HDF5) format Produces output structure matching xDIC format.
MAT File Reader for CPPXDIC Helper functions for reading MATLAB .mat files using matio.
Image processing utilities for CPPXDIC Handles image saturation and filtering operations Equivalent to satur.m and filter_like_ben.m in Matlab xDIC.
Face Isotropy Index for CPPXDIC Port of MATLAB faceIsotropyIndex.m.
Data structures for DIC results Matches MATLAB xDIC structure format.
Delaunay Triangulation for CPPXDIC CGAL-based implementation matching MATLAB's delaunayTriangulation.
The MATLAB data structure (mat_trees.txt) is the canonical schema. This abstraction allows transparent switching between output formats (.mat, .bin, .json) via a config parameter, without changing pipeline code.
To add a new format, implement a new subclass and register it in create().
Computes triangle regularity/quality metric
Reference: Cappozzo, A., Cappello, A., Della Croce, U., & Pensalfini, F. (1997). Surface-marker cluster design criteria for 3-D bone movement reconstruction. IEEE Transactions on Biomedical Engineering, 44(12), 1165-1174.
These functions replicate specific MATLAB operations used in the xDIC pipeline, prefixed with matlab_ to clearly indicate their origin and purpose.
Provides interactive (OpenCV highgui) and non-interactive (file/config based) setup of the reference MASK (polygon ROI) and Seed point(s) used to initialise DIC tracking.
This mirrors the MATLAB MultiDIC interactive helpers draw_ref_roi.m and draw_ref_seed.m (polygon ROI via roipoly + seed point picking) but exposes a headless path so the exact same binary runs on a cluster node with no display.
The mask/seed data structures and any persistence to/from the cppxdic MAT format are delegated to cppxdic::ROIManager so this tool does not duplicate ROI/seed logic.
C++ port of MATLAB MultiDIC main_script/stepC_stereovision_calibration.m and the helpers it calls:
The 11-parameter DLT fit itself reuses the existing Utils::DLT11Calibration helper (src/utils.cpp) so no new linear-algebra path is introduced. Eigen is used for the stereo triangulation least-squares solve, consistent with the rest of the repo.
Reference: Solav, Dana, et al. "Bone pose estimation in the presence of soft tissue artifact using triangular cosserat point elements." Annals of biomedical engineering 44.4 (2016): 1181-1190.
Implements Butterworth low-pass filtering for smoothing displacement time series
Small, header-only utilities shared by the gen_subject_trial generator and the trial-level experiment runner (single trial, SLURM array over a trial list, SLURM array over a subject_trial.csv). Kept self-contained so new targets can include just this header without pulling in the full pipeline.
See matlab_functions.h for documentation.
GUI drawing code is guarded by XDIC_STEPSABC_GUI so the translation unit compiles and links on a headless cluster node where no highgui window backend is available. When GUI support is disabled, runGui() returns a clean error.
Ported from MATLAB MultiDIC stepC_stereovision_calibration.m. The 11-parameter DLT fit reuses Utils::DLT11Calibration; the stereo triangulation uses Eigen (consistent with the rest of the repo).
| typedef CGAL::Delaunay_triangulation_2<K, Tds> cppxdic::Delaunay |
Definition at line 20 of file delaunay_triangulation.cpp.
| typedef CGAL::Exact_predicates_inexact_constructions_kernel cppxdic::K |
Definition at line 17 of file delaunay_triangulation.cpp.
| typedef K::Point_2 cppxdic::Point_2 |
Definition at line 21 of file delaunay_triangulation.cpp.
| typedef CGAL::Triangulation_data_structure_2<Vb> cppxdic::Tds |
Definition at line 19 of file delaunay_triangulation.cpp.
| typedef CGAL::Triangulation_vertex_base_with_info_2<size_t, K> cppxdic::Vb |
Definition at line 18 of file delaunay_triangulation.cpp.
|
strong |
|
static |
Definition at line 593 of file surface_stitching.cpp.
|
static |
Build face adjacency map from triangle connectivity For each face, find all faces that share at least one vertex.
| faces | Flattened triangle indices (size = n_faces * 3) |
| n_faces | Number of faces |
Definition at line 110 of file visualization.cpp.
|
static |
Compute average resolution (spacing) of face centroids.
| centroids | Face centroid positions |
| adjacency | Face adjacency list |
Definition at line 182 of file visualization.cpp.
| std::vector< double > cppxdic::computeEdgeLengths | ( | const std::vector< int > & | faces, |
| const std::vector< Eigen::Vector3d > & | vertices | ||
| ) |
Compute edge lengths for all triangles Matches MATLAB: patchEdgeLengths(F, V)
Definition at line 263 of file surface_stitching.cpp.
|
static |
Compute face centroids from vertices and faces.
| points | 3D points for the current frame |
| faces | Flattened triangle indices |
| n_faces | Number of faces |
Definition at line 156 of file visualization.cpp.
| std::vector< double > cppxdic::computeFaceIsotropyIndex | ( | const std::vector< int > & | faces, |
| const std::vector< Eigen::Vector3d > & | vertices | ||
| ) |
Compute isotropy index for triangular faces.
The isotropy index measures the "regularity" of a triangle:
Algorithm:
| faces | Triangle connectivity (3*nFaces flattened: [v0,v1,v2, v0,v1,v2, ...]) |
| vertices | 3D vertex positions (nVertices x 3) |
Definition at line 64 of file face_isotropy.cpp.
| std::vector< int > cppxdic::computeMeshBoundary | ( | const std::vector< int > & | faces, |
| const std::vector< Eigen::Vector3d > & | vertices | ||
| ) |
Compute boundary edges of a triangular mesh Matches MATLAB: patchBoundary(F, V)
| faces | Triangle faces (flat array: [v0,v1,v2, v0,v1,v2, ...]) |
| vertices | Vertex positions |
Definition at line 218 of file surface_stitching.cpp.
|
static |
Definition at line 568 of file surface_stitching.cpp.
| double cppxdic::computeSingleFaceIsotropyIndex | ( | const Eigen::Vector3d & | v0, |
| const Eigen::Vector3d & | v1, | ||
| const Eigen::Vector3d & | v2 | ||
| ) |
Compute isotropy index for a single triangle.
| v0 | First vertex position |
| v1 | Second vertex position |
| v2 | Third vertex position |
Definition at line 12 of file face_isotropy.cpp.
| DeformationResult cppxdic::computeSingleFrameDeformation | ( | const std::vector< int > & | faces, |
| const std::vector< Eigen::Vector3d > & | vertices_ref, | ||
| const std::vector< Eigen::Vector3d > & | vertices_cur | ||
| ) |
Compute deformation for a single frame.
| faces | Triangle connectivity |
| vertices_ref | Reference vertices |
| vertices_cur | Current (deformed) vertices |
Definition at line 14 of file strain_computation.cpp.
| FrameDeformationResult cppxdic::computeTriSurfaceDeformation | ( | const std::vector< int > & | faces, |
| const std::vector< Eigen::Vector3d > & | vertices_ref, | ||
| const std::vector< std::vector< Eigen::Vector3d > > & | vertices_def, | ||
| bool | cumulative = true |
||
| ) |
Compute deformation and strain for triangular surface elements.
| faces | Triangle connectivity (Nx3, each row is [v1, v2, v3]) |
| vertices_ref | Reference vertex positions (Mx3) |
| vertices_def | Deformed vertex positions for each frame (vector of Mx3) |
| cumulative | If true, use first frame as reference; if false, use previous frame |
Definition at line 319 of file strain_computation.cpp.
|
static |
Definition at line 298 of file surface_stitching.cpp.
|
static |
Definition at line 25 of file mat_writer.cpp.
| bool cppxdic::cuncorr_cuda_available | ( | ) |
True if cuNCorr was built with CUDA and a device is present at runtime.
Definition at line 47 of file cuncorr_dic.cpp.
|
static |
Definition at line 368 of file data_serializer.cpp.
|
static |
Definition at line 350 of file data_serializer.cpp.
|
static |
Design 4th order Butterworth low-pass filter coefficients Equivalent to MATLAB's [B,A] = butter(4, Wn)
| Wn | Normalized cutoff frequency (0 to 1, where 1 = Nyquist) |
| b | Output numerator coefficients (size 5 for 4th order) |
| a | Output denominator coefficients (size 5 for 4th order) |
Definition at line 830 of file visualization.cpp.
| std::vector< int > cppxdic::edgeListToCurve | ( | const std::vector< int > & | edges | ) |
Convert an unordered list of edges into an ordered curve of vertex indices.
Matches MATLAB: edgeListToCurve(E)
| edges | Edge pairs [v0,v1, v0,v1, ...] |
Definition at line 933 of file surface_stitching.cpp.
|
static |
Fill missing values (NaN) with linear interpolation Equivalent to MATLAB's fillmissing(d,'linear',1,'EndValues','nearest')
Definition at line 952 of file visualization.cpp.
|
static |
Definition at line 1065 of file surface_stitching.cpp.
|
static |
Definition at line 1049 of file surface_stitching.cpp.
| std::vector< std::vector< double > > cppxdic::filterTime | ( | const std::vector< std::vector< double > > & | data, |
| double | freq_filt = 10.0, |
||
| double | freq_acq = 50.0 |
||
| ) |
Apply temporal Butterworth low-pass filter to displacement data.
| data | Input data (nPoints x nFrames) - each column is a time series |
| freq_filt | Filter cutoff frequency (Hz) |
| freq_acq | Acquisition/sampling frequency (Hz) |
| nPoints | Number of spatial points |
| nFrames | Number of time frames |
Algorithm:
Definition at line 17 of file temporal_filter.cpp.
| std::tuple< std::vector< std::vector< double > >, std::vector< std::vector< double > >, std::vector< std::vector< double > > > cppxdic::filterTime3D | ( | const std::vector< std::vector< double > > & | disp_x, |
| const std::vector< std::vector< double > > & | disp_y, | ||
| const std::vector< std::vector< double > > & | disp_z, | ||
| double | freq_filt = 10.0, |
||
| double | freq_acq = 50.0 |
||
| ) |
Apply temporal filtering to 3D displacement vectors.
| disp_x | X-component displacement (nPoints x nFrames) |
| disp_y | Y-component displacement (nPoints x nFrames) |
| disp_z | Z-component displacement (nPoints x nFrames) |
| freq_filt | Filter cutoff frequency (Hz) |
| freq_acq | Acquisition/sampling frequency (Hz) |
Definition at line 89 of file temporal_filter.cpp.
|
static |
Apply zero-phase filtering (equivalent to MATLAB's filtfilt) Filters forward and backward to eliminate phase distortion.
| b | Numerator coefficients |
| a | Denominator coefficients |
| x | Input signal |
Definition at line 885 of file visualization.cpp.
| std::vector< bool > cppxdic::findAllBoundaryFaces | ( | const std::vector< int > & | faces, |
| const std::vector< int > & | boundary_edges | ||
| ) |
Remove faces where all 3 edges are on the boundary (degenerate boundary triangles).
Matches MATLAB DIC3DsurfaceStitch lines 127-160.
| faces | Triangle faces (flat: [v0,v1,v2, ...]) |
| boundary_edges | Boundary edge pairs [v0,v1, ...] |
Definition at line 972 of file surface_stitching.cpp.
|
static |
Find k-nearest neighbors for each face using BFS on adjacency graph.
| adjacency | Face adjacency list |
| k | Number of neighbors to find |
Definition at line 208 of file visualization.cpp.
| std::vector< std::vector< int > > cppxdic::groupBoundaryEdges | ( | const std::vector< int > & | boundary_edges | ) |
Group boundary edges into connected components.
Matches MATLAB: tesgroup(E)
| boundary_edges | Boundary edges as pairs [v0,v1, v0,v1, ...] |
Definition at line 888 of file surface_stitching.cpp.
| std::vector< cv::Mat > cppxdic::matlab_imgaussfilt3 | ( | const std::vector< cv::Mat > & | volume, |
| double | sigma_spatial, | ||
| double | sigma_temporal | ||
| ) |
Applies a 3D Gaussian filter (spatial + temporal) to a volume of 2D fields.
Equivalent to MATLAB imgaussfilt3(volume, sigma, 'FilterDomain', 'spatial', 'padding', 'replicate').
Uses separable filtering: 2D spatial Gaussian per frame, then 1D temporal Gaussian per pixel.
| volume | Input 3D data as vector of CV_64F Mats (H x W each) |
| sigma_spatial | Gaussian sigma for spatial (x,y) dimensions |
| sigma_temporal | Gaussian sigma for temporal (frame) dimension |
Definition at line 84 of file matlab_functions.cpp.
| int cppxdic::matlab_replacebadcorr | ( | ncorr::DIC_analysis_output & | data, |
| double | level_corr_coef = 1.0, |
||
| double | sigma_spatial = 1.0, |
||
| double | sigma_temporal = 2.0, |
||
| double | shrink_factor = 0.9 |
||
| ) |
Replaces badly correlated displacement data with spatiotemporally filtered values.
Equivalent to MATLAB replacebadcorr() in step2_dic_finish.m.
Algorithm:
| data | DIC analysis output (modified in-place) |
| level_corr_coef | Correlation coefficient threshold (MATLAB default: 1.0) |
| sigma_spatial | Spatial Gaussian sigma (MATLAB default: 1.0) |
| sigma_temporal | Temporal Gaussian sigma (MATLAB default: 2.0) |
| shrink_factor | Mask shrink factor to avoid border effects (MATLAB default: 0.9) |
Definition at line 163 of file matlab_functions.cpp.
| cv::Mat cppxdic::matlab_shrink_mask | ( | const cv::Mat & | mask, |
| double | factor | ||
| ) |
Shrinks a binary mask by a scale factor around its centroid.
Equivalent to MATLAB shrink_mask.m:
| mask | Input binary mask (CV_8U, nonzero = valid) |
| factor | Scale factor (0.9 = shrink to 90%) |
Definition at line 21 of file matlab_functions.cpp.
|
static |
Definition at line 583 of file surface_stitching.cpp.
|
inline |
Parse a comma/space-separated list of integer trial IDs.
Accepts e.g. "7,12,25" or "7 12 25" or "7, 12 , 25".
Definition at line 42 of file trial_selection.h.
|
static |
Definition at line 244 of file data_serializer.cpp.
|
static |
Definition at line 235 of file data_serializer.cpp.
|
static |
Definition at line 512 of file surface_stitching.cpp.
|
static |
Definition at line 328 of file surface_stitching.cpp.
| void cppxdic::readCalibrationData | ( | std::ifstream & | ifs, |
| CalibrationData & | calib | ||
| ) |
Definition at line 125 of file dic_structures.cpp.
| void cppxdic::readDispData | ( | std::ifstream & | ifs, |
| DispData & | disp | ||
| ) |
Definition at line 96 of file dic_structures.cpp.
| void cppxdic::readDistortionData | ( | std::ifstream & | ifs, |
| DistortionData & | dist | ||
| ) |
Definition at line 186 of file dic_structures.cpp.
| void cppxdic::readPOD | ( | std::ifstream & | ifs, |
| T & | value | ||
| ) |
Definition at line 20 of file dic_structures.cpp.
| void cppxdic::readPoints3D | ( | std::ifstream & | ifs, |
| Point3DFrame & | pts | ||
| ) |
Definition at line 85 of file dic_structures.cpp.
| void cppxdic::readString | ( | std::ifstream & | ifs, |
| std::string & | str | ||
| ) |
Definition at line 51 of file dic_structures.cpp.
| void cppxdic::readStringMap | ( | std::ifstream & | ifs, |
| std::map< std::string, std::string > & | map | ||
| ) |
Definition at line 214 of file dic_structures.cpp.
|
inline |
Read subject_trial.csv (header "subject,trial") into rows, skipping the header line and any blank/comment lines.
Each data line must contain at least two comma-separated fields: subject, trial.
Definition at line 83 of file trial_selection.h.
|
inline |
Read a trials file: one trial ID per line.
Blank lines and lines whose first non-whitespace character is '#' are ignored.
Definition at line 63 of file trial_selection.h.
| void cppxdic::readVector | ( | std::ifstream & | ifs, |
| std::vector< T > & | vec | ||
| ) |
Definition at line 34 of file dic_structures.cpp.
| void cppxdic::readVector2D | ( | std::ifstream & | ifs, |
| std::vector< std::vector< T > > & | vec | ||
| ) |
Definition at line 70 of file dic_structures.cpp.
|
static |
Definition at line 610 of file surface_stitching.cpp.
| std::pair< std::vector< bool >, std::vector< bool > > cppxdic::removeOverlapSurfaces | ( | const std::vector< int > & | faces1, |
| const std::vector< int > & | faces2, | ||
| const std::vector< Eigen::Vector3d > & | vertices1, | ||
| const std::vector< Eigen::Vector3d > & | vertices2, | ||
| double | min_gap, | ||
| bool | pair_forced = false |
||
| ) |
Remove overlapping regions from two surfaces Matches MATLAB: removeOverlapSurface_temp_2018_10_30(F1, F2, V1, V2, [], [], minGap, pairforced)
| faces1 | First surface faces |
| faces2 | Second surface faces |
| vertices1 | First surface vertices |
| vertices2 | Second surface vertices |
| min_gap | Minimum gap threshold for overlap detection |
Definition at line 642 of file surface_stitching.cpp.
| ncorr::DIC_analysis_output cppxdic::run_cuncorr_dic | ( | const std::vector< ncorr::Image2D > & | imgs, |
| const ncorr::ROI2D & | roi, | ||
| const CuncorrDicConfig & | cfg, | ||
| CuncorrDicInfo * | info = nullptr |
||
| ) |
Run cuNCorr in sequence mode (fixed reference = imgs[0], warm-start each frame) over the stack against the full-resolution roi.
Returns a raw Lagrangian, pixel-unit DIC_analysis_output on the reduced grid (one Disp2D per current frame).
| std::invalid_argument | if fewer than 2 images. |
Definition at line 53 of file cuncorr_dic.cpp.
| void cppxdic::setStitchRayAccel | ( | bool | enabled | ) |
Enable/disable the AABB-hierarchy prefilter used by the overlap-removal ray casts.
Off by default. The prefilter is exact (a ray that hits a triangle also hits its padded bounding box, so nothing is pruned that could have been hit) and only changes how many triangles are tested per ray: O(log F) box tests instead of O(F) triangle tests. On rigs with many pairs the brute-force path is the dominant cost of Step E.
Process-wide, set once from Config::step_e_ray_bvh before stitching.
Definition at line 372 of file surface_stitching.cpp.
|
inline |
Resolve SLURM_ARRAY_TASK_ID from the environment.
Definition at line 120 of file trial_selection.h.
| DIC3Dcombined cppxdic::stitchPairsGeometric | ( | const std::vector< DIC3DpairResults > & | all_pairs, |
| const std::vector< int > & | pair_order, | ||
| bool | pair_forced = false |
||
| ) |
Geometric stitching with overlap removal and boundary zipping Matches MATLAB's DIC3DsurfaceStitch.m with geometric stitching enabled.
| all_pairs | Vector of DIC3DpairResults structures, one per stereo pair |
| pair_order | Order in which to stitch pairs (1-indexed, matching MATLAB pairIndList) |
Definition at line 1077 of file surface_stitching.cpp.
| DIC3Dcombined cppxdic::stitchPairsSimple | ( | const std::vector< DIC3DpairResults > & | all_pairs | ) |
Simple append-based stitching for multiple stereo pairs.
Simple append-based stitching (no geometric overlap removal) Equivalent to Matlab lines 450-479 (when pairIndList is empty)
Concatenates all pairs together with proper index offsetting. Does not perform geometric overlap removal.
| all_pairs | Vector of DIC3DpairResults structures, one per stereo pair |
Definition at line 25 of file surface_stitching.cpp.
| bool cppxdic::stitchRayAccel | ( | ) |
Current state of the ray-cast prefilter (see setStitchRayAccel).
Definition at line 373 of file surface_stitching.cpp.
|
static |
Definition at line 359 of file data_serializer.cpp.
|
inline |
Trim leading/trailing whitespace (spaces, tabs, CR, LF).
Definition at line 30 of file trial_selection.h.
| void cppxdic::writeCalibrationData | ( | std::ofstream & | ofs, |
| const CalibrationData & | calib | ||
| ) |
Definition at line 101 of file dic_structures.cpp.
| void cppxdic::writeDispData | ( | std::ofstream & | ofs, |
| const DispData & | disp | ||
| ) |
Definition at line 91 of file dic_structures.cpp.
| void cppxdic::writeDistortionData | ( | std::ofstream & | ofs, |
| const DistortionData & | dist | ||
| ) |
Definition at line 153 of file dic_structures.cpp.
| void cppxdic::writePOD | ( | std::ofstream & | ofs, |
| const T & | value | ||
| ) |
Definition at line 15 of file dic_structures.cpp.
| void cppxdic::writePoints3D | ( | std::ofstream & | ofs, |
| const Point3DFrame & | pts | ||
| ) |
Definition at line 79 of file dic_structures.cpp.
| void cppxdic::writeString | ( | std::ofstream & | ofs, |
| const std::string & | str | ||
| ) |
Definition at line 43 of file dic_structures.cpp.
| void cppxdic::writeStringMap | ( | std::ofstream & | ofs, |
| const std::map< std::string, std::string > & | map | ||
| ) |
Definition at line 177 of file dic_structures.cpp.
| void cppxdic::writeVector | ( | std::ofstream & | ofs, |
| const std::vector< T > & | vec | ||
| ) |
Definition at line 25 of file dic_structures.cpp.
| void cppxdic::writeVector2D | ( | std::ofstream & | ofs, |
| const std::vector< std::vector< T > > & | vec | ||
| ) |
Definition at line 61 of file dic_structures.cpp.
| std::vector< int > cppxdic::zipBoundaryCurves | ( | const std::vector< int > & | curve1, |
| const std::vector< int > & | curve2, | ||
| const std::vector< Eigen::Vector3d > & | V_combined | ||
| ) |
Zip two boundary curves together by creating a triangle strip.
Simplified equivalent of MATLAB's delaunayZip. Uses greedy advancing-front: picks the shorter diagonal at each step.
| curve1 | Ordered vertex indices of boundary curve 1 |
| curve2 | Ordered vertex indices of boundary curve 2 (already offset for combined mesh) |
| V_combined | Combined vertex positions [V1; V2] |
Definition at line 999 of file surface_stitching.cpp.
|
static |
Definition at line 370 of file surface_stitching.cpp.
|
static |
Definition at line 20 of file mat_writer.cpp.