File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger > Class Template Reference

Aim: Functor that embeds a 2D point into a 3D space from two axis vectors and an origin point given in the 3D space. More...

#include <DGtal/kernel/BasicPointFunctors.h>

Public Types

typedef SpaceND< 3, TInteger > Space
typedef Space::Point Point
typedef Space::Integer Integer

Public Member Functions

 Point2DEmbedderIn3D (const TDomain3D &aDomain3DImg, const Point &anOriginPoint, const Point &anUpperPointOnAxis1, const Point &anUpperPointOnAxis2, const Point &aDefautPoint=Point(0, 0, 0))
 Point2DEmbedderIn3D (const TDomain3D &aDomain3DImg, const Point &anOriginPoint, const typename Space::RealPoint &aNormalVector, const typename Point::Component &aWidth, const Point &aDefautPoint=Point(0, 0, 0))
 Point2DEmbedderIn3D (const TDomain3D &aDomain3DImg, const Point &anOriginPoint, const typename Space::RealPoint &aNormalVector, const typename Space::RealPoint &orientXaxisVector, const typename Point::Component &aWidth, const Point &aDefautPoint=Point(0, 0, 0))
template<typename TPoint2D>
Point operator() (const TPoint2D &aPoint, bool checkInsideDomain=true) const
void shiftOriginPoint (const typename Space::RealPoint &shift)

Private Attributes

TDomain3D myDomain
Space::RealPoint myOriginPointEmbeddedIn3D
Point myDefaultPoint
Space::RealPoint myFirstAxisEmbeddedDirection
Space::RealPoint mySecondAxisEmbeddedDirection

Detailed Description

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
class DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >

Aim: Functor that embeds a 2D point into a 3D space from two axis vectors and an origin point given in the 3D space.

Description of template class 'Point2DEmbedderIn3D'

It also checks if the resulting point is inside the 3D domain, else it returns a particular point (by default the point at domain origin (from the domain method lowerBound())).

It can be used to extract 2D images from volumetric files. For instance (see full example images/extract2DImagesFrom3D.cpp):

See also
tests/kernel/testBasicPointFunctors.cpp
Template Parameters
TDomain3Dthe type of the 3d domain.
TIntegerspecifies the integer number type used to define the space.
Examples
images/extract2DImagesFrom3D.cpp.

Definition at line 372 of file BasicPointFunctors.h.

Member Typedef Documentation

◆ Integer

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
typedef Space::Integer DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Integer

Definition at line 378 of file BasicPointFunctors.h.

◆ Point

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
typedef Space::Point DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Point

Definition at line 377 of file BasicPointFunctors.h.

◆ Space

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
typedef SpaceND< 3, TInteger> DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Space

Definition at line 376 of file BasicPointFunctors.h.

Constructor & Destructor Documentation

◆ Point2DEmbedderIn3D() [1/3]

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Point2DEmbedderIn3D ( const TDomain3D & aDomain3DImg,
const Point & anOriginPoint,
const Point & anUpperPointOnAxis1,
const Point & anUpperPointOnAxis2,
const Point & aDefautPoint = Point(0,0,0) )
inline

Constructor. Construct the functor from an origin 3D point, and two other 3D points defining the upper part of the 2D domain.

Parameters
aDomain3DImgthe 3D domain used to keep the resulting point in the domain.
anOriginPointthe origin point given in the 3D domain.
anUpperPointOnAxis1the upper point given in the 3D domain to define the first axis of the 2D domain.
anUpperPointOnAxis2the upper point given in the 3D domain to define the second axis of the 2D domain.
aDefautPointthe point given when the resulting point is outside the domain (default Point(0,0,0)).

Definition at line 390 of file BasicPointFunctors.h.

402
403
404 {
407 }
Aim: Functor that embeds a 2D point into a 3D space from two axis vectors and an origin point given i...

References myDefaultPoint, myDomain, myFirstAxisEmbeddedDirection, myOriginPointEmbeddedIn3D, and mySecondAxisEmbeddedDirection.

◆ Point2DEmbedderIn3D() [2/3]

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Point2DEmbedderIn3D ( const TDomain3D & aDomain3DImg,
const Point & anOriginPoint,
const typename Space::RealPoint & aNormalVector,
const typename Point::Component & aWidth,
const Point & aDefautPoint = Point(0,0,0) )
inline

Constructor. Construct the functor from an origin 3D point, an normal vector (normal to the 2D domain), and a width. The points of an 2D domain are embedded in 3D by using a normal vector giving the direction of the 2D domain embedded in the 3D space.

Parameters
aDomain3DImgthe 3D domain used to keep the resulting point in the domain.
anOriginPointthe center point given in the 3D domain.
aNormalVectorthe normal vector to the 2d domain embedded in 3D.
aWidththe width to determine the 2d domain bounds (the resulting 2d domain will be a square of length aWidth).
aDefautPointthe point given when the resulting point is outside the domain (default Point(0,0,0)).

Definition at line 422 of file BasicPointFunctors.h.

