Aim: Implements method to read a set of points represented in each line of a file.
More...
#include <DGtal/io/readers/PointListReader.h>
|
static std::vector< TPoint > | getPointsFromInputStream (std::istream &in, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >()) |
|
static std::vector< TPoint > | getPointsFromFile (const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >()) |
|
static std::vector< std::vector< TPoint > > | getPolygonsFromFile (const std::string &filename) |
|
static std::vector< std::vector< TPoint > > | getPolygonsFromInputStream (std::istream &in) |
|
template<typename TInteger > |
static std::vector< FreemanChain< TInteger > > | getFreemanChainsFromFile (const std::string &filename) |
|
template<typename TPoint>
struct DGtal::PointListReader< TPoint >
Aim: Implements method to read a set of points represented in each line of a file.
Description of class 'PointListReader'
The main method to read a set of points as a simple format where each elements is represented in a single line. Blank line or line beginning with "#" are skipped.
Simple example:
#include "DGtal/helpers/StdDefs.h"
....
string filename= "testFile.dat";
static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
and you can specifying the point position:
vector<unsigned int> vIndice;
vIndice.push_back(1);
vIndice.push_back(2);
- See also
- testPointListReader.cpp
- Examples
- geometry/curves/exampleAlphaThickSegmentNoisy.cpp, geometry/curves/exampleAlphaThickSegmentTgtCover.cpp, geometry/curves/exampleArithDSS3d.cpp, geometry/curves/greedyAlphaThickDecomposition.cpp, geometry/volumes/dvcm-2d.cpp, and io/digitalSetFromPointList.cpp.
Definition at line 84 of file PointListReader.h.
◆ getFreemanChainsFromFile()
template<typename TPoint >
template<typename TInteger >
Main method to FreemanChain contours. Each line of the file should represent a FreemanChain
- Parameters
-
[in] | filename | the input filename |
- Returns
- the vector containing the set of FreemanChain.
◆ getPointsFromFile()
template<typename TPoint >
static std::vector< TPoint > DGtal::PointListReader< TPoint >::getPointsFromFile |
( |
const std::string & |
filename, |
|
|
std::vector< unsigned int > |
aVectPosition = std::vector< unsigned int >() |
|
) |
| |
|
static |
◆ getPointsFromInputStream()
template<typename TPoint >
static std::vector< TPoint > DGtal::PointListReader< TPoint >::getPointsFromInputStream |
( |
std::istream & |
in, |
|
|
std::vector< unsigned int > |
aVectPosition = std::vector< unsigned int >() |
|
) |
| |
|
static |
Main method to import a vector containing a list of points defined in a file where each line defines a point. Blank line or line beginning with "#" are skipped.
- Parameters
-
in | the input stream. |
aVectPosition | used to specify the position of indices of value points (default set to 0,..,dimension). |
- Returns
- a vector containing the set of points.
◆ getPolygonsFromFile()
template<typename TPoint >
static std::vector< std::vector< TPoint > > DGtal::PointListReader< TPoint >::getPolygonsFromFile |
( |
const std::string & |
filename | ) |
|
|
static |
Import a vector containing all polygons defined on each line of a given file.
- Parameters
-
[in] | filename | input filename |
- Returns
- a vector containing the vector of polygons.
Referenced by testPointListReader().
◆ getPolygonsFromInputStream()
template<typename TPoint >
static std::vector< std::vector< TPoint > > DGtal::PointListReader< TPoint >::getPolygonsFromInputStream |
( |
std::istream & |
in | ) |
|
|
static |
Import a vector containing all polygons defined on each line of a given istream.
- Parameters
-
- Returns
- a vector containing the vector of polygons.
The documentation for this struct was generated from the following file: