]> Creatis software - clitk.git/commitdiff
- add get extent and orientation
authordsarrut <dsarrut>
Mon, 19 Apr 2010 07:23:20 +0000 (07:23 +0000)
committerdsarrut <dsarrut>
Mon, 19 Apr 2010 07:23:20 +0000 (07:23 +0000)
vv/vvSlicer.cxx
vv/vvSlicer.h

index a5c2641bd1a8f24c249bcf8fda6376441c5bc961..9552a387f061770d527c20bd4f1aefbec2753e1d 100644 (file)
@@ -566,6 +566,9 @@ void vvSlicer::SetTSlice(int t)
     t = 0;
   else if ((unsigned int)t >= mImage->GetVTKImages().size())
     t = mImage->GetVTKImages().size() -1;
+
+  if (mCurrentTSlice == t) return;
+
   mCurrentTSlice = t;
   this->SetInput(mImage->GetVTKImages()[t]);
   if (mVF && mVFActor->GetVisibility())
@@ -635,6 +638,27 @@ void vvSlicer::SetSliceOrientation(int orientation)
 
   SetContourSlice();
 }
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+int * vvSlicer::GetExtent() {
+  int *w_ext;
+  if (mUseReducedExtent) {
+    w_ext = mReducedExtent;
+  }
+  else w_ext = GetInput()->GetWholeExtent();
+  return w_ext;
+}
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+int vvSlicer::GetOrientation() {
+  return this->SliceOrientation;
+}
+//----------------------------------------------------------------------------
+
 
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateDisplayExtent()
@@ -1189,6 +1213,8 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max)
 //----------------------------------------------------------------------------
 void vvSlicer::Render()
 {
+  //  DD("Render");
+  //DD(SliceOrientation);
   if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
     {
       legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable());
@@ -1380,3 +1406,5 @@ void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
   this->Superclass::PrintSelf(os, indent);
 }
 //----------------------------------------------------------------------------
+
+
index 51e047370effec580a4ca87a2b5603e4ab54b904..4315dd8b35ff640a23eec53df309cb7f506c3af9 100644 (file)
@@ -160,6 +160,10 @@ public:
     void EnableReducedExtent(bool b);
     void SetReducedExtent(int * ext);
 
+    void ClipDisplayedExtent(int extent[6], int refExtent[6]);
+    int GetOrientation();
+    int * GetExtent();
+
 protected:
     vvSlicer();
     ~vvSlicer();
@@ -212,7 +216,6 @@ private:
     void ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int extent[6]);
     void ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
     void ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
-    void ClipDisplayedExtent(int extent[6], int refExtent[6]);
     ///Sets the surfaces to be cut on the image slice: update the vtkCutter
     void SetContourSlice();