1 #ifndef __CIFTI_SERIES_MAP_H__
2 #define __CIFTI_SERIES_MAP_H__
31 #include "CiftiMappingType.h"
45 float getStart()
const {
return m_start; }
46 float getStep()
const {
return m_step; }
47 Unit getUnit()
const {
return m_unit; }
56 CiftiSeriesMap(
const int64_t& length,
const float& start = 0.0f,
const float& step = 1.0f,
const Unit& unit = SECOND)
63 void setStart(
const float& start) { m_start = start; }
64 void setStep(
const float& step) { m_step = step; }
65 void setUnit(
const Unit& unit) { m_unit = unit; }
66 void setLength(
const int64_t& length);
68 static Unit stringToUnit(
const AString&
string,
bool& ok);
69 static AString unitToString(
const Unit& theUnit);
70 static std::vector<Unit> getAllUnits();
73 MappingType getType()
const {
return SERIES; }
74 int64_t getLength()
const {
return m_length; }
77 if (rhs.getType() != getType())
return false;
79 return (temp.m_length == m_length &&
80 temp.m_unit == m_unit &&
81 temp.m_start == m_start &&
82 temp.m_step == m_step);
84 bool approximateMatch(
const CiftiMappingType& rhs, AString* explanation = NULL)
const
86 switch (rhs.getType())
91 if (getLength() != rhs.getLength())
93 if (explanation != NULL) *explanation =
"mappings have different length";
97 if (explanation != NULL) *explanation = CiftiMappingType::mappingTypeToName(rhs.getType()) +
" mapping never matches " + CiftiMappingType::mappingTypeToName(getType());
101 void readXML1(XmlReader& xml);
102 void readXML2(XmlReader& xml);
103 void writeXML1(XmlWriter& xml)
const;
104 void writeXML2(XmlWriter& xml)
const;
107 float m_start, m_step;
Definition: CiftiMappingType.h:39
Definition: CiftiSeriesMap.h:36
namespace for all CiftiLib functionality
Definition: CiftiBrainModelsMap.h:42