34#ifndef CARTODATA_TRANSFORMATION_REFERENTIAL_H
35#define CARTODATA_TRANSFORMATION_REFERENTIAL_H
37#include <soma-io/transformation/affinetransformation3d_base.h>
38#include <cartobase/smart/rcobject.h>
116 unsigned order()
const {
return _orientation.size(); }
120 const std::string &
uuid()
const {
return _uuid; }
121 std::string &
uuid() {
return _uuid; }
144 const std::string & orient,
145 const std::vector<float> & transl = std::vector<float>(),
146 bool allow_resize =
false )
const;
150 const std::string & orient,
151 const std::vector<int> & transl,
152 bool allow_resize =
false )
const
155 std::vector<float>( transl.begin(),
166 const std::vector<int> & orient,
167 const std::vector<float> & transl = std::vector<float>() )
const;
192 bool allow_resize =
false );
215 const AffineTransformationBase & tr )
const;
237 int src_axis,
int dst_axis,
int inv_mult,
238 const std::vector<float> & transl
239 = std::vector<float>() );
248 bool except_if_undefined =
false );
252 mutable std::string _lpi_uuid;
253 std::vector<int> _orientation;
Orientation
Axis orientation enum.
void setHeader(const Object header)
static std::string orientationStr(Orientation orient)
orientation string for a single axis orientation (1 char)
bool is3DOriented() const
tells if the orientation is comatible with a 3D transformation (all axes after the 3th are the defaul...
static Referential fromHeader(const Object header, bool except_if_undefined=false)
Build a Referential object from a header.
void setLpiReferential(const std::string &lpi_uuid)
set the LPI original referential UUID
static std::vector< int > orientationVector(const std::string &orient, unsigned dim=0)
build an orientation vector from a string.
void setUuid(const std::string &uuid)
force a new UUID
static bool is3DOriented(const std::vector< int > &orient)
tells if the given orientation is 3D compatible
static void setAxisTransform(AffineTransformationBase &tr, int src_axis, int dst_axis, int inv_mult, const std::vector< float > &transl=std::vector< float >())
Build one line of transformation matrix.
rc_ptr< Transformation > toOrientation(const std::vector< int > &orient, const std::vector< float > &transl=std::vector< float >()) const
Build a transformation matrix to go from this referential to a given orientation.
std::string orientationStr(const std::string &orient) const
extended orientation information according to the needed number of axes
Referential(unsigned ndim=3)
Build a referential with the given number of dimensions.
static Orientation orientationCode(const std::string &orient)
orientation constant for a single orientation axis character
unsigned order() const
number of axes (or space dimensions)
std::string orientationStr() const
orientation of the referential, as a string of one letter per axis
rc_ptr< Transformation > toOrientation(const std::string &orient, const std::vector< int > &transl, bool allow_resize=false) const
same as above but translation is given as ints
std::string lpiReferentialUuid() const
LPI oriented referential.
Referential & operator=(const Referential &ref)
std::vector< int > axesOrientation() const
orientation of the referential, as a vector of constants.
void setOrientation(const std::string &orient, bool allow_resize=false)
set a new orientation for the referential.
void ensureOrder(unsigned ndim)
update the order, keeping existing orientation information
Referential(const Referential &ref)
void setOrientation(const std::vector< int > &orient)
set a new orientation for the referential.
const std::string & uuid() const
a referential has an unique identifier
Object header() const
referential header, may contain anything useful
Object exportedHeader() const
export a ready-to-save version of the header, where, especially, the axes_orientation property is an ...
rc_ptr< Transformation > toOrientation(const std::string &orient, const std::vector< float > &transl=std::vector< float >(), bool allow_resize=false) const
Build a transformation matrix to go from this referential to a given orientation.
bool isLpiOriented() const
tells if the orientation is the default LPI one.
std::vector< int > orientationFromTransform(const AffineTransformationBase &tr) const
target orientation for a given transform matrix.
static std::string orientationStr(const std::vector< int > &orient)
build the orientation string from a vector of constants
bool is3DOriented(const std::string &orient) const
tells if the given orientation is 3D compatible