15 #include "vtkUnicodeString.h" 16 #include <vtkImageData.h> 17 #include <vtkImageData.h> 18 #include <vtkImageMapper.h> 19 #include <vtkImageMapper.h> 20 #include <vtkImageReader2.h> 21 #include <vtkImageReader2Factory.h> 22 #include <vtkTextActor.h> 23 #include <vtkTextProperty.h> 24 #include <vtkTextRenderer.h> 25 #include <vtkTextRendererStringToImage.h> 28 #include <vtkImageImport.h> 29 #include <vtkProperty2D.h> 30 #include <vtkImageFlip.h> 42 m_VtkImageImport = vtkSmartPointer<vtkImageImport>::New();
43 m_UpdatedLogoImage = vtkSmartPointer<vtkImageData>::New();
63 m_LogoRep = vtkSmartPointer<mitkVtkLogoRepresentation>::New();
84 ls->
m_LogoRep->SetPosition(offset[0], offset[1]);
87 ls->
m_LogoRep->GetImageProperty()->SetOpacity(opacity);
103 if (imageNodeVector.size() == 1)
107 if (image.IsNotNull())
109 vtkNew<vtkImageFlip> flip;
110 flip->SetInputData(image->GetVtkImageData());
111 flip->SetFilteredAxis(1);
113 m_UpdatedLogoImage->DeepCopy(flip->GetOutput());
121 m_UpdatedLogoImage = logo;
135 SetProperty(
"Annotation.OffsetVector", OffsetVectorProperty.GetPointer());
142 OffsetVector.Fill(0);
143 GetPropertyValue<mitk::Point2D>(
"Annotation.OffsetVector", OffsetVector);
void SetProperty(const std::string &propertyKey, const BaseProperty::Pointer &property)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
L * GetLocalStorage(mitk::BaseRenderer *forRenderer)
Retrieves a LocalStorage for a specific BaseRenderer.
LogoAnnotation()
explicit constructor which disallows implicit conversions
std::vector< mitk::BaseRenderer * > GetRegisteredBaseRenderer()
float GetRelativeSize() const
bool GetFloatProperty(const std::string &propertyKey, float &floatValue) const
Convenience access method for float properties (instances of FloatProperty)
vtkRenderer * GetVtkRenderer() const
LocalStorage()
Default constructor of the local storage.
Organizes the rendering process.
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Annotation *Annotation)
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all LocalStorages for the render windows.
~LogoAnnotation() override
virtual destructor in order to derive from this class
void SetCornerPosition(const int &corner)
The corner where the logo is displayed. 0 = Bottom left 1 = Bottom right 2 = Top right 3 = Top left 4...
void SetLogoImage(vtkSmartPointer< vtkImageData > logo)
void LoadLogoImageFromPath()
Point2D GetOffsetVector() const
int GetCornerPosition() const
vtkSmartPointer< vtkImageData > m_LogoImage
Actor of a 2D render window.
bool GetStringProperty(const char *propertyKey, std::string &stringValue) const
Convenience method to access the value of a StringProperty.
void SetStringProperty(const std::string &propertyKey, const std::string &string)
Convenience method for setting int properties (instances of IntProperty)
Image class for storing images.
void SetFloatProperty(const std::string &propertyKey, float floatValue)
Convenience method for setting int properties (instances of IntProperty)
mitk::Image::Pointer image
vtkSmartPointer< mitkVtkLogoRepresentation > m_LogoRep
void RemoveFromBaseRenderer(BaseRenderer *renderer) override
Removes the Annotation from the specified renderer. It is not visible anymore then.
vtkProp * GetVtkProp(BaseRenderer *renderer) const override
This method is implemented by the specific VTKAnnotation in order to create the element as a vtkProp...
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override
bool GetOpacity(float &opacity, const std::string &propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
void SetOffsetVector(const Point2D &OffsetVector)
The relative offset to the corner position.
~LocalStorage()
Default deconstructor of the local storage.
void SetRelativeSize(const float &size)
PropertyList * GetPropertyList() const
void SetLogoImagePath(std::string text)
void UpdateGenerateDataTime()
void SetIntProperty(const std::string &propertyKey, int intValue)
Convenience method for setting int properties (instances of IntProperty)
std::string GetLogoImagePath() const
bool GetIntProperty(const std::string &propertyKey, int &intValue) const
Convenience access method for int properties (instances of IntProperty)
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage, const ReaderOptionsFunctorBase *optionsCallback=nullptr)
Load a file into the given DataStorage.
vtkSmartPointer< vtkImageReader2Factory > m_readerFactory