void QmitkBinaryThresholdULToolGUI::OnAcceptThresholdPreview()
{
  QmitkConfirmSegmentationDialog dialog;
  QString segName = QString::fromStdString(m_BinaryThresholdULTool->GetCurrentSegmentationName());

  dialog.SetSegmentationName(segName);
  int result = dialog.exec();

  switch(result)
  {
  case QmitkConfirmSegmentationDialog::CREATE_NEW_SEGMENTATION:
    m_BinaryThresholdULTool->SetOverwriteExistingSegmentation(false);
    break;
  case QmitkConfirmSegmentationDialog::OVERWRITE_SEGMENTATION:
    m_BinaryThresholdULTool->SetOverwriteExistingSegmentation(true);
    break;
  case QmitkConfirmSegmentationDialog::CANCEL_SEGMENTATION:
    return;
  }

  if (m_BinaryThresholdULTool.IsNotNull())
  {
    m_BinaryThresholdULTool->AcceptCurrentThresholdValue();
  }
}
Example #2
0
void QmitkFastMarchingTool3DGUI::OnConfirmSegmentation()
{
  QmitkConfirmSegmentationDialog dialog;
  QString segName = QString::fromStdString(m_FastMarchingTool->GetCurrentSegmentationName());

  dialog.SetSegmentationName(segName);
  int result = dialog.exec();

  switch(result)
  {
  case QmitkConfirmSegmentationDialog::CREATE_NEW_SEGMENTATION:
    m_FastMarchingTool->SetOverwriteExistingSegmentation(false);
    break;
  case QmitkConfirmSegmentationDialog::OVERWRITE_SEGMENTATION:
    m_FastMarchingTool->SetOverwriteExistingSegmentation(true);
    break;
  case QmitkConfirmSegmentationDialog::CANCEL_SEGMENTATION:
    return;
  }
  if (m_FastMarchingTool.IsNotNull())
  {
    m_FastMarchingTool->ConfirmSegmentation();
    m_btConfirm->setEnabled(false);
  }
}
Example #3
0
void QmitkOtsuTool3DGUI::OnSegmentationRegionAccept()
{
    QmitkConfirmSegmentationDialog dialog;
    QString segName = QString::fromStdString(m_OtsuTool3DTool->GetCurrentSegmentationName());

    dialog.SetSegmentationName(segName);
    int result = dialog.exec();

    switch(result)
    {
    case QmitkConfirmSegmentationDialog::CREATE_NEW_SEGMENTATION:
        m_OtsuTool3DTool->SetOverwriteExistingSegmentation(false);
        break;
    case QmitkConfirmSegmentationDialog::OVERWRITE_SEGMENTATION:
        m_OtsuTool3DTool->SetOverwriteExistingSegmentation(true);
        break;
    case QmitkConfirmSegmentationDialog::CANCEL_SEGMENTATION:
        return;
    }

    if (m_OtsuTool3DTool.IsNotNull() && m_Controls.m_selectionListWidget->currentItem() != NULL)
    {
        m_OtsuTool3DTool->ConfirmSegmentation();
    }
}
void QmitkAdaptiveRegionGrowingToolGUI::ConfirmSegmentation()
{
  //get image node
  if(m_InputImageNode.IsNull())
  {
    QMessageBox::critical( NULL, "Adaptive region growing functionality", "Please specify the image in Datamanager!");
    return;
  }
  //get image data
  mitk::Image::Pointer orgImage = dynamic_cast<mitk::Image*> (m_InputImageNode->GetData());
  if(orgImage.IsNull())
  {
    QMessageBox::critical( NULL, "Adaptive region growing functionality", "No Image found!");
    return;
  }
  //get labeled segmentation
  mitk::Image::Pointer labeledSeg = (mitk::Image*)m_DataStorage->GetNamedObject<mitk::Image>(m_NAMEFORLABLEDSEGMENTATIONIMAGE);
  if(labeledSeg.IsNull())
  {
    QMessageBox::critical( NULL, "Adaptive region growing functionality", "No Segmentation Preview found!");
    return;
  }

  mitk::DataNode::Pointer newNode = m_DataStorage->GetNamedNode( m_NAMEFORLABLEDSEGMENTATIONIMAGE);
  if (newNode.IsNull())
    return;

  QmitkConfirmSegmentationDialog dialog;
  QString segName = QString::fromStdString(m_RegionGrow3DTool->GetCurrentSegmentationName());

  dialog.SetSegmentationName(segName);
  int result = dialog.exec();

  switch(result)
  {
  case QmitkConfirmSegmentationDialog::CREATE_NEW_SEGMENTATION:
    m_RegionGrow3DTool->SetOverwriteExistingSegmentation(false);
    break;
  case QmitkConfirmSegmentationDialog::OVERWRITE_SEGMENTATION:
    m_RegionGrow3DTool->SetOverwriteExistingSegmentation(true);
    break;
  case QmitkConfirmSegmentationDialog::CANCEL_SEGMENTATION:
    return;
  }


  mitk::Image* img = dynamic_cast<mitk::Image*>(newNode->GetData());
  AccessByItk(img, ITKThresholding);

  // disable volume rendering preview after the segmentation node was created
  this->EnableVolumeRendering(false);
  newNode->SetVisibility(false);
  m_Controls.m_cbVolumeRendering->setChecked(false);
  //TODO disable slider etc...
}