Fix ClearTransformations function.

This commit is contained in:
Krad
2022-07-22 15:50:56 +08:00
parent 0667650ceb
commit a6feaacaf8
2 changed files with 8 additions and 16 deletions

View File

@@ -376,6 +376,8 @@ vtkTypeMacro(infinitiViewer, vtkObject);
void GetSlicePoint(double *point);
virtual void UpdateOrientation();
protected:
infinitiViewer();
@@ -391,8 +393,6 @@ protected:
void PrepareFusionColorTable(vtkScalarsToColors *table, bool reset = false);
virtual void UpdateOrientation();
void LoadMeasures() {
LoadMeasures(false);
}

View File

@@ -403,21 +403,21 @@ void DicomImageView::syncEventFunc(vtkObject *, unsigned long eid, void *calldat
int *r = (int *) calldata;
switch (eid) {
case (vtkCommand::EventIds::EndPanEvent):
this->onSync(this, VTKIS_IMAGE_PAN, calldata);
emit onSync(this, VTKIS_IMAGE_PAN, calldata);
break;
case (vtkCommand::EventIds::EndWindowLevelEvent):
//update corner info through callback
this->onSync(this, VTKIS_IMAGE_WINDOWLEVEL, calldata);
emit onSync(this, VTKIS_IMAGE_WINDOWLEVEL, calldata);
break;
case (ActorDraggableInteractorStyle::DraggableStyleEvents::EndDollyEvent):
this->onSync(this, VTKIS_IMAGE_ZOOM, calldata);
emit onSync(this, VTKIS_IMAGE_ZOOM, calldata);
break;
case (ActorDraggableInteractorStyle::DraggableStyleEvents::SlicedEvent): {
mScrollBar->SetValueSilently(r[0]);
//invoke event
double focusPoint[3] = {.0, .0, .0};
mImageViewer->GetSlicePoint(focusPoint);
this->onSync(this, VTKIS_IMAGE_SLICING, focusPoint);
emit onSync(this, VTKIS_IMAGE_SLICING, focusPoint);
break;
}
default:
@@ -485,11 +485,10 @@ void DicomImageView::setPanOffset(double *pan) {
}
}
//FIXME:这个函数有问题,会导致MPR显示出错
void DicomImageView::resetPanZoom() {
if (hasSeries()) {
mImageViewer->GetRenderer()->ResetCamera();
mImageViewer->ResetZoomScaleToFitWindowSize();
}
}
@@ -581,15 +580,8 @@ void DicomImageView::rotateImage(double angle, TransFormType operation) {
void DicomImageView::ClearTransformations() {
if (hasSeries()) {
int slice = mImageViewer->GetSlice();
mImageViewer->UpdateOrientation();
resetPanZoom();
double cameraPosition[3];
double vup[3];
mSeries->getCameraCfg(vup, cameraPosition);
//necessary to reset flip and rotate
mImageViewer->GetRenderer()->GetActiveCamera()->SetPosition(cameraPosition);
mImageViewer->GetRenderer()->GetActiveCamera()->SetViewUp(vup);
//avoid black out problem
mImageViewer->GetRenderer()->ResetCameraClippingRange();
mImageViewer->SetSlice(slice);