mConcatenatedTransform = vtkSmartPointer<vtkTransform>::New();
mConcatenatedFusionTransform = vtkSmartPointer<vtkTransform>::New();
mConcatenatedOverlayTransform = vtkSmartPointer<vtkTransform>::New();
+ mFirstSetSliceOrientation = true;
}
//------------------------------------------------------------------------------
// DDV(cursorPos, 3);
// SetCurrentPosition(cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]);
- if (this->Renderer && this->GetInput()) {
+ if (mFirstSetSliceOrientation) {
+ int *range = this->GetSliceRange();
+ if (range)
+ this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
+ mFirstSetSliceOrientation = false;
+ }
+ else if (this->Renderer && this->GetInput()) {
double s = mCursor[orientation];
double sCursor = (s - this->GetInput()->GetOrigin()[orientation])/this->GetInput()->GetSpacing()[orientation];
this->Slice = static_cast<int>(sCursor);
}
-
-// int *range = this->GetSliceRange();
-// if (range)
-// this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
this->UpdateOrientation();
this->UpdateDisplayExtent();
this->SetupInteractor(rw->GetInteractor());
ca->SetImageActor(this->GetImageActor());
ca->SetWindowLevel(this->GetWindowLevel());
- ca->SetText(2, "<slice>");
ca->SetText(3, "<window>\n<level>");
double bounds[6];
//----------------------------------------------------------------------------
void vvSlicer::SetOverlayColorWindow(double window)
{
- mOverlayMapper->SetWindow(window);
+ if(mOverlayMapper)
+ mOverlayMapper->SetWindow(window);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicer::SetOverlayColorLevel(double level)
{
- mOverlayMapper->SetLevel(level);
+ if(mOverlayMapper)
+ mOverlayMapper->SetLevel(level);
}
//----------------------------------------------------------------------------
<< std::endl;
}
ca->SetText(1,worldPos.str().c_str());
+
+ std::stringstream slicePos;
+ slicePos << "Slice: " << this->GetSlice();
+ ca->SetText(2, slicePos.str().c_str());
}
if (pdmA->GetVisibility()) {