当前位置: 首页>>代码示例>>C++>>正文


C++ MITK_WARN函数代码示例

本文整理汇总了C++中MITK_WARN函数的典型用法代码示例。如果您正苦于以下问题:C++ MITK_WARN函数的具体用法?C++ MITK_WARN怎么用?C++ MITK_WARN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MITK_WARN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MITK_INFO

STDMETHODIMP USTelemedScanConverterPlugin::SetScanConverterPlugin(IDispatch* plugin)
{
  // make sure that there is no scan converter plugin registered already
  this->ReleasePlugin();

  HRESULT hr;

  // it is ok to call this method with a nullptr plugin to remove
  // a previous callback
  if (plugin == nullptr)
  {
    MITK_INFO("IUsgfwScanConverterPluginCB")("ScanConverterPlugin")
      << "nullptr plugin set to the scan converter. The callback for the previous plugin is removed now.";
    return S_OK;
  }

  // get Telemed API plugin from the COM library
  Usgfw2Lib::IUsgScanConverterPlugin* tmp_plugin;
  hr = plugin->QueryInterface(__uuidof(Usgfw2Lib::IUsgScanConverterPlugin), (void**)&tmp_plugin);

  if (FAILED(hr))
  {
    MITK_WARN("IUsgfwScanConverterPluginCB")("ScanConverterPlugin")
      << "Could not query com interface for IUsgScanConverterPlugin (" << hr << ").";
    return hr;
  }

  // get the converter for scan lines from the COM library and
  // save it as a member attribute
  hr = tmp_plugin->get_ScanConverter((IUnknown**)&m_Plugin);

  if (FAILED(hr))
  {
    MITK_WARN("IUsgfwScanConverterPluginCB")("ScanConverterPlugin")
      << "Could not get ScanConverter from plugin (" << hr << ").";
    return hr;
  }

  SAFE_RELEASE(tmp_plugin);

  // now the callback can be set -> interface functions of this
  // object will be called from now on when new image data is
  // available
  hr = m_Plugin->SetCallback(this,USPC_BUFFER_INTERIM_OUTPUT);

  if (FAILED(hr))
  {
    MITK_WARN("IUsgfwScanConverterPluginCB")("ScanConverterPlugin")
      << "Could not set callback for plugin (" << hr << ").";
    return hr;
  }

  return S_OK;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:54,代码来源:mitkUSTelemedScanConverterPlugin.cpp

示例2: MITK_DEBUG

void QmitkPythonSnippets::SaveStringMap(const QString &filename, const QmitkPythonSnippets::QStringMap &) const
{
  MITK_DEBUG("QmitkPythonSnippets") << "saving to xml file " << filename.toStdString();

  if( filename.isEmpty() )
  {
    MITK_WARN("QmitkPythonSnippets") << "empty auto save file path given. quit.";
    return;
  }

  QFile file(filename);
  file.open(QIODevice::WriteOnly);
  if( !file.isOpen() )
  {
    MITK_WARN("QmitkPythonSnippets") << "could not open file " << filename.toStdString() << " for writing";
    return;
  }
  QXmlStreamWriter xmlWriter(&file);

  xmlWriter.setAutoFormatting(true);
  xmlWriter.writeStartDocument();
  xmlWriter.writeStartElement(SNIPPETS_ROOT_XML_ELEMENT_NAME);

  QStringMap::const_iterator it = d->m_Snippets.begin();
  while( it != d->m_Snippets.end() )
  {

    {
      MITK_DEBUG("QmitkPythonSnippets") << "SNIPPETS_XML_ELEMENT_NAME " << SNIPPETS_XML_ELEMENT_NAME.toStdString();
      MITK_DEBUG("QmitkPythonSnippets") << "writing item " << it.key().toStdString();
    }

    xmlWriter.writeStartElement(SNIPPETS_XML_ELEMENT_NAME);

    xmlWriter.writeAttribute( "key", it.key() );
    xmlWriter.writeAttribute( "value", it.value() );

    xmlWriter.writeEndElement();

    ++it;
  }

  xmlWriter.writeEndDocument();
  if( file.isOpen() )
    file.close();

  {
    MITK_DEBUG("QmitkPythonSnippets") << "SaveStringMap successful ";
  }

}
开发者ID:Cdebus,项目名称:MITK,代码行数:51,代码来源:QmitkPythonSnippets.cpp

示例3: catch

void QmitkUSNavigationStepMarkerIntervention::UpdateSensorsNames()
{
  mitk::USCombinedModality::Pointer combinedModality = this->GetCombinedModality(false);
  if (combinedModality.IsNull())
  {
    return;
  }

  mitk::NavigationDataSource::Pointer navigationDataSource = combinedModality->GetNavigationDataSource();
  if (navigationDataSource.IsNull())
  {
    return;
  }

  if (!m_NeedleSensorName.empty())
  {
    try
    {
      m_NeedleSensorIndex = navigationDataSource->GetOutputIndex(m_NeedleSensorName);
    }
    catch (const std::exception &e)
    {
      MITK_WARN("QmitkUSAbstractNavigationStep")
        ("QmitkUSNavigationStepPlacementPlanning") << "Cannot get index for needle sensor name: " << e.what();
    }
  }
  if (this->GetNavigationStepState() >= QmitkUSAbstractNavigationStep::State_Active)
  {
    m_NeedleProjectionFilter->SelectInput(m_NeedleSensorIndex);
  }

  if (!m_ReferenceSensorName.empty())
  {
    try
    {
      m_ReferenceSensorIndex = navigationDataSource->GetOutputIndex(m_ReferenceSensorName);
    }
    catch (const std::exception &e)
    {
      MITK_WARN("QmitkUSAbstractNavigationStep")
        ("QmitkUSNavigationStepPlacementPlanning") << "Cannot get index for reference sensor name: " << e.what();
    }
  }
  if (this->GetNavigationStepState() >= QmitkUSAbstractNavigationStep::State_Active)
  {
    m_NodeDisplacementFilter->SelectInput(m_ReferenceSensorIndex);
  }

  ui->freezeImageButton->SetCombinedModality(combinedModality, m_ReferenceSensorIndex);
}
开发者ID:pollen-metrology,项目名称:MITK,代码行数:50,代码来源:QmitkUSNavigationStepMarkerIntervention.cpp

示例4: MITK_WARN

void QmitkImageStatisticsView::JumpToCoordinates(int row ,int col)
{
  if(m_SelectedDataNodes.isEmpty())
  {
    MITK_WARN("QmitkImageStatisticsView") << "No data node selected for statistics calculation." ;
    return;
  }

  mitk::Point3D world;
  if (row==4 && !m_WorldMinList.empty())
    world = m_WorldMinList[col];
  else if (row==3 && !m_WorldMaxList.empty())
    world = m_WorldMaxList[col];
  else
    return;

  mitk::IRenderWindowPart* part = this->GetRenderWindowPart();
  if (part)
  {
    part->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SelectSliceByPoint(world);
    part->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController()->SelectSliceByPoint(world);
    part->GetQmitkRenderWindow("coronal")->GetSliceNavigationController()->SelectSliceByPoint(world);

    mitk::SliceNavigationController::GeometryTimeEvent timeEvent(this->m_SelectedImage->GetTimeGeometry(), col);
    part->GetQmitkRenderWindow("axial")->GetSliceNavigationController()->SetGeometryTime(timeEvent);
  }
}
开发者ID:151706061,项目名称:MITK,代码行数:27,代码来源:QmitkImageStatisticsView.cpp

示例5: navDatas

mitk::NavigationDataSet::Pointer mitk::NavigationDataReaderXML::ReadNavigationDataSet()
{
  mitk::NavigationDataSet::Pointer navigationDataSet = mitk::NavigationDataSet::New(m_NumberOfOutputs);
  mitk::NavigationData::Pointer curNavigationData;

  do
    {
      std::vector<mitk::NavigationData::Pointer> navDatas(m_NumberOfOutputs);
      for (unsigned int n = 0; n < m_NumberOfOutputs; ++n)
      {
        curNavigationData = this->ReadVersion1();

        if (curNavigationData.IsNull())
        {
          if (n != 0)
          {
            MITK_WARN("mitkNavigationDataReaderXML")
                << "Different number of NavigationData objects for different tools. Ignoring last ones.";
          }
          break;
        }
        navDatas.at(n) = curNavigationData;
      }

      if (curNavigationData.IsNotNull())
      {
        navigationDataSet->AddNavigationDatas(navDatas);
      }
    }
    while (curNavigationData.IsNotNull());

    return navigationDataSet;
}
开发者ID:danielknorr,项目名称:MITK,代码行数:33,代码来源:mitkNavigationDataReaderXML.cpp

示例6: MITK_WARN

  void KinectDevice::GetDistances(float* distanceArray, int& imageSequence)
  {
    m_ImageMutex->Lock();
    if (m_CameraActive)
    {
      // 1) copy the image buffer
      // 2) convert the distance values from m to mm
      // 3) Flip around y- axis (vertical axis)

      /*
      this->m_Controller->GetDistances(this->m_SourceDataBuffer[this->m_CurrentPos], this->m_DistanceArray);
      for (int i=0; i<this->m_CaptureHeight; i++)
      {
      for (int j=0; j<this->m_CaptureWidth; j++)
      {
      distanceArray[i*this->m_CaptureWidth+j] = 1000 * this->m_DistanceArray[(i+1)*this->m_CaptureWidth-1-j];
      }
      }
      */
      for (int i=0; i<this->m_PixelNumber; i++)
      {
        distanceArray[i] = this->m_DistanceDataBuffer[this->m_CurrentPos][i]; // * 1000
      }
      imageSequence = this->m_ImageSequence;
    }
    else
    {
      MITK_WARN("ToF") << "Warning: Data can only be acquired if camera is active.";
    }
    m_ImageMutex->Unlock();
  }
开发者ID:beneon,项目名称:MITK,代码行数:31,代码来源:mitkKinectDevice.cpp

示例7: MapElemPair

void OclResourceServiceImpl::InsertProgram(cl_program _program_in, std::string name, bool forceOverride)
{
  typedef std::pair < std::string, ProgramData > MapElemPair;
  std::pair< ProgramMapType::iterator, bool> retValue;

  ProgramData data;
  data.counter = 1;
  data.program = _program_in;
  data.mutex = itk::FastMutexLock::New();

  // program is not stored, insert first instance (count = 1)
  m_ProgramStorageMutex->Lock();
  retValue = m_ProgramStorage.insert( MapElemPair(name, data) );
  m_ProgramStorageMutex->Unlock();

  // insertion failed, i.e. a program with same name exists
  if( !retValue.second )
  {
    std::string overrideMsg("");
    if( forceOverride )
    {
      // overwrite old instance
      m_ProgramStorage[name].program = _program_in;
      overrideMsg +=" The old program was overwritten!";
    }

    MITK_WARN("OpenCL.ResourceService") << "The program " << name << " already exists." << overrideMsg;
  }
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:29,代码来源:mitkOclResourceServiceImpl_Private.cpp

示例8: MITK_WARN

mitk::NavigationData::Pointer mitk::NavigationDataSet::GetNavigationDataForIndex( unsigned int index, unsigned int toolIndex ) const
{
  if ( index >= m_NavigationDataVectors.size() )
  {
    MITK_WARN("NavigationDataSet") << "There is no NavigationData available at index " << index << ".";
    return nullptr;
  }

  if ( toolIndex >= m_NavigationDataVectors.at(index).size() )
  {
    MITK_WARN("NavigationDataSet") << "There is NavigatitionData available at index " << index << " for tool " << toolIndex << ".";
    return nullptr;
  }

  return m_NavigationDataVectors.at(index).at(toolIndex);
}
开发者ID:151706061,项目名称:MITK,代码行数:16,代码来源:mitkNavigationDataSet.cpp

示例9: clReleaseProgram

void OclResourceServiceImpl::RemoveProgram(const std::string& name)
{
  ProgramMapType::iterator it = m_ProgramStorage.find(name);
  cl_int status = 0;
  cl_program program = NULL;

  if( it != m_ProgramStorage.end() )
  {
    it->second.mutex->Lock();
    // decrease reference by one
    it->second.counter -= 1;
    it->second.mutex->Unlock();

    // remove from the storage
    if( it->second.counter == 0 )
    {
      program = it->second.program;

      m_ProgramStorageMutex->Lock();
      m_ProgramStorage.erase(it);
      m_ProgramStorageMutex->Unlock();
    }

    // delete the program
    if( program )
    {
      status = clReleaseProgram(program);
      CHECK_OCL_ERR( status );
    }
  }
  else
  {
    MITK_WARN("OpenCL.ResourceService") << "Program name [" <<name <<"] passed for deletion not found.";
  }
}
开发者ID:GHfangxin,项目名称:MITK,代码行数:35,代码来源:mitkOclResourceServiceImpl_Private.cpp

示例10: tr

void QmitkNavigationDataPlayerView::OnOpenFile()
{
  mitk::NavigationDataReaderInterface::Pointer reader = NULL;

  QString filter = tr("NavigationData File (*.csv *.xml)");

  QString fileName = QFileDialog::getOpenFileName(NULL, tr("Open NavigationData Set"), "", filter);

  if ( fileName.isNull() ) { return; } // user pressed cancel

  try
  {
    m_Data = dynamic_cast<mitk::NavigationDataSet*> (mitk::IOUtil::LoadBaseData(fileName.toStdString()).GetPointer());
  }
  catch ( const mitk::Exception &e )
  {
    MITK_WARN("NavigationDataPlayerView") << "could not open file " << fileName.toStdString();
    QMessageBox::critical(0, "Error Reading File", "The file '" + fileName
                          +"' could not be read.\n" + e.GetDescription() );
    return;
  }

  // Update Labels
  m_Controls->m_LblFilePath->setText(fileName);
  m_Controls->m_LblFrames->setText(QString::number(m_Data->Size()));
  m_Controls->m_LblTools->setText(QString::number(m_Data->GetNumberOfTools()));

  // Initialize Widgets and create Player
  this->OnSelectPlayer();
  this->SetInteractionComponentsEnabledState(true);
}
开发者ID:151706061,项目名称:MITK,代码行数:31,代码来源:QmitkNavigationDataPlayerView.cpp

示例11: MITK_ERROR

bool mitk::USCombinedModality::OnActivation()
{
  if ( m_UltrasoundDevice.IsNull() )
  {
    MITK_ERROR("USCombinedModality")("USDevice") << "UltrasoundDevice must not be null.";
    mitkThrow() << "UltrasoundDevice must not be null.";
  }

  mitk::TrackingDeviceSource::Pointer trackingDeviceSource = dynamic_cast<mitk::TrackingDeviceSource*>(m_TrackingDevice.GetPointer());
  if ( trackingDeviceSource.IsNull() )
  {
    MITK_WARN("USCombinedModality")("USDevice") << "Cannot start tracking as TrackingDeviceSource is null.";
  }
  trackingDeviceSource->StartTracking();

  // activate ultrasound device only if it is not already activated
  if ( m_UltrasoundDevice->GetDeviceState() >= mitk::USDevice::State_Activated )
  {
    return true;
  }
  else
  {
    return m_UltrasoundDevice->Activate();
  }
}
开发者ID:SaschaD-DKFZ,项目名称:MITK,代码行数:25,代码来源:mitkUSCombinedModality.cpp

示例12: MITK_WARN

  bool mitk::NodeDisplacementFilter::AddNode( mitk::DataNode::Pointer node )
  {
    // Consistency Checks
    if (node.IsNull())
    {
      MITK_WARN("NodeDisplacementFilter")
        << "Null Node passed to NodeDisplacementFilter. Ignoring Node....";
      return false;
    }
    if (node->GetData() == 0)
    {
      MITK_WARN("NodeDisplacementFilter")
        << "Empty Node passed to NodeDisplacementFilter. Ignoring Node....";
      return false;
    }
    if(m_SelectedInput == -1)
    {
      MITK_ERROR("NodeDisplacementFilter")
        << "Cannot add nodes before input Stream was selected";
      mitkThrow() << "Cannot add nodes before input Stream was selected";
    }

    this->Update(); // make sure we are working on current data
    mitk::NavigationData::Pointer reference = this->GetOutput(m_SelectedInput);

    if (! reference->IsDataValid())
    {
      MITK_WARN("NodeDisplacementFilter")
        << "Cannot add node while selected tool is not tracked. Ignoring Node....";
      return false;
    }

    // find transformation and add node
    mitk::AffineTransform3D::Pointer inverseAffineTransform = mitk::AffineTransform3D::New();
    if ( ! reference->GetAffineTransform3D()->GetInverse(inverseAffineTransform) )
    {
      MITK_ERROR("NodeDisplacementFilter")
        << "Could not get the inverse transformation of the navigation data transformation.";
      mitkThrow() << "Could not get the inverse transformation of the navigation data transformation.";
    }

    inverseAffineTransform->Compose(node->GetData()->GetGeometry()->GetIndexToWorldTransform(), true);
    m_Transforms.push_back(inverseAffineTransform);
    m_Nodes.push_back(node);

    return true;
  }
开发者ID:lsanzdiaz,项目名称:MITK-BiiG,代码行数:47,代码来源:mitkNodeDisplacementFilter.cpp

示例13: MITK_WARN

HistogramStatisticsCalculator::MeasurementType HistogramStatisticsCalculator::GetUPP()
{
    if (!m_StatisticsCalculated)
    {
        MITK_WARN("Statistics have not yet been calculated, running calculation now...");
        CalculateStatistics();
    }
    return m_UPP;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:9,代码来源:mitkHistogramStatisticsCalculator.cpp

示例14: MITK_WARN

bool CropOpenCVImageFilter::OnFilterImage( cv::Mat& image )
{
  if (m_CropRegion.width == 0)
  {
    MITK_WARN("AbstractOpenCVImageFilter")("CropOpenCVImageFilter")
        << "Cropping cannot be done without setting a non-empty crop region first.";
    return false;
  }

  cv::Size imageSize = image.size();

  if (m_CropRegion.x >= imageSize.width || m_CropRegion.y >= imageSize.height)
  {
    MITK_WARN("AbstractOpenCVImageFilter")("CropOpenCVImageFilter")
        << "Cannot crop if top left corner of the roi is outside the image boundaries.";
    return false;
  }

  // We can try and correct too large boundaries (do this only once
  // after a new crop region was set.
  if (m_NewCropRegionSet)
  {
    m_NewCropRegionSet = false;

    if ( m_CropRegion.x + m_CropRegion.width > imageSize.width)
    {
      m_CropRegion.width = imageSize.width - m_CropRegion.x;
      MITK_WARN("AbstractOpenCVImageFilter")("CropOpenCVImageFilter")
          << "Changed too large roi in x direction to fit the image size.";
    }
    if ( m_CropRegion.y + m_CropRegion.height > imageSize.height)
    {
      m_CropRegion.height = imageSize.height - m_CropRegion.y;
      MITK_WARN("AbstractOpenCVImageFilter")("CropOpenCVImageFilter")
          << "Changed too large roi in y direction to fit the image size.";
    }
  }

  // crop image and copy cropped region into the input image
  cv::Mat buffer = image(m_CropRegion);
  buffer.copyTo(image);

  return true;
}
开发者ID:151706061,项目名称:MITK,代码行数:44,代码来源:mitkCropOpenCVImageFilter.cpp

示例15: MITK_WARN

void mitk::NavigationToolStorage::UnRegisterMicroservice(){
  if (!m_ServiceRegistration)
  {
    MITK_WARN("NavigationToolStorage")
      << "Cannot unregister microservice as it wasn't registered before.";
    return;
  }

  m_ServiceRegistration.Unregister();
  m_ServiceRegistration = 0;
}
开发者ID:Cdebus,项目名称:MITK,代码行数:11,代码来源:mitkNavigationToolStorage.cpp


注:本文中的MITK_WARN函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。