24 CPPUNIT_TEST_SUITE(mitkLabelAnnotation3DTestSuite);
28 CPPUNIT_TEST_SUITE_END();
33 std::vector<std::string> m_CommandlineArgs;
34 std::string m_PathToBall;
35 std::string m_PathToImage;
36 std::string m_ReferenceImagePath;
44 mitkLabelAnnotation3DTestSuite() : m_RenderingTestHelper(300, 300) {}
55 m_ReferenceImagePath =
"RenderingTestData/ReferenceScreenshots/Annotation/";
63 m_CommandlineArgs.push_back(
"-V");
67 void Render2DAnnotation()
69 std::string refImagePath =
GetTestDataFilePath(m_ReferenceImagePath +
"mitkLabelAnnotation2D.png");
71 m_CommandlineArgs.push_back(refImagePath);
83 std::vector<std::string> labels;
84 unsigned long idx = 0;
85 for (
int i = -10; i < 10; i += 4)
87 for (
int j = -10; j < 10; j += 4)
92 point[2] = (i * j) / 10;
93 pointset->InsertPoint(idx++, point);
94 labels.push_back(
"test");
98 label3d->SetLabelCoordinates(pointset);
99 label3d->SetLabelVector(labels);
100 label3d->SetOffsetVector(offset);
103 datanode->SetData(pointset);
104 datanode->SetName(
"pointSet");
110 m_RenderingTestHelper.
Render();
116 void Render3DAnnotation()
118 std::string refImagePath =
GetTestDataFilePath(m_ReferenceImagePath +
"mitkLabelAnnotation3D.png");
120 m_CommandlineArgs.push_back(refImagePath);
132 std::vector<std::string> labels;
133 unsigned long idx = 0;
134 for (
int i = -10; i < 10; i += 4)
136 for (
int j = -10; j < 10; j += 4)
141 point[2] = (i * j) / 10;
142 pointset->InsertPoint(idx++, point);
143 labels.push_back(
"test");
147 label3d->SetLabelCoordinates(pointset);
148 label3d->SetLabelVector(labels);
149 label3d->SetOffsetVector(offset);
152 datanode->SetData(pointset);
153 datanode->SetName(
"pointSet");
159 m_RenderingTestHelper.
Render();
void SetViewDirection(mitk::SliceNavigationController::ViewDirection viewDirection)
Set the view direction of the renderwindow (e.g. sagittal, coronal, axial)
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
vtkRenderWindow * GetVtkRenderWindow()
Getter for the vtkRenderWindow which should be used to call vtkRegressionTestImage.
Organizes the rendering process.
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
void SetMapperIDToRender3D()
SetMapperIDToRender3D Convenience method to render in a 3D renderwindow.
static std::string GetTestDataFilePath(const std::string &testData)
Get the absolute path for test data.
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
void Render()
Render everything into an mitkRenderWindow. Call SetViewDirection() and SetProperty() before this met...
Test fixture for parameterized tests.
static void AddAnnotation(Annotation *Annotation, const std::string &rendererID)
The ArgcHelperClass class is a convinience class to convert a vector of strings to the standard c++ a...
void SetAutomaticallyCloseRenderWindow(bool automaticallyCloseRenderWindow)
SetStopRenderWindow Convenience method to make the renderwindow hold after rendering. Usefull for debugging.
void AddNodeToStorage(mitk::DataNode::Pointer node)
AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering...