34 MITK_TEST_BEGIN(
"mitkThreadedToFRawDataReconstruction");
35 mitk::ThreadedToFRawDataReconstruction::Pointer testObject = mitk::ThreadedToFRawDataReconstruction::New();
37 MITK_TEST_CONDITION_REQUIRED(testObject.GetPointer(),
"Testing initializing of class");
38 MITK_TEST_CONDITION_REQUIRED(!testObject->GetInit(),
"Testing initial state of GetInit()");
42 int sdsize = width*height*8*
sizeof(short);
43 testObject->Initialize(width, height, modfreq, sdsize );
44 MITK_TEST_CONDITION_REQUIRED(testObject->GetInit(),
"Testing state of GetInit() after initialization");
47 short* shortSource =
new short[sdsize];
48 vtkShortArray* channelData = vtkShortArray::New();
50 for(
long i = 0; i < sdsize; ++i)
56 RawDataDeviceHelperImpl::Pointer testHelper = RawDataDeviceHelperImpl::New();
57 testHelper->SetCaptureWidth(width);
58 testHelper->SetCaptureHeight(height);
59 testHelper->GetChannelSourceData(shortSource, channelData);
60 testObject->SetChannelData( channelData );
63 float* distances =
new float[width*height];
64 float* amplitudes =
new float[width*height];
65 float* intensties =
new float[width*height];
69 amplitudes[50] = -111;
70 intensties[50] = -111;
71 float before = distances[50];
73 testObject->GetDistances(distances);
74 testObject->GetAmplitudes(amplitudes);
75 testObject->GetIntensities(intensties);
76 MITK_TEST_CONDITION_REQUIRED(before != distances[50],
"Testing distance data generation and output");
77 MITK_TEST_CONDITION_REQUIRED(before != amplitudes[50],
"Testing ampltude data generation and output");
78 MITK_TEST_CONDITION_REQUIRED(before != intensties[50],
"Testing intensity data generation and output");
85 channelData->Delete();