]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.h
continued the fusion sequence visualization mode
[clitk.git] / vv / vvSlicer.h
index 0a0bcca86395deffd27d00230ffbc6e62eeaf2c1..7cb4036d97a5a9bcd08b557d803c9edb9017b82a 100644 (file)
 #include <iostream>
 #include <vector>
 
+#include <QString> //TODO delete
+#include <QMessageBox>
+
 #include "vvLandmarks.h"
 #include "vvImage.h"
 #include "vvMesh.h"
 #include "vvMeshActor.h"
+#include "vvClipPolyData.h"
 
 #include <vtkSmartPointer.h>
 #include <vtkImageViewer2.h>
 #include <vtkImageReslice.h>
 #include <vtkImageMapToColors.h>
+#include <vtkCaptionActor2D.h>
 
 class vtkActor;
 class vtkActor2D;
@@ -76,7 +81,7 @@ public:
   vtkActor* GetVFActor() ;
   vtkCornerAnnotation* GetAnnotation();
     
-  void SetFusion(vvImage::Pointer inputFusion);
+  void SetFusion(vvImage::Pointer inputFusion, int fusionSequenceCode = -1);
   vvImage::Pointer GetFusion() {
     return mFusion;
   }
@@ -95,15 +100,19 @@ public:
   }
 
   void SetLandmarks(vvLandmarks* landmarks);
-  void SetTSlice(int t);
+  void SetTSlice(int t, bool updateLinkedImages = true);
+
+  void SetFusionSequenceTSlice(int t);
+
   void SetSliceOrientation(int orientation);
   void AdjustResliceToSliceOrientation(vtkImageReslice *reslice);
   int GetTSlice();
+  int GetFusionTSlice();
+  int GetOverlayTSlice();
+  int GetMaxCurrentTSlice();
   ///Reimplemented from vtkImageViewer2 to add polydata support
   void SetSlice(int s);
-  int GetTMax() {
-    return (unsigned int)mImage->GetVTKImages().size() - 1;
-  }
+  int GetTMax();
 
   void SetOpacity(double s);
   void SetRenderWindow(int orientation, vtkRenderWindow * rw);
@@ -142,6 +151,8 @@ public:
 
   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();
@@ -207,23 +218,27 @@ protected:
 
   vvLandmarks* mLandmarks;
 
+  int mFusionSequenceCode; //-1: not involved in a fusion sequence, 0: main sequence (CT), 1: secondary sequence (US)
+
   //                         __________ Image coordinates accounting for spacing and origin
   //                            Λ  Λ
   //                            |  | 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;
@@ -239,14 +254,17 @@ protected:
   vtkSmartPointer<vtkActor> mVFActor;
   vtkSmartPointer<vtkGlyph3D> mLandGlyph;
   vtkSmartPointer<vtkCursor3D> mCross;
-  vtkSmartPointer<vtkClipPolyData> mLandClipper;
+  vtkSmartPointer<vvClipPolyData> mLandClipper;
   vtkSmartPointer<vtkPolyDataMapper> mLandMapper;
   vtkSmartPointer<vtkActor> mLandActor;
+  std::vector<vtkSmartPointer<vtkCaptionActor2D> > mLandLabelActors;
   vtkSmartPointer<vtkBox> mClipBox;
   vtkSmartPointer<vtkScalarBarActor> legend;
   std::vector<vvMeshActor*> mSurfaceCutActors;
 
   int mCurrentTSlice;
+  int mCurrentFusionTSlice;
+  int mCurrentOverlayTSlice;
   double mCurrent[3];
   double mCurrentBeforeSlicingTransform[3];
   double mCursor[4];