Rename infinitiViewer to DICOMImageViewer.

This commit is contained in:
Krad
2022-08-23 09:36:58 +08:00
parent dded748d35
commit 89cf57561a
6 changed files with 125 additions and 125 deletions

View File

@@ -53,7 +53,7 @@ void DicomExporter::initVTK()
m_glrenWinExport = vtkSmartPointer<vtkRenderWindow>::New(); m_glrenWinExport = vtkSmartPointer<vtkRenderWindow>::New();
m_glrenWinExport->OffScreenRenderingOn(); m_glrenWinExport->OffScreenRenderingOn();
m_imageViewerExport = vtkSmartPointer<infinitiViewer>::New(); m_imageViewerExport = vtkSmartPointer<DICOMImageViewer>::New();
m_imageViewerExport->SetRenderWindow(m_glrenWinExport); m_imageViewerExport->SetRenderWindow(m_glrenWinExport);
m_imageViewerExport->SetupInteractor(m_glrenWinExport->GetInteractor()); m_imageViewerExport->SetupInteractor(m_glrenWinExport->GetInteractor());
} }

View File

@@ -23,7 +23,7 @@
#include <qdir.h> #include <qdir.h>
#include <sstream> #include <sstream>
#include "Rendering/Viewer/infinitiViewer.h" #include "Rendering/Viewer/DICOMImageViewer.h"
//#include "itkMetaDataObject.h" //#include "itkMetaDataObject.h"
//#include "itkMetaDataDictionary.h" //#include "itkMetaDataDictionary.h"
@@ -117,7 +117,7 @@ private:
// ConnectorTypeExport::Pointer m_itkConnectorExport; // ConnectorTypeExport::Pointer m_itkConnectorExport;
// InputNamesGeneratorTypeExport::Pointer m_inputNamesExport; // InputNamesGeneratorTypeExport::Pointer m_inputNamesExport;
vtkSmartPointer<vtkRenderWindow> m_glrenWinExport; vtkSmartPointer<vtkRenderWindow> m_glrenWinExport;
vtkSmartPointer<infinitiViewer> m_imageViewerExport; vtkSmartPointer<DICOMImageViewer> m_imageViewerExport;
}; };
#endif // DICOMEXPORTER_H #endif // DICOMEXPORTER_H

View File