427 {
430 if(aNormalVector[0]!=0){
431 pRefOrigin [0]= -d/aNormalVector[0];
432 pRefOrigin [1]= 0.0;
433 pRefOrigin [2]= 0.0;
435 pRefOrigin[1]=-1.0;
436 }
437 }else if (aNormalVector[1]!=0){
438 pRefOrigin [0]= 0.0;
439 pRefOrigin [1]= -d/aNormalVector[1];
440 pRefOrigin [2]= 0.0;
442 pRefOrigin[0]=-1.0;
443 }
444 }else if (aNormalVector[2]!=0){
445 pRefOrigin [0]= 0.0;
446 pRefOrigin [1]= 0.0;
447 pRefOrigin [2]= -d/aNormalVector[2];
449 pRefOrigin[0]=-1.0;
450 }
451 }
452 typename Space::RealPoint uDir1;
454 typename Space::RealPoint uDir2;
458
459 uDir2/=uDir2.norm();
460
464 }
PointVector< dim, double > RealPoint
Definition SpaceND.h:117

References myDefaultPoint, myDomain, myFirstAxisEmbeddedDirection, myOriginPointEmbeddedIn3D, mySecondAxisEmbeddedDirection, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().

◆ Point2DEmbedderIn3D() [3/3]

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::Point2DEmbedderIn3D ( const TDomain3D & aDomain3DImg,
const Point & anOriginPoint,
const typename Space::RealPoint & aNormalVector,
const typename Space::RealPoint & orientXaxisVector,
const typename Point::Component & aWidth,
const Point & aDefautPoint = Point(0,0,0) )
inline

Constructor. Construct the functor from an origin 3D point, an normal vector (normal to the 2D domain), another vector fixing the direction of the the image plane (from the x axis) and a width. The points of an 2D domain are embedded in 3D by using a normal vector giving the direction of the 2D domain embedded in the 3D space.

Parameters
aDomain3DImgthe 3D domain used to keep the resulting point in the domain.
anOriginPointthe center point given in the 3D domain.
aNormalVectorthe normal vector to the 2d domain embedded in 3D.
orientXaxisVectorthe vector determining the 3D orientation of the image plane (from the x axis).
aWidththe width to determine the 2d domain bounds (the resulting 2d domain will be a square of length aWidth).
aDefautPointthe point given when the resulting point is outside the domain (default Point(0,0,0)).

Definition at line 480 of file BasicPointFunctors.h.

References myDefaultPoint, myDomain, myFirstAxisEmbeddedDirection, myOriginPointEmbeddedIn3D, mySecondAxisEmbeddedDirection, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().

Member Function Documentation

◆ operator()()

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
template<typename TPoint2D>
Point DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::operator() ( const TPoint2D & aPoint,
bool checkInsideDomain = true ) const
inline

The operator just recover the 3D Point associated to the Point2DEmbederIn3D parameters.

Parameters
[in]aPointpoint of the input domain (of dimension 2).
checkInsideDomainif 'true', checks that the point lies inside the domain.
Returns
the digital point of dimension 3 (value rounded downward with floor).

Definition at line 510 of file BasicPointFunctors.h.

511 {
512 Point pt ;
513 for( Dimension i=0; i<pt.size(); i++){
514
519 }
520
521 if(myDomain.isInside(pt)|| !checkInsideDomain)
522 {
523 return pt;
524 }
525 else
526 {
527#ifdef DEBUG_VERBOSE
528 trace.warning() << "Warning pt outside the 3D domain " << pt << std::endl;
529#endif
530 return myDefaultPoint;
531 }
532 }

References aPoint, DGtal::NumberTraitsImpl< std::decay< T >::type >::castToDouble(), myDefaultPoint, myDomain, myFirstAxisEmbeddedDirection, myOriginPointEmbeddedIn3D, mySecondAxisEmbeddedDirection, DGtal::PointVector< dim, TEuclideanRing, TContainer >::size(), and DGtal::trace.

◆ shiftOriginPoint()

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
void DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::shiftOriginPoint ( const typename Space::RealPoint & shift)
inline

Shift the image plane center of the functor (without modify the the image plane direction).

Parameters
[in]shiftdirection.

Definition at line 541 of file BasicPointFunctors.h.

542 {
543 for( Dimension i=0; i<myOriginPointEmbeddedIn3D.size(); i++){
545 }
546 }

References myOriginPointEmbeddedIn3D.

Referenced by testProjector().

Field Documentation

◆ myDefaultPoint

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
Point DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::myDefaultPoint
private

◆ myDomain

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
TDomain3D DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::myDomain
private

◆ myFirstAxisEmbeddedDirection

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
Space::RealPoint DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::myFirstAxisEmbeddedDirection
private

◆ myOriginPointEmbeddedIn3D

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
Space::RealPoint DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::myOriginPointEmbeddedIn3D
private

◆ mySecondAxisEmbeddedDirection

template<typename TDomain3D, typename TInteger = DGtal::Z3i::Integer>
Space::RealPoint DGtal::functors::Point2DEmbedderIn3D< TDomain3D, TInteger >::mySecondAxisEmbeddedDirection
private

The documentation for this class was generated from the following file: