17 #include <QStringList>
22 struct OrganNamesHandling
24 static QStringList GetDefaultOrganColorString()
26 QStringList organColors;
31 for (
const auto& preset : anatomicalStructureColorPresets->
GetColorPresets())
33 auto organName = preset.first.c_str();
34 auto color = QColor(preset.second.GetRed(), preset.second.GetGreen(), preset.second.GetBlue());
36 AppendToOrganList(organColors, organName, color);
41 static void UpdateOrganList(QStringList& organColors,
const QString& organname,
mitk::Color color)
43 QString listElement(organname + QColor(color.GetRed() * 255, color.GetGreen() * 255, color.GetBlue() * 255).name());
46 int oldIndex = organColors.indexOf(QRegExp(QRegExp::escape(organname) +
"#......", Qt::CaseInsensitive));
47 if (oldIndex < 0 || organColors.at(oldIndex) != listElement)
51 organColors.removeAt(oldIndex);
55 organColors.append(listElement);
60 static void AppendToOrganList(QStringList& organColors,
const QString& organname,
const QColor& color)
62 organColors.append(organname + color.name());
std::map< std::string, Color > const GetColorPresets()
DataCollection - Class to facilitate loading/accessing structured data.
static AnatomicalStructureColorPresets * New()
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)