critical_point.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __mia_3d_criticalpoint_h
#define __mia_3d_criticalpoint_h
#include <list>
#include <mia/3d/matrix.hh>
NS_MIA_BEGIN
class EXPORT_3D C3DCriticalPoint
{
public:
typedef std::vector< C3DCriticalPoint > List;
C3DCriticalPoint();
C3DCriticalPoint(const C3DFVector& x0_);
C3DCriticalPoint(float x, float y, float z);
C3DCriticalPoint(const C3DCriticalPoint& org);
C3DCriticalPoint& operator = (const C3DCriticalPoint& org);
const C3DFVector get_point()const;
const C3DFMatrix get_a()const;
float get_gamma()const;
void set_point(const C3DFVector&);
void set_a(const C3DFMatrix&);
void set_gamma(float gamma_);
C3DFVector at(const C3DFVector& x) const;
C3DFVector at_alt(const C3DFVector& x) const;
bool operator ==(const C3DCriticalPoint& cp) const;
#ifdef UGLY_HACK
bool operator < (const C3DCriticalPoint& cp) const;
#endif
private:
float gamma;
C3DFVector x0;
C3DFMatrix A;
};
typedef C3DCriticalPoint::List C3DCriticalPointList;
class EXPORT_3D C3DCriticalPointEigen
{
C3DFVector location;
C3DFMatrix portrait;
float eval1;
float eval2;
float eval3;
T3DCVector<float> evec1;
T3DCVector<float> evec2;
T3DCVector<float> evec3;
public:
enum EVType {ev_zero,
ev_real,
ev_real_two_equal,
ev_real_three_equal,
ev_complex
};
C3DCriticalPointEigen(C3DCriticalPoint cp);
C3DCriticalPointEigen(const C3DFVector& l, const C3DFMatrix& m);
C3DCriticalPointEigen(const C3DFVector& location_,
const C3DFMatrix& portrait_,
float eval1, float eval2, float eval3,
const C3DFVector& evec1, const C3DFVector& evec2, const C3DFVector& evec3,
EVType type);
EVType get_type()const;
float get_eval1()const;
float get_eval2()const;
float get_eval3()const;
float get_real_eval2()const;
float get_real_eval3()const;
std::complex<float> get_complex_eval2()const;
std::complex<float> get_complex_eval3()const;
const C3DFMatrix get_portrait()const;
const C3DFVector get_location()const;
const C3DFVector get_evect1()const;
const C3DFVector get_real_evect2()const;
const C3DFVector get_real_evect3()const;
const T3DCVector<float> get_complex_evect2()const;
const T3DCVector<float> get_complex_evect3()const;
private:
EVType type;
bool estimate();
};
typedef std::vector< C3DCriticalPointEigen > C3DCriticalPointEigenList;
inline C3DCriticalPointEigen::EVType C3DCriticalPointEigen::get_type()const
{
return type;
}
inline float C3DCriticalPointEigen::get_eval1()const
{
return eval1;
}
inline float C3DCriticalPointEigen::get_eval2()const
{
return eval2;
}
inline float C3DCriticalPointEigen::get_eval3()const
{
return eval3;
}
inline float C3DCriticalPointEigen::get_real_eval2()const
{
assert(type != ev_complex);
return eval2;
}
inline float C3DCriticalPointEigen::get_real_eval3()const
{
assert(type != ev_complex);
return eval3;
}
inline std::complex<float> C3DCriticalPointEigen::get_complex_eval2()const
{
assert(type == ev_complex);
return std::complex<float>(eval2, eval3);
}
inline std::complex<float> C3DCriticalPointEigen::get_complex_eval3()const
{
assert(type == ev_complex);
return std::complex<float>(eval2, eval3);
}
inline const C3DFVector C3DCriticalPointEigen::get_evect1()const
{
return C3DFVector(evec1.x.real(), evec1.y.real(), evec1.z.real());
}
inline const C3DFVector C3DCriticalPointEigen::get_real_evect2()const
{
assert(type != ev_complex);
return C3DFVector(evec2.x.real(), evec2.y.real(), evec2.z.real());
}
inline const C3DFVector C3DCriticalPointEigen::get_real_evect3()const
{
assert(type != ev_complex);
return C3DFVector(evec3.x.real(), evec3.y.real(), evec3.z.real()); ;
}
inline const T3DCVector<float> C3DCriticalPointEigen::get_complex_evect2()const
{
assert(type == ev_complex);
return evec2;
}
inline const T3DCVector<float> C3DCriticalPointEigen::get_complex_evect3()const
{
assert(type == ev_complex);
return evec3;
}
inline const C3DFVector C3DCriticalPointEigen::get_location()const
{
return location;
}
inline const C3DFMatrix C3DCriticalPointEigen::get_portrait()const
{
return portrait;
}
//template implementation
inline const C3DFVector C3DCriticalPoint::get_point()const
{
return x0;
}
inline const C3DFMatrix C3DCriticalPoint::get_a()const
{
return A;
}
inline void C3DCriticalPoint::set_point(const C3DFVector& x)
{
x0 = x;
}
inline void C3DCriticalPoint::set_a(const C3DFMatrix& a)
{
A = a;
}
inline float C3DCriticalPoint::get_gamma()const
{
return gamma;
}
inline void C3DCriticalPoint::set_gamma(float _gamma)
{
gamma = _gamma;
}
inline bool C3DCriticalPoint::operator ==(const C3DCriticalPoint& cp) const
{
return gamma == cp.gamma && A == cp.A && x0 == cp.x0;
}
#ifdef UGLY_HACK
inline bool C3DCriticalPoint::operator < (const C3DCriticalPoint& cp) const
{
// we shouldn't need this ...
return x0 < cp.x0;
}
#endif
#endif
NS_MIA_END
operator<
bool operator<(const T2DVector< T > &a, const T2DVector< S > &b)
Definition 2d/vector.hh:495
matrix.hh
C3DFMatrix
T3DMatrix< float > C3DFMatrix
a simple 3x3 matrix with single precision floating point values
Definition 3d/matrix.hh:226
T3DCVector
T3DVector< std::complex< T > > T3DCVector
Definition 3d/matrix.hh:32
C3DFVector
T3DVector< float > C3DFVector
A float 3D Vector.
Definition 3d/vector.hh:409
operator==
bool operator==(const CAttribute &a, const CAttribute &b)
Definition attributes.hh:95
C3DCriticalPointEigen::get_eval1
float get_eval1() const
Definition critical_point.hh:281
C3DCriticalPointEigen::C3DCriticalPointEigen
C3DCriticalPointEigen(C3DCriticalPoint cp)
C3DCriticalPointEigen::get_real_eval2
float get_real_eval2() const
Definition critical_point.hh:294
C3DCriticalPointEigen::get_evect1
const C3DFVector get_evect1() const
Definition critical_point.hh:315
C3DCriticalPointEigen::get_real_evect3
const C3DFVector get_real_evect3() const
Definition critical_point.hh:324
C3DCriticalPointEigen::get_eval3
float get_eval3() const
Definition critical_point.hh:289
C3DCriticalPointEigen::EVType
EVType
types of critical points
Definition critical_point.hh:179
C3DCriticalPointEigen::ev_real
@ ev_real
Definition critical_point.hh:180
C3DCriticalPointEigen::ev_real_two_equal
@ ev_real_two_equal
Definition critical_point.hh:181
C3DCriticalPointEigen::ev_zero
@ ev_zero
Definition critical_point.hh:179
C3DCriticalPointEigen::ev_real_three_equal
@ ev_real_three_equal
Definition critical_point.hh:182
C3DCriticalPointEigen::ev_complex
@ ev_complex
Definition critical_point.hh:183
C3DCriticalPointEigen::get_complex_evect2
const T3DCVector< float > get_complex_evect2() const
Definition critical_point.hh:329
C3DCriticalPointEigen::get_eval2
float get_eval2() const
Definition critical_point.hh:285
C3DCriticalPointEigen::get_real_evect2
const C3DFVector get_real_evect2() const
Definition critical_point.hh:319
C3DCriticalPointEigen::get_real_eval3
float get_real_eval3() const
Definition critical_point.hh:299
C3DCriticalPointEigen::C3DCriticalPointEigen
C3DCriticalPointEigen(const C3DFVector &location_, const C3DFMatrix &portrait_, float eval1, float eval2, float eval3, const C3DFVector &evec1, const C3DFVector &evec2, const C3DFVector &evec3, EVType type)
C3DCriticalPointEigen::get_complex_eval2
std::complex< float > get_complex_eval2() const
Definition critical_point.hh:304
C3DCriticalPointEigen::get_complex_eval3
std::complex< float > get_complex_eval3() const
Definition critical_point.hh:309
C3DCriticalPointEigen::get_type
EVType get_type() const
Definition critical_point.hh:277
C3DCriticalPointEigen::get_portrait
const C3DFMatrix get_portrait() const
Definition critical_point.hh:346
C3DCriticalPointEigen::C3DCriticalPointEigen
C3DCriticalPointEigen(const C3DFVector &l, const C3DFMatrix &m)
C3DCriticalPointEigen::get_complex_evect3
const T3DCVector< float > get_complex_evect3() const
Definition critical_point.hh:334
C3DCriticalPointEigen::get_location
const C3DFVector get_location() const
Definition critical_point.hh:340
C3DCriticalPoint
A class to hold a critical point. This class holds a critical point in a 3D vector field It consists ...
Definition critical_point.hh:45
C3DCriticalPoint::operator==
bool operator==(const C3DCriticalPoint &cp) const
Definition critical_point.hh:388
C3DCriticalPoint::C3DCriticalPoint
C3DCriticalPoint(const C3DFVector &x0_)
C3DCriticalPoint::C3DCriticalPoint
C3DCriticalPoint(float x, float y, float z)
C3DCriticalPoint::get_gamma
float get_gamma() const
Definition critical_point.hh:377
C3DCriticalPoint::List
std::vector< C3DCriticalPoint > List
A list of critical points.
Definition critical_point.hh:49
C3DCriticalPoint::get_a
const C3DFMatrix get_a() const
Definition critical_point.hh:360
C3DCriticalPoint::at
C3DFVector at(const C3DFVector &x) const
C3DCriticalPoint::get_point
const C3DFVector get_point() const
Definition critical_point.hh:355
C3DCriticalPoint::set_point
void set_point(const C3DFVector &)
Definition critical_point.hh:366
C3DCriticalPoint::C3DCriticalPoint
C3DCriticalPoint(const C3DCriticalPoint &org)
C3DCriticalPoint::C3DCriticalPoint
C3DCriticalPoint()
C3DCriticalPoint::set_a
void set_a(const C3DFMatrix &)
Definition critical_point.hh:371
C3DCriticalPoint::at_alt
C3DFVector at_alt(const C3DFVector &x) const
C3DCriticalPoint::set_gamma
void set_gamma(float gamma_)
Definition critical_point.hh:382
C3DCriticalPointList
C3DCriticalPoint::List C3DCriticalPointList
typedef for convinience
Definition critical_point.hh:140
C3DCriticalPointEigenList
std::vector< C3DCriticalPointEigen > C3DCriticalPointEigenList
Definition critical_point.hh:275
EXPORT_3D
#define EXPORT_3D
Definition defines3d.hh:45
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36