void setUp() override
  {
    _propList = mitk::PropertyList::New();
    oldSeriesName = "dicom.study.SeriesDescription";
    oldStudyName = "dicom.study.StudyDescription";

    _propList->SetStringProperty(oldSeriesName.c_str(), "old_series");
    _propList->SetStringProperty(mitk::GeneratePropertyNameForDICOMTag(0x0008, 0x103e).c_str(), "new_series");

    _propList->SetStringProperty(oldStudyName.c_str(), "old_study");
  }
void QmitkScalarBarOverlay::GetProperties( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  QPen pen = QPen();


  mitk::PropertyList::Pointer propertyList = pl;
  QPalette palette = QPalette();

  // get the desired color of the textOverlays
  mitk::ColorProperty::Pointer colorProp =
    dynamic_cast<mitk::ColorProperty*>( propertyList->GetProperty( "overlay.color" ) );

  if ( colorProp.IsNull() )
  {
    MITK_DEBUG << "creating new colorProperty";
    colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 );
  }

  mitk::Color color = colorProp->GetColor();
  pen.setColor( QColor( color[0],color[1],color[2],255 ) );
  pen.setStyle( Qt::SolidLine );
  pen.setCapStyle( Qt::FlatCap );
  pen.setJoinStyle( Qt::MiterJoin );

  m_ScalarBar->SetPen( pen );
}
Exemple #3
0
void QmitkTextOverlay::UpdateFontProperties( mitk::PropertyList::Pointer pl )
{
    if ( pl.IsNull() )
        return;

    mitk::PropertyList::Pointer propertyList = pl;
    QPalette palette = QPalette();
    QFont font = QFont();

    // get the desired color of the textOverlays
    mitk::ColorProperty::Pointer colorProp =
        dynamic_cast<mitk::ColorProperty*>( propertyList->GetProperty( "overlay.color" ) );

    if ( colorProp.IsNull() )
    {
        colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 );
    }

    mitk::Color color = colorProp->GetColor();
    palette.setColor( QPalette::Foreground, QColor( color[0],color[1],color[2],255 ) );
    palette.setColor( QPalette::Window, Qt::transparent);
    m_Label->setPalette( palette );

    // get the desired opacity of the overlays
    //mitk::FloatProperty::Pointer opacityProperty =
    //  dynamic_cast<mitk::FloatProperty*>( propertyList->GetProperty( "overlay.opacity" ) );

    //if ( opacityProperty.IsNull() )
    //{
    //  m_Label->setWindowOpacity( 1 );
    //}
    //else
    //{
    //  m_Label->setWindowOpacity( opacityProperty->GetValue() );
    //}

    //set the desired font-size of the overlays
    int fontSize = 0;
    if ( !propertyList->GetIntProperty( "overlay.fontSize", fontSize ) )
    {
        fontSize = 9;
    }
    font.setPointSize( fontSize );

    bool useKerning = false;
    if ( !propertyList->GetBoolProperty( "overlay.kerning", useKerning ) )
    {
        useKerning = true;
    }
    font.setKerning( useKerning );

    std::string fontFamily = "";
    if ( !propertyList->GetStringProperty( "overlay.fontFamily", fontFamily ) )
    {
        fontFamily = "Verdana";
    }
    font.setFamily(  QString(fontFamily.c_str()) );

    m_Label->setFont( font );
}
void QmitkScalarBarOverlay::GenerateData( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  m_PropertyList = pl->Clone();

  if ( m_PropertyList.IsNotNull() )
  {
    this->SetupCallback( m_PropertyList->GetProperty( m_Id ) );

    this->GetProperties( pl );
    this->SetScaleFactor();
  }
  else
  {
    MITK_DEBUG << "invalid propList";
  }

}
void mitk::PlanarFigureInteractor::ConfigurationChanged()
{
  const mitk::PropertyList::Pointer properties = GetAttributes();

  std::string precision = "";
  if (properties->GetStringProperty("precision", precision))
  {
    m_Precision = atof(precision.c_str());
  }
  else
  {
    m_Precision = (ScalarType) 6.5;
  }

  std::string minPointDistance = "";
  if (properties->GetStringProperty("minPointDistance", minPointDistance))
  {
    m_MinimumPointDistance = atof(minPointDistance.c_str());
  }
  else
  {
    m_MinimumPointDistance = (ScalarType) 25.0;
  }
}
void QmitkPropertiesTableEditor::SetPropertyList(mitk::PropertyList::Pointer _List)
{
  if (_List.IsNotNull())
  {
    m_Model->SetPropertyList(_List);
    m_NodePropertiesTableView->resizeColumnsToContents();
    m_NodePropertiesTableView->resizeRowsToContents();
    m_NodePropertiesTableView->horizontalHeader()->setStretchLastSection(true);
    m_NodePropertiesTableView->setEditTriggers(QAbstractItemView::CurrentChanged);
  }
  else
  {
    m_Model->SetPropertyList(0);
  }
}
void QmitkTextOverlay::GenerateData( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  m_PropertyList = pl;

  if ( m_PropertyList.IsNotNull() )
  {
    this->SetupCallback( m_PropertyList->GetProperty( m_Id ) );

    this->GetTextProperties( pl );
    this->SetText();
  }
  else
  {
    MITK_ERROR << "invalid propList";
  }

}
bool mitk::DisplayInteractor::GetBoolProperty( mitk::PropertyList::Pointer propertyList,
                                               const char* propertyName,
                                               bool defaultValue )
{
  std::string valueAsString;
  if ( !propertyList->GetStringProperty( propertyName, valueAsString ) )
  {
    return defaultValue;
  }
  else
  {
    if ( valueAsString == "true" )
    {
      return true;
    }
    else
    {
      return false;
    }
  }
}