|
DGtal 2.1.0
|
functions namespace gathers all DGtal functionsxs.
More...
Namespaces | |
| namespace | Hull2D |
| Hull2D namespace gathers useful functions to compute and return the convex hull or the alpha-shape of a range of 2D points. | |
| namespace | setops |
Functions | |
| template<typename T > | |
| constexpr T | const_pow (T b, unsigned int e) |
| template<typename T > | |
| constexpr T | const_middle (T K, unsigned int e) |
| template<typename Container , bool ordered> | |
| bool | isEqual (const Container &S1, const Container &S2) |
| template<typename Container > | |
| bool | isEqual (const Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| bool | isSubset (const Container &S1, const Container &S2) |
| template<typename Container > | |
| bool | isSubset (const Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container & | assignDifference (Container &S1, const Container &S2) |
| template<typename Container > | |
| Container & | assignDifference (Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container | makeDifference (const Container &S1, const Container &S2) |
| template<typename Container > | |
| Container | makeDifference (const Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container & | assignUnion (Container &S1, const Container &S2) |
| template<typename Container > | |
| Container & | assignUnion (Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container | makeUnion (const Container &S1, const Container &S2) |
| template<typename Container > | |
| Container | makeUnion (const Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container & | assignIntersection (Container &S1, const Container &S2) |
| template<typename Container > | |
| Container & | assignIntersection (Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container | makeIntersection (const Container &S1, const Container &S2) |
| template<typename Container > | |
| Container | makeIntersection (const Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container & | assignSymmetricDifference (Container &S1, const Container &S2) |
| template<typename Container > | |
| Container & | assignSymmetricDifference (Container &S1, const Container &S2) |
| template<typename Container , bool ordered> | |
| Container | makeSymmetricDifference (const Container &S1, const Container &S2) |
| template<typename Container > | |
| Container | makeSymmetricDifference (const Container &S1, const Container &S2) |
| template<typename TCoordinate , typename TInteger , unsigned short adjacency> | |
| bool | checkOnePoint (const ArithmeticalDSS< TCoordinate, TInteger, adjacency > &aDSS) |
| template<typename TCoordinate , typename TInteger , unsigned short adjacency> | |
| bool | checkPointsPosition (const ArithmeticalDSS< TCoordinate, TInteger, adjacency > &aDSS) |
| template<typename TCoordinate , typename TInteger , unsigned short adjacency> | |
| bool | checkPointsRemainder (const ArithmeticalDSS< TCoordinate, TInteger, adjacency > &aDSS) |
| template<typename TCoordinate , typename TInteger , unsigned short adjacency> | |
| bool | checkAll (const ArithmeticalDSS< TCoordinate, TInteger, adjacency > &aDSS) |
| template<typename Position , typename Coordinate , typename PointVector , typename OutputIterator , typename PositionFunctor , typename TruncationFunctor1 , typename TruncationFunctor2 > | |
| bool | smartCHNextVertex (const Position &positionBound, const Coordinate &remainderBound, PointVector &X, Coordinate &rX, const PointVector &Y, const Coordinate &rY, PointVector &V, Coordinate &rV, OutputIterator ito, const PositionFunctor &pos, const TruncationFunctor1 &f1, const TruncationFunctor2 &f2) |
| Procedure that computes the next (lower or upper) vertex of the left hull of a DSS. | |
| template<typename PointVector , typename Coordinate , typename Position , typename PositionFunctor , typename OutputIterator > | |
| PointVector | smartCH (const PointVector &aFirstPoint, const Coordinate &aRemainderBound, const Position &aPositionBound, const PointVector &aStep, const Coordinate &aRStep, const PointVector &aShift, const Coordinate &aRShift, const PositionFunctor &aPositionFunctor, OutputIterator uIto, OutputIterator lIto) |
| Procedure that computes the lower and upper left hull of a DSS of first point aFirstPoint, length aPositionBound, contained in a digital straight line described by aRStep, aRShift and aRemainderBound. | |
| template<typename DSL , typename OutputIterator > | |
| DSL::Vector | smartCH (const DSL &aDSL, const typename DSL::Point &aFirstPoint, const typename DSL::Position &aLength, OutputIterator uIto, OutputIterator lIto) |
| Procedure that computes the lower and upper left hull of a DSS of first point aFirstPoint, length aLength, contained in a DSL aDSL [Roussillon 2014 : [108]]. | |
| template<typename PointVector , typename Position , typename OutputIterator , typename TruncationFunctor1 , typename TruncationFunctor2 , typename PositionFunctor > | |
| bool | smartCHPreviousVertex (PointVector &X, const PointVector &Y, PointVector &V, const Position &aFirstPosition, const Position &aLastPosition, OutputIterator ito, const PositionFunctor &pos, const TruncationFunctor1 &f1, const TruncationFunctor2 &f2) |
| Procedure that computes the previous vertex of the left hull of a DSS of main direction vector V , first upper leaning point U and first positive Bezout point L. The computation stops as soon as a computed vertex is located before aLastPosition. | |
| template<typename PointVector , typename Position , typename PositionFunctor , typename OutputIterator > | |
| PointVector | reversedSmartCH (PointVector U, PointVector L, PointVector V, const Position &aFirstPosition, const Position &aLastPosition, const PositionFunctor &aPositionFunctor, OutputIterator uIto, OutputIterator lIto) |
| Procedure that computes the lower and upper left hull of the left subsegment of a greater DSS characterized by the first upper leaning point U, the first positive Bezout point L and its direction vector V. Note that the so-called left subsegment is bounded on the one hand by the first point of the DSS located at aFirstPosition and on the other hand by the point located at position aLastPosition. | |
| template<typename DSS , typename OutputIterator > | |
| DSS::Vector | reversedSmartCH (const DSS &aDSS, const typename DSS::Position &aPositionBound, OutputIterator uIto, OutputIterator lIto) |
| Procedure that computes the lower and upper left hull of the left subsegment of a greater DSS aDSS. Note that the so-called left subsegment is bounded on the one hand by the first point of aDSS and on the other hand by the point located at position aPositionBound [Roussillon 2014 : [108]]. | |
| template<typename TPoint > | |
| DGtal::int64_t | computeAffineDimension (const std::vector< TPoint > &X, const double tolerance=1e-12) |
| template<typename TPoint > | |
| std::vector< std::size_t > | computeAffineSubset (const std::vector< TPoint > &X, const double tolerance=1e-12) |
| template<typename TPoint , typename TIndexRange > | |
| static std::vector< std::size_t > | computeAffineSubset (const std::vector< TPoint > &X, const TIndexRange &I, const double tolerance=1e-12) |
| template<typename TPoint , typename TInputPoint > | |
| void | getAffineBasis (TInputPoint &o, std::vector< TPoint > &basis, const std::vector< TInputPoint > &X, const double tolerance=1e-12) |
| template<typename TPoint , typename TInputPoint , typename TIndexRange > | |
| static void | getAffineBasis (TInputPoint &o, std::vector< TPoint > &basis, const std::vector< TInputPoint > &X, const TIndexRange &I, const double tolerance=1e-12) |
| template<typename TPoint > | |
| TPoint | computeIndependentVector (const std::vector< TPoint > &basis, const double tolerance=1e-12) |
| template<typename TPoint > | |
| static void | getCompleteBasis (std::vector< TPoint > &basis, bool normal_vector, const double tolerance=1e-12) |
| template<typename TPoint > | |
| static TPoint | computeOrthogonalVectorToBasis (const std::vector< TPoint > &basis) |
| template<typename TPoint , typename TInputPoint , typename TIndexRange > | |
| static void | getOrthogonalVector (TPoint &w, const std::vector< TInputPoint > &X, const TIndexRange &I, const double tolerance=1e-12) |
| template<typename TPoint , typename TInputPoint > | |
| static void | getOrthogonalVector (TPoint &w, const std::vector< TInputPoint > &X, const double tolerance=1e-12) |
| template<typename TPoint , typename TInputPoint > | |
| static void | getOrthogonalLatticeBasis (std::vector< TPoint > &B, const TInputPoint &N, bool shortened=false) |
| template<typename TPoint > | |
| TPoint | computeSimplifiedVector (const TPoint &v) |
| template<typename T > | |
| T | power (const T &aVal, const unsigned int exponent) |
| template<typename T > | |
| T | roundToUpperPowerOfTwo (const T &n) |
| template<typename T > | |
| T | abs (const T &a) |
| template<typename T > | |
| T | square (T x) |
| template<typename T > | |
| T | cube (T x) |
| template<typename TComponent > | |
| void | negate (std::vector< TComponent > &V) |
| template<typename TComponent > | |
| bool | equals (const std::vector< TComponent > &a, const std::vector< TComponent > &b) |
| template<typename T , typename U > | |
| DGtal::ArithmeticConversionTraits< T, U >::type | dotProduct (const std::vector< T > &a, const std::vector< U > &b) |
| double | dotProduct (const std::vector< BigInteger > &a, const std::vector< double > &b) |
| double | dotProduct (const std::vector< double > &a, const std::vector< BigInteger > &b) |
| template<typename T , typename U > | |
| std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > | crossProduct (const std::vector< T > &a, const std::vector< U > &b) |
| template<typename T , typename U , typename Op2 > | |
| std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > | apply (const std::vector< T > &a, const std::vector< U > &b, Op2 op2) |
| template<typename T > | |
| T | squaredNormL2 (const std::vector< T > &a) |
| template<typename T > | |
| T | normL1 (const std::vector< T > &a) |
| template<typename T > | |
| T | normLoo (const std::vector< T > &a) |
| template<typename TOutput , typename T > | |
| void | getSquaredNormL2 (TOutput &n, const std::vector< T > &a) |
| template<typename TOutput , DGtal::Dimension dim, typename TEuclideanRing , typename TContainer > | |
| void | getSquaredNormL2 (TOutput &n, const DGtal::PointVector< dim, TEuclideanRing, TContainer > &a) |
| template<typename TComponent , DGtal::Dimension TN, typename TInternalNumber > | |
| void | getDeterminantBareiss (TInternalNumber &result, const SimpleMatrix< TComponent, TN, TN > &matrix) |
| template<typename TComponent , typename TInternalNumber > | |
| void | getDeterminantBareiss (TInternalNumber &result, const std::vector< std::vector< TComponent > > &matrix) |
| template<typename TComponent > | |
| std::vector< std::vector< TComponent > > | matrixAsVectorVector (std::size_t m, std::size_t n, const std::vector< TComponent > &c) |
| template<typename TComponent , DGtal::Dimension TM, DGtal::Dimension TN> | |
| std::vector< std::vector< TComponent > > | matrixAsVectorVector (const SimpleMatrix< TComponent, TM, TN > &M) |
| template<typename TComponent , typename TDouble = long double> | |
| std::vector< std::vector< TComponent > > | computeLLLBasis (const std::vector< std::vector< TComponent > > &B, TDouble delta=0.75) |
| template<typename TComponent , typename TDouble = long double> | |
| void | reduceBasisWithLLL (std::vector< std::vector< TComponent > > &B, TDouble delta=0.75) |
| template<typename TComponent > | |
| TComponent | makePrimitive (std::vector< TComponent > &N) |
| template<typename TComponent > | |
| TComponent | extendedGcd (TComponent &x, TComponent &y, TComponent a, TComponent b) |
| template<typename TComponent > | |
| TComponent | extendedGcd (std::vector< TComponent > &C, const std::vector< TComponent > &A) |
| template<typename TComponent > | |
| std::vector< std::vector< TComponent > > | computeOrthogonalLattice (std::vector< TComponent > N) |
| template<typename TComponent > | |
| bool | shortenVectors (std::vector< TComponent > &u, std::vector< TComponent > &v) |
| template<typename TComponent > | |
| std::size_t | shortenBasis (std::vector< std::vector< TComponent > > &B) |
| template<typename TKSpace , typename TCellContainer , typename CellConstIterator , typename CellMapIteratorPriority > | |
| uint64_t | collapse (CubicalComplex< TKSpace, TCellContainer > &K, CellConstIterator S_itB, CellConstIterator S_itE, const CellMapIteratorPriority &priority, bool hintIsSClosed=false, bool hintIsKClosed=false, bool verbose=false) |
| template<typename TKSpace , typename TCellContainer , typename BdryCellOutputIterator , typename InnerCellOutputIterator > | |
| void | filterCellsWithinBounds (const CubicalComplex< TKSpace, TCellContainer > &K, const typename TKSpace::Point &kLow, const typename TKSpace::Point &kUp, BdryCellOutputIterator itBdry, InnerCellOutputIterator itInner) |
| template<typename TObject , typename TKSpace , typename TCellContainer > | |
| std::unique_ptr< TObject > | objectFromSpels (const CubicalComplex< TKSpace, TCellContainer > &C) |
| template<typename TComplex > | |
| NeighborhoodConfiguration | getSpelNeighborhoodConfigurationOccupancy (const TComplex &input_complex, const typename TComplex::Point ¢er, const std::unordered_map< typename TComplex::Point, NeighborhoodConfiguration > &mapPointToMask) |
| DGtal::CountedPtr< boost::dynamic_bitset<> > | loadTable (const std::string &input_filename, const unsigned int known_size, const bool compressed=true) |
| template<unsigned int dimension = 3> | |
| DGtal::CountedPtr< boost::dynamic_bitset<> > | loadTable (const std::string &input_filename, const bool compressed=true) |
| template<typename TPoint > | |
| DGtal::CountedPtr< std::unordered_map< TPoint, NeighborhoodConfiguration > > | mapZeroPointNeighborhoodToConfigurationMask () |
| template<typename TObject , typename TMap > | |
| void | generateSimplicityTable (const typename TObject::DigitalTopology &dt, TMap &map) |
| template<typename TVoxelComplex , typename TMap > | |
| void | generateVoxelComplexTable (TMap &map, std::function< bool(const TVoxelComplex &, const typename TVoxelComplex::Cell &) > skelFunction) |
| template<typename TComplex > | |
| TComplex | asymetricThinningScheme (TComplex &vc, std::function< std::pair< typename TComplex::Cell, typename TComplex::Data >(const typename TComplex::Clique &) > Select, std::function< bool(const TComplex &, const typename TComplex::Cell &) > Skel, bool verbose=false) |
| template<typename TComplex > | |
| TComplex | persistenceAsymetricThinningScheme (TComplex &vc, std::function< std::pair< typename TComplex::Cell, typename TComplex::Data >(const typename TComplex::Clique &) > Select, std::function< bool(const TComplex &, const typename TComplex::Cell &) > Skel, uint32_t persistence, bool verbose=false) |
| template<typename TComplex > | |
| std::pair< typename TComplex::Cell, typename TComplex::Data > | selectFirst (const typename TComplex::Clique &clique) |
| template<typename TComplex > | |
| std::pair< typename TComplex::Cell, typename TComplex::Data > | selectRandom (const typename TComplex::Clique &clique) |
| template<typename TComplex , typename TRandomGenerator > | |
| std::pair< typename TComplex::Cell, typename TComplex::Data > | selectRandom (const typename TComplex::Clique &clique, TRandomGenerator &gen) |
| template<typename TDistanceTransform , typename TComplex > | |
| std::pair< typename TComplex::Cell, typename TComplex::Data > | selectMaxValue (const TDistanceTransform &dist_map, const typename TComplex::Clique &clique) |
| template<typename TComplex > | |
| bool | skelUltimate (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | skelEnd (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | skelSimple (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | skelIsthmus (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | oneIsthmus (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | twoIsthmus (const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TComplex > | |
| bool | skelWithTable (const boost::dynamic_bitset<> &table, const std::unordered_map< typename TComplex::Point, unsigned int > &pointToMaskMap, const TComplex &vc, const typename TComplex::Cell &cell) |
| template<typename TObject > | |
| bool | isZeroSurface (const TObject &small_obj) |
| template<typename TObject > | |
| bool | isOneSurface (const TObject &small_obj) |
| template<typename TObject > | |
| std::vector< TObject > | connectedComponents (const TObject &input_obj, bool verbose) |
| template<typename TComplex , typename TDistanceTransform = DistanceTransformation<Z3i::Space, Z3i::DigitalSet, ExactPredicateLpSeparableMetric<Z3i::Space, 3>>> | |
| TComplex | thinningVoxelComplex (TComplex &vc, const std::string &skel_type_str, const std::string &skel_select_type_str, const std::string &tables_folder, const int &persistence=0, const TDistanceTransform *distance_transform=nullptr, const bool profile=false, const bool verbose=false) |
functions namespace gathers all DGtal functionsxs.
| T DGtal::functions::abs | ( | const T & | a | ) |
Return the absolute value of an instance of type T.
| T | the type of elements to compare (model of boost::LessThanComparable). |
| a | first value |
Definition at line 116 of file BasicMathFunctions.h.
| std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > DGtal::functions::apply | ( | const std::vector< T > & | a, |
| const std::vector< U > & | b, | ||
| Op2 | op2 | ||
| ) |
Applies the binary operation op2 to every pair of elements (a[i],b[i]) and returns the resulting range of values op2([a[0],b[0]), ..., op2([a[n-1],b[n-1]).
| T | the number type of the left operand vector. |
| U | the number type of the right operand vector. |
| Op2 | the type for the binary operator. |
| a | the range of values acting as left operands. |
| b | the range of values acting as rights operands. |
| op2 | the binary operator (T,U) -> V, where V is the best possible type combining T and U. |
| Container & DGtal::functions::assignDifference | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set difference operation. Updates the set S1 as S1 - S2.
| [in,out] | S1 | an input set, S1 - S2 as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 896 of file SetFunctions.h.
Referenced by makeDifference(), and DGtal::functions::setops::operator-=().
| Container & DGtal::functions::assignDifference | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set difference operation. Updates the set S1 as S1 - S2.
| [in,out] | S1 | an input set, S1 - S2 as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 918 of file SetFunctions.h.
| Container & DGtal::functions::assignIntersection | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set intersection operation. Updates the set S1 as \( S1 \cap S2 \).
| [in,out] | S1 | an input set, \( S1 \cap S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 1082 of file SetFunctions.h.
Referenced by makeIntersection(), and DGtal::functions::setops::operator&=().
| Container & DGtal::functions::assignIntersection | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set intersection operation. Updates the set S1 as \( S1 \cap S2 \).
| [in,out] | S1 | an input set, \( S1 \cap S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1104 of file SetFunctions.h.
| Container & DGtal::functions::assignSymmetricDifference | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set symmetric difference operation. Updates the set S1 as \( S1 \Delta S2 \).
| [in,out] | S1 | an input set, \( S1 \Delta S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 1176 of file SetFunctions.h.
Referenced by makeSymmetricDifference(), and DGtal::functions::setops::operator^=().
| Container & DGtal::functions::assignSymmetricDifference | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set symmetric difference operation. Updates the set S1 as \( S1 \Delta S2 \).
| [in,out] | S1 | an input set, \( S1 \Delta S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1198 of file SetFunctions.h.
| Container & DGtal::functions::assignUnion | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set union operation. Updates the set S1 as \( S1 \cup S2 \).
| [in,out] | S1 | an input set, \( S1 \cup S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 990 of file SetFunctions.h.
Referenced by makeUnion(), and DGtal::functions::setops::operator|=().
| Container & DGtal::functions::assignUnion | ( | Container & | S1, |
| const Container & | S2 | ||
| ) |
Set union operation. Updates the set S1 as \( S1 \cup S2 \).
| [in,out] | S1 | an input set, \( S1 \cup S2 \) as output. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1012 of file SetFunctions.h.
| TComplex DGtal::functions::asymetricThinningScheme | ( | TComplex & | vc, |
| std::function< std::pair< typename TComplex::Cell, typename TComplex::Data >(const typename TComplex::Clique &) > | Select, | ||
| std::function< bool(const TComplex &, const typename TComplex::Cell &) > | Skel, | ||
| bool | verbose = false |
||
| ) |
| bool DGtal::functions::checkAll | ( | const ArithmeticalDSS< TCoordinate, TInteger, adjacency > & | aDSS | ) |
Checks whether a DSS is valid or not. NB: in logarithmic time (in order to check that a and b are relatively prime)
| aDSS | any DSS |
| bool DGtal::functions::checkOnePoint | ( | const ArithmeticalDSS< TCoordinate, TInteger, adjacency > & | aDSS | ) |
Checks the validity of the DSS when it contains only one point.
| aDSS | any DSS |
| bool DGtal::functions::checkPointsPosition | ( | const ArithmeticalDSS< TCoordinate, TInteger, adjacency > & | aDSS | ) |
Checks that the difference between two extremal upper (resp. lower) leaning points is equal to the direction vector (a,b) scaled by an integer. Checks that there is no pattern between end points and extremal leaning points.
| aDSS | any DSS |
| bool DGtal::functions::checkPointsRemainder | ( | const ArithmeticalDSS< TCoordinate, TInteger, adjacency > & | aDSS | ) |
Checks the consistency between the parameters and the leaning points: first and last upper leaning points should have a remainder equal to mu while firsta and last lower leaning points should have a remainder equal to mu + omega - 1. Moreover, front and back points should have a remainder lying within the range [mu, mu+omega[.
| aDSS | any DSS |
| uint64_t DGtal::functions::collapse | ( | CubicalComplex< TKSpace, TCellContainer > & | K, |
| CellConstIterator | S_itB, | ||
| CellConstIterator | S_itE, | ||
| const CellMapIteratorPriority & | priority, | ||
| bool | hintIsSClosed = false, |
||
| bool | hintIsKClosed = false, |
||
| bool | verbose = false |
||
| ) |
Collapse a user-specified part of complex K, collapsing cells following priority [priority], in a decreasing sequence until no more collapse is feasible. The range [S_itb,S_itE) provides the starting cells, generally (but not compulsory) maximal cells. The resulting complex is guaranteed to keep the same homotopy type (a kind of topology equivalence).
| TKSpace | the digital space in which lives the cubical complex. |
| TCellContainer | the associative container used to store cells within the cubical complex. |
| CellConstIterator | any forward const iterator on Cell. |
| CellMapIteratorPriority | any type defining a method 'bool operator()( const Cell&, const Cell&) const'. Defines the order in which cells are collapsed. |
| [in,out] | K | the complex that is collapsed. |
| S_itB | the start of a range of cells which is included in [K]. | |
| S_itE | the end of a range of cells which is included in [K]. | |
| priority | the object that assign a priority to each cell. | |
| hintIsSClosed | indicates if [S_itb,S_ite) is a closed set (faster in this case). | |
| hintIsKClosed | indicates that complex K is closed. | |
| verbose | outputs some information during processing when 'true'. |
Referenced by main(), main(), SCENARIO(), and SCENARIO().
| DGtal::int64_t DGtal::functions::computeAffineDimension | ( | const std::vector< TPoint > & | X, |
| const double | tolerance = 1e-12 |
||
| ) |
Given a range of points X, returns the affine dimension of its spanned affine subspace.
| TPoint | any type of lattice point or real point. |
| X | the range of input points (may be lattice points or not). |
| tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1068 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineDimension().
Referenced by checkAffineGeometry(), SCENARIO(), and SCENARIO().
| std::vector< std::size_t > DGtal::functions::computeAffineSubset | ( | const std::vector< TPoint > & | X, |
| const double | tolerance = 1e-12 |
||
| ) |
Given a range of points X, returns a subset of these points that form an affine basis of X. Equivalently it is a simplex whose affine space spans all the points of X.
| TPoint | any type of lattice point or real point. |
| X | the range of input points (may be lattice points or not). |
| tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1089 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineSubset().
Referenced by checkAffineGeometry(), SCENARIO(), and SCENARIO().
|
static |
Given a range of points X and a subset of it given by indices I, returns a subset of these points that form an affine basis of X[I]. Equivalently it is a simplex whose affine space spans all the points of X[I].
| TPoint | any type of lattice point or real point. |
| TIndexRange | any type of range of indices that specifies the subset of points of interest. |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | I | the range of indices specifying the subset of interest. |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1117 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineSubset().
| TPoint DGtal::functions::computeIndependentVector | ( | const std::vector< TPoint > & | basis, |
| const double | tolerance = 1e-12 |
||
| ) |
Given a partial basis of vectors, returns a canonic unit vector that is independent.
| TPoint | any type of lattice point or real point. |
| [in] | basis | a range of independent vectors that defines a partial basis of the space. |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1202 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::independentVector().
Referenced by checkAffineGeometry(), SCENARIO(), and SCENARIO().
| std::vector< std::vector< TComponent > > DGtal::functions::computeLLLBasis | ( | const std::vector< std::vector< TComponent > > & | B, |
| TDouble | delta = 0.75 |
||
| ) |
Computes the \( \delta \)-LLL-reduced lattice of the input lattice B (represented as an integer matrix B whose rows are the lattice vectors), using the LLL algorithm.
Such lattice has "almost" orthogonal vectors, while minimizing their norm at most as possible.
| TComponent | the integer type of each coefficient of the integer matrix B. |
| TDouble | the floating-point number type used for the Gram-Schmidt orthogonalisation of B. |
| [in] | B | the lattice of m vectors in Z^n represented as a mxn matrix. |
| [in] | delta | the parameter \( \delta \) of LLL-algorithm, which should be between 0.25 and 1 (value 0.99 is default in sagemath). |
TDouble. Referenced by testLLL().
| std::vector< std::vector< TComponent > > DGtal::functions::computeOrthogonalLattice | ( | std::vector< TComponent > | N | ) |
Computes a basis of the orthogonal lattice to the vector N, i.e. it has n-1 vectors if N had n components. It essentially follows https://math.stackexchange.com/questions/1049608/lattice-generated-by-vectors-orthogonal-to-an-integer-vector
| TComponent | the integer type for the input vector and for computations. |
| [in] | N | the input normal vector, which should be non null. Even if N is not primitive, it is considered primitive in the function. |
Referenced by DGtal::AffineGeometry< TPoint >::orthogonalLatticeBasis(), and testOrthogonalLattice().
|
static |
Given d-1 independent vectors in dD, outputs a vector that is orthogonal to each of them. This function signature allows automatic internal type computations deduction.
| TPoint | any type of lattice point or real point. |
| [in] | basis | a range of independent vectors of size dimension-1. |
Definition at line 1262 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::orthogonalVector().
Referenced by checkAffineGeometry(), SCENARIO(), and SCENARIO().
| TPoint DGtal::functions::computeSimplifiedVector | ( | const TPoint & | v | ) |
Given a vector, returns the aligned vector with its component simplified by the gcd of all components (when the components are integers) or the aligned vector with a squared L2-norm of 1 (when the components are floating-point numbers).
| TPoint | any type of lattice point or real point. |
| [in] | v | any vector. |
Definition at line 1394 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::simplifiedVector().
Referenced by checkAffineGeometry(), SCENARIO(), and SCENARIO().
| std::vector< TObject > DGtal::functions::connectedComponents | ( | const TObject & | input_obj, |
| bool | verbose | ||
| ) |
Get all connected components of the input object.
| TObject | Object Type |
| input_obj | input object |
| verbose | flag to be verbose at execution |
|
constexpr |
| T | any model of bounded number. |
| K | a non negative number |
| e | a non negative integer |
e-dimensional array of width \( 2K+1 \), computed at compile time.Definition at line 75 of file ConstExpressions.h.
References const_middle(), const_pow(), and K.
Referenced by const_middle().
|
constexpr |
| T | any model of bounded number. |
| b | a number |
| e | a non negative integer |
Definition at line 60 of file ConstExpressions.h.
References const_pow().
Referenced by const_middle(), and const_pow().
| std::vector< typename DGtal::ArithmeticConversionTraits< T, U >::type > DGtal::functions::crossProduct | ( | const std::vector< T > & | a, |
| const std::vector< U > & | b | ||
| ) |
Overloaded cross product operator for vector of numbers.
| T | the number type of the left operand vector. |
| U | the number type of the right operand vector. |
| [in] | a | the left vector (must be of size 3 ) |
| [in] | b | the right vector (must be of size 3 ) |
Referenced by testOrthogonalLattice().
|
inline |
Returns the value x * x * x
| T | a type with the multiply operator. |
| x | any value |
Definition at line 144 of file BasicMathFunctions.h.
| double DGtal::functions::dotProduct | ( | const std::vector< BigInteger > & | a, |
| const std::vector< double > & | b | ||
| ) |
Overloaded dot product operator for vector of big integers with vector of doubles.
| [in] | a | the left vector |
| [in] | b | the right vector |
| double DGtal::functions::dotProduct | ( | const std::vector< double > & | a, |
| const std::vector< BigInteger > & | b | ||
| ) |
Overloaded dot product operator for vector of big integers with vector of doubles.
| [in] | a | the left vector |
| [in] | b | the right vector |
| DGtal::ArithmeticConversionTraits< T, U >::type DGtal::functions::dotProduct | ( | const std::vector< T > & | a, |
| const std::vector< U > & | b | ||
| ) |
Overloaded dot product operator for vector of numbers.
| T | the number type of the left operand vector. |
| U | the number type of the right operand vector. |
| [in] | a | the left vector |
| [in] | b | the right vector |
Referenced by testOrthogonalLattice().
| bool DGtal::functions::equals | ( | const std::vector< TComponent > & | a, |
| const std::vector< TComponent > & | b | ||
| ) |
Returns 'true' iff all the components of the two vectors are equal.
| TComponent | the scalar type of each component. |
| [in] | a | the left vector (same size) |
| [in] | b | the right vector (same size) |
Referenced by testOrthogonalLattice().
| TComponent DGtal::functions::extendedGcd | ( | std::vector< TComponent > & | C, |
| const std::vector< TComponent > & | A | ||
| ) |
Extended Eucliden algorithm to compute the gcd g of n integers A as will as the vector of integers C such that C[0]*A[0]+...+C[n-1]*A[n-1]=g, where g is the gcd of A[0],...,A[n-1].
| [out] | C | the array of integers such that C[0]*A[0]+...+C[n-1]*A[n-1]=g |
| [in] | A | the array of input integers. |
| TComponent DGtal::functions::extendedGcd | ( | TComponent & | x, |
| TComponent & | y, | ||
| TComponent | a, | ||
| TComponent | b | ||
| ) |
Extended Eucliden algorithm to compute the gcd g of two integers a and b as well as two other integers x and y such that a*x+b*y=g, where g the gcd of a and b.
| [out] | x,y | two integers x and y such that a*x+b*y=g. |
| [in] | a,b | any pair of integers. |
| void DGtal::functions::filterCellsWithinBounds | ( | const CubicalComplex< TKSpace, TCellContainer > & | K, |
| const typename TKSpace::Point & | kLow, | ||
| const typename TKSpace::Point & | kUp, | ||
| BdryCellOutputIterator | itBdry, | ||
| InnerCellOutputIterator | itInner | ||
| ) |
Computes the cells of the given complex K that lies on the boundary or inside the parallelepiped specified by bounds kLow and kUp.
| TKSpace | the digital space in which lives the cubical complex. |
| TCellContainer | the associative container used to store cells within the cubical complex. |
| BdryCellOutputIterator | any output iterator on TCubicalComplex::Cell. |
| InnerCellOutputIterator | any output iterator on TCubicalComplex::Cell. |
| [in] | K | any cubical complex. |
| [in] | kLow | any Khalimsky coordinate representing the lowest possible cell. |
| [in] | kUp | any Khalimsky coordinate representing the uppermost possible cell. |
| [in,out] | itBdry | An output iterator on Cell that outputs all the cells of K that lie on the boundary of the parallelepiped specified by bounds kLow and kUp. |
| [in,out] | itInner | An output iterator on Cell that outputs all the cells of K that lie in the interior of the parallelepiped specified by bounds kLow and kUp. |
| void DGtal::functions::generateSimplicityTable | ( | const typename TObject::DigitalTopology & | dt, |
| TMap & | map | ||
| ) |
Given a digital topology dt, generates tables that tells if the central point is simple for the specified configuration. The configuration is determined by a sequence of bits, the first bit for the point in the neighborhood, the second bit for the second point, etc. When set to one, the point is in the neighborhood.
| TObject | the type of object whose simpleness we wish to precompute. Includes the topology. |
| TMap | the type used to store the mapping configuration -> bool. |
| dt | an instance of the digital topology. |
| map | (modified) the mapping configuration -> bool. |
Definition at line 71 of file NeighborhoodTablesGenerators.h.
References domain, dt, DGtal::Trace::progressBar(), and DGtal::trace.
| void DGtal::functions::generateVoxelComplexTable | ( | TMap & | map, |
| std::function< bool(const TVoxelComplex &, const typename TVoxelComplex::Cell &) > | skelFunction | ||
| ) |
Generates a table mapping the number of configuration of a 26 topology voxel neighborhood, and the boolean result of a predicate function applied to the central point for each configuration. The configuration is determined by a sequence of bits, the first bit for the point in the neighborhood, the second bit for the second point, etc. When set to one, the point is in the neighborhood.
| TVoxelComplex | the type of the VoxelComplex whose property we wish to precompute. |
| TMap | the type used to store the mapping configuration -> bool. |
| map | (modified) the mapping configuration -> bool. |
| skelFunction | a predicate function related to the property we want to check. |
Definition at line 132 of file NeighborhoodTablesGenerators.h.
References domain, DGtal::KhalimskySpaceND< dim, TInteger >::init(), DGtal::Trace::progressBar(), and DGtal::trace.
| void DGtal::functions::getAffineBasis | ( | TInputPoint & | o, |
| std::vector< TPoint > & | basis, | ||
| const std::vector< TInputPoint > & | X, | ||
| const double | tolerance = 1e-12 |
||
| ) |
Given a range of points X, returns a point and a range of vectors forming an affine basis containing X.
| TPoint | any type of lattice point or real point (but one may choose a more precise type than TInputPoint. |
| TInputPoint | any type of lattice point or real point. |
| [out] | o | the origin point |
| [out] | basis | a range of vectors forming an affine basis containing X. |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1145 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineBasis().
Referenced by checkAffineGeometry(), SCENARIO(), SCENARIO(), and SCENARIO().
|
static |
Given a range of points X, returns a point and a range of vectors forming an affine basis containing X.
| TPoint | any type of lattice point or real point (but one may choose a more precise type than TInputPoint. |
| TInputPoint | any type of lattice point or real point. |
| TIndexRange | any type of range of indices. |
| [out] | o | the origin point |
| [out] | basis | a range of vectors forming an affine basis containing X. |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | I | the range of indices within X that specifies the subset of interest. |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1178 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineBasis().
|
static |
Complete the vectors basis with independent vectors so as to form a basis of the space. When normal_vector is true, the last added vector is guaranteed to be orthogonal to all the previous vectors, otherwise it is just an independent canonic vector.
| TPoint | any type of lattice point or real point. |
| [in,out] | basis | a range of independent vectors of size less than dimension, which is completed so as to be a basis of the full space. |
| [in] | normal_vector | when 'true', the last vector of the basis is orthogonal to all the other vectors of the basis, otherwise it is just an independent canonic vector. |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1235 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::completeBasis().
| void DGtal::functions::getDeterminantBareiss | ( | TInternalNumber & | result, |
| const SimpleMatrix< TComponent, TN, TN > & | matrix | ||
| ) |
Computes the determinant of a squared matrix with integer or floating-point coefficients using Bareiss method. Complexity is in O(n^3) if you assume O(1) for each arithmetic operation.
| TComponent | the number type. |
| TN | the order of the squared matrix. |
| TInternalNumber | the number type used for internal computations and for the output. |
| [out] | result | the determinant of this matrix. |
| [in] | matrix | a squared matrix. |
Referenced by DGtal::AffineGeometry< TPoint >::orthogonalVector(), testBareissDeterminant(), and testLLL().
| void DGtal::functions::getDeterminantBareiss | ( | TInternalNumber & | result, |
| const std::vector< std::vector< TComponent > > & | matrix | ||
| ) |
Computes the determinant of a squared matrix with integer or floating-point coefficients using Bareiss method. Complexity is in O(n^3) if you assume O(1) for each arithmetic operation.
| TComponent | the number type. |
| TInternalNumber | the number type used for internal computations and for the output. |
| [in] | matrix | a squared matrix, represented as a vector of row vectors. |
| [out] | result | the determinant of this matrix. |
|
static |
Given a primitive lattice vector N, returns a possible basis for its orthogonal d-1 dimensional lattice.
| TPoint | any type of lattice point (type for computations and output). |
| TInputPoint | any type of lattice point |
| [out] | B | the d-1 dimension basis of the orthognal lattice to N. |
| [in] | N | a non null primitive lattice vector |
| [in] | shortened | when 'false', the basis is in row echelon form, when 'true', the basis is shortened (with pairwise shortenings, may not be optimal, except in 3D). |
Definition at line 1375 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::orthogonalLatticeBasis().
|
static |
Given a range of points X, returns a vector that is orthogonal to this affine set, if it is d-1-dimensional.
| TPoint | any type of lattice point or real point (type for computations and output). |
| TInputPoint | any type of lattice point or real point. |
| [out] | w | an orthogonal vector to every vector of the affine subset (reduced or normalized depending on integer/floating-point number type). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1344 of file AffineGeometry.h.
References DGtal::AffineGeometry< TPoint >::affineSubset().
|
static |
Given a range of points X, a range of indices I specifying the affine subset of interest, returns a vector that is orthogonal to this affine subset, if it is d-1-dimensional.
| TPoint | any type of lattice point or real point. |
| TInputPoint | any type of lattice point or real point. |
| TIndexRange | any type of range of indices that specifies the subset of points of interest. |
| [out] | w | an orthogonal vector to every vector of the affine subset (reduced or normalized depending on integer/floating-point number type). |
| [in] | X | the range of input points (may be lattice points or not). |
| [in] | I | the range of indices within X that specifies the subset of interest. |
| [in] | tolerance | the accepted squared L2-norm below which the vector is null (used only for points with float/double coordinates). |
Definition at line 1301 of file AffineGeometry.h.
Referenced by DGtal::ConvexHullCommonKernel< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), and SCENARIO().
| NeighborhoodConfiguration DGtal::functions::getSpelNeighborhoodConfigurationOccupancy | ( | const TComplex & | input_complex, |
| const typename TComplex::Point & | center, | ||
| const std::unordered_map< typename TComplex::Point, NeighborhoodConfiguration > & | mapPointToMask | ||
| ) |
Get the occupancy configuration of the neighborhood of a point in a cubical complex. The neighborhood size is considered 3^D for dimension D of the point (ie 3x3x3 cube for 3D point).
| TComplex | Complex type. |
| input_complex | input complex. Used to check what points are occupied. |
| center | of the neighborhood. It doesn't matter if center belongs or not to input_complex. |
| mapPointToMask | map[Point]->configuration, where Point is inside a DxD cube centered in {0,0,..} in ND. |
| void DGtal::functions::getSquaredNormL2 | ( | TOutput & | n, |
| const DGtal::PointVector< dim, TEuclideanRing, TContainer > & | a | ||
| ) |
Overloaded squared L2-norm operator for a vector of numbers.
| TOutput | the desired number type for output. |
| dim | static constant of type DGtal::Dimension that specifies the static dimension of the space and thus the number of elements of the Point or Vector. |
| TEuclideanRing | speficies the number type assoicated to an Euclidean domain (or Euclidean ring) algebraic structure (commutative unitary ring with no zero divisors and with a division operator but not necessarily an inverse for the multiplication operator). This type is used to represent PointVector elements (Coordinate for Point and Component for Vector) and define operations on Point or Vectors. |
| TContainer | specifies the container to be used to store the point coordinates. At this point, such container must be a random access bidirectionnal a-la STL containers (e.g. vector, boost/array). If TContainer implements comparison operators == != < <= > <=, then PointVector will also implements it and with the exact same behaviour. |
| [out] | n | the dot product a.a, i.e. the squared L2-norm of a. |
| [in] | a | the vector of numbers. |
| void DGtal::functions::getSquaredNormL2 | ( | TOutput & | n, |
| const std::vector< T > & | a | ||
| ) |
Overloaded squared L2-norm operator for a vector of numbers.
| TOutput | the desired number type for output. |
| T | the number type of the input vector. |
| [out] | n | the dot product a.a, i.e. the squared L2-norm of a. |
| [in] | a | the vector of numbers. |
Referenced by DGtal::AffineGeometry< TPoint >::addIfIndependent(), DGtal::AffineGeometry< TPoint >::independentVector(), and DGtal::AffineGeometry< TPoint >::simplifiedVector().
| bool DGtal::functions::isEqual | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Equality test.
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 789 of file SetFunctions.h.
Referenced by DGtal::operator!=(), and DGtal::operator==().
| bool DGtal::functions::isEqual | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Equality test.
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 815 of file SetFunctions.h.
| bool DGtal::functions::isOneSurface | ( | const TObject & | small_obj | ) |
Check if input object is a simple closed curve. Object must be:
| TObject | Object Type |
| small_obj | input object |
| bool DGtal::functions::isSubset | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Inclusion test.
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 845 of file SetFunctions.h.
Referenced by DGtal::operator<=(), and DGtal::operator>=().
| bool DGtal::functions::isSubset | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Inclusion test.
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 869 of file SetFunctions.h.
| bool DGtal::functions::isZeroSurface | ( | const TObject & | small_obj | ) |
Check if the object contains, exclusively, two disconnected voxels.
| TObject | Object Type |
| small_obj | input object |
|
inline |
Load existing look up table existing in file_name, precalculated tables can be accessed including the header: "DGtal/topology/tables/NeighborhoodTables.h"
| dimension | of the space input_filename table refers. 2 or 3 |
| input_filename | plain text containing the bool table. |
| compressed | true if table to read has been compressed with zlib. |
|
inline |
Load existing look up table existing in file_name, precalculated tables can be accessed including the header: "DGtal/topology/tables/NeighborhoodTables.h"
| input_filename | plain text containing the bool table. |
| known_size | of the bitset, for 2D = 256 (2^8), 3D = 67108864 (2^26) |
| compressed | true if table to read has been compressed with zlib. |
Referenced by SCENARIO(), SCENARIO(), TEST_CASE_METHOD(), TEST_CASE_METHOD(), TEST_CASE_METHOD(), TEST_CASE_METHOD(), TEST_CASE_METHOD(), and thinningVoxelComplex().
| Container DGtal::functions::makeDifference | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set difference operation. Returns the difference of S1 - S2.
| [in] | S1 | an input set |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 946 of file SetFunctions.h.
Referenced by DGtal::functions::setops::operator-().
| Container DGtal::functions::makeDifference | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set difference operation. Returns the difference of S1 - S2.
| [in] | S1 | an input set |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 965 of file SetFunctions.h.
References assignDifference().
| Container DGtal::functions::makeIntersection | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set intersection operation. Returns the set \( S1 \cap S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 1131 of file SetFunctions.h.
Referenced by DGtal::functions::setops::operator&().
| Container DGtal::functions::makeIntersection | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set intersection operation. Returns the set \( S1 \cap S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1149 of file SetFunctions.h.
References assignIntersection().
| TComponent DGtal::functions::makePrimitive | ( | std::vector< TComponent > & | N | ) |
Makes a lattice vector primitive.
| TComponent | the integer type for the input vector and for computations. |
| [in,out] | N | the input vector, that is modified to be N/g, where g is the gcd of its components. |
Referenced by testOrthogonalLattice().
| Container DGtal::functions::makeSymmetricDifference | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set symmetric difference operation. Returns the set \( S1 \Delta S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 1225 of file SetFunctions.h.
Referenced by DGtal::functions::setops::operator^().
| Container DGtal::functions::makeSymmetricDifference | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set symmetric difference operation. Returns the set \( S1 \Delta S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1243 of file SetFunctions.h.
References assignSymmetricDifference().
| Container DGtal::functions::makeUnion | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set union operation. Returns the set \( S1 \cup S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
| ordered | when 'true', the user indicates that values are ordered (e.g. a sorted vector), otherwise, depending on the container type, the compiler may still determine that values are ordered. |
Definition at line 1039 of file SetFunctions.h.
Referenced by DGtal::functions::setops::operator|().
| Container DGtal::functions::makeUnion | ( | const Container & | S1, |
| const Container & | S2 | ||
| ) |
Set union operation. Returns the set \( S1 \cup S2 \).
| [in] | S1 | an input set. |
| [in] | S2 | another input set. |
| Container | any type of container (even a sequence, a set, an unordered_set, a map, etc). |
Definition at line 1057 of file SetFunctions.h.
References assignUnion().
|
inline |
Maps any point in the neighborhood of point Zero (0,..,0) to its corresponding configuration bit mask. This is a helper to use with tables. The order of the configuration is lexicographic, starting in {-1, -1, ...}.
Example: Point{ -1, -1, -1 } = 1; // corresponding to mask x x 0000 0001 Point{ 0, -1, -1 } = 2; // corresponding to mask x x 0000 0010 Point{ 1, 1, 1 } = 2^26; // x 0010 x x x x x x
| TPoint | type of point to create map and input the desired dimension. |
| std::vector< std::vector< TComponent > > DGtal::functions::matrixAsVectorVector | ( | const SimpleMatrix< TComponent, TM, TN > & | M | ) |
Outputs the matrix of size m x n with coefficients c, as a vector of vector representation.
| TComponent | the number type. |
| TN | the number of rows |
| TM | the number of columns |
| [in] | M | any matrix |
| std::vector< std::vector< TComponent > > DGtal::functions::matrixAsVectorVector | ( | std::size_t | m, |
| std::size_t | n, | ||
| const std::vector< TComponent > & | c | ||
| ) |
Outputs the matrix M of size m x n with coefficients c, as a vector of vector representation.
| TComponent | the number type. |
| [in] | m,n | the number of rows and columns of the matrix M. |
| [in] | c | the coefficients of the matrix in order c_00, c01, etc. |
Referenced by testBareissDeterminant().
| void DGtal::functions::negate | ( | std::vector< TComponent > & | V | ) |
Negates the components of the input vector.
| TComponent | the scalar type of each component. |
| [in,out] | V | the vector as input, outputed as -V. |
Referenced by testOrthogonalLattice().
| T DGtal::functions::normL1 | ( | const std::vector< T > & | a | ) |
Overloaded L1-norm operator for a vector of numbers.
| T | the number type of the input vector. |
| [in] | a | the vector of numbers |
Referenced by testLLL().
| T DGtal::functions::normLoo | ( | const std::vector< T > & | a | ) |
Overloaded Loo-norm operator for a vector of numbers.
| T | the number type of the input vector. |
| [in] | a | the vector of numbers |
| std::unique_ptr< TObject > DGtal::functions::objectFromSpels | ( | const CubicalComplex< TKSpace, TCellContainer > & | C | ) |
Create object from the spels in the complex.
User has to provide a 3D TObject type with its associated DigitalSet and DigitalTopology.
Given a dimension n, spels are the n-cells, equivalently, spels are the grid-points in Z^n.
| TObject | with its associdated DigitalSet and DigitalTopology |
| TKSpace | kspace type of the input CubicalComplex. |
| TCellContainer | cell container type of the input CubicalComplex |
| C | input CubicalComplex |
| bool DGtal::functions::oneIsthmus | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Check if input cell is a 1-isthmus. A voxel is a 1-isthmus if, after a thinning, its proper neighborhood is made only by two voxels, ie, it is a 0-Surface isZeroSurface.
| TComplex | VoxelComplex. |
| vc | input complex. |
| cell | apply function on input cell. |
| TComplex DGtal::functions::persistenceAsymetricThinningScheme | ( | TComplex & | vc, |
| std::function< std::pair< typename TComplex::Cell, typename TComplex::Data >(const typename TComplex::Clique &) > | Select, | ||
| std::function< bool(const TComplex &, const typename TComplex::Cell &) > | Skel, | ||
| uint32_t | persistence, | ||
| bool | verbose = false |
||
| ) |
| T DGtal::functions::power | ( | const T & | aVal, |
| const unsigned int | exponent | ||
| ) |
Compute exponentiation by squaring of a scalar aVal of type T by the exponent exponent (unsigned int). The computation is done in \( O(\log(exponent))\) multiplications.
| aVal | the value |
| exponent | the exponent |
| T | scalar value type (must have '*' operator). |
Definition at line 73 of file BasicMathFunctions.h.
Referenced by testBasicMathFunctions().
| void DGtal::functions::reduceBasisWithLLL | ( | std::vector< std::vector< TComponent > > & | B, |
| TDouble | delta = 0.75 |
||
| ) |
Computes the \( \delta \)-LLL-reduced lattice of the input lattice B (represented as an integer matrix B whose rows are the lattice vectors), using the LLL algorithm.
Such lattice has "almost" orthogonal vectors, while minimizing their norm at most as possible.
| TComponent | the integer type of each coefficient of the integer matrix B. |
| TDouble | the floating-point number type used for the Gram-Schmidt orthogonalisation of B. |
| [in,out] | B | as input, the lattice of m vectors in Z^n represented as a mxn matrix, as output the \( delta \)-LLL-reduced lattice of B. |
| [in] | delta | the parameter \( \delta \) of LLL-algorithm, which should be between 0.25 and 1 (value 0.99 is default in sagemath). |
TDouble. Referenced by DGtal::AffineBasis< TPoint >::reduceAsLLL().
|
inline |
Procedure that computes the lower and upper left hull of the left subsegment of a greater DSS aDSS. Note that the so-called left subsegment is bounded on the one hand by the first point of aDSS and on the other hand by the point located at position aPositionBound [Roussillon 2014 : [108]].
| aDSS | bounding DSS |
| aPositionBound | position of the last point of the subsegment (should be located after the first point of aDSS). |
| uIto | output iterator used to store the vertices of the upper convex hull |
| lIto | output iterator used to store the vertices of the lower convex hull |
| DSS | a model of arithmetical DSS |
| OutputIterator | a model of output iterator |
|
inline |
Procedure that computes the lower and upper left hull of the left subsegment of a greater DSS characterized by the first upper leaning point U, the first positive Bezout point L and its direction vector V. Note that the so-called left subsegment is bounded on the one hand by the first point of the DSS located at aFirstPosition and on the other hand by the point located at position aLastPosition.
| U | last upper convex hull vertex |
| L | last lower convex hull vertex |
| V | last valid Bezout vector (main direction vector) |
| aFirstPosition | position of the first point of the subsegment |
| aLastPosition | position of the last point of the subsegment |
| aPositionFunctor | position functor, which returns the position of any given point/vector |
| uIto | output iterator used to store the vertices of the upper convex hull |
| lIto | output iterator used to store the vertices of the lower convex hull |
| PointVector | a model of 2d point/vector |
| Position | a model of integer for the position of the point in the bounding DSS |
| PositionFunctor | a model of unary functor that returns the position of a point/vector |
| OutputIterator | a model of output iterator |
Referenced by basicTest2(), and reversedSmartCHSubsegment().
| T DGtal::functions::roundToUpperPowerOfTwo | ( | const T & | n | ) |
Compute the next higher power of two of the given argument n of type T.
| T | the type of the element T |
| n | an element of type T (casted to unsigned integer). |
Definition at line 102 of file BasicMathFunctions.h.
References DGtal::Bits::mostSignificantBit().
Referenced by testBasicMathFunctions().
| std::pair< typename TComplex::Cell, typename TComplex::Data > DGtal::functions::selectFirst | ( | const typename TComplex::Clique & | clique | ) |
Select first voxel of input clique.
| TComplex | input CubicalComplex |
| clique | from where cell is chosen. |
| std::pair< typename TComplex::Cell, typename TComplex::Data > DGtal::functions::selectMaxValue | ( | const TDistanceTransform & | dist_map, |
| const typename TComplex::Clique & | clique | ||
| ) |
Select cell from clique that has max value looking at the input dist_map. The points in the dist_map and in the clique must refer to the same position.
If you need to have a std::function<bool(const Clique &)> signature (for using it in thinning algorithms), use a lambda: subsitute skelRandom (for example) for:
| TDistanceTransform | Container type for the distance map. |
| TComplex | input CubicalComplex |
| dist_map | container holding the values. |
| clique | from where cell is chosen. |
| std::pair< typename TComplex::Cell, typename TComplex::Data > DGtal::functions::selectRandom | ( | const typename TComplex::Clique & | clique | ) |
Select random voxel from input clique.
| TComplex | input CubicalComplex |
| clique | from where cell is chosen. |
| std::pair< typename TComplex::Cell, typename TComplex::Data > DGtal::functions::selectRandom | ( | const typename TComplex::Clique & | clique, |
| TRandomGenerator & | gen | ||
| ) |
Select random voxel from input clique.
| TComplex | CubicalComplex |
| TRandomGenerator | RandomGenerator |
| clique | from where cell is chosen |
| gen | random generator |
| std::size_t DGtal::functions::shortenBasis | ( | std::vector< std::vector< TComponent > > & | B | ) |
Shortens the vectors of the basis B (by pairwise shortenings) until no further shortening pairs are found, and returns the number of shortening operations.
| TComponent | the integer type for the input vector and for computations. |
| [in,out] | B | a range of vectors forming a basis, which is shorten as much as possible in terms of L2-norm. Note that the output basis is not in echelon form in general. |
Referenced by DGtal::AffineGeometry< TPoint >::orthogonalLatticeBasis(), testLLL(), and testOrthogonalLattice().
| bool DGtal::functions::shortenVectors | ( | std::vector< TComponent > & | u, |
| std::vector< TComponent > & | v | ||
| ) |
Tries to shorten u and v while preserving their vector span by trying u+v and u-v.
| TComponent | the integer type for the input vector and for computations. |
| [in,out] | u | any vector |
| [in,out] | v | any vector |
| bool DGtal::functions::skelEnd | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Check if input cell only has one neighbor, using Object::topology.
| TComplex | VoxelComplex |
| vc | input voxel complex. |
| cell | c apply function on this voxel cell. |
| bool DGtal::functions::skelIsthmus | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Check if input cell is a 1 or 2 Isthmus.
| TComplex | VoxelComplex. |
| vc | input complex. |
| cell | apply function on input cell. |
| bool DGtal::functions::skelSimple | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Check if input cell is simple using VoxelComplex::isSimple interface to Object::isSimple.
| TComplex | VoxelComplex. |
| vc | input complex. |
| cell | apply function on input cell. |
| bool DGtal::functions::skelUltimate | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Always returns false. Used in thinning schemes to calculate an ultimate skeleton. An ultimate skeleton only keeps voxels that don't change the topology.
| TComplex | VoxelComplex |
| vc | input voxel complex. |
| cell | c apply function on this voxel cell. |
| bool DGtal::functions::skelWithTable | ( | const boost::dynamic_bitset<> & | table, |
| const std::unordered_map< typename TComplex::Point, unsigned int > & | pointToMaskMap, | ||
| const TComplex & | vc, | ||
| const typename TComplex::Cell & | cell | ||
| ) |
Generic predicate to use external tables[configuration]->bool with skel functions. Can be adapted to any table using lambdas.
If you need to have a std::function<bool(const Complex & vc, const Cell & c )> signature (for using it in thinning algorithms), use a lambda to capture values: subsitute skelIsthmus (for example) for:
| TComplex | input CubicalComplex type. |
| table | [configuration]->bool |
| pointToMaskMap | map[neighborhood points] to a bit mask. Used to get the neighborhood configuration. |
| vc | input complex. |
| cell | input cell, center from where the neighborhood [configuration] will be checked. Note that only neighborhood are checked to belong to the complex, not the input cell. |
Referenced by thinningVoxelComplex().
|
inline |
Procedure that computes the lower and upper left hull of a DSS of first point aFirstPoint, length aLength, contained in a DSL aDSL [Roussillon 2014 : [108]].
| aDSL | bounding DSL |
| aFirstPoint | first point of the DSS |
| aLength | (strictly positive) length of the DSS |
| uIto | output iterator used to store the vertices of the upper convex hull |
| lIto | output iterator used to store the vertices of the lower convex hull |
| DSL | a model of arithmetical DSL |
| OutputIterator | a model of output iterator |
|
inline |
Procedure that computes the lower and upper left hull of a DSS of first point aFirstPoint, length aPositionBound, contained in a digital straight line described by aRStep, aRShift and aRemainderBound.
| aFirstPoint | first point of the DSS |
| aRemainderBound | difference between the intercept mu of the bounding DSL and the remainder of the first point. |
| aPositionBound | (strictly positive) length of the DSS |
| aStep | first step of the DSL |
| aRStep | remainder of the first step, ie. parameter \( a \) of the bounding DSL |
| aShift | shift vector of the DSL |
| aRShift | remainder of the shift vector, ie. parameter \( omega \) of the bounding DSL. |
| aPositionFunctor | position functor, which returns the position of any given point/vector |
| uIto | output iterator used to store the vertices of the upper convex hull |
| lIto | output iterator used to store the vertices of the lower convex hull |
| PointVector | a model of 2d point/vector |
| Coordinate | a model of integer for the coordinates of the point/vector |
| Position | a model of integer for locating points in the DSS |
| PositionFunctor | a model of unary functor that returns the position of a point/vector |
| OutputIterator | a model of output iterator |
Referenced by basicTest(), comparisonLeftHull(), and smartCHSubsegment().
|
inline |
Procedure that computes the next (lower or upper) vertex of the left hull of a DSS.
| positionBound | position of the last point of the DSS |
| remainderBound | remainder of the lower leaning points contained in the DSS |
| X | (returned) last vertex of the considered side |
| rX | (returned) remainder of X |
| Y | last vertex of the opposite side |
| rY | remainder of Y |
| V | (returned) last direction vector (unimodular with (X - Y)) |
| rV | (returned) remainder of V (not null) |
| ito | output iterator used to store the new vertex lying on the same side as X |
| pos | position functor, which returns the position of any given point/vector |
| f1 | first floor function (for the vertex) |
| f2 | second floor function (for the direction vector) |
| Position | a model of integer for locating points in the DSS |
| PointVector | a model of 2d point/vector |
| Coordinate | a model of integer for the coordinates of the point/vector |
| OutputIterator | a model of output iterator |
| PositionFunctor | a model of unary functor that returns the position of a point/vector |
| TruncationFunctor1 | a model of unary functor that implements an integer division |
| TruncationFunctor2 | a model of unary functor that implements an integer division |
|
inline |
Procedure that computes the previous vertex of the left hull of a DSS of main direction vector V , first upper leaning point U and first positive Bezout point L. The computation stops as soon as a computed vertex is located before aLastPosition.
| X | (returned) first vertex of the left hull on the considered side |
| Y | first vertex of the left hull on the opposite side |
| V | (returned) previous direction vector |
| aFirstPosition | position of the first point of the subsegment |
| aLastPosition | position of the last point of the subsegment |
| ito | output iterator used to store the vertices of the left hull lying on the same side as X |
| pos | position functor, which returns the position of any given point/vector |
| f1 | integer divisor for the direction vector update |
| f2 | integer divisor for the vertex update |
| PointVector | a model of couple of coordinates |
| Position | a model of integer for the position of the points |
| OutputIterator | a model of output iterator |
| TruncationFunctor1 | a model of functor for the integer division |
| TruncationFunctor2 | a model of functor for the integer division |
| PositionFunctor | a model of functor returning the position of a point |
|
inline |
Returns the value x * x
| T | a type with the multiply operator. |
| x | any value |
Definition at line 133 of file BasicMathFunctions.h.
Referenced by DGtal::functors::HatPointFunction< TPoint, TScalar >::operator()(), and DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::operator()().
| T DGtal::functions::squaredNormL2 | ( | const std::vector< T > & | a | ) |
Overloaded squared L2-norm operator for a vector of numbers.
| T | the number type of the input vector. |
| [in] | a | the vector of numbers |
| TComplex DGtal::functions::thinningVoxelComplex | ( | TComplex & | vc, |
| const std::string & | skel_type_str, | ||
| const std::string & | skel_select_type_str, | ||
| const std::string & | tables_folder, | ||
| const int & | persistence = 0, |
||
| const TDistanceTransform * | distance_transform = nullptr, |
||
| const bool | profile = false, |
||
| const bool | verbose = false |
||
| ) |
Definition at line 92 of file VoxelComplexThinning.h.
References DGtal::Trace::beginBlock(), DGtal::PointVector< dim, Integer >::diagonal(), DGtal::Trace::endBlock(), DGtal::Trace::info(), loadTable(), skelWithTable(), DGtal::trace, and DGtal::PointVector< dim, Integer >::zero.
| bool DGtal::functions::twoIsthmus | ( | const TComplex & | vc, |
| const typename TComplex::Cell & | cell | ||
| ) |
Check if input cell is a 2-isthmus. A voxel is a 2-isthmus if, after a thinning, its proper neighborhood is a 1-Surface isOneSurface.
| TComplex | VoxelComplex. |
| vc | input complex. |
| cell | apply function on input cell. |