]> Creatis software - clitk.git/blobdiff - vv/vvMaximumIntensityProjection.cxx
script to easily create new clitk tools. Does not do vv tools yet
[clitk.git] / vv / vvMaximumIntensityProjection.cxx
index 3014720cd3238337815dbce18da2f944e86b70c6..8baeb5545c7665e8e4af1a8fdfba25722795a9ad 100644 (file)
@@ -1,27 +1,20 @@
 /*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
- Program:   vv
- Language:  C++
- Author :   Joel Schaerer (joel.schaerer@insa-lyon.fr)
+  Authors belong to: 
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
-Copyright (C) 2008
-Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
-CREATIS-LRMN http://www.creatis.insa-lyon.fr
+  This software is distributed WITHOUT ANY WARRANTY; without even
+  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE.  See the copyright notices for more information.
 
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 3 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-=========================================================================*/
+  It is distributed under dual licence
 
+  - 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>
 
@@ -31,6 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "vvToITK.h"
 #include "vvFromITK.h"
 #include "vvMaximumIntensityProjection.h"
+#include <QMessageBox>
 
 void vvMaximumIntensityProjection::Compute(vvSlicerManager * slicer_manager)
 {
@@ -39,10 +33,15 @@ if (clitk::IsSameType<TYPE>(image->GetScalarTypeAsString())) { this->Update_With
     std::string list = clitk::CreateListOfTypes<short>();
     vvImage::Pointer image=slicer_manager->GetSlicer(0)->GetImage();
     TRY_TYPE(float);
+    TRY_TYPE(double);
+    TRY_TYPE(int);
+    TRY_TYPE(unsigned int);
     TRY_TYPE(short);
-    std::cerr << "Error, I don't know the type '" << image->GetScalarTypeAsString() << "' for the input image. "
-        << std::endl << "Known types are " << list << std::endl;
-    exit(0);
+    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()));
+    error=true;
 #undef TRY_TYPE
 }
 
@@ -58,7 +57,8 @@ void vvMaximumIntensityProjection::Update_WithPixelType(vvImage::Pointer image)
             Update_WithDimAndPixelType<PixelType,4>(image);
             break;;
         default:
-            DD("Error: dimension not handled.");
+            QMessageBox::warning(0,"Unsupported image dimension",QString("Unsupported image dimension. Supported dimensions are 3 and 4"));
+            error=true;
     }
 }