void StartRecording_ValidDepthImage_WritesImageToFile()
  {
    m_ToFImageRecorder->SetDistanceImageFileName(m_DistanceImageName);
    m_ToFImageRecorder->StartRecording();
    m_ToFImageRecorder->WaitForThreadBeingTerminated();
    m_ToFImageRecorder->StopRecording();

    mitk::Image::Pointer recordedImage = dynamic_cast<mitk::Image*>(mitk::IOUtil::Load(m_DistanceImageName)[0].GetPointer());
    MITK_ASSERT_EQUAL( m_GroundTruthDepthImage, recordedImage, "Recorded image should be equal to the test data.");

    //delete the tmp image
    if( remove( m_DistanceImageName.c_str() ) != 0 )
    {
      MITK_ERROR<<"File: "<< m_DistanceImageName << " not successfully deleted!";
    }
  }
Пример #2
0
  void StartRecording_ValidIntensityImage_WritesImageToFile()
  {
    m_ToFImageRecorder->SetIntensityImageFileName(m_IntensityImageName);
    m_ToFImageRecorder->SetIntensityImageSelected(true);
    m_ToFImageRecorder->SetDistanceImageSelected(false);
    m_ToFImageRecorder->StartRecording();
    m_ToFImageRecorder->WaitForThreadBeingTerminated();
    m_ToFImageRecorder->StopRecording();

    mitk::Image::Pointer recordedImage = mitk::IOUtil::LoadImage(m_IntensityImageName);
    MITK_ASSERT_EQUAL( m_GroundTruthIntensityImage, recordedImage, "Recorded image should be equal to the test data.");

    //delete the tmp image
    if( remove( m_IntensityImageName.c_str() ) != 0 )
    {
      MITK_ERROR<<"File: "<< m_IntensityImageName << " not successfully deleted!";
    }
  }