|
Correa 1
C++ library with Python bindings to analyse the shape of simple closed curves in R^2
|
compare polygons with specific focal points More...
#include "Comp2DShapesFocal.h"Functions | |
| Vector2D | parse_focal_point (const std::string &focal_input, bool verbose=false) |
| Parse focal point from either a file path or inline coordinates. | |
| int | main (int argc, char **argv) |
| Main function for comparing 2D shapes with specified focal points. | |
| bool | parse_args (int argc, char **argv, std::string *file1, std::string *focal1, std::string *file2, std::string *focal2, int *disttype, double *microns_per_pixel1, double *microns_per_pixel2, bool *verbose) |
| Parse command-line arguments for Comp2DShapesFocal. | |
compare polygons with specific focal points
| int main | ( | int | argc, |
| char ** | argv ) |
Main function for comparing 2D shapes with specified focal points.
This program compares two 2D polygons using various distance metrics, with user-specified focal points for each polygon. The polygons are shifted so that their focal points are at the origin before comparison, allowing for focal-point-relative shape analysis.
The program supports multiple distance metrics:
| argc | Number of command-line arguments |
| argv | Array of command-line argument strings |
| bool parse_args | ( | int | argc, |
| char ** | argv, | ||
| std::string * | file1, | ||
| std::string * | focal1, | ||
| std::string * | file2, | ||
| std::string * | focal2, | ||
| int * | disttype, | ||
| double * | microns_per_pixel1, | ||
| double * | microns_per_pixel2, | ||
| bool * | verbose ) |
Parse command-line arguments for Comp2DShapesFocal.
Parses command-line arguments for the Comp2DShapesFocal program, extracting input files, focal points, distance type, microns per pixel settings, and verbose flag.
| argc | Argument count from main() | |
| argv | Argument vector from main() | |
| [out] | file1 | Path to first input polygon file (set by -i1 flag) |
| [out] | focal1 | Focal point for first polygon - file path or "x,y" format (set by -f1 flag) |
| [out] | file2 | Path to second input polygon file (set by -i2 flag) |
| [out] | focal2 | Focal point for second polygon - file path or "x,y" format (set by -f2 flag) |
| [out] | disttype | Distance type flag (set by -d flag):
|
| [out] | microns_per_pixel1 | Microns per pixel conversion for polygon 1 (set by -mpp1 or -mpp flag, default: 1.0) |
| [out] | microns_per_pixel2 | Microns per pixel conversion for polygon 2 (set by -mpp2 or -mpp flag, default: 1.0) |
| [out] | verbose | Enable verbose output (set by -v or –verbose flag, default: false) |
| Vector2D parse_focal_point | ( | const std::string & | focal_input, |
| bool | verbose = false ) |
Parse focal point from either a file path or inline coordinates.
This function accepts either a file path containing focal point coordinates or a string with inline coordinates in the format "x,y". If a valid file exists at the path, it reads the coordinates from the file. Otherwise, it parses the string as inline coordinates.
| focal_input | String containing either a file path or inline coordinates (e.g., "698.678,816.662") |
| verbose | If true, prints debug information during parsing (default: false) |
| std::exit(1) | if the focal point cannot be parsed or has fewer than 2 coordinates |