33 std::map<std::string, MDLabel> MDL::names;
39 if (names.find(name) != names.end())
53 void MDL::addExtraAliases()
55 const char * extra_aliases = getenv(
"XMIPP_EXTRA_ALIASES");
65 for (std::vector<String>::iterator it = sv.begin(); it != sv.end(); ++it)
67 if (it->find(eq) != it->npos)
72 else if (it->find(co) != it->npos)
85 formatString(
"Invalid label name: %s found in environment var XMIPP_EXTRA_ALIASES", pair[0].c_str()));
96 data[label]->
str = alias;
104 MDLabel newLabel = MDL::bufferIndex;
110 MDL::bufferIndex = (
MDLabel)((
int)newLabel + 1);
125 for (
size_t i = 0;
i < parts.size(); ++
i)
134 if (names.find(labelName) == names.end())
136 return names[labelName];
141 return (
isValidLabel(label)) ? data[(int)label]->str :
"";
152 std::stringstream ss;
192 return "VECTOR(DOUBLE)";
196 return "VECTOR(SIZE_T)";
252 return data[label]->
type;
267 return data[label]->
tags & tags;
static bool isMicrograph(const MDLabel label)
static MDLabel str2Label(const String &labelName)
static bool isImage(const MDLabel label)
static std::map< String, MDLabel > & getLabelDict()
#define REPORT_ERROR(nerr, ErrormMsg)
static bool isInt(const MDLabel label)
static bool isCtfParam(const MDLabel label)
void setValue(const MDObject &object) override
static bool isValidLabel(const MDLabel &label)
static void emptifyHeader(MDRow &)
static bool isBool(const MDLabel label)
static String labelType2Str(MDLabelType type)
static bool isVector(const MDLabel label)
static String label2StrSql(const MDLabel label)
std::vector< String > StringVector
static MDLabelType labelType(const MDLabel label)
static void resetBufferIndex()
int splitString(const String &input, const String &delimiter, StringVector &results, bool includeEmpties)
static bool isStack(const MDLabel label)
void setValue(const MDObject &object) override
Incorrect argument received.
static bool isMetadata(const MDLabel label)
static bool isTextFile(const MDLabel label)
static bool isLong(const MDLabel label)
void eq(Image< double > &op1, const Image< double > &op2)
Be careful with integer images for relational operations...due to double comparisons.
static MDLabel getNewAlias(const String &alias, MDLabelType type=LABEL_NOTYPE)
void tokenize(const String &str, StringVector &tokens, const String &delimiters)
static MDRowSql emptyHeaderSql()
static MDRowVec emptyHeaderVec()
virtual void resetGeo(bool addLabels=true)
static bool isPSD(const MDLabel label)
static bool isString(const MDLabel label)
void setValue(MDLabel label, const T &d, bool addLabel=true)
static String label2SqlColumn(const MDLabel label)
static bool isDouble(const MDLabel label)
String formatString(const char *format,...)
static bool hasTag(const MDLabel label, const int tags)
static void str2LabelVector(const String &labelsStr, std::vector< MDLabel > &labels)
static String label2Str(const MDLabel &label)
static void addLabelAlias(MDLabel label, const String &alias, bool replace=false, MDLabelType type=LABEL_NOTYPE)
static bool isVectorLong(const MDLabel label)