]> Creatis software - clitk.git/commitdiff
correct GetScalarTypeAsITKString
authordsarrut <dsarrut>
Wed, 7 Jul 2010 07:04:09 +0000 (07:04 +0000)
committerdsarrut <dsarrut>
Wed, 7 Jul 2010 07:04:09 +0000 (07:04 +0000)
vv/vvImageWarp.cxx
vv/vvMainWindow.cxx
vv/vvMaximumIntensityProjection.cxx
vv/vvMidPosition.cxx
vv/vvToolImageArithm.cxx
vv/vvToolResample.cxx
vv/vvToolSimpleInputSelectorWidget.cxx
vv/vvToolWidgetBase.cxx

index 1fd6778bcfe5d8252cb9ad1fc3816cbeaa72f60d..904e4cb82d75e32ea7939f325250ec189397d630 100644 (file)
@@ -43,7 +43,7 @@ template<unsigned int Dim>
 void vvImageWarp::Update_WithDim()
 {
 #define TRY_TYPE(TYPE)                                                 \
-  if (clitk::IsSameType<TYPE>(mInputImage->GetScalarTypeAsString())) { this->Update_WithDimAndPixelType<Dim, TYPE>(); return; }
+  if (clitk::IsSameType<TYPE>(mInputImage->GetScalarTypeAsITKString())) { this->Update_WithDimAndPixelType<Dim, TYPE>(); return; }
 //  TRY_TYPE(signed char);
 //  TRY_TYPE(uchar);
   TRY_TYPE(short);
@@ -54,7 +54,7 @@ void vvImageWarp::Update_WithDim()
 #undef TRY_TYPE
 
   std::string list = clitk::CreateListOfTypes<char, clitk::uchar, short, ushort, int, float, double>();
-  std::cerr << "Error, I don't know the type '" << mInputImage->GetScalarTypeAsString() << "' for the input image. "
+  std::cerr << "Error, I don't know the type '" << mInputImage->GetScalarTypeAsITKString() << "' for the input image. "
             << std::endl << "Known types are " << list << std::endl;
   exit(0);
 }
index 28094dfdd661eb3b8768ee03ac2a7efeb3181d9d..1948e791eed57439f08e4d428ea467281e01dcf1 100644 (file)
@@ -979,7 +979,7 @@ void vvMainWindow::ImageInfoChanged()
       inputSpacing.resize(dimension);
       inputSize.resize(dimension);
       sizeMM.resize(dimension);
-      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str();
+      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str();
       for (int i = 0; i < dimension; i++) {
         origin[i] = imageSelected->GetOrigin()[i];
         inputSpacing[i] = imageSelected->GetSpacing()[i];
@@ -995,7 +995,7 @@ void vvMainWindow::ImageInfoChanged()
       inputSpacing.resize(dimension);
       inputSize.resize(dimension);
       sizeMM.resize(dimension);
-      pixelType = mSlicerManagers[index]->GetVF()->GetScalarTypeAsString().c_str();
+      pixelType = mSlicerManagers[index]->GetVF()->GetScalarTypeAsITKString().c_str();
       for (int i = 0; i < dimension; i++) {
         origin[i] = imageSelected->GetOrigin()[i];
         inputSpacing[i] = imageSelected->GetSpacing()[i];
@@ -1011,7 +1011,7 @@ void vvMainWindow::ImageInfoChanged()
       inputSpacing.resize(dimension);
       inputSize.resize(dimension);
       sizeMM.resize(dimension);
-      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str();
+      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str();
       for (int i = 0; i < dimension; i++) {
         origin[i] = imageSelected->GetOrigin()[i];
         inputSpacing[i] = imageSelected->GetSpacing()[i];
@@ -1027,7 +1027,7 @@ void vvMainWindow::ImageInfoChanged()
       inputSpacing.resize(dimension);
       inputSize.resize(dimension);
       sizeMM.resize(dimension);
-      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsString().c_str();
+      pixelType = mSlicerManagers[index]->GetImage()->GetScalarTypeAsITKString().c_str();
       for (int i = 0; i < dimension; i++) {
         origin[i] = imageSelected->GetOrigin()[i];
         inputSpacing[i] = imageSelected->GetSpacing()[i];
index 077a884cab2932e48a4070d0439020e733181a73..7c2c3d7c68f132cb93c100de15de5724b965bfc2 100644 (file)
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+  ======================================================================-====*/
 #include <itkImage.h>
 #include <itkMaximumProjectionImageFilter.h>
 
@@ -29,7 +29,7 @@
 void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager)
 {
 #define TRY_TYPE(TYPE)                                                 \
-if (clitk::IsSameType<TYPE>(image->GetScalarTypeAsString())) { this->Update_WithPixelType<TYPE>(image); return; }
+  if (clitk::IsSameType<TYPE>(image->GetScalarTypeAsITKString())) { this->Update_WithPixelType<TYPE>(image); return; }
   std::string list = clitk::CreateListOfTypes<short>();
   vvImage::Pointer image=slicer_manager->GetSlicer(0)->GetImage();
   TRY_TYPE(float);
@@ -40,7 +40,8 @@ if (clitk::IsSameType<TYPE>(image->GetScalarTypeAsString())) { this->Update_With
   TRY_TYPE(unsigned short);
   TRY_TYPE(char);
   TRY_TYPE(unsigned char);
-  QMessageBox::warning(0,"Unsupported image type",QString("Error, I don't know the type")+QString(image->GetScalarTypeAsString().c_str()) +QString("' for the input image.\nKnown types are ") + QString(list.c_str()));
+  QMessageBox::warning(0,"Unsupported image type",
+                       QString("Error, I don't know the type")+QString(image->GetScalarTypeAsITKString().c_str()) +QString("' for the input image.\nKnown types are ") + QString(list.c_str()));
   error=true;
 #undef TRY_TYPE
 }
index 7d9f772851ac7ff4b18bb33de8b4643b49684e69..8e715e7abc1d8fcadfef2337f945cf419593f641 100644 (file)
@@ -64,7 +64,7 @@ void vvMidPosition::run()
     error_message="Computation of midposition is only supported for 4D image sequences.";
   else if (!slicer_manager->GetVF())
     error_message="A VF is required for midposition computation";
-  else if (slicer_manager->GetVF()->GetScalarTypeAsString() != "float")
+  else if (slicer_manager->GetVF()->GetScalarTypeAsITKString() != "float")
     error_message="Please use a vector field of type float.";
   else {
     VFType::ConstPointer vf = vvImageToITK<VFType>(slicer_manager->GetVF());
@@ -74,7 +74,7 @@ void vvMidPosition::run()
     inv_filter->SetInput(avg_vf);
     inv_filter->Update();
     progress++;
-    if (slicer_manager->GetImage()->GetScalarTypeAsString() == "short")
+    if (slicer_manager->GetImage()->GetScalarTypeAsITKString() == "short")
       this->output=WarpRefImage<short>(inv_filter->GetOutput(),slicer_manager->GetImage(),reference_image_index);
     else {
       error_message="Unsupported image pixel type.";
index ad6343ed15c288e2ec55afab74b96a9d2157e8d5..897e3d661a5f2aa28b581b6415037f810a8c1caf 100644 (file)
@@ -143,10 +143,10 @@ void vvToolImageArithm::apply()
     inputs.push_back(mInput2->GetImage());
 
     // Check input type
-    if (inputs[0]->GetScalarTypeAsString() != inputs[1]->GetScalarTypeAsString()) {
+    if (inputs[0]->GetScalarTypeAsITKString() != inputs[1]->GetScalarTypeAsITKString()) {
       std::cerr << "Sorry inputs should have the same pixeltype." << std::endl;
-      std::cerr << "Input1 = " << inputs[0]->GetScalarTypeAsString() << std::endl;
-      std::cerr << "Input2 = " << inputs[1]->GetScalarTypeAsString() << std::endl;
+      std::cerr << "Input1 = " << inputs[0]->GetScalarTypeAsITKString() << std::endl;
+      std::cerr << "Input2 = " << inputs[1]->GetScalarTypeAsITKString() << std::endl;
       QApplication::restoreOverrideCursor();
       QMessageBox::information(this, "Wrong image type","Sorry, could not perform operation. Please select inputs with same pixe type.");
       close();
index d3fc1fb5ba6a47df4043710f3321ab9b625f392b..403775e8c917477bf7c048d1f119ce09145b4709 100644 (file)
@@ -136,7 +136,7 @@ void vvToolResample::InputIsSelected(vvSlicerManager* m)
   mInputFileName = mCurrentSlicerManager->GetFileName().c_str();
 
   // Set current information
-  mPixelType = mCurrentImage->GetScalarTypeAsString().c_str();
+  mPixelType = mCurrentImage->GetScalarTypeAsITKString().c_str();
   //ds      ComponentType = mCurrentImageGetNumberOfScalarComponents();
   mDimension = mCurrentImage->GetNumberOfDimensions();
 
index e7c7d0db9d00ce812c4a5e13fc6c3e4f538b60a4..0f0860a86f8701b97437822787cdb3680d5e6542 100644 (file)
 ======================================================================-====*/
 #ifndef VVTOOLINPUTSELECTORWIDGET_CXX
 #define VVTOOLINPUTSELECTORWIDGET_CXX
+
+// vv
 #include "vvToolSimpleInputSelectorWidget.h"
 #include "vvSlicerManager.h"
+
+// qt
 #include <QAbstractButton>
 
 //------------------------------------------------------------------------------
@@ -153,7 +157,7 @@ void vvToolSimpleInputSelectorWidget::changeInput(int index)
   spacing.append(QString("%1").arg(mCurrentImage->GetSpacing()[d-1]));
   mLabelInputInfo->setText(QString("%1D %2\n%3\n%4")
                            .arg(d)
-                           .arg(mCurrentImage->GetScalarTypeAsString().c_str())
+                           .arg(mCurrentImage->GetScalarTypeAsITKString().c_str())
                            .arg(size)
                            .arg(spacing));
  //  DD("fin");
index d258aafe5106ad23e0cabbcbcfb9e4b124c6dfe2..58ff83cf6fa1386126c9380b6e794e64d153f017 100644 (file)
@@ -190,7 +190,7 @@ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFil
     vvImage * s = mMainWindow->GetSlicerManagers()[i]->GetImage();
     if (mFilter->CheckImageType(s->GetNumberOfDimensions(),
                                 s->GetNumberOfScalarComponents(),
-                                s->GetScalarTypeAsString())) {
+                                s->GetScalarTypeAsITKString())) {
       mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]);
       if ((int)i == mMainWindow->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j;
       j++;