mImage = NULL;
mReducedExtent = new int[6];
mCurrentTSlice = 0;
+ mCurrentFusionTSlice = 0;
+ mCurrentOverlayTSlice = 0;
mUseReducedExtent = false;
mCurrent[0] = -VTK_DOUBLE_MAX;
mSlicingTransform = vtkSmartPointer<vtkTransform>::New();
mConcatenatedTransform = vtkSmartPointer<vtkTransform>::New();
+ mConcatenatedFusionTransform = vtkSmartPointer<vtkTransform>::New();
+ mConcatenatedOverlayTransform = vtkSmartPointer<vtkTransform>::New();
}
//------------------------------------------------------------------------------
mOverlayReslice->AutoCropOutputOn();
mOverlayReslice->SetBackgroundColor(-1000,-1000,-1000,1);
}
- mOverlayReslice->SetResliceTransform(mOverlay->GetTransform()[0]);
+
+ mConcatenatedOverlayTransform->Identity();
+ mConcatenatedOverlayTransform->Concatenate(mOverlay->GetTransform()[0]);
+ mConcatenatedOverlayTransform->Concatenate(mSlicingTransform);
+ mOverlayReslice->SetResliceTransform(mConcatenatedOverlayTransform);
mOverlayReslice->SetInput(0, mOverlay->GetFirstVTKImageData());
+ mImageReslice->UpdateInformation();
if (!mOverlayMapper)
mOverlayMapper = vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();
mFusionReslice->AutoCropOutputOn();
mFusionReslice->SetBackgroundColor(-1000,-1000,-1000,1);
}
- mFusionReslice->SetResliceTransform(mFusion->GetTransform()[0]);
+
+ mConcatenatedFusionTransform->Identity();
+ mConcatenatedFusionTransform->Concatenate(mFusion->GetTransform()[0]);
+ mConcatenatedFusionTransform->Concatenate(mSlicingTransform);
+ mFusionReslice->SetResliceTransform(mConcatenatedFusionTransform);
mFusionReslice->SetInput(0, mFusion->GetFirstVTKImageData());
+ mFusionReslice->UpdateInformation();
if (!mFusionMapper)
mFusionMapper = vtkSmartPointer<vtkImageMapToColors>::New();
mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
}
if (mOverlay && mOverlayActor->GetVisibility()) {
- if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
- mOverlayReslice->SetInput( mOverlay->GetVTKImages()[mCurrentTSlice] );
+ if (mOverlay->GetVTKImages().size() > (unsigned int)mCurrentTSlice) {
+ mCurrentOverlayTSlice = mCurrentTSlice;
+ mOverlayReslice->SetInput( mOverlay->GetVTKImages()[mCurrentOverlayTSlice] );
+ }
}
if (mFusion && mFusionActor->GetVisibility()) {
- if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
- mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentTSlice]);
+ if (mFusion->GetVTKImages().size() > (unsigned int)mCurrentTSlice) {
+ mCurrentFusionTSlice = mCurrentTSlice;
+ mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice]);
+ }
}
if (mSurfaceCutActors.size() > 0)
for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+int vvSlicer::GetFusionTSlice()
+{
+ return mCurrentFusionTSlice;
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+int vvSlicer::GetOverlayTSlice()
+{
+ return mCurrentOverlayTSlice;
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvSlicer::SetSliceOrientation(int orientation)
{
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
-// Returns the min an the max value in a 41x41 region around the mouse pointer
+// Returns the min an the max value in a 20%x20% region around the mouse pointer
void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image, vtkTransform *transform)
{
//Get mouse pointer position in view coordinates
void SetSliceOrientation(int orientation);
void AdjustResliceToSliceOrientation(vtkImageReslice *reslice);
int GetTSlice();
+ int GetFusionTSlice();
+ int GetOverlayTSlice();
///Reimplemented from vtkImageViewer2 to add polydata support
void SetSlice(int s);
int GetTMax() {
vtkTransform * GetSlicingTransform() { return mSlicingTransform; }
vtkTransform * GetConcatenatedTransform() { return mConcatenatedTransform; }
+ vtkTransform * GetConcatenatedFusionTransform() { return mConcatenatedFusionTransform; }
+ vtkTransform * GetConcatenatedOverlayTransform() { return mConcatenatedOverlayTransform; }
void SetCurrentPosition(double x, double y, double z, int t);
double* GetCurrentPosition();
// Λ Λ
// | | vvImage.GetTransform()
// | |
- // GetConcatenatedTransform() | _|___ VV world coordinates (mm) (displayed in VV)
+ // GetConcatenatedTransform() | _|___ VV world coordinates (mm) (displayed in VV) mCurrentBeforeSlicingTransform
// | Λ
// | | GetSlicingTransform()
// | |
- // ___|__|___ VTK world coordinates (mm) (never displayed)
+ // ___|__|___ VTK world coordinates (mm) (never displayed) mCurrent
- vtkSmartPointer<vtkImageReslice> mImageReslice;
vtkSmartPointer<vtkTransform> mSlicingTransform;
+ vtkSmartPointer<vtkImageReslice> mImageReslice;
vtkSmartPointer<vtkTransform> mConcatenatedTransform;
vtkSmartPointer<vtkImageReslice> mOverlayReslice;
+ vtkSmartPointer<vtkTransform> mConcatenatedOverlayTransform;
vtkSmartPointer<vtkImageMapToWindowLevelColors> mOverlayMapper;
vtkSmartPointer<vvBlendImageActor> mOverlayActor;
vtkSmartPointer<vtkImageReslice> mFusionReslice;
+ vtkSmartPointer<vtkTransform> mConcatenatedFusionTransform;
vtkSmartPointer<vtkImageMapToColors> mFusionMapper;
vtkSmartPointer<vtkImageActor> mFusionActor;
vtkSmartPointer<vtkCornerAnnotation> ca;
std::vector<vvMeshActor*> mSurfaceCutActors;
int mCurrentTSlice;
+ int mCurrentFusionTSlice;
+ int mCurrentOverlayTSlice;
double mCurrent[3];
double mCurrentBeforeSlicingTransform[3];
double mCursor[4];
void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey)
{
double min, max;
- int t = this->GetTSlice();
if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) {
+ int t = mSlicers[slicer]->GetFusionTSlice();
this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max,
this->mSlicers[slicer]->GetFusion()->GetVTKImages()[t],
- this->mSlicers[slicer]->GetFusion()->GetTransform()[t]);
+ this->mSlicers[slicer]->GetConcatenatedFusionTransform());
this->SetFusionWindow(max-min);
this->SetFusionLevel(0.5*(min+max));
this->SetColorMap(mColorMap);
}
else if(bCtrlKey && this->mSlicers[slicer]->GetOverlay()) {
+ int t = mSlicers[slicer]->GetOverlayTSlice();
this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max,
this->mSlicers[slicer]->GetOverlay()->GetVTKImages()[t],
- this->mSlicers[slicer]->GetOverlay()->GetTransform()[t]);
+ this->mSlicers[slicer]->GetConcatenatedOverlayTransform());
if(this->mSlicers[slicer]->GetLinkOverlayWindowLevel()){
this->SetColorWindow(max-min);
this->SetColorLevel(0.5*(min+max));
}
}
else {
+ int t = this->GetTSlice();
this->mSlicers[slicer]->GetExtremasAroundMousePointer(min, max,
this->mSlicers[slicer]->GetImage()->GetVTKImages()[t],
this->mSlicers[slicer]->GetConcatenatedTransform());