コード例 #1
0
void AddDisplayPlaneSubTree()
{
  // add the displayed planes of the multiwidget to a node to which the subtree
  // @a planesSubTree points ...

  float white[3] = {1.0f, 1.0f, 1.0f};
  mitk::PlaneGeometryDataMapper2D::Pointer mapper;
  mitk::IntProperty::Pointer layer = mitk::IntProperty::New(1000);

  // ... of widget 1
  m_PlaneNode1 =
    (mitk::BaseRenderer::GetInstance(mitkWidget1->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
  m_PlaneNode1->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
  m_PlaneNode1->SetProperty("visible", mitk::BoolProperty::New(true));
  m_PlaneNode1->SetProperty("name", mitk::StringProperty::New("widget1Plane"));
  m_PlaneNode1->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
  m_PlaneNode1->SetProperty("helper object", mitk::BoolProperty::New(true));
  m_PlaneNode1->SetProperty("layer", layer);
  m_PlaneNode1->SetColor(1.0, 0.0, 0.0);
  mapper = mitk::PlaneGeometryDataMapper2D::New();
  m_PlaneNode1->SetMapper(mitk::BaseRenderer::Standard2D, mapper);

  // ... of widget 2
  m_PlaneNode2 =
    (mitk::BaseRenderer::GetInstance(mitkWidget2->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
  m_PlaneNode2->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
  m_PlaneNode2->SetProperty("visible", mitk::BoolProperty::New(true));
  m_PlaneNode2->SetProperty("name", mitk::StringProperty::New("widget2Plane"));
  m_PlaneNode2->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
  m_PlaneNode2->SetProperty("helper object", mitk::BoolProperty::New(true));
  m_PlaneNode2->SetProperty("layer", layer);
  m_PlaneNode2->SetColor(0.0, 1.0, 0.0);
  mapper = mitk::PlaneGeometryDataMapper2D::New();
  m_PlaneNode2->SetMapper(mitk::BaseRenderer::Standard2D, mapper);

  // ... of widget 3
  m_PlaneNode3 =
    (mitk::BaseRenderer::GetInstance(mitkWidget3->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
  m_PlaneNode3->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
  m_PlaneNode3->SetProperty("visible", mitk::BoolProperty::New(true));
  m_PlaneNode3->SetProperty("name", mitk::StringProperty::New("widget3Plane"));
  m_PlaneNode3->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
  m_PlaneNode3->SetProperty("helper object", mitk::BoolProperty::New(true));
  m_PlaneNode3->SetProperty("layer", layer);
  m_PlaneNode3->SetColor(0.0, 0.0, 1.0);
  mapper = mitk::PlaneGeometryDataMapper2D::New();
  m_PlaneNode3->SetMapper(mitk::BaseRenderer::Standard2D, mapper);

  // AddPlanesToDataStorage
  if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull() && m_PlaneNode3.IsNotNull() && m_Node.IsNotNull())
  {
    if (m_DataStorage.IsNotNull())
    {
      m_DataStorage->Add(m_PlaneNode1);
      m_DataStorage->Add(m_PlaneNode2);
      m_DataStorage->Add(m_PlaneNode3);
    }
  }
}
コード例 #2
0
void QmitkNavigationToolCreationAdvancedWidget::SetToolTipSurface( bool cone, mitk::DataNode::Pointer node /*= NULL*/ )
{
  m_ToolTipSurface = NULL;
  if(cone)
  {
    m_ToolTipSurface = mitk::Surface::New();
    vtkConeSource *vtkData = vtkConeSource::New();
    vtkData->SetAngle(5.0);
    vtkData->SetResolution(50);
    vtkData->SetHeight(6.0f);
    vtkData->SetRadius(2.0f);
    vtkData->SetCenter(0.0, 0.0, 0.0);

    vtkData->Update();
    m_ToolTipSurface->SetVtkPolyData(vtkData->GetOutput());

    vtkData->Delete();
    m_SurfaceNodeName ="";
  }
  else if(!cone && node.IsNotNull())
  {
    m_ToolTipSurface = dynamic_cast<mitk::Surface*>(node->GetData());
    m_SurfaceNodeName = node->GetName();
  }
}
コード例 #3
0
  foreach ( mitk::DataNode::Pointer referenceNode, selectedNodes )
  {
    if (referenceNode.IsNotNull())
    {
      mitk::LabelSetImage::Pointer referenceImage = dynamic_cast<mitk::LabelSetImage*>( referenceNode->GetData() );
      assert(referenceImage);

      if(referenceImage->GetNumberOfLabels() <= 1)
      {
        QMessageBox::information(nullptr, "Create LabelSetImage Preset", "Could not create a LabelSetImage preset.\nNo Labels defined!\n");\
        return;
      }

      std::string sName = referenceNode->GetName();
      QString qName;
      qName.sprintf("%s.lsetp",sName.c_str());
      QString filename = QFileDialog::getSaveFileName( nullptr,"save file dialog",QString(),"LabelSet Preset(*.lsetp)");
      if ( filename.isEmpty() )
        return;

      std::string fileName = filename.toStdString();
      bool wasSaved = mitk::LabelSetIOHelper::SaveLabelSetImagePreset(fileName,referenceImage);

      if(!wasSaved)
      {
        QMessageBox::information(nullptr, "Create LabelSetImage Preset", "Could not save a LabelSetImage preset as Xml.\n");\
        return;
      }
    }
  }
コード例 #4
0
 foreach( mitk::DataNode::Pointer node, nodes )
 {
   if( node.IsNotNull() )
   {
     m_Controls.m_AddInteractor->setEnabled( true );
     return;
   }
 }
コード例 #5
0
ファイル: QmitkTemplateView.cpp プロジェクト: test-fd301/MITK
 // iterate all selected objects, adjust warning visibility
 foreach( mitk::DataNode::Pointer node, nodes )
 {
   if( node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()) )
   {
     m_Controls.labelWarning->setVisible( false );
     m_Controls.buttonPerformImageProcessing->setEnabled( true );
     return;
   }
 }
コード例 #6
0
ファイル: QmitkTubeGraphView.cpp プロジェクト: 151706061/MITK
  foreach( mitk::DataNode::Pointer node, nodes )
  {
    if( node.IsNotNull() && dynamic_cast< mitk::TubeGraph* >(node->GetData()) )
    {
      m_Controls.activeGraphComboBox->SetSelectedNode(node);
      m_ActiveTubeGraph = dynamic_cast< mitk::TubeGraph* >(node->GetData());

      m_ActiveProperty = dynamic_cast<mitk::TubeGraphProperty*>(m_ActiveTubeGraph->GetProperty( "Tube Graph.Visualization Information" ).GetPointer());

      this->UpdateActiveTubeGraphInInteractors();
      this->UpdateLabelGroups();
      this->UpdateAnnotation();
    }
  }
コード例 #7
0
void QmitkNavigationDataPlayerView::AddTrajectory(mitk::DataStorage* ds, mitk::DataNode::Pointer trajectoryNode)
{
  if(ds == NULL)
    return;

  if(m_Trajectory.IsNotNull())
    ds->Remove(m_Trajectory);  // remove trajectory from DataStorage if already exists


  // add trajectory to DataStorage
  if(ds != NULL && trajectoryNode.IsNotNull())
  {
    m_Trajectory = trajectoryNode;
    ds->Add(m_Trajectory);
  }
}