13 #ifndef mitkRenderingTestHelper_h
14 #define mitkRenderingTestHelper_h
18 #include <vtkSmartPointer.h>
20 #include <MitkTestingHelperExports.h>
23 class vtkRenderWindow;
162 std::vector<char *> argv;
163 std::vector<std::vector<char>> argvec;
167 : argv(argstrings.size() + 1), argvec(argstrings.size() + 1)
169 std::vector<std::string> cmdArgs;
171 cmdArgs.insert(cmdArgs.end(), argstrings.begin(), argstrings.end());
172 for (std::size_t i = 0; i < cmdArgs.size(); ++i)
174 argvec[i].assign(cmdArgs[i].begin(), cmdArgs[i].end());
175 argvec[i].push_back(
'\0');
176 argv[i] = &argvec[i][0];
Abstract base class for properties.
StandardMapperSlot
Defines which kind of mapper (e.g. 2D or 3D) should be used.
static std::string GetProgramPath()
The ArgcHelperClass class is a convenience class to convert a vector of strings to the standard c++ a...
ArgcHelperClass(const std::vector< std::string > &argstrings)
mitk::DataStorage::Pointer GetDataStorage()
Returns the datastorage, in order to modify the data inside a rendering test.
void SetAutomaticallyCloseRenderWindow(bool automaticallyCloseRenderWindow)
SetStopRenderWindow Convenience method to make the renderwindow hold after rendering....
void SetViewDirection(mitk::AnatomicalPlane viewDirection)
Set the view direction of the renderwindow (e.g. sagittal, coronal, axial)
void SetImageProperty(const char *propertyKey, mitk::BaseProperty *property)
This method set the property of the member datastorage.
mitk::DataStorage::Pointer m_DataStorage
bool CompareRenderWindowAgainstReference(int argc, char *argv[], double threshold=10.0)
CompareRenderWindowAgainstReference Convenience method to compare the image rendered in the internal ...
mitk::RenderWindow::Pointer m_RenderWindow
vtkRenderWindow * GetVtkRenderWindow()
Getter for the vtkRenderWindow which should be used to call vtkRegressionTestImage.
void SaveAsPNG(std::string fileName)
Method can be used to save a screenshot (e.g. reference screenshot as a .png file.
void Render()
Render everything into an mitkRenderWindow. Call SetViewDirection() and SetProperty() before this met...
void SetInputFileNames(int argc, char *argv[])
This method tries to parse the given argv for files (e.g. images) and load them into a member datasto...
void SaveReferenceScreenShot(std::string fileName)
SaveReferenceScreenShot Convenience method to save a reference screen shot.
RenderingTestHelper(int width, int height, AntiAliasing antiAliasing=AntiAliasing::None)
Generate a rendering test helper object including a render window of the size width * height (in pixe...
void SetMapperIDToRender2D()
SetMapperIDToRender2D Convenience method to render in a 2D renderwindow.
void AddToStorage(const std::string &filename)
This method tries to load the given file into a member datastorage, in order to render it.
void ReorientSlices(mitk::Point3D origin, mitk::Vector3D rotation)
Reorient the slice (e.g. rotation and translation like the swivel mode).
vtkRenderer * GetVtkRenderer()
Getter for the vtkRenderer.
bool m_AutomaticallyCloseRenderWindow
void SetMapperID(mitk::BaseRenderer::StandardMapperSlot id)
SetMapperID Change between Standard2D and 3D mappers.
RenderingTestHelper(int width, int height, int argc, char *argv[], AntiAliasing antiAliasing=AntiAliasing::None)
Generate a rendering test helper object including a render window of the size width * height (in pixe...
void AddNodeToStorage(mitk::DataNode::Pointer node)
AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering.
void SetMapperIDToRender3D()
SetMapperIDToRender3D Convenience method to render in a 3D renderwindow.
void Initialize(int width, int height, AntiAliasing antiAliasing=AntiAliasing::None)
Initialize Internal method to initialize the renderwindow and set the datastorage.
Find image slices visible on a given plane.