MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkUSImageVideoSourceTest.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14#include "mitkTestingMacros.h"
15
17{
18public:
19
20 static void TestInstantiation()
21 {
22 // let's create an object of our class
23 mitk::USImageVideoSource::Pointer usSource = mitk::USImageVideoSource::New();
24 MITK_TEST_CONDITION_REQUIRED(usSource.IsNotNull(), "USImageVideoSource should not be null after instantiation");
25 }
26
27 static void TestOpenVideoFile(std::string videoFilePath)
28 {
29 mitk::USImageVideoSource::Pointer usSource = mitk::USImageVideoSource::New();
30
31 usSource->SetVideoFileInput(videoFilePath);
32 MITK_TEST_CONDITION_REQUIRED(usSource->GetIsVideoReady(), "USImageVideoSource should have isVideoReady flag set after opening a Video File");
33 mitk::Image::Pointer frame;
34 frame = usSource->GetNextImage()[0];
35 MITK_TEST_CONDITION_REQUIRED(frame.IsNotNull(), "First frame should not be null.");
36 frame = usSource->GetNextImage()[0];
37 MITK_TEST_CONDITION_REQUIRED(frame.IsNotNull(), "Second frame should not be null.");
38 frame = usSource->GetNextImage()[0];
39 MITK_TEST_CONDITION_REQUIRED(frame.IsNotNull(), "Third frame should not be null.");
40 frame = usSource->GetNextImage()[0];
41 MITK_TEST_CONDITION_REQUIRED(frame.IsNotNull(), "Fourth frame should not be null.");
42 frame = usSource->GetNextImage()[0];
43 MITK_TEST_CONDITION_REQUIRED(frame.IsNotNull(), "Fifth frame should not be null.");
44 }
53};
54
55#ifdef WIN32 // Video file compression is currently only supported under windows.
59int mitkUSImageVideoSourceTest(int, char* argv[])
60{
61 MITK_TEST_BEGIN("mitkUSImageVideoSourceTest");
62
64
66
67 // This test is commented out since no videodevcie ist steadily connected to the dart clients.
68 // Functionality should sufficiently be tested through TestOpenVideoFile anyway
69 //mitkUSImageVideoSourceTestClass::TestOpenDevice();
70
71 MITK_TEST_END();
72}
73#else
74int mitkUSImageVideoSourceTest(int, char* [] )
75{
76 MITK_TEST_BEGIN("mitkUSImageVideoSourceTest");
77 MITK_TEST_END();
78}
79#endif
static void TestOpenVideoFile(std::string videoFilePath)
int mitkUSImageVideoSourceTest(int, char *[])