OpenMS
|
Allows dynamical switching (at runtime) between a dimension (RT, m/z, int, IM, etc) and X,Y,Z coordinates. You can set either of them, and query the other. The Mapping is stored internally. The unit to which the X,Y,Z coordinates currently mapped onto can also be queried (useful for axis labels etc). More...
#include <OpenMS/KERNEL/DimMapper.h>
Public Types | |
using | Point = DPosition< N_DIM, DimBase::ValueType > |
Public Member Functions | |
DimMapper ()=delete | |
No default c'tor (we need dimensions) More... | |
DimMapper (const DIM_UNIT(&units)[N_DIM]) | |
Custom C'tor with given dimensions to map to (the order is assumed to be X, Y, Z, ...) More... | |
DimMapper (const DimMapper &rhs) | |
Copy C'tor. More... | |
DimMapper & | operator= (const DimMapper &rhs) |
Assignment operator. More... | |
bool | operator== (const DimMapper &rhs) const |
Equality. More... | |
bool | operator!= (const DimMapper &rhs) const |
Inequality. More... | |
template<typename T > | |
Point | map (const T &data) const |
convert an OpenMS datatype (such as Feature) to an N_DIM-dimensional point More... | |
template<typename Container > | |
Point | map (const Container &data, const Size index) const |
convert an OpenMS datapoint in a container (such as MSSpectrum) to an N_DIM-dimensional point More... | |
template<typename ... Ranges> | |
DRange< N_DIM > | mapRange (const RangeManager< Ranges... > &ranges) const |
Convert Range to an N_DIM-dimensional area (min and max for each dimension) More... | |
template<typename... Ranges> | |
void | fromXY (const DRange< N_DIM > &in, RangeManager< Ranges... > &output) const |
template<typename... Ranges> | |
void | fromXY (const Point &in, RangeManager< Ranges... > &output) const |
template<typename T > | |
void | fromXY (const Point &in, T &out) const |
RangeAllType | fromXY (const Point &in) const |
const DimBase & | getDim (DIM d) const |
obtain unit/name for X/Y/Z dimension. More... | |
bool | hasUnit (DIM_UNIT unit) const |
Static Protected Member Functions | |
static std::unique_ptr< const DimBase > | create_ (DIM_UNIT u) |
a minimal factory More... | |
Protected Attributes | |
std::array< std::unique_ptr< const DimBase >, N_DIM > | dims_ |
mappers for the X,Y,Z... dimension More... | |
Allows dynamical switching (at runtime) between a dimension (RT, m/z, int, IM, etc) and X,Y,Z coordinates. You can set either of them, and query the other. The Mapping is stored internally. The unit to which the X,Y,Z coordinates currently mapped onto can also be queried (useful for axis labels etc).
Use N_DIM template parameter to determine the number of axis dimensions (1-3 is currently supported). Usually 2 or 3 make sense.
using Point = DPosition<N_DIM, DimBase::ValueType> |
|
delete |
No default c'tor (we need dimensions)
Custom C'tor with given dimensions to map to (the order is assumed to be X, Y, Z, ...)
References DimMapper< N_DIM >::create_().
a minimal factory
References OpenMS::FAIMS_CV, OpenMS::IM_MS, OpenMS::IM_VSSC, OpenMS::INT, OpenMS::MZ, and OpenMS::RT.
Referenced by DimMapper< N_DIM >::DimMapper().
|
inline |
Convert an N_DIM-dimensional area (min and max for each dimension) to a Range. Empty dimensions in the input in
, will also be made empty in output
. Dimensions not contained in this DimMapper will remain untouched in output
References DimMapper< N_DIM >::dims_, DIntervalBase< D >::isEmpty(), DIntervalBase< D >::maxPosition(), and DIntervalBase< D >::minPosition().
Referenced by Annotation1DCaret< DataPoint >::move(), and Annotation1DPeakItem< DataPoint >::move().
|
inline |
Convert an N_DIM-Point to a Range with all known dimensions. The range will only span a single value in each dimension covered by this mapper. Dimensions not contained in this DimMapper will remain empty.
References DimMapper< N_DIM >::dims_.
|
inline |
Convert an N_DIM-Point to a Range. The range will only span a single value in each dimension covered by this mapper. Dimensions not contained in this DimMapper will remain untouched in output
References DimMapper< N_DIM >::dims_.
|
inline |
Convert an N_DIM-Point to a Peak1D or ChromatogramPeak. Dimensions not contained in this DimMapper will remain untouched in out
Exception::InvalidRange | if DimMapper has a dimension not supported by T |
References DimMapper< N_DIM >::dims_.
obtain unit/name for X/Y/Z dimension.
References DimMapper< N_DIM >::dims_.
Referenced by Gravitator::setIntensityAsGravity(), and Plot2DWidget::setMapper().
|
inline |
References DimMapper< N_DIM >::dims_.
convert an OpenMS datapoint in a container (such as MSSpectrum) to an N_DIM-dimensional point
References DimMapper< N_DIM >::dims_, and DimMapper< N_DIM >::map().
|
inline |
convert an OpenMS datatype (such as Feature) to an N_DIM-dimensional point
References DimMapper< N_DIM >::dims_.
Referenced by Annotation1DCaret< DataPoint >::draw(), Annotation1DPeakItem< DataPoint >::draw(), DimMapper< N_DIM >::map(), Annotation1DCaret< DataPoint >::move(), and Annotation1DPeakItem< DataPoint >::move().
|
inline |
Convert Range to an N_DIM-dimensional area (min and max for each dimension)
References RangeManager< RangeBases >::assign(), DimMapper< N_DIM >::dims_, RangeBase::getMax(), RangeBase::getMin(), RangeBase::isEmpty(), and DIntervalBase< D >::setDimMinMax().
|
inline |
Inequality.
References DimMapper< N_DIM >::operator==().
Assignment operator.
References DimMapper< N_DIM >::dims_.
|
inline |
|
protected |
mappers for the X,Y,Z... dimension
Referenced by DimMapper< N_DIM >::fromXY(), DimMapper< N_DIM >::getDim(), DimMapper< N_DIM >::hasUnit(), DimMapper< N_DIM >::map(), DimMapper< N_DIM >::mapRange(), DimMapper< N_DIM >::operator=(), and DimMapper< N_DIM >::operator==().