]> Creatis software - clitk.git/blobdiff - vv/vvToolMIP.cxx
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvToolMIP.cxx
index 970ad3509d9582ed60b57b4c24e460f19027205d..2ef4918480472feee170c3af761724fff660021c 100644 (file)
@@ -1,14 +1,31 @@
+/*=========================================================================
+  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
+
+  Authors belong to:
+  - University of LYON              http://www.universite-lyon.fr/
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
+  - CREATIS CNRS laboratory         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.
+
+  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
+===========================================================================*/
 /*=========================================================================
 
   Program:   vv
   Module:    $RCSfile: vvToolMIP.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/10/26 12:37:58 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2011/04/15 08:29:21 $
+  Version:   $Revision: 1.3 $
   Author :   Bharath Navalpakkam (Bharath.Navalpakkam@creatis.insa-lyon.fr)
 
   Copyright (C) 2010
-  Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+  Léon Bérard cancer center http://www.centreleonberard.fr
   CREATIS                   http://www.creatis.insa-lyon.fr
 
   This program is free software: you can redistribute it and/or modify
@@ -61,16 +78,15 @@ vvToolMIP::vvToolMIP(vvMainWindowBase * parent, Qt::WindowFlags f)
 //------------------------------------------------------------------------------
 vvToolMIP::~vvToolMIP()
 {
-  delete mFilter;
 }
 //------------------------------------------------------------------------------
 void vvToolMIP::Initialize()
 {
   SetToolName("MIP");
   SetToolMenuName("Maximum Intensity Projection");
-  SetToolIconFilename(":common/icons/ducky.png");
+  SetToolIconFilename(":common/icons/mip.png");
   SetToolTip("Compute the maximum intensity projection of an image.");
-  SetToolExperimental(true);
+  SetToolExperimental(false);
 }
 //------------------------------------------------------------------------------
 
@@ -83,7 +99,7 @@ void vvToolMIP::apply()
   cmdline_parser_clitkMIP_init(&args_info);
   args_info.dimension_arg=this->dimensionSpinBox->value();
   args_info.dimension_given=true;
-  clitk::MIPGenericFilter* filter= dynamic_cast<clitk::MIPGenericFilter*>(mFilter);
+  clitk::MIPGenericFilter* filter= dynamic_cast<clitk::MIPGenericFilter*>(mFilter.GetPointer());
   filter->SetArgsInfo(args_info);
   filter->SetInputVVImage(mCurrentImage);
   filter->Update();
@@ -98,6 +114,11 @@ void vvToolMIP::apply()
 void vvToolMIP::InputIsSelected(vvSlicerManager *m)
 {
   mCurrentSlicerManager =m;
+  if (m->GetDimension() <3) {
+    QMessageBox::information(this, "Wrong image dimension","Sorry, only work with 3D or 4D images.");
+    close();
+    return;
+  }
   this->dimensionSpinBox->setMaximum(m->GetDimension()-1);
 }