]> Creatis software - clitk.git/blobdiff - vv/vvToolRigidReg.cxx
Merge branch 'VTK6_Qt5' of git.creatis.insa-lyon.fr:clitk into VTK6_Qt5
[clitk.git] / vv / vvToolRigidReg.cxx
index 508551da86a7dec2ed064921e170439f2d6faeff..a3ee90233c8d30b5a047b444a5dcfd2c8dd9336c 100644 (file)
 // vv
 #include "vvToolRigidReg.h"
 #include "vvSlicer.h"
+#include <vvBlendImageActor.h>
 
 // vtk
 #include <vtkImageData.h>
 #include <vtkSmartPointer.h>
+#include <vtkInformation.h>
 #include <vtkTransform.h>
+#include <vtkImageActor.h>
+#include <vtkImageMapper3D.h>
+#include <vtkOpenGLImageSliceMapper.h>
 
 // itk
 #include <itkEuler3DTransform.h>
 
 // clitk
 #include "clitkTransformUtilities.h"
+#include "clitkMatrix.h"
 
 // qt
 #include <QMessageBox>
@@ -120,7 +126,7 @@ void vvToolRigidReg::InputIsSelected(vvSlicerManager *input)
     for(int i=0; i<4; i++)
       // TODO SR and BP: check on the list of transforms and not the first only
       mInitialMatrix->SetElement(i,j, mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix()->GetElement(i,j));
-  QString origTransformString = dynamic_cast<vvMainWindow*>(mMainWindow)->Get4x4MatrixDoubleAsString(mInitialMatrix);
+  QString origTransformString(clitk::Get4x4MatrixDoubleAsString(mInitialMatrix).c_str());
   transformationLabel->setText(origTransformString);
   SetTransform(mInitialMatrix);
 
@@ -298,7 +304,7 @@ void vvToolRigidReg::SaveFile()
   if (file.open(QFile::WriteOnly | QFile::Truncate)) {
     // TODO SR and BP: check on the list of transforms and not the first only
     vtkMatrix4x4* matrix = mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix();
-    QString matrixStr = dynamic_cast<vvMainWindow*>(mMainWindow)->Get4x4MatrixDoubleAsString(matrix,16);
+    QString matrixStr = clitk::Get4x4MatrixDoubleAsString(matrix,16).c_str();
     QTextStream out(&file);
     out << matrixStr;
   }
@@ -430,14 +436,34 @@ void vvToolRigidReg::GetSlidersAndSpinBoxes(std::vector<QSlider *>&transSliders,
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvToolRigidReg::ExtentMax(const double pointExtent[8][4], double maxExtent[2][3])
+{
+    double max, min;
+    for (int i=0; i<3; ++i) {
+        max = pointExtent[0][i];
+        min = pointExtent[0][i];
+        for (int j=1; j<8; ++j) {
+            if (pointExtent[j][i] > max) {
+                max = pointExtent[j][i];
+            }
+            if (pointExtent[j][i] < min) {
+                min = pointExtent[j][i];
+            }
+        }
+        maxExtent[0][i] = min;
+        maxExtent[1][i] = max;
+    }
+}
+//------------------------------------------------------------------------------
+
 //------------------------------------------------------------------------------
 void vvToolRigidReg::Render()
 {
-  for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++)
-    {
+for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
     mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
     mCurrentSlicerManager->GetSlicer(i)->Render();
-    }
+}
 }
 //------------------------------------------------------------------------------