Refactor infinitiViewer.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -14,55 +14,78 @@
|
|||||||
#include "Common/QGlobals.h"
|
#include "Common/QGlobals.h"
|
||||||
|
|
||||||
class vtkAlgorithm;
|
class vtkAlgorithm;
|
||||||
|
|
||||||
class vtkAlgorithmOutput;
|
class vtkAlgorithmOutput;
|
||||||
|
|
||||||
class vtkImageStack;
|
class vtkImageStack;
|
||||||
|
|
||||||
class vtkImageSlice;
|
class vtkImageSlice;
|
||||||
|
|
||||||
class vtkLookupTable;
|
class vtkLookupTable;
|
||||||
|
|
||||||
class vtkScalarsToColors;
|
class vtkScalarsToColors;
|
||||||
|
|
||||||
class vtkImageSliceMapper;
|
class vtkImageSliceMapper;
|
||||||
|
|
||||||
class vtkImageData;
|
class vtkImageData;
|
||||||
|
|
||||||
class vtkInformation;
|
class vtkInformation;
|
||||||
|
|
||||||
class ActorDraggableInteractorStyle;
|
class ActorDraggableInteractorStyle;
|
||||||
|
|
||||||
class vtkRenderWindow;
|
class vtkRenderWindow;
|
||||||
|
|
||||||
class vtkRenderer;
|
class vtkRenderer;
|
||||||
|
|
||||||
class vtkRenderWindowInteractor;
|
class vtkRenderWindowInteractor;
|
||||||
|
|
||||||
class ExtendMedicalImageProperties;
|
class ExtendMedicalImageProperties;
|
||||||
|
|
||||||
class MeasureStore;
|
class MeasureStore;
|
||||||
|
|
||||||
#define IN_TEST_MODE
|
#define IN_TEST_MODE
|
||||||
|
|
||||||
|
|
||||||
#ifdef IN_TEST_MODE
|
#ifdef IN_TEST_MODE
|
||||||
|
|
||||||
class vtkScalarBarActor;
|
class vtkScalarBarActor;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class vtkCornerAnnotation;
|
class vtkCornerAnnotation;
|
||||||
|
|
||||||
class Measure;
|
class Measure;
|
||||||
class infinitiViewer : public vtkObject
|
|
||||||
{
|
class infinitiViewer : public vtkObject {
|
||||||
public:
|
public:
|
||||||
static infinitiViewer* New();
|
static infinitiViewer *New();
|
||||||
vtkTypeMacro(infinitiViewer, vtkObject);
|
|
||||||
void PrintSelf(ostream& os, vtkIndent indent) override;
|
vtkTypeMacro(infinitiViewer, vtkObject);
|
||||||
|
|
||||||
|
void PrintSelf(ostream &os, vtkIndent indent) override;
|
||||||
|
|
||||||
//vtkGetMacro(m_cornerAnnotation, vtkCornerAnnotation);
|
//vtkGetMacro(m_cornerAnnotation, vtkCornerAnnotation);
|
||||||
vtkCornerAnnotation* GetvtkCornerAnnotation()
|
vtkCornerAnnotation *GetvtkCornerAnnotation() {
|
||||||
{
|
|
||||||
return cornerAnnotation;
|
return cornerAnnotation;
|
||||||
}
|
}
|
||||||
void updateCornerInfo(int index);
|
|
||||||
void updateCornerInfoAll();
|
void UpdateCornerInfo(int index);
|
||||||
void initCornerInfo(ExtendMedicalImageProperties *pSeriesTags);
|
|
||||||
void updateOrienInfo();
|
void UpdateCornerInfoAll();
|
||||||
void setUpImageViewer();
|
|
||||||
|
void InitCornerInfo(ExtendMedicalImageProperties *pSeries);
|
||||||
|
|
||||||
|
void UpdateOrientationInfo();
|
||||||
|
|
||||||
|
void SetupImageViewer();
|
||||||
|
|
||||||
//For Export
|
//For Export
|
||||||
void initTopLeftCornerInfo(const std::string &lbl_ser_num, const std::string &SeriesNumber);
|
void InitTopLeftCornerInfo(const std::string &lbl_ser_num, const std::string &ser_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the name of rendering window.
|
* Get the name of rendering window.
|
||||||
*/
|
*/
|
||||||
virtual const char* GetWindowName();
|
virtual const char *GetWindowName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the resulting image.
|
* Render the resulting image.
|
||||||
@@ -73,9 +96,11 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set/Get the input image to the viewer.
|
* Set/Get the input image to the viewer.
|
||||||
*/
|
*/
|
||||||
virtual void SetInputData(vtkImageData* in);
|
virtual void SetInputData(vtkImageData *in);
|
||||||
virtual vtkImageData* GetInput();
|
|
||||||
virtual void SetInputConnection(vtkAlgorithmOutput* input);
|
virtual vtkImageData *GetInput();
|
||||||
|
|
||||||
|
virtual void SetInputConnection(vtkAlgorithmOutput *input);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -83,30 +108,28 @@ public:
|
|||||||
* Set/get the slice orientation
|
* Set/get the slice orientation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
SLICE_ORIENTATION_YZ = 0,
|
SLICE_ORIENTATION_YZ = 0,
|
||||||
SLICE_ORIENTATION_XZ = 1,
|
SLICE_ORIENTATION_XZ = 1,
|
||||||
SLICE_ORIENTATION_XY = 2
|
SLICE_ORIENTATION_XY = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
vtkGetMacro(SliceOrientation, int);
|
vtkGetMacro(SliceOrientation, int);
|
||||||
|
|
||||||
virtual void SetSliceOrientation(int orientation);
|
virtual void SetSliceOrientation(int orientation);
|
||||||
|
|
||||||
virtual void SetSliceOrientationToXY()
|
virtual void SetSliceOrientationToXY() {
|
||||||
{
|
|
||||||
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XY);
|
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XY);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetSliceOrientationToYZ()
|
virtual void SetSliceOrientationToYZ() {
|
||||||
{
|
|
||||||
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_YZ);
|
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_YZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetSliceOrientationToXZ()
|
virtual void SetSliceOrientationToXZ() {
|
||||||
{
|
|
||||||
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XZ);
|
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetWorldSliceOrientation();
|
int GetWorldSliceOrientation();
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
@@ -114,6 +137,7 @@ public:
|
|||||||
* this can be in X, Y or Z).
|
* this can be in X, Y or Z).
|
||||||
*/
|
*/
|
||||||
virtual int GetSlice();
|
virtual int GetSlice();
|
||||||
|
|
||||||
virtual void SetSlice(int s);
|
virtual void SetSlice(int s);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -123,13 +147,18 @@ public:
|
|||||||
* this can be in X, Y or Z).
|
* this can be in X, Y or Z).
|
||||||
*/
|
*/
|
||||||
virtual int GetSliceMin();
|
virtual int GetSliceMin();
|
||||||
|
|
||||||
virtual int GetSliceMax();
|
virtual int GetSliceMax();
|
||||||
|
|
||||||
virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
|
virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
|
||||||
virtual void GetSliceRange(int& min, int& max);
|
|
||||||
virtual int* GetSliceRange();
|
virtual void GetSliceRange(int &min, int &max);
|
||||||
|
|
||||||
|
virtual int *GetSliceRange();
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void ChangeSlice(vtkObject*,unsigned long eventid,void* calldata);
|
void ChangeSlice(vtkObject *, unsigned long eventid, void *calldata);
|
||||||
|
|
||||||
vtkSmartPointer<vtkPoints> GetSliceBoundPoints();
|
vtkSmartPointer<vtkPoints> GetSliceBoundPoints();
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
@@ -137,10 +166,15 @@ public:
|
|||||||
* Set window and level for mapping pixels to colors.
|
* Set window and level for mapping pixels to colors.
|
||||||
*/
|
*/
|
||||||
virtual double GetColorWindow();
|
virtual double GetColorWindow();
|
||||||
|
|
||||||
virtual double GetColorLevel();
|
virtual double GetColorLevel();
|
||||||
|
|
||||||
virtual void SetColorWindow(double s);
|
virtual void SetColorWindow(double s);
|
||||||
|
|
||||||
virtual void SetColorLevel(double s);
|
virtual void SetColorLevel(double s);
|
||||||
|
|
||||||
void SetNegativeMode(bool negative);
|
void SetNegativeMode(bool negative);
|
||||||
|
|
||||||
void SetLookupTable(vtkLookupTable *lut);
|
void SetLookupTable(vtkLookupTable *lut);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -148,20 +182,24 @@ public:
|
|||||||
/**
|
/**
|
||||||
* These are here when using a Tk window.
|
* These are here when using a Tk window.
|
||||||
*/
|
*/
|
||||||
virtual void SetDisplayId(void* a);
|
virtual void SetDisplayId(void *a);
|
||||||
virtual void SetWindowId(void* a);
|
|
||||||
virtual void SetParentId(void* a);
|
virtual void SetWindowId(void *a);
|
||||||
|
|
||||||
|
virtual void SetParentId(void *a);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
void SetZoomScale(double scale);
|
void SetZoomScale(double scale);
|
||||||
void SetPanOffset(const double* point);
|
|
||||||
|
void SetPanOffset(const double *point);
|
||||||
|
|
||||||
void ResetZoomScaleToFitWindowSize();
|
void ResetZoomScaleToFitWindowSize();
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
* Get the position (x and y) of the rendering window in
|
* Get the position (x and y) of the rendering window in
|
||||||
* screen coordinates (in pixels).
|
* screen coordinates (in pixels).
|
||||||
*/
|
*/
|
||||||
virtual int* GetPosition() VTK_SIZEHINT(2);
|
virtual int *GetPosition() VTK_SIZEHINT(2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the position (x and y) of the rendering window in
|
* Set the position (x and y) of the rendering window in
|
||||||
@@ -169,6 +207,7 @@ public:
|
|||||||
* system's view/window and redraws it.
|
* system's view/window and redraws it.
|
||||||
*/
|
*/
|
||||||
virtual void SetPosition(int x, int y);
|
virtual void SetPosition(int x, int y);
|
||||||
|
|
||||||
virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
|
virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -177,7 +216,7 @@ public:
|
|||||||
* Get the size (width and height) of the rendering window in
|
* Get the size (width and height) of the rendering window in
|
||||||
* screen coordinates (in pixels).
|
* screen coordinates (in pixels).
|
||||||
*/
|
*/
|
||||||
virtual int* GetSize() VTK_SIZEHINT(2);
|
virtual int *GetSize() VTK_SIZEHINT(2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size (width and height) of the rendering window in
|
* Set the size (width and height) of the rendering window in
|
||||||
@@ -188,6 +227,7 @@ public:
|
|||||||
* vtkCommand::WindowResizeEvent.
|
* vtkCommand::WindowResizeEvent.
|
||||||
*/
|
*/
|
||||||
virtual void SetSize(int width, int height);
|
virtual void SetSize(int width, int height);
|
||||||
|
|
||||||
virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
|
virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -197,9 +237,13 @@ public:
|
|||||||
* image map instances.
|
* image map instances.
|
||||||
*/
|
*/
|
||||||
vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
|
vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
|
||||||
|
|
||||||
vtkGetObjectMacro(Renderer, vtkRenderer);
|
vtkGetObjectMacro(Renderer, vtkRenderer);
|
||||||
|
|
||||||
vtkGetObjectMacro(ImageActor, vtkImageSlice);
|
vtkGetObjectMacro(ImageActor, vtkImageSlice);
|
||||||
|
|
||||||
vtkGetObjectMacro(ImageMapper, vtkImageSliceMapper);
|
vtkGetObjectMacro(ImageMapper, vtkImageSliceMapper);
|
||||||
|
|
||||||
vtkGetObjectMacro(InteractorStyle, ActorDraggableInteractorStyle);
|
vtkGetObjectMacro(InteractorStyle, ActorDraggableInteractorStyle);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
@@ -207,14 +251,15 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set your own renderwindow and renderer
|
* Set your own renderwindow and renderer
|
||||||
*/
|
*/
|
||||||
virtual void SetRenderWindow(vtkRenderWindow* arg);
|
virtual void SetRenderWindow(vtkRenderWindow *arg);
|
||||||
virtual void SetRenderer(vtkRenderer* arg);
|
|
||||||
|
virtual void SetRenderer(vtkRenderer *arg);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attach an interactor for the internal render window.
|
* Attach an interactor for the internal render window.
|
||||||
*/
|
*/
|
||||||
virtual void SetupInteractor(vtkRenderWindowInteractor*);
|
virtual void SetupInteractor(vtkRenderWindowInteractor *);
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
@@ -223,12 +268,15 @@ public:
|
|||||||
* need to invoke this prior to the first render.
|
* need to invoke this prior to the first render.
|
||||||
*/
|
*/
|
||||||
virtual void SetOffScreenRendering(vtkTypeBool);
|
virtual void SetOffScreenRendering(vtkTypeBool);
|
||||||
|
|
||||||
virtual vtkTypeBool GetOffScreenRendering();
|
virtual vtkTypeBool GetOffScreenRendering();
|
||||||
|
|
||||||
vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
|
vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
||||||
vtkGetMacro(Fusion, vtkTypeBool);
|
vtkGetMacro(Fusion, vtkTypeBool);
|
||||||
|
|
||||||
vtkSetMacro(Fusion, vtkTypeBool);
|
vtkSetMacro(Fusion, vtkTypeBool);
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
@@ -244,15 +292,18 @@ public:
|
|||||||
* Fusion Opacity, default is 0.5
|
* Fusion Opacity, default is 0.5
|
||||||
*/
|
*/
|
||||||
vtkGetMacro(FusionOpacity, double);
|
vtkGetMacro(FusionOpacity, double);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
void SetFusionOpacity(double);
|
void SetFusionOpacity(double);
|
||||||
|
|
||||||
void IncreFusionOpacity(double);
|
void IncreFusionOpacity(double);
|
||||||
|
|
||||||
void SetScalarBarTitle(double);
|
void SetScalarBarTitle(double);
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
* Set a imageData to fusion with current rendered image.
|
* Set a imageData to fusion with current rendered image.
|
||||||
*/
|
*/
|
||||||
void SetFusionInputData(vtkImageData*);
|
void SetFusionInputData(vtkImageData *);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
@@ -273,7 +324,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set a ColorTable for fusion, only will take effect after SetFusionInputData.
|
* Set a ColorTable for fusion, only will take effect after SetFusionInputData.
|
||||||
*/
|
*/
|
||||||
void SetFusionColorTable(vtkScalarsToColors*);
|
void SetFusionColorTable(vtkScalarsToColors *);
|
||||||
//@}
|
//@}
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
@@ -303,94 +354,108 @@ public:
|
|||||||
void RemoveFusionActor();
|
void RemoveFusionActor();
|
||||||
|
|
||||||
void DeleteSelectedMeasure();
|
void DeleteSelectedMeasure();
|
||||||
|
|
||||||
void DeleteCurrentSliceMeasure();
|
void DeleteCurrentSliceMeasure();
|
||||||
|
|
||||||
void DeleteCurrentSeriesMeasure();
|
void DeleteCurrentSeriesMeasure();
|
||||||
|
|
||||||
void ActiveMeasure(Measure* m);
|
void ActiveMeasure(Measure *m);
|
||||||
|
|
||||||
void UnActiveMeasure();
|
void UnActiveMeasure();
|
||||||
|
|
||||||
void ActiveRuler();
|
void ActiveRuler();
|
||||||
|
|
||||||
void UnActiveRuler();
|
void UnActiveRuler();
|
||||||
|
|
||||||
//for convert vtkEvent to Qt signal
|
//for convert vtkEvent to Qt signal
|
||||||
vtkSignalRaiser* GetSignalRaiser(){
|
vtkSignalRaiser *GetSignalRaiser() {
|
||||||
return &raiser;
|
return &raiser;
|
||||||
}
|
}
|
||||||
void SyncSlicePoint(double* point);
|
|
||||||
void GetSlicePoint(double* point);
|
void SyncSlicePoint(double *point);
|
||||||
|
|
||||||
|
void GetSlicePoint(double *point);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
infinitiViewer();
|
infinitiViewer();
|
||||||
|
|
||||||
~infinitiViewer() override;
|
~infinitiViewer() override;
|
||||||
|
|
||||||
|
vtkAlgorithm *GetInputAlgorithm();
|
||||||
|
|
||||||
|
vtkInformation *GetInputInformation();
|
||||||
|
|
||||||
virtual void InstallPipeline();
|
virtual void InstallPipeline();
|
||||||
|
|
||||||
virtual void UnInstallPipeline();
|
virtual void UnInstallPipeline();
|
||||||
|
|
||||||
void PrepareFusionColorTable(vtkScalarsToColors* table, bool reset = false);
|
void PrepareFusionColorTable(vtkScalarsToColors *table, bool reset = false);
|
||||||
|
|
||||||
vtkRenderWindow* RenderWindow;
|
virtual void UpdateOrientation();
|
||||||
vtkRenderer* Renderer;
|
|
||||||
vtkImageStack* ImageStack;
|
|
||||||
vtkImageSlice* ImageActor;
|
|
||||||
vtkImageSlice* FusionActor;
|
|
||||||
vtkImageSliceMapper* ImageMapper;
|
|
||||||
vtkImageSliceMapper* FusionMapper;
|
|
||||||
vtkRenderWindowInteractor* Interactor;
|
|
||||||
ActorDraggableInteractorStyle* InteractorStyle = nullptr;
|
|
||||||
vtkTextActor* OpacityActor;
|
|
||||||
vtkCornerAnnotation* cornerAnnotation;
|
|
||||||
|
|
||||||
#ifdef IN_TEST_MODE
|
void LoadMeasures() {
|
||||||
vtkScalarBarActor* bar;
|
LoadMeasures(false);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
|
void LoadMeasures(bool forceReload);
|
||||||
|
|
||||||
|
void AddMeasures(vtkObject *, unsigned long eventid, void *calldata);
|
||||||
|
|
||||||
|
void RemoveMeasures(vtkObject *, unsigned long eventid, void *calldata);
|
||||||
|
|
||||||
|
private:
|
||||||
|
infinitiViewer(const infinitiViewer &) = delete;
|
||||||
|
|
||||||
|
void operator=(const infinitiViewer &) = delete;
|
||||||
|
|
||||||
|
std::vector<std::vector<double>> fusion_tf_vector;
|
||||||
|
//for convert vtkEvent to Qt signal
|
||||||
|
vtkSignalRaiser raiser;
|
||||||
|
|
||||||
|
QList<Measure *> *list = nullptr;
|
||||||
|
MeasureStore *measureStore;
|
||||||
|
|
||||||
|
void raiseEvent(vtkObject *sender, unsigned long eventId, void *callData = nullptr) {
|
||||||
|
raiser.raiseEvent(sender, eventId, callData);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClearCurrentSliceMeasure() const;
|
||||||
|
|
||||||
|
void ReloadCurrentSliceMeasure();
|
||||||
|
|
||||||
|
void UpdateTopLeftCornerInfo();
|
||||||
|
|
||||||
|
void RenderRuler();
|
||||||
|
|
||||||
|
vtkRenderWindow *RenderWindow;
|
||||||
|
vtkRenderer *Renderer;
|
||||||
|
vtkImageStack *ImageStack;
|
||||||
|
vtkImageSlice *ImageActor;
|
||||||
|
vtkImageSlice *FusionActor;
|
||||||
|
vtkImageSliceMapper *ImageMapper;
|
||||||
|
vtkImageSliceMapper *FusionMapper;
|
||||||
|
vtkRenderWindowInteractor *Interactor;
|
||||||
|
ActorDraggableInteractorStyle *InteractorStyle = nullptr;
|
||||||
|
vtkTextActor *OpacityActor;
|
||||||
|
vtkCornerAnnotation *cornerAnnotation;
|
||||||
|
vtkScalarBarActor *bar;
|
||||||
|
|
||||||
|
vtkNew<RulerLegendActor> ruler;
|
||||||
|
vtkNew<vtkMatrix4x4> matrix;
|
||||||
|
DicomCornerInfo m_cornerInfo;
|
||||||
|
|
||||||
int SliceOrientation;
|
int SliceOrientation;
|
||||||
int FirstRender;
|
int FirstRender;
|
||||||
int Slice;
|
int Slice;
|
||||||
int loadedMeasureSlice;
|
int loadedMeasureSlice;
|
||||||
|
int currentPresetIndex = 1;
|
||||||
vtkTypeBool Fusion = false;
|
vtkTypeBool Fusion = false;
|
||||||
vtkTypeBool firstFusion = true;
|
vtkTypeBool firstFusion = true;
|
||||||
|
|
||||||
double FusionOpacity = 0.5;
|
double FusionOpacity = 0.5;
|
||||||
|
|
||||||
|
|
||||||
virtual void UpdateOrientation();
|
|
||||||
vtkAlgorithm* GetInputAlgorithm();
|
|
||||||
vtkInformation* GetInputInformation();
|
|
||||||
void LoadMeasures(){
|
|
||||||
LoadMeasures(false);
|
|
||||||
}
|
|
||||||
void LoadMeasures(bool forceReload);
|
|
||||||
void AddMeasures(vtkObject*,unsigned long eventid,void* calldata );
|
|
||||||
void RemoveMeasures(vtkObject*,unsigned long eventid,void* calldata );
|
|
||||||
|
|
||||||
private:
|
|
||||||
infinitiViewer(const infinitiViewer&) = delete;
|
|
||||||
void operator=(const infinitiViewer&) = delete;
|
|
||||||
std::vector<std::vector<double>> fusion_tf_vector;
|
|
||||||
//for convert vtkEvent to Qt signal
|
|
||||||
vtkSignalRaiser raiser;
|
|
||||||
|
|
||||||
QList<Measure*>* list = nullptr;
|
|
||||||
MeasureStore* measureStore;
|
|
||||||
|
|
||||||
void raiseEvent(vtkObject* sender,unsigned long eventId,void* callData = nullptr){
|
|
||||||
raiser.raiseEvent(sender,eventId,callData);
|
|
||||||
}
|
|
||||||
void ClearCurrentSliceMeasure() const;
|
|
||||||
void ReloadCurrentSliceMeasure();
|
|
||||||
void updateTopLeftCornerInfo();
|
|
||||||
|
|
||||||
vtkNew<RulerLegendActor> ruler;
|
|
||||||
bool rulerActive = false;
|
bool rulerActive = false;
|
||||||
void RenderRuler();
|
char SOP_UID[20] = {0};
|
||||||
int currentPresetIndex=1;
|
|
||||||
int viewUpIndex = 0;
|
|
||||||
int viewRightIndex = 1;
|
|
||||||
DicomCornerInfo m_cornerInfo;
|
|
||||||
char SOP_UID[20]={0};
|
|
||||||
double imageDataOrigin[3] = {.0, .0, .0};
|
double imageDataOrigin[3] = {.0, .0, .0};
|
||||||
vtkNew<vtkMatrix4x4> matrix;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void DicomImageView::Slot_WindowLevelEventForFusion(double level, double width)
|
|||||||
|
|
||||||
void DicomImageView::Slot_Transformation()
|
void DicomImageView::Slot_Transformation()
|
||||||
{
|
{
|
||||||
mImageViewer->updateOrienInfo();
|
mImageViewer->UpdateOrientationInfo();
|
||||||
mImageViewer->Render();
|
mImageViewer->Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,9 +331,9 @@ void DicomImageView::LoadSeries(SeriesImageSet *series)
|
|||||||
{
|
{
|
||||||
mSeries = series;
|
mSeries = series;
|
||||||
mImageViewer->SetInputData(mSeries->GetData());
|
mImageViewer->SetInputData(mSeries->GetData());
|
||||||
mImageViewer->initCornerInfo(series->GetProperty());
|
mImageViewer->InitCornerInfo(series->GetProperty());
|
||||||
mImageViewer->setUpImageViewer();
|
mImageViewer->SetupImageViewer();
|
||||||
mImageViewer->updateOrienInfo();
|
mImageViewer->UpdateOrientationInfo();
|
||||||
//以下是一些转接函数
|
//以下是一些转接函数
|
||||||
//使用connect 替代 AddObserver,避免出现多种事件机制架构
|
//使用connect 替代 AddObserver,避免出现多种事件机制架构
|
||||||
connect(mImageViewer->GetSignalRaiser(),&vtkSignalRaiser::raiseEvent, this, &DicomImageView::syncEventFunc);
|
connect(mImageViewer->GetSignalRaiser(),&vtkSignalRaiser::raiseEvent, this, &DicomImageView::syncEventFunc);
|
||||||
@@ -350,7 +350,7 @@ void DicomImageView::LoadSeries(SeriesImageSet *series)
|
|||||||
//Callbacks------------------------------------------------------------------------------------
|
//Callbacks------------------------------------------------------------------------------------
|
||||||
void DicomImageView::updateWindowLevelCb(vtkObject* caller, unsigned long eid, void *calldata)
|
void DicomImageView::updateWindowLevelCb(vtkObject* caller, unsigned long eid, void *calldata)
|
||||||
{
|
{
|
||||||
mImageViewer->updateCornerInfo(BOTTOM_RIGHT);
|
mImageViewer->UpdateCornerInfo(BOTTOM_RIGHT);
|
||||||
emit Signal_WindowLevelEventForFusion(mImageViewer->GetColorLevel(), mImageViewer->GetColorWindow());
|
emit Signal_WindowLevelEventForFusion(mImageViewer->GetColorLevel(), mImageViewer->GetColorWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,7 +538,7 @@ void DicomImageView::SetWindowLevel(double level, double width)
|
|||||||
mImageViewer->SetColorWindow(width);
|
mImageViewer->SetColorWindow(width);
|
||||||
//You have to call updateConerInfo manually
|
//You have to call updateConerInfo manually
|
||||||
//only mouse event can rely on callback
|
//only mouse event can rely on callback
|
||||||
mImageViewer->updateCornerInfo(BOTTOM_RIGHT);
|
mImageViewer->UpdateCornerInfo(BOTTOM_RIGHT);
|
||||||
emit Signal_WindowLevelEventForFusion(level, width);
|
emit Signal_WindowLevelEventForFusion(level, width);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -652,7 +652,7 @@ void DicomImageView::updateCornerInfoAll()
|
|||||||
{
|
{
|
||||||
if (HasSeries())
|
if (HasSeries())
|
||||||
{
|
{
|
||||||
mImageViewer->updateCornerInfoAll();
|
mImageViewer->UpdateCornerInfoAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,7 +660,7 @@ void DicomImageView::updateCornerInfoPrivacy()
|
|||||||
{
|
{
|
||||||
if (HasSeries())
|
if (HasSeries())
|
||||||
{
|
{
|
||||||
mImageViewer->updateCornerInfo(TOP_RIGHT);
|
mImageViewer->UpdateCornerInfo(TOP_RIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,8 +802,5 @@ void DicomImageView::viewerClicked() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DicomImageView::SyncScrollBar() {
|
void DicomImageView::SyncScrollBar() {
|
||||||
// setScrollChangedType(scrollScope::TriggerType::SYNC_ONLY);
|
|
||||||
mScrollBar->SetValueSilently(mImageViewer->GetSlice());
|
mScrollBar->SetValueSilently(mImageViewer->GetSlice());
|
||||||
mImageViewer->updateCornerInfo(TOP_LEFT);
|
|
||||||
// setScrollChangedType(scrollScope::TriggerType::USER_TRIGGER);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -594,7 +594,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(90, ROTATE_90_CCW);
|
curV->Rotate(90, ROTATE_90_CCW);
|
||||||
//curV->getImageViewer()->updateOrienInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -603,7 +602,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(-90, ROTATE_90_CW);
|
curV->Rotate(-90, ROTATE_90_CW);
|
||||||
//curV->getImageViewer()->updateOrienInfo();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Rotate 180"), this, [&] {
|
m->addAction(tr("Rotate 180"), this, [&] {
|
||||||
@@ -611,7 +609,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(180, ROTATE_180);
|
curV->Rotate(180, ROTATE_180);
|
||||||
//curV->getImageViewer()->updateOrienInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -621,7 +618,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->HFlip();
|
curV->HFlip();
|
||||||
//curV->getImageViewer()->updateOrienInfo(H_FLIP);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Flip vertical"), this, [&] {
|
m->addAction(tr("Flip vertical"), this, [&] {
|
||||||
@@ -629,7 +625,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->VFlip();
|
curV->VFlip();
|
||||||
//curV->getImageViewer()->updateOrienInfo(V_FLIP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -639,7 +634,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->ClearTransformations();
|
curV->ClearTransformations();
|
||||||
//curV->getImageViewer()->updateOrienInfo(CLEAR);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
flipBtn->setPopupMode(QToolButton::MenuButtonPopup);
|
flipBtn->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
@@ -650,7 +644,6 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->HasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(90, ROTATE_90_CCW);
|
curV->Rotate(90, ROTATE_90_CCW);
|
||||||
//curV->getImageViewer()->updateOrienInfo(ROTATE_90_CCW);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user