]> Creatis software - clitk.git/blobdiff - vv/vvMainWindow.cxx
Allow to retrieve and display multiple series.
[clitk.git] / vv / vvMainWindow.cxx
index e3e5c993f88b2123643b9ddafa123b55bb54aa73..a566c3aa96bed30fa99bb5e958efdb71937b1f26 100644 (file)
@@ -51,6 +51,7 @@ It is distributed under dual licence
 #include "vvQPacsConnection.h"
 #endif
 #include "clitkConfiguration.h"
+#include "clitkMatrix.h"
 
 // ITK include
 #include <itkImage.h>
@@ -761,8 +762,11 @@ void vvMainWindow::ConnectPacs()
 
   //std::cout << "dicomSeriesSelector " << std::endl;
 if (PacsConnection->exec() == QDialog::Accepted) {
-       files = PacsConnection->getFileNames();
-    LoadImages(files, vvImageReader::DICOM);
+       for (int i = 0; i < PacsConnection->getSeriesCount(); i++)
+       {
+               files = PacsConnection->getFileNames(i);
+               LoadImages(files, vvImageReader::DICOM);
+       }
        PacsConnection->clearMove();
   }
   }
@@ -1168,7 +1172,7 @@ void vvMainWindow::ImageInfoChanged()
     infoPanel->setNPixel(QString::number(NPixel)+" ("+inputSizeInBytes+")");
 
     transformation = imageSelected->GetTransform()[tSlice]->GetMatrix();
-    infoPanel->setTransformation(Get4x4MatrixDoubleAsString(transformation));
+    infoPanel->setTransformation(clitk::Get4x4MatrixDoubleAsString(transformation).c_str());
 
     landmarksPanel->SetCurrentLandmarks(mSlicerManagers[index]->GetLandmarks(),
                                         mSlicerManagers[index]->GetTSlice());
@@ -1366,38 +1370,6 @@ QString vvMainWindow::GetSizeInBytes(unsigned long size)
 }
 //------------------------------------------------------------------------------
 
-//------------------------------------------------------------------------------
-QString vvMainWindow::Get4x4MatrixDoubleAsString(vtkSmartPointer<vtkMatrix4x4> matrix, const int precision)
-{
-  std::ostringstream strmatrix;
-
-  // Figure out the number of digits of the integer part of the largest absolute value
-  // for each column
-  unsigned width[4];
-  for (unsigned int j = 0; j < 4; j++){
-    double absmax = 0.;
-    for (unsigned int i = 0; i < 4; i++)
-      absmax = std::max(absmax, vnl_math_abs(matrix->GetElement(i, j)));
-    unsigned ndigits = (unsigned)std::max(0.,std::log10(absmax))+1;
-    width[j] = precision+ndigits+3;
-  }
-
-  // Output with correct width, aligned to the right
-  for (unsigned int i = 0; i < 4; i++) {
-    for (unsigned int j = 0; j < 4; j++) {
-      strmatrix.setf(ios::fixed,ios::floatfield);
-      strmatrix.precision(precision);
-      strmatrix.fill(' ');
-      strmatrix.width(width[j]);
-      strmatrix << std::right << matrix->GetElement(i, j);
-    }
-    strmatrix << std::endl;
-  }
-  QString result = strmatrix.str().c_str();
-  return result;
-}
-//------------------------------------------------------------------------------
-
 //------------------------------------------------------------------------------
 QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
 {