@@ -1,4 +1,4 @@
#include "infinitiViewer.h" #include "DICOMImageViewer.h"
#include <vector> #include <vector>
#include <vtkCamera.h> #include <vtkCamera.h>
@@ -28,16 +28,16 @@
#include "Interaction/ActorDraggableInteractorStyle.h" #include "Interaction/ActorDraggableInteractorStyle.h"
vtkStandardNewMacro(infinitiViewer); vtkStandardNewMacro(DICOMImageViewer);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
infinitiViewer::infinitiViewer() DICOMImageViewer::DICOMImageViewer()
: vtkObject(), : vtkObject(),
RenderWindow(nullptr), Renderer(nullptr), ImageStack(vtkImageStack::New()), RenderWindow(nullptr), Renderer(nullptr), ImageStack(vtkImageStack::New()),
ImageActor(vtkImageSlice::New()), ImageMapper(vtkImageSliceMapper::New()), FusionActor(nullptr), ImageActor(vtkImageSlice::New()), ImageMapper(vtkImageSliceMapper::New()), FusionActor(nullptr),
FusionMapper(nullptr), Interactor(nullptr), InteractorStyle(nullptr), OpacityActor(nullptr), FusionMapper(nullptr), Interactor(nullptr), InteractorStyle(nullptr), OpacityActor(nullptr),
cornerAnnotation(vtkCornerAnnotation::New()), bar(nullptr), cornerAnnotation(vtkCornerAnnotation::New()), bar(nullptr),
SliceOrientation(infinitiViewer::SLICE_ORIENTATION_XY), FirstRender(1), Slice(0), loadedMeasureSlice(0), SliceOrientation(DICOMImageViewer::SLICE_ORIENTATION_XY), FirstRender(1), Slice(0), loadedMeasureSlice(0),
currentPresetIndex(1), Fusion(false), firstFusion(true), FusionOpacity(0.5), list(nullptr), currentPresetIndex(1), Fusion(false), firstFusion(true), FusionOpacity(0.5), list(nullptr),
measureStore(MeasureStore::Instance()), measureStore(MeasureStore::Instance()),
rulerActive(false){ rulerActive(false){
@@ -58,22 +58,22 @@ infinitiViewer::infinitiViewer()
cornerAnnotation->SetMaximumFontSize(FontSizeHelper::font_size); cornerAnnotation->SetMaximumFontSize(FontSizeHelper::font_size);
vtkRenderWindow *renwin = vtkRenderWindow::New(); vtkRenderWindow *renwin = vtkRenderWindow::New();
infinitiViewer::SetRenderWindow(renwin); DICOMImageViewer::SetRenderWindow(renwin);
renwin->Delete(); renwin->Delete();
vtkRenderer *ren = vtkRenderer::New(); vtkRenderer *ren = vtkRenderer::New();
infinitiViewer::SetRenderer(ren); DICOMImageViewer::SetRenderer(ren);
ren->Delete(); ren->Delete();
infinitiViewer::InstallPipeline(); DICOMImageViewer::InstallPipeline();
uintptr_t handler = reinterpret_cast<uintptr_t>(this); uintptr_t handler = reinterpret_cast<uintptr_t>(this);
sprintf(SOP_UID, "%llu", handler); sprintf(SOP_UID, "%llu", handler);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
infinitiViewer::~infinitiViewer() { DICOMImageViewer::~DICOMImageViewer() {
if (this->ImageMapper) { if (this->ImageMapper) {
this->ImageMapper->SetInputData(nullptr); this->ImageMapper->SetInputData(nullptr);
this->ImageMapper->Delete(); this->ImageMapper->Delete();
@@ -122,7 +122,7 @@ infinitiViewer::~infinitiViewer() {
//delete measureStore; //delete measureStore;
} }
void infinitiViewer::SetupImageViewer() { void DICOMImageViewer::SetupImageViewer() {
this->SetColorLevel(m_cornerInfo.win_level); this->SetColorLevel(m_cornerInfo.win_level);
this->SetColorWindow(m_cornerInfo.win_width); this->SetColorWindow(m_cornerInfo.win_width);
//this->GetRenderer()->ResetCamera(); //this->GetRenderer()->ResetCamera();
@@ -133,19 +133,19 @@ void infinitiViewer::SetupImageViewer() {
} }
// Render Pipe line------------------------------------------------------------ // Render Pipe line------------------------------------------------------------
vtkImageData *infinitiViewer::GetInput() { vtkImageData *DICOMImageViewer::GetInput() {
return this->ImageMapper->GetInput(); return this->ImageMapper->GetInput();
} }
vtkInformation *infinitiViewer::GetInputInformation() { vtkInformation *DICOMImageViewer::GetInputInformation() {
return this->ImageMapper->GetInputInformation(); return this->ImageMapper->GetInputInformation();
} }
vtkAlgorithm *infinitiViewer::GetInputAlgorithm() { vtkAlgorithm *DICOMImageViewer::GetInputAlgorithm() {
return this->ImageMapper->GetInputAlgorithm(); return this->ImageMapper->GetInputAlgorithm();
} }
void infinitiViewer::SetupInteractor(vtkRenderWindowInteractor *arg) { void DICOMImageViewer::SetupInteractor(vtkRenderWindowInteractor *arg) {
if (this->Interactor == arg) { if (this->Interactor == arg) {
return; return;
} }
@@ -169,7 +169,7 @@ void infinitiViewer::SetupInteractor(vtkRenderWindowInteractor *arg) {
} }
} }
void infinitiViewer::SetRenderWindow(vtkRenderWindow *arg) { void DICOMImageViewer::SetRenderWindow(vtkRenderWindow *arg) {
if (this->RenderWindow == arg) { if (this->RenderWindow == arg) {
return; return;
} }
@@ -186,11 +186,11 @@ void infinitiViewer::SetRenderWindow(vtkRenderWindow *arg) {
this->RenderWindow->Register(this); this->RenderWindow->Register(this);
} }
//add legend to render //add legend to render
this->RenderWindow->AddObserver(vtkCommand::EventIds::RenderEvent, this, &infinitiViewer::RenderLegend); this->RenderWindow->AddObserver(vtkCommand::EventIds::RenderEvent, this, &DICOMImageViewer::RenderLegend);
this->InstallPipeline(); this->InstallPipeline();
} }
void infinitiViewer::SetRenderer(vtkRenderer *arg) { void DICOMImageViewer::SetRenderer(vtkRenderer *arg) {
if (this->Renderer == arg) { if (this->Renderer == arg) {
return; return;
} }
@@ -211,7 +211,7 @@ void infinitiViewer::SetRenderer(vtkRenderer *arg) {
this->UpdateOrientation(); this->UpdateOrientation();
} }
void infinitiViewer::SetInputData(vtkImageData *in) { void DICOMImageViewer::SetInputData(vtkImageData *in) {
if (!in) return; if (!in) return;
#ifdef _DEBUG #ifdef _DEBUG
printf("fusion imageDataOrigin:%f,%f,%f", in->GetOrigin()[0], in->GetOrigin()[1], in->GetOrigin()[2]); printf("fusion imageDataOrigin:%f,%f,%f", in->GetOrigin()[0], in->GetOrigin()[1], in->GetOrigin()[2]);
@@ -226,20 +226,20 @@ void infinitiViewer::SetInputData(vtkImageData *in) {
defaultProjection[2][2] = zVec>0.0?1.0:-1.0; defaultProjection[2][2] = zVec>0.0?1.0:-1.0;
} }
void infinitiViewer::SetInputConnection(vtkAlgorithmOutput *input) { void DICOMImageViewer::SetInputConnection(vtkAlgorithmOutput *input) {
this->ImageMapper->SetInputConnection(input); this->ImageMapper->SetInputConnection(input);
this->RemoveFusionData(); this->RemoveFusionData();
} }
vtkTypeBool infinitiViewer::GetOffScreenRendering() { vtkTypeBool DICOMImageViewer::GetOffScreenRendering() {
return this->RenderWindow->GetOffScreenRendering(); return this->RenderWindow->GetOffScreenRendering();
} }
void infinitiViewer::SetOffScreenRendering(vtkTypeBool i) { void DICOMImageViewer::SetOffScreenRendering(vtkTypeBool i) {
this->RenderWindow->SetOffScreenRendering(i); this->RenderWindow->SetOffScreenRendering(i);
} }
void infinitiViewer::InstallPipeline() { void DICOMImageViewer::InstallPipeline() {
if (this->RenderWindow && this->Renderer) { if (this->RenderWindow && this->Renderer) {
this->RenderWindow->AddRenderer(this->Renderer); this->RenderWindow->AddRenderer(this->Renderer);
} }
@@ -252,20 +252,20 @@ void infinitiViewer::InstallPipeline() {
this->InteractorStyle->SetCornerAnnotation(cornerAnnotation); this->InteractorStyle->SetCornerAnnotation(cornerAnnotation);
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::EndMeasureEvent, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::EndMeasureEvent,
this, &infinitiViewer::AddMeasures); this, &DICOMImageViewer::AddMeasures);
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::DeleteMeasureEvent, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::DeleteMeasureEvent,
this, &infinitiViewer::RemoveMeasures); this, &DICOMImageViewer::RemoveMeasures);
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SliceEvent, this, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SliceEvent, this,
&infinitiViewer::ChangeSlice); &DICOMImageViewer::ChangeSlice);
//for convert vtkEvent to Qt signal //for convert vtkEvent to Qt signal
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent, this,
&infinitiViewer::raiseEvent); &DICOMImageViewer::raiseEvent);
this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::EndDollyEvent, this, this->InteractorStyle->AddObserver(ActorDraggableInteractorStyle::DraggableStyleEvents::EndDollyEvent, this,
&infinitiViewer::raiseEvent); &DICOMImageViewer::raiseEvent);
this->InteractorStyle->AddObserver(vtkCommand::EventIds::EndWindowLevelEvent, this, this->InteractorStyle->AddObserver(vtkCommand::EventIds::EndWindowLevelEvent, this,
&infinitiViewer::raiseEvent); &DICOMImageViewer::raiseEvent);
this->InteractorStyle->AddObserver(vtkCommand::EventIds::EndPanEvent, this, &infinitiViewer::raiseEvent); this->InteractorStyle->AddObserver(vtkCommand::EventIds::EndPanEvent, this, &DICOMImageViewer::raiseEvent);
} }
this->Interactor->SetInteractorStyle(this->InteractorStyle); this->Interactor->SetInteractorStyle(this->InteractorStyle);
@@ -287,7 +287,7 @@ void infinitiViewer::InstallPipeline() {
loadedMeasureSlice = -1; loadedMeasureSlice = -1;
} }
void infinitiViewer::UnInstallPipeline() { void DICOMImageViewer::UnInstallPipeline() {
if (this->ImageActor && this->ImageMapper) { if (this->ImageActor && this->ImageMapper) {
// this->ImageActor->SetMapper(nullptr); // this->ImageActor->SetMapper(nullptr);
} }
@@ -308,7 +308,7 @@ void infinitiViewer::UnInstallPipeline() {
} }
} }
void infinitiViewer::Render() { void DICOMImageViewer::Render() {
if (this->FirstRender) { if (this->FirstRender) {
// // Initialize the size if not set yet // // Initialize the size if not set yet
@@ -320,18 +320,18 @@ void infinitiViewer::Render() {
int xs = 0, ys = 0; int xs = 0, ys = 0;
switch (this->SliceOrientation) { switch (this->SliceOrientation) {
case infinitiViewer::SLICE_ORIENTATION_XY: case DICOMImageViewer::SLICE_ORIENTATION_XY:
default: default:
xs = w_ext[1] - w_ext[0] + 1; xs = w_ext[1] - w_ext[0] + 1;
ys = w_ext[3] - w_ext[2] + 1; ys = w_ext[3] - w_ext[2] + 1;
break; break;
case infinitiViewer::SLICE_ORIENTATION_XZ: case DICOMImageViewer::SLICE_ORIENTATION_XZ:
xs = w_ext[1] - w_ext[0] + 1; xs = w_ext[1] - w_ext[0] + 1;
ys = w_ext[5] - w_ext[4] + 1; ys = w_ext[5] - w_ext[4] + 1;
break; break;
case infinitiViewer::SLICE_ORIENTATION_YZ: case DICOMImageViewer::SLICE_ORIENTATION_YZ:
xs = w_ext[3] - w_ext[2] + 1; xs = w_ext[3] - w_ext[2] + 1;
ys = w_ext[5] - w_ext[4] + 1; ys = w_ext[5] - w_ext[4] + 1;
break; break;
@@ -381,7 +381,7 @@ void infinitiViewer::Render() {
} }
// slice about----------------------------------------------------------------- // slice about-----------------------------------------------------------------
void infinitiViewer::GetSliceRange(int &min, int &max) { void DICOMImageViewer::GetSliceRange(int &min, int &max) {
vtkAlgorithm *input = this->GetInputAlgorithm(); vtkAlgorithm *input = this->GetInputAlgorithm();
if (input) { if (input) {
input->UpdateInformation(); input->UpdateInformation();
@@ -392,7 +392,7 @@ void infinitiViewer::GetSliceRange(int &min, int &max) {
} }
} }
int *infinitiViewer::GetSliceRange() { int *DICOMImageViewer::GetSliceRange() {
vtkAlgorithm *input = this->GetInputAlgorithm(); vtkAlgorithm *input = this->GetInputAlgorithm();
if (input) { if (input) {
input->UpdateInformation(); input->UpdateInformation();
@@ -402,7 +402,7 @@ int *infinitiViewer::GetSliceRange() {
return nullptr; return nullptr;
} }
int infinitiViewer::GetSliceMin() { int DICOMImageViewer::GetSliceMin() {
int *range = this->GetSliceRange(); int *range = this->GetSliceRange();
if (range) { if (range) {
return range[0]; return range[0];
@@ -410,7 +410,7 @@ int infinitiViewer::GetSliceMin() {
return 0; return 0;
} }
int infinitiViewer::GetSliceMax() { int DICOMImageViewer::GetSliceMax() {
int *range = this->GetSliceRange(); int *range = this->GetSliceRange();
if (range) { if (range) {
return range[1]; return range[1];
@@ -418,11 +418,11 @@ int infinitiViewer::GetSliceMax() {
return 0; return 0;
} }
int infinitiViewer::GetSlice() { int DICOMImageViewer::GetSlice() {
return this->ImageMapper->GetSliceNumber(); return this->ImageMapper->GetSliceNumber();
} }
void infinitiViewer::SetSlice(int slice) { void DICOMImageViewer::SetSlice(int slice) {
int *range = this->GetSliceRange(); int *range = this->GetSliceRange();
if (range) { if (range) {
if (slice < range[0]) { if (slice < range[0]) {
@@ -470,7 +470,7 @@ void infinitiViewer::SetSlice(int slice) {
} }
} }
void infinitiViewer::ChangeSlice(vtkObject *, unsigned long eventid, void *calldata) { void DICOMImageViewer::ChangeSlice(vtkObject *, unsigned long eventid, void *calldata) {
int lastSlice = GetSlice(); int lastSlice = GetSlice();
int *p = (int *) calldata; int *p = (int *) calldata;
int newSlice = lastSlice + (*p); int newSlice = lastSlice + (*p);
@@ -478,7 +478,7 @@ void infinitiViewer::ChangeSlice(vtkObject *, unsigned long eventid, void *calld
SetSlice(newSlice); SetSlice(newSlice);
} }
void infinitiViewer::GetSlicePoint(double *point) { void DICOMImageViewer::GetSlicePoint(double *point) {
double focusPoint[4] = {point[0], point[1], point[2], 1.0}; double focusPoint[4] = {point[0], point[1], point[2], 1.0};
Renderer->GetActiveCamera()->GetFocalPoint(focusPoint); Renderer->GetActiveCamera()->GetFocalPoint(focusPoint);
ModelToWorldMatrix->MultiplyPoint(focusPoint, focusPoint); ModelToWorldMatrix->MultiplyPoint(focusPoint, focusPoint);
@@ -487,7 +487,7 @@ void infinitiViewer::GetSlicePoint(double *point) {
point[2] = focusPoint[2]; point[2] = focusPoint[2];
} }
void infinitiViewer::applySliceOffset(double offset, double direction){ void DICOMImageViewer::applySliceOffset(double offset, double direction){
double projV = Renderer->GetActiveCamera()->GetDirectionOfProjection()[SliceOrientation]; double projV = Renderer->GetActiveCamera()->GetDirectionOfProjection()[SliceOrientation];
double defaultProjV = defaultProjection[SliceOrientation][SliceOrientation]; double defaultProjV = defaultProjection[SliceOrientation][SliceOrientation];
// 根据投影向量判断当前镜头方向, innerDirection>0 与默认同向, innerDirection<0 与默认反向 // 根据投影向量判断当前镜头方向, innerDirection>0 与默认同向, innerDirection<0 与默认反向
@@ -502,7 +502,7 @@ void infinitiViewer::applySliceOffset(double offset, double direction){
UpdateTopLeftCornerInfo(); UpdateTopLeftCornerInfo();
} }
vtkPoints* infinitiViewer::GetSliceBoundPoints() { vtkPoints* DICOMImageViewer::GetSliceBoundPoints() {
double bounds[6] = {.0, .0, .0, .0, .0, .0}; double bounds[6] = {.0, .0, .0, .0, .0, .0};
ImageMapper->GetBounds(bounds); ImageMapper->GetBounds(bounds);
vtkCamera *camera = this->Renderer->GetActiveCamera(); vtkCamera *camera = this->Renderer->GetActiveCamera();
@@ -541,7 +541,7 @@ vtkPoints* infinitiViewer::GetSliceBoundPoints() {
return worldPts; return worldPts;
} }
void infinitiViewer::updateReferenceLine(vtkPoints* worldPts){ void DICOMImageViewer::updateReferenceLine(vtkPoints* worldPts){
//model to world //model to world
for (vtkIdType i = 0; i < worldPts->GetNumberOfPoints(); ++i) { for (vtkIdType i = 0; i < worldPts->GetNumberOfPoints(); ++i) {
double temp[4] = {.0, .0, .0, 1.}; double temp[4] = {.0, .0, .0, 1.};
@@ -552,13 +552,13 @@ void infinitiViewer::updateReferenceLine(vtkPoints* worldPts){
Render(); Render();
} }
void infinitiViewer::modifiedReferenceLine(){ void DICOMImageViewer::modifiedReferenceLine(){
//model to world //model to world
referenceLine->Modified(); referenceLine->Modified();
Render(); Render();
} }
void infinitiViewer::SyncSlicePoint(double *point) { void DICOMImageViewer::SyncSlicePoint(double *point) {
double focusPoint[4] = {point[0], point[1], point[2], 1.0}; double focusPoint[4] = {point[0], point[1], point[2], 1.0};
WorldToModelMatrix->MultiplyPoint(focusPoint, focusPoint); WorldToModelMatrix->MultiplyPoint(focusPoint, focusPoint);
double f[3] = {.0, .0, .0}; double f[3] = {.0, .0, .0};
@@ -572,20 +572,20 @@ void infinitiViewer::SyncSlicePoint(double *point) {
} }
// zoom------------------------------------------------------------------------ // zoom------------------------------------------------------------------------
void infinitiViewer::SetZoomScale(double scale) { void DICOMImageViewer::SetZoomScale(double scale) {
if (Renderer) { if (Renderer) {
Renderer->GetActiveCamera()->SetParallelScale(scale); Renderer->GetActiveCamera()->SetParallelScale(scale);
} }
} }
double infinitiViewer::GetZoomScale(){ double DICOMImageViewer::GetZoomScale(){
if (Renderer) { if (Renderer) {
return Renderer->GetActiveCamera()->GetParallelScale(); return Renderer->GetActiveCamera()->GetParallelScale();
} }
return 0.0; return 0.0;
} }
void infinitiViewer::ResetZoomScaleToFitWindowSize() { void DICOMImageViewer::ResetZoomScaleToFitWindowSize() {
vtkImageData *inputData = nullptr; vtkImageData *inputData = nullptr;
if (Renderer && (inputData = GetInput())) { if (Renderer && (inputData = GetInput())) {
double proj[4] = {0, 0, 0, 1}; double proj[4] = {0, 0, 0, 1};
@@ -616,7 +616,7 @@ void infinitiViewer::ResetZoomScaleToFitWindowSize() {
} }
// pan------------------------------------------------------------------------- // pan-------------------------------------------------------------------------
void infinitiViewer::applyPanOffset(const double *point) { void DICOMImageViewer::applyPanOffset(const double *point) {
double fp[3] = {0.0, 0.0, 0.0}; double fp[3] = {0.0, 0.0, 0.0};
Renderer->GetActiveCamera()->GetPosition(fp); Renderer->GetActiveCamera()->GetPosition(fp);
fp[0] = fp[0] + point[0]; fp[0] = fp[0] + point[0];
@@ -631,7 +631,7 @@ void infinitiViewer::applyPanOffset(const double *point) {
} }
void infinitiViewer::shiftCamera(const double *point) { void DICOMImageViewer::shiftCamera(const double *point) {
double fp[3] = {0.0, 0.0, 0.0}; double fp[3] = {0.0, 0.0, 0.0};
double newP[3] = {point[0], point[1], point[2]}; double newP[3] = {point[0], point[1], point[2]};
Renderer->GetActiveCamera()->GetPosition(fp); Renderer->GetActiveCamera()->GetPosition(fp);
@@ -644,23 +644,23 @@ void infinitiViewer::shiftCamera(const double *point) {
} }
// window---------------------------------------------------------------------- // window----------------------------------------------------------------------
double infinitiViewer::GetColorWindow() { double DICOMImageViewer::GetColorWindow() {
return this->ImageActor->GetProperty()->GetColorWindow(); return this->ImageActor->GetProperty()->GetColorWindow();
} }
double infinitiViewer::GetColorLevel() { double DICOMImageViewer::GetColorLevel() {
return this->ImageActor->GetProperty()->GetColorLevel(); return this->ImageActor->GetProperty()->GetColorLevel();
} }
void infinitiViewer::SetColorWindow(double s) { void DICOMImageViewer::SetColorWindow(double s) {
this->ImageActor->GetProperty()->SetColorWindow(s); this->ImageActor->GetProperty()->SetColorWindow(s);
} }
void infinitiViewer::SetColorLevel(double s) { void DICOMImageViewer::SetColorLevel(double s) {
this->ImageActor->GetProperty()->SetColorLevel(s); this->ImageActor->GetProperty()->SetColorLevel(s);
} }
void infinitiViewer::SetNegativeMode(bool negative) { void DICOMImageViewer::SetNegativeMode(bool negative) {
if (negative) { if (negative) {
double window = this->ImageActor->GetProperty()->GetColorWindow(); double window = this->ImageActor->GetProperty()->GetColorWindow();
double level = this->ImageActor->GetProperty()->GetColorLevel(); double level = this->ImageActor->GetProperty()->GetColorLevel();
@@ -680,7 +680,7 @@ void infinitiViewer::SetNegativeMode(bool negative) {
} }
} }
void infinitiViewer::SetLookupTable(vtkLookupTable *lut) { void DICOMImageViewer::SetLookupTable(vtkLookupTable *lut) {
this->ImageActor->GetProperty()->SetLookupTable(lut); this->ImageActor->GetProperty()->SetLookupTable(lut);
} }
@@ -691,7 +691,7 @@ bool simpleFusionableCheck(vtkImageData *a, vtkImageData *b) {
return (origin1[0] == origin2[0]) && (origin1[1] == origin2[1]) && (origin1[2] == origin2[2]); return (origin1[0] == origin2[0]) && (origin1[1] == origin2[1]) && (origin1[2] == origin2[2]);
} }
void infinitiViewer::SetFusionInputData(vtkImageData *data, vtkMatrix4x4* matrix) { void DICOMImageViewer::SetFusionInputData(vtkImageData *data, vtkMatrix4x4* matrix) {
if (!this->GetInput()) return; if (!this->GetInput()) return;
if (!simpleFusionableCheck(data, this->GetInput())) return; if (!simpleFusionableCheck(data, this->GetInput())) return;
if (!this->FusionMapper) { if (!this->FusionMapper) {
@@ -770,28 +770,28 @@ void infinitiViewer::SetFusionInputData(vtkImageData *data, vtkMatrix4x4* matrix
} }
void infinitiViewer::SetFusionColorLeveL(double level) { void DICOMImageViewer::SetFusionColorLeveL(double level) {
if (FusionActor) { if (FusionActor) {
FusionActor->GetProperty()->SetColorLevel(level); FusionActor->GetProperty()->SetColorLevel(level);
PrepareFusionColorTable(FusionActor->GetProperty()->GetLookupTable()); PrepareFusionColorTable(FusionActor->GetProperty()->GetLookupTable());
} }
} }
void infinitiViewer::SetFusionColorWindow(double window) { void DICOMImageViewer::SetFusionColorWindow(double window) {
if (FusionActor) { if (FusionActor) {
FusionActor->GetProperty()->SetColorWindow(window); FusionActor->GetProperty()->SetColorWindow(window);
PrepareFusionColorTable(FusionActor->GetProperty()->GetLookupTable()); PrepareFusionColorTable(FusionActor->GetProperty()->GetLookupTable());
} }
} }
void infinitiViewer::SetScalarBarTitle(double FusionOpa) { void DICOMImageViewer::SetScalarBarTitle(double FusionOpa) {
int opa = int(FusionOpa * 100); int opa = int(FusionOpa * 100);
std::string str_opa = std::to_string(opa); std::string str_opa = std::to_string(opa);
str_opa.append("%"); str_opa.append("%");
OpacityActor->SetInput(str_opa.c_str()); OpacityActor->SetInput(str_opa.c_str());
} }
void infinitiViewer::IncreFusionOpacity(double percent) { void DICOMImageViewer::IncreFusionOpacity(double percent) {
if (FusionActor) { if (FusionActor) {
FusionOpacity += percent; FusionOpacity += percent;
FusionOpacity = FusionOpacity > 1.0 ? 1.0 : FusionOpacity; FusionOpacity = FusionOpacity > 1.0 ? 1.0 : FusionOpacity;
@@ -802,7 +802,7 @@ void infinitiViewer::IncreFusionOpacity(double percent) {
} }
} }
void infinitiViewer::SetFusionOpacity(double opacity) { void DICOMImageViewer::SetFusionOpacity(double opacity) {
if (FusionActor) { if (FusionActor) {
opacity = opacity > 1.0 ? 1.0 : opacity; opacity = opacity > 1.0 ? 1.0 : opacity;
opacity = opacity < 0.0 ? 0.0 : opacity; opacity = opacity < 0.0 ? 0.0 : opacity;
@@ -842,7 +842,7 @@ void prepareTransferFunction(vtkDiscretizableColorTransferFunction *table, vtkIm
table->EnableOpacityMappingOn(); table->EnableOpacityMappingOn();
} }
void infinitiViewer::SetFusionColorTable(vtkScalarsToColors *table) { void DICOMImageViewer::SetFusionColorTable(vtkScalarsToColors *table) {
if (!FusionActor) return; if (!FusionActor) return;
PrepareFusionColorTable(table, true); PrepareFusionColorTable(table, true);
FusionActor->GetProperty()->SetLookupTable(table); FusionActor->GetProperty()->SetLookupTable(table);
@@ -851,7 +851,7 @@ void infinitiViewer::SetFusionColorTable(vtkScalarsToColors *table) {
#endif #endif
} }
void infinitiViewer::SetFusionColorPreset(const char *preset) { void DICOMImageViewer::SetFusionColorPreset(const char *preset) {
auto values = ColorMapReader::DefaultPresets()->GetPresetValues(preset); auto values = ColorMapReader::DefaultPresets()->GetPresetValues(preset);
auto PresetType = ColorMapReader::DefaultPresets()->GetPresetType(preset); auto PresetType = ColorMapReader::DefaultPresets()->GetPresetType(preset);
@@ -888,7 +888,7 @@ void infinitiViewer::SetFusionColorPreset(const char *preset) {
} }
} }
void infinitiViewer::PrepareFusionColorTable(vtkScalarsToColors *table, bool reset) { void DICOMImageViewer::PrepareFusionColorTable(vtkScalarsToColors *table, bool reset) {
const auto prop = FusionActor->GetProperty(); const auto prop = FusionActor->GetProperty();
table->SetAlpha(FusionOpacity); table->SetAlpha(FusionOpacity);
if (table->IsA("vtkLookupTable")) { if (table->IsA("vtkLookupTable")) {
@@ -913,7 +913,7 @@ void infinitiViewer::PrepareFusionColorTable(vtkScalarsToColors *table, bool res
table->Build(); table->Build();
} }
void infinitiViewer::RemoveFusionActor() { void DICOMImageViewer::RemoveFusionActor() {
this->Renderer->RemoveActor(bar); this->Renderer->RemoveActor(bar);
bar->Delete(); bar->Delete();
bar = nullptr; bar = nullptr;
@@ -922,7 +922,7 @@ void infinitiViewer::RemoveFusionActor() {
OpacityActor = nullptr; OpacityActor = nullptr;
} }
void infinitiViewer::RemoveFusionData() { void DICOMImageViewer::RemoveFusionData() {
if (!FusionMapper) return; if (!FusionMapper) return;
if (ImageStack->HasImage(FusionActor)) { if (ImageStack->HasImage(FusionActor)) {
ImageStack->RemoveImage(FusionActor); ImageStack->RemoveImage(FusionActor);
@@ -938,7 +938,7 @@ void infinitiViewer::RemoveFusionData() {
//this->Render(); //this->Render();
} }
void infinitiViewer::SwitchToNextPreset() { void DICOMImageViewer::SwitchToNextPreset() {
if (ColorMapReader::DefaultPresets()) { if (ColorMapReader::DefaultPresets()) {
//const char* preset3 = ColorMapReader::DefaultPresets()->GetPresetNames().at(currentPresetIndex).data(); //const char* preset3 = ColorMapReader::DefaultPresets()->GetPresetNames().at(currentPresetIndex).data();
@@ -952,40 +952,40 @@ void infinitiViewer::SwitchToNextPreset() {
} }
// window about---------------------------------------------------------------- // window about----------------------------------------------------------------
void infinitiViewer::SetPosition(int x, int y) { void DICOMImageViewer::SetPosition(int x, int y) {
this->RenderWindow->SetPosition(x, y); this->RenderWindow->SetPosition(x, y);
} }
int *infinitiViewer::GetPosition() { int *DICOMImageViewer::GetPosition() {
return this->RenderWindow->GetPosition(); return this->RenderWindow->GetPosition();
} }
void infinitiViewer::SetDisplayId(void *a) { void DICOMImageViewer::SetDisplayId(void *a) {
this->RenderWindow->SetDisplayId(a); this->RenderWindow->SetDisplayId(a);
} }
void infinitiViewer::SetWindowId(void *a) { void DICOMImageViewer::SetWindowId(void *a) {
this->RenderWindow->SetWindowId(a); this->RenderWindow->SetWindowId(a);
} }
const char *infinitiViewer::GetWindowName() { const char *DICOMImageViewer::GetWindowName() {
return this->RenderWindow->GetWindowName(); return this->RenderWindow->GetWindowName();
} }
void infinitiViewer::SetParentId(void *a) { void DICOMImageViewer::SetParentId(void *a) {
this->RenderWindow->SetParentId(a); this->RenderWindow->SetParentId(a);
} }
// measure-------------------------------------------------------------------- // measure--------------------------------------------------------------------
void infinitiViewer::ActiveMeasure(Measure *m) { void DICOMImageViewer::ActiveMeasure(Measure *m) {
this->InteractorStyle->ActiveMeasure(m); this->InteractorStyle->ActiveMeasure(m);
} }
void infinitiViewer::UnActiveMeasure() { void DICOMImageViewer::UnActiveMeasure() {
this->InteractorStyle->UnActiveMeasure(); this->InteractorStyle->UnActiveMeasure();
} }
void infinitiViewer::LoadMeasures(bool forceReload) { void DICOMImageViewer::LoadMeasures(bool forceReload) {
if (!forceReload && this->loadedMeasureSlice == this->ImageMapper->GetSliceNumber()) return; if (!forceReload && this->loadedMeasureSlice == this->ImageMapper->GetSliceNumber()) return;
this->loadedMeasureSlice = this->ImageMapper->GetSliceNumber(); this->loadedMeasureSlice = this->ImageMapper->GetSliceNumber();
@@ -993,7 +993,7 @@ void infinitiViewer::LoadMeasures(bool forceReload) {
ReloadCurrentSliceMeasure(); ReloadCurrentSliceMeasure();
} }
void infinitiViewer::ReloadCurrentSliceMeasure() { void DICOMImageViewer::ReloadCurrentSliceMeasure() {
list = measureStore->GetMeasures(SOP_UID, this->SliceOrientation, ImageMapper->GetSliceNumber()); list = measureStore->GetMeasures(SOP_UID, this->SliceOrientation, ImageMapper->GetSliceNumber());
if (list) { if (list) {
@@ -1005,7 +1005,7 @@ void infinitiViewer::ReloadCurrentSliceMeasure() {
} }
} }
void infinitiViewer::ClearCurrentSliceMeasure() const { void DICOMImageViewer::ClearCurrentSliceMeasure() const {
if (list) { if (list) {
for (int i = 0; i < list->length(); i++) { for (int i = 0; i < list->length(); i++) {
auto item = list->value(i); auto item = list->value(i);
@@ -1015,7 +1015,7 @@ void infinitiViewer::ClearCurrentSliceMeasure() const {
} }
} }
void infinitiViewer::AddMeasures(vtkObject *, unsigned long eventid, void *calldata) { void DICOMImageViewer::AddMeasures(vtkObject *, unsigned long eventid, void *calldata) {
auto m = static_cast<Measure *>(calldata); auto m = static_cast<Measure *>(calldata);
if (m->Valid()) { if (m->Valid()) {
measureStore->Store(SOP_UID, this->SliceOrientation, this->ImageMapper->GetSliceNumber(), m); measureStore->Store(SOP_UID, this->SliceOrientation, this->ImageMapper->GetSliceNumber(), m);
@@ -1024,7 +1024,7 @@ void infinitiViewer::AddMeasures(vtkObject *, unsigned long eventid, void *calld
this->Render(); this->Render();
} }
void infinitiViewer::RemoveMeasures(vtkObject *, unsigned long eventid, void *calldata) { void DICOMImageViewer::RemoveMeasures(vtkObject *, unsigned long eventid, void *calldata) {
auto p = static_cast<vtkProp *>(calldata); auto p = static_cast<vtkProp *>(calldata);
auto da = DraggableActor::SafeDownCast(p); auto da = DraggableActor::SafeDownCast(p);
auto m = dynamic_cast<Measure *>(da); auto m = dynamic_cast<Measure *>(da);
@@ -1035,13 +1035,13 @@ void infinitiViewer::RemoveMeasures(vtkObject *, unsigned long eventid, void *ca
this->Render(); this->Render();
} }
void infinitiViewer::DeleteSelectedMeasure() { void DICOMImageViewer::DeleteSelectedMeasure() {
if (this->InteractorStyle->GetSelectedProp()) { if (this->InteractorStyle->GetSelectedProp()) {
RemoveMeasures(nullptr, 0, this->InteractorStyle->GetSelectedProp()); RemoveMeasures(nullptr, 0, this->InteractorStyle->GetSelectedProp());
} }
} }
void infinitiViewer::DeleteCurrentSliceMeasure() { void DICOMImageViewer::DeleteCurrentSliceMeasure() {
this->InteractorStyle->ClearSelectedProp(); this->InteractorStyle->ClearSelectedProp();
ClearCurrentSliceMeasure(); ClearCurrentSliceMeasure();
measureStore->RemoveAllInSlice(SOP_UID, this->SliceOrientation, this->ImageMapper->GetSliceNumber()); measureStore->RemoveAllInSlice(SOP_UID, this->SliceOrientation, this->ImageMapper->GetSliceNumber());
@@ -1049,7 +1049,7 @@ void infinitiViewer::DeleteCurrentSliceMeasure() {
this->Render(); this->Render();
} }
void infinitiViewer::DeleteCurrentSeriesMeasure() { void DICOMImageViewer::DeleteCurrentSeriesMeasure() {
this->InteractorStyle->ClearSelectedProp(); this->InteractorStyle->ClearSelectedProp();
ClearCurrentSliceMeasure(); ClearCurrentSliceMeasure();
measureStore->RemoveAllInSeries(SOP_UID); measureStore->RemoveAllInSeries(SOP_UID);
@@ -1075,7 +1075,7 @@ public:
}; };
void infinitiViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) { void DICOMImageViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) {
// mono and has preset // mono and has preset
if (pSeries->GetNumberOfWindowLevelPresets() > 0 && pSeries->GetSamplePerPixel() == 1) { if (pSeries->GetNumberOfWindowLevelPresets() > 0 && pSeries->GetSamplePerPixel() == 1) {
double *wwwl = pSeries->GetNthWindowLevelPreset(0); double *wwwl = pSeries->GetNthWindowLevelPreset(0);
@@ -1116,19 +1116,19 @@ void infinitiViewer::InitCornerInfo(ExtendMedicalImageProperties *pSeries) {
m_cornerInfo.ConstAnno[TOP_RIGHT_PRIVACY].append("\n"); m_cornerInfo.ConstAnno[TOP_RIGHT_PRIVACY].append("\n");
} }
void infinitiViewer::SetCoordsTransformMatrix(ExtendMedicalImageProperties *pSeries) const { void DICOMImageViewer::SetCoordsTransformMatrix(ExtendMedicalImageProperties *pSeries) const {
OrientationMatrix->DeepCopy(pSeries->GetOrientationMatrix()); OrientationMatrix->DeepCopy(pSeries->GetOrientationMatrix());
WorldToModelMatrix->DeepCopy(pSeries->GetWorldToModelMatrix()); WorldToModelMatrix->DeepCopy(pSeries->GetWorldToModelMatrix());
ModelToWorldMatrix->DeepCopy(pSeries->GetModelToWorldMatrix()); ModelToWorldMatrix->DeepCopy(pSeries->GetModelToWorldMatrix());
} }
void infinitiViewer::InitTopLeftCornerInfo(const std::string &lbl_ser_num, const std::string &ser_num) { void DICOMImageViewer::InitTopLeftCornerInfo(const std::string &lbl_ser_num, const std::string &ser_num) {
m_cornerInfo.ConstAnno[TOP_LEFT].append(lbl_ser_num); m_cornerInfo.ConstAnno[TOP_LEFT].append(lbl_ser_num);
m_cornerInfo.ConstAnno[TOP_LEFT].append(" "); m_cornerInfo.ConstAnno[TOP_LEFT].append(" ");
m_cornerInfo.ConstAnno[TOP_LEFT].append(ser_num); m_cornerInfo.ConstAnno[TOP_LEFT].append(ser_num);
} }
void infinitiViewer::UpdateCornerInfo(int index) { void DICOMImageViewer::UpdateCornerInfo(int index) {
if (AnnoHelper::GetVisibility()) { if (AnnoHelper::GetVisibility()) {
if (index == TOP_LEFT) { if (index == TOP_LEFT) {
@@ -1166,7 +1166,7 @@ void infinitiViewer::UpdateCornerInfo(int index) {
this->Render(); this->Render();
} }
void infinitiViewer::UpdateCornerInfoAll() { void DICOMImageViewer::UpdateCornerInfoAll() {
if (AnnoHelper::GetVisibility()) { if (AnnoHelper::GetVisibility()) {
UpdateCornerInfo(TOP_LEFT); UpdateCornerInfo(TOP_LEFT);
UpdateCornerInfo(BOTTOM_RIGHT); UpdateCornerInfo(BOTTOM_RIGHT);
@@ -1183,7 +1183,7 @@ void infinitiViewer::UpdateCornerInfoAll() {
} }
} }
void infinitiViewer::UpdateTopLeftCornerInfo() { void DICOMImageViewer::UpdateTopLeftCornerInfo() {
if (AnnoHelper::GetVisibility()) { if (AnnoHelper::GetVisibility()) {
int maxSlice = this->GetSliceMax(); int maxSlice = this->GetSliceMax();
int currentSlice = this->GetSlice(); int currentSlice = this->GetSlice();
@@ -1196,9 +1196,9 @@ void infinitiViewer::UpdateTopLeftCornerInfo() {
} }
// SliceOrientation------------------------------------------------------------ // SliceOrientation------------------------------------------------------------
void infinitiViewer::SetSliceOrientation(int orientation) { void DICOMImageViewer::SetSliceOrientation(int orientation) {
if (orientation < infinitiViewer::SLICE_ORIENTATION_YZ || if (orientation < DICOMImageViewer::SLICE_ORIENTATION_YZ ||
orientation > infinitiViewer::SLICE_ORIENTATION_XY) { orientation > DICOMImageViewer::SLICE_ORIENTATION_XY) {
vtkErrorMacro("Error - invalid slice orientation " << orientation); vtkErrorMacro("Error - invalid slice orientation " << orientation);
return; return;
} }
@@ -1231,7 +1231,7 @@ void infinitiViewer::SetSliceOrientation(int orientation) {
} }
//TODO暂时只有正交数据否则强制转型会有一些问题 //TODO暂时只有正交数据否则强制转型会有一些问题
int infinitiViewer::GetWorldSliceOrientation() { int DICOMImageViewer::GetWorldSliceOrientation() {
double orientations[4] = {.0, .0, .0, 1.0}; double orientations[4] = {.0, .0, .0, 1.0};
orientations[SliceOrientation] = 1.0; orientations[SliceOrientation] = 1.0;
OrientationMatrix->MultiplyPoint(orientations, orientations); OrientationMatrix->MultiplyPoint(orientations, orientations);
@@ -1239,13 +1239,13 @@ int infinitiViewer::GetWorldSliceOrientation() {
} }
// Orientation (with corner text)---------------------------------------------- // Orientation (with corner text)----------------------------------------------
void infinitiViewer::UpdateOrientation() { void DICOMImageViewer::UpdateOrientation() {
// Set the camera position // Set the camera position
vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : nullptr; vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : nullptr;
if (cam) { if (cam) {
switch (SliceOrientation) { switch (SliceOrientation) {
case infinitiViewer::SLICE_ORIENTATION_XY: { case DICOMImageViewer::SLICE_ORIENTATION_XY: {
cam->SetFocalPoint(0, 0, 0); cam->SetFocalPoint(0, 0, 0);
cam->SetPosition(0, 0, -1); cam->SetPosition(0, 0, -1);
cam->SetViewUp(0, -1, 0); cam->SetViewUp(0, -1, 0);
@@ -1253,7 +1253,7 @@ void infinitiViewer::UpdateOrientation() {
} }
//Z轴负数间隔则Z轴的slice为反方向堆叠 //Z轴负数间隔则Z轴的slice为反方向堆叠
//初始的朝向和ViewUp都需要调整 //初始的朝向和ViewUp都需要调整
case infinitiViewer::SLICE_ORIENTATION_XZ: { case DICOMImageViewer::SLICE_ORIENTATION_XZ: {
double zVec = GetInput()->GetSpacing()[2]; double zVec = GetInput()->GetSpacing()[2];
double upVal = (zVec > 0.0 ? 1.0 : -1.0); double upVal = (zVec > 0.0 ? 1.0 : -1.0);
cam->SetFocalPoint(0, 0, 0); cam->SetFocalPoint(0, 0, 0);
@@ -1261,7 +1261,7 @@ void infinitiViewer::UpdateOrientation() {
cam->SetViewUp(0, 0, -1.0 * upVal); cam->SetViewUp(0, 0, -1.0 * upVal);
break; break;
} }
case infinitiViewer::SLICE_ORIENTATION_YZ: { case DICOMImageViewer::SLICE_ORIENTATION_YZ: {
double zVec = GetInput()->GetSpacing()[2]; double zVec = GetInput()->GetSpacing()[2];
double upVal = (zVec > 0.0 ? 1.0 : -1.0); double upVal = (zVec > 0.0 ? 1.0 : -1.0);
cam->SetFocalPoint(0, 0, 0); cam->SetFocalPoint(0, 0, 0);
@@ -1290,7 +1290,7 @@ int getOppositeOrientation(int f) {
return f + 1 - inner_idx * 2; return f + 1 - inner_idx * 2;
} }
void infinitiViewer::UpdateOrientationInfo() { void DICOMImageViewer::UpdateOrientationInfo() {
static const char *dds[6] = {"R", "L", "A", "P", "F", "H"}; static const char *dds[6] = {"R", "L", "A", "P", "F", "H"};
double proj[4] = {0, 0, 0, 1}; double proj[4] = {0, 0, 0, 1};
Renderer->GetActiveCamera()->GetDirectionOfProjection(proj); Renderer->GetActiveCamera()->GetDirectionOfProjection(proj);
@@ -1317,23 +1317,23 @@ void infinitiViewer::UpdateOrientationInfo() {
} }
// ruler legend---------------------------------------------------------------- // ruler legend----------------------------------------------------------------
void infinitiViewer::ActiveRuler() { void DICOMImageViewer::ActiveRuler() {
rulerActive = true; rulerActive = true;
} }
void infinitiViewer::UnActiveRuler() { void DICOMImageViewer::UnActiveRuler() {
rulerActive = false; rulerActive = false;
} }
void infinitiViewer::ActiveReferenceLine() { void DICOMImageViewer::ActiveReferenceLine() {
referenceLine->SetVisibility(true); referenceLine->SetVisibility(true);
} }
void infinitiViewer::UnActiveReferenceLine() { void DICOMImageViewer::UnActiveReferenceLine() {
referenceLine->SetVisibility(false); referenceLine->SetVisibility(false);
} }
void infinitiViewer::RenderLegend() { void DICOMImageViewer::RenderLegend() {
if (AnnoHelper::GetVisibility()) { if (AnnoHelper::GetVisibility()) {
if (Renderer) { if (Renderer) {
if (rulerActive)ruler->RenderOverlay(Renderer); if (rulerActive)ruler->RenderOverlay(Renderer);
@@ -1343,16 +1343,16 @@ void infinitiViewer::RenderLegend() {
} }
// size------------------------------------------------------------------------ // size------------------------------------------------------------------------
void infinitiViewer::SetSize(int width, int height) { void DICOMImageViewer::SetSize(int width, int height) {
this->RenderWindow->SetSize(width, height); this->RenderWindow->SetSize(width, height);
} }
int *infinitiViewer::GetSize() { int *DICOMImageViewer::GetSize() {
return this->RenderWindow->GetSize(); return this->RenderWindow->GetSize();
} }
//print self------------------------------------------------------------------- //print self-------------------------------------------------------------------
void infinitiViewer::PrintSelf(ostream &os, vtkIndent indent) { void DICOMImageViewer::PrintSelf(ostream &os, vtkIndent indent) {
this->Superclass::PrintSelf(os, indent); this->Superclass::PrintSelf(os, indent);
os << indent << "RenderWindow:\n"; os << indent << "RenderWindow:\n";

View File

@@ -57,11 +57,11 @@ class vtkCornerAnnotation;
class Measure; class Measure;
class infinitiViewer : public vtkObject { class DICOMImageViewer : public vtkObject {
public: public:
static infinitiViewer *New(); static DICOMImageViewer *New();
vtkTypeMacro(infinitiViewer, vtkObject); vtkTypeMacro(DICOMImageViewer, vtkObject);
void PrintSelf(ostream &os, vtkIndent indent) override; void PrintSelf(ostream &os, vtkIndent indent) override;
@@ -120,15 +120,15 @@ public:
virtual void SetSliceOrientation(int orientation); virtual void SetSliceOrientation(int orientation);
virtual void SetSliceOrientationToXY() { virtual void SetSliceOrientationToXY() {
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XY); this->SetSliceOrientation(DICOMImageViewer::SLICE_ORIENTATION_XY);
} }
virtual void SetSliceOrientationToYZ() { virtual void SetSliceOrientationToYZ() {
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_YZ); this->SetSliceOrientation(DICOMImageViewer::SLICE_ORIENTATION_YZ);
} }
virtual void SetSliceOrientationToXZ() { virtual void SetSliceOrientationToXZ() {
this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XZ); this->SetSliceOrientation(DICOMImageViewer::SLICE_ORIENTATION_XZ);
} }
int GetWorldSliceOrientation(); int GetWorldSliceOrientation();
@@ -396,9 +396,9 @@ public:
void SetCoordsTransformMatrix(ExtendMedicalImageProperties *pSeries) const; void SetCoordsTransformMatrix(ExtendMedicalImageProperties *pSeries) const;
protected: protected:
infinitiViewer(); DICOMImageViewer();
~infinitiViewer() override; ~DICOMImageViewer() override;
vtkAlgorithm *GetInputAlgorithm(); vtkAlgorithm *GetInputAlgorithm();
@@ -421,9 +421,9 @@ protected:
void RemoveMeasures(vtkObject *, unsigned long eventid, void *calldata); void RemoveMeasures(vtkObject *, unsigned long eventid, void *calldata);
private: private:
infinitiViewer(const infinitiViewer &) = delete; DICOMImageViewer(const DICOMImageViewer &) = delete;
void operator=(const infinitiViewer &) = delete; void operator=(const DICOMImageViewer &) = delete;
std::vector<std::vector<double>> fusion_tf_vector; std::vector<std::vector<double>> fusion_tf_vector;

View File

@@ -100,7 +100,7 @@ void DicomImageView::initScrollbar() {
void DicomImageView::initImageViewer() { void DicomImageView::initImageViewer() {
if (!mImageViewer) { if (!mImageViewer) {
mImageViewer = infinitiViewer::New(); mImageViewer = DICOMImageViewer::New();
mImageViewer->SetRenderWindow(mGLRenWin); mImageViewer->SetRenderWindow(mGLRenWin);
mImageViewer->SetupInteractor(mGLRenWin->GetInteractor()); mImageViewer->SetupInteractor(mGLRenWin->GetInteractor());
} }

View File

@@ -8,7 +8,7 @@
#include "Common/SeriesImageSet.h" #include "Common/SeriesImageSet.h"
#include "UI/Widget/Component/ClickableScrollBar.h" #include "UI/Widget/Component/ClickableScrollBar.h"
#include "Rendering/Viewer/infinitiViewer.h" #include "Rendering/Viewer/DICOMImageViewer.h"
class vtkCornerAnnotation; class vtkCornerAnnotation;
@@ -38,7 +38,7 @@ public:
return mGLWidget; return mGLWidget;
} }
infinitiViewer *getImageViewer() { DICOMImageViewer *getImageViewer() {
return mImageViewer; return mImageViewer;
} }
@@ -323,7 +323,7 @@ private:
vtkSmartPointer<vtkGenericOpenGLRenderWindow> mGLRenWin; vtkSmartPointer<vtkGenericOpenGLRenderWindow> mGLRenWin;
infinitiViewer *mImageViewer; DICOMImageViewer *mImageViewer;
SeriesImageSet *mSeries; SeriesImageSet *mSeries;
ClickableScrollBar *mScrollBar; ClickableScrollBar *mScrollBar;
MyTitleBar *mTitleBar; MyTitleBar *mTitleBar;