void QmitkSegmentationView::UpdateOrganList(QStringList& organColors, const QString& organname, mitk::Color color)
{
  QString listElement( organname + QColor(color.GetRed() * 255 , color.GetGreen() * 255 , color.GetBlue() * 255).name() );
  
  // remove previous definition if necessary
  int oldIndex = organColors.indexOf( QRegExp(QRegExp::escape(organname) + "#......", Qt::CaseInsensitive));
  if (oldIndex < 0 || organColors.at(oldIndex) != listElement )
  {
    if (oldIndex >= 0)
    {
      organColors.removeAt( oldIndex );
    }

    // add colored organ name AND sort list
    organColors.append( listElement );
    organColors.sort();
  }
}
void mitk::LabelSetImageVtkMapper2D::ApplyColor(mitk::BaseRenderer *renderer, const mitk::Color &color)
{
  LocalStorage *localStorage = this->GetLocalStorage(renderer);
  localStorage->m_OutlineActor->GetProperty()->SetColor(color.GetRed(), color.GetGreen(), color.GetBlue());
  localStorage->m_OutlineShadowActor->GetProperty()->SetColor(0, 0, 0);
}
Ejemplo n.º 3
0
static QColor MitkToQt(const mitk::Color &color)
{
  return QColor(color.GetRed() * 255, color.GetGreen() * 255, color.GetBlue() * 255);
}