/** * Progam made by Olivier Bernard, associate professor * at Institut National des Sciences Appliquees (INSA) Lyon, * CREATIS Laboratory, * 69621 Villeurbanne, France, * 07th of May 2014 */ #ifndef _OpenHeartGUI_h #define _OpenHeartGUI_h #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ui_OpenHeartGui.h" #include #include #include using namespace std; class vtkRenderer; class vtkEventQtSlotConnect; class vtkObject; class vtkCommand; struct RendererProperties { vtkSmartPointer lut; vtkSmartPointer xIPW, yIPW, zIPW; vtkSmartPointer xyIPW,xzIPW,yzIPW; double *position; vtkSmartPointer TextActorPixel; vtkSmartPointer TextMapperPixel; vtkSmartPointer TextActorMM; vtkSmartPointer TextMapperMM; vtkSmartPointer TextActorValue; vtkSmartPointer TextMapperValue; vtkSmartPointer TextActorSlice; vtkSmartPointer TextMapperSlice; vtkSmartPointer TextActorNumFrame; vtkSmartPointer TextMapperNumFrame; vtkSmartPointer TextActorResolution; vtkSmartPointer TextMapperResolution; vtkSmartPointer MeshActor; vtkSmartPointer xCutActor, yCutActor, zCutActor; vtkSmartPointer BasalPointActor; vtkSmartPointer ApexPointActor; vtkSmartPointer LongAxisActor; vtkSmartPointer BoundingBoxActor; list StackMapperList; list::iterator itStackMapperList; list StackMapXCutter; list::iterator itStackMapXCutter; list StackMapYCutter; list::iterator itStackMapYCutter; list StackMapZCutter; list::iterator itStackMapZCutter; }; class OpenHeartGui : public QMainWindow, public Ui::OpenHeartGui { Q_OBJECT public: OpenHeartGui(); ~OpenHeartGui(); vtkSmartPointer GetPicker() { return this->Picker; } vtkSmartPointer GetPickerXY() { return this->PickerXY; } vtkSmartPointer GetPickerXZ() { return this->PickerXZ; } vtkSmartPointer GetPickerYZ() { return this->PickerYZ; } RendererProperties *GetRendererProperties() { return this->Properties; } vtkRenderWindow *GetRenderWindow() { return this->qVTK->GetRenderWindow(); } vtkRenderWindow *GetRenderWindowXY() { return this->qVTKXY->GetRenderWindow(); } vtkRenderWindow *GetRenderWindowXZ() { return this->qVTKXZ->GetRenderWindow(); } vtkRenderWindow *GetRenderWindowYZ() { return this->qVTKYZ->GetRenderWindow(); } vtkSmartPointer GetMeshRenderer() { return this->Ren; } vtkSmartPointer GetMainRenderer() { return this->Ren; } vtkSmartPointer GetXYRenderer() { return this->RenXY; } vtkSmartPointer GetXZRenderer() { return this->RenXZ; } vtkSmartPointer GetYZRenderer() { return this->RenYZ; } vtkImageData *GetCurrentImageData() { return this->ImageData; } int *GetDimensions() { return this->Dims; } void InterpolationManagement(); void CreateFromSequenceDataPointer(std::string inputFilename); void UpdateForwardViewers(); void UpdateBackwardViewers(); int GetCurrentFrame() { return this->CurrentFrame; } int GetNumberOfFrames() { return this->NumberOfVolumes; } void SetFlagLoopEndToBegin( int val ) { this->FlagLoopEndToBegin = val; } void SetFlagLoopBeginToEnd( int val ) { this->FlagLoopBeginToEnd = val; } void DisplayMainAxisManagement(); void DisplayMeshManagement(); void DisplayModeManagement(); void HidePlanModeManagement(); void UpdateCoords(double *pos); int GetSelectedButton() { return ViewButton; } int GetFlagDisplayText() { return FlagDisplayText; } void ComputePointBeforeRotation(double *pt); public slots: void slotMeshAlpha(int); void slotRefreshViewer(int); void slotTabChange(int); void slotPlay(); void slotXYView(); void slotXZView(); void slotYZView(); void slot3DView(); void slotMeshView(); void slotMeshRepresentation(); void slotMeshColor(); void slotMeshCutter(); void slotTimerEvent(); void slotBasalPoint(); void slotApexPoint(); void slotReslice(); void slotUpdateCoords(vtkObject*); protected: int Dims[3]; int PreviousFrame; int CurrentFrame; int NumberOfVolumes; double BasalPoint[3]; double ApexPoint[3]; vtkSmartPointer Ren; vtkSmartPointer RenXY; vtkSmartPointer RenXZ; vtkSmartPointer RenYZ; vtkRenderer* RenChart; QTimer *Timer; vtkEventQtSlotConnect* Connections; list StackVolume; list::iterator itStackVolume; list StackMesh; list::iterator itStackMesh; vtkPolyData * Mesh; vtkImageData *ImageData; vtkSmartPointer OrientationWidget; RendererProperties *Properties; vtkSmartPointer Picker; vtkSmartPointer PickerXY; vtkSmartPointer PickerXZ; vtkSmartPointer PickerYZ; vtkSmartPointer Interactor; vtkSmartPointer InteractorXY; vtkSmartPointer InteractorXZ; vtkSmartPointer InteractorYZ; vtkSmartPointer ViewChart; vtkSmartPointer TableChart; vtkSmartPointer RotationMatrix; vtkSmartPointer TransformViewOrientation; vtkSmartPointer RotationMatrixInv; vtkSmartPointer TransformViewOrientationInv; int FlagInterpolation; int FlagDisplayMesh; int FlagDisplayMeshContourX; int FlagDisplayMeshContourY; int FlagDisplayMeshContourZ; int FlagLoopEndToBegin; int FlagLoopBeginToEnd; int FlagPlay; int FlagDisplayText; int FlagHidePlan; int FlagDisplayMeshContours; int FlagLongAxis; int FlagDisplayApexPoint; int FlagDisplayBasalPoint; int FlagDisplayLongAxis; int FlagReslice; int ViewButton; int MeshRepresentation; int MeshColor; double ZoomLabel; double ZoomMain; void InstantiateQtVtkRenderers(); void InitPickers(); void InitWidgets(); void InitProperties(); void InitOrientationAxes(); void InitPlaneWidget(); void InitTexts(); void InitChar(); void SetCustomInteractorStyle(); vtkActor2D* AddFixedText(const char *text, float x, float y, float R,float G, float B, int Size); void ForceXZView(); void UpdateClinicalIndices(); void SetInterfaceColors(); void CreateLongAxisActor(); void SetLongAxisView(); void ResetReslicing(); void ComputeRotationMatrix(); void UpdateViewer(int view, double zoom, vtkRenderer *ren); /// overloaded resize handler virtual void resizeEvent(QResizeEvent* event); }; #endif