#=========================================================
#Add your ggo files to this list if they are used by vv
FOREACH(clitkTool clitkAffineTransform clitkBinarizeImage clitkImageArithm
- clitkMedianImageFilter clitkImageConvert clitkImageResample clitkCropImage)
+ clitkMedianImageFilter clitkImageConvert clitkImageResample clitkCropImage
+ clitkMIP)
WRAP_GGO(${clitkTool}_GGO_C ${clitkTool}.ggo)
SET(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
ENDFOREACH(clitkTool)
ADD_LIBRARY(clitkImageResampleLib clitkImageResampleGenericFilter.cxx)
ADD_LIBRARY(clitkBinarizeImageLib clitkBinarizeImageGenericFilter.cxx)
ADD_LIBRARY(clitkImageArithmImageLib clitkImageArithmGenericFilter.cxx)
+ADD_LIBRARY(clitkMIPLib clitkMIPGenericFilter.cxx)
TARGET_LINK_LIBRARIES(clitkBinarizeImageLib clitkToolsGgoLib)
void BinarizeImageGenericFilter::SetArgsInfo(const args_info_type & a)
{
mArgsInfo=a;
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
+ if (mArgsInfo.verbose_given)
+ SetIOVerbose(mArgsInfo.verbose_flag);
+ if (mArgsInfo.imagetypes_given && mArgsInfo.imagetypes_flag)
+ this->PrintAvailableImageTypes();
if (mArgsInfo.input_given) {
SetInputFilename(mArgsInfo.input_arg);
{
mArgsInfo=a;
SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
-
+ if (mArgsInfo.imagetypes_given && mArgsInfo.imagetypes_flag)
+ this->PrintAvailableImageTypes();
if (mArgsInfo.input_given) {
SetInputFilename(mArgsInfo.input_arg);
}
vvToolResample
vvToolExtractPatient
vvToolExtractLung
+ vvToolMIP
vvToolConvert ## with dummy vvToolConvert.ui
## these ones are for tests (not working)
)
# dependencies of the tools
# Future issues : when tool depend on other tools ... how to manage that ?
+# >> add the relevant $_LIBS variable to the tool that has dependencies?
SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib clitkRegistrationGgoLib)
SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
SET(vvToolResample_LIBS clitkImageResampleLib)
SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
SET(vvToolCropImage_LIBS clitkToolsGgoLib)
+SET(vvToolMIP_LIBS clitkMIPLib clitkToolsGgoLib)
#=========================================================
# List of vv source files
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vvToolMIP</class>
+ <widget class="QWidget" name="vvToolMIP">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>319</width>
+ <height>86</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Projection Dimension</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="dimensionSpinBox"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- /dev/null
+/*=========================================================================
+
+ Program: vv
+ Module: $RCSfile: vvToolMIP.cxx,v $
+ Language: C++
+ Date: $Date: 2010/10/26 12:37:58 $
+ Version: $Revision: 1.1 $
+ Author : Bharath Navalpakkam (Bharath.Navalpakkam@creatis.insa-lyon.fr)
+
+ Copyright (C) 2010
+ Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ CREATIS http://www.creatis.insa-lyon.fr
+
+ 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/>.
+
+ =========================================================================*/
+
+#include <QMessageBox>
+#include <QSpinBox>
+#include <itkImage.h>
+#include <itkMaximumProjectionImageFilter.h>
+
+#include "vvToolMIP.h"
+#include "vvSlicerManager.h"
+#include "vvSlicer.h"
+#include "vvToolInputSelectorWidget.h"
+#include "clitkMIPGenericFilter.h"
+
+//------------------------------------------------------------------------------
+// Create the tool and automagically
+ADD_TOOL(vvToolMIP);
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+vvToolMIP::vvToolMIP(vvMainWindowBase * parent, Qt::WindowFlags f)
+ :vvToolWidgetBase(parent,f),
+ vvToolBase<vvToolMIP>(parent),
+ Ui::vvToolMIP()
+{
+ // Setup the UI
+ Ui_vvToolMIP::setupUi(mToolWidget);
+ //mFilter=clitk::MIPGenericFilter::New(); //Causes a segfault. Why? (joel 26/10/2010)
+ mFilter=new clitk::MIPGenericFilter;
+
+ // Main filter
+ // Set how many inputs are needed for this tool
+ //AddInputSelector("Select one image", mFilter);
+ AddInputSelector("Select one image");
+}
+
+//------------------------------------------------------------------------------
+vvToolMIP::~vvToolMIP()
+{
+ delete mFilter;
+}
+//------------------------------------------------------------------------------
+void vvToolMIP::Initialize()
+{
+ SetToolName("MIP");
+ SetToolMenuName("Maximum Intensity Projection");
+ SetToolIconFilename(":common/icons/ducky.png");
+ SetToolTip("Compute the maximum intensity projection of an image.");
+ SetToolExperimental(true);
+}
+//------------------------------------------------------------------------------
+
+void vvToolMIP::apply()
+{
+ if (!mCurrentSlicerManager) close();
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ // Main filter
+ clitk::MIPGenericFilter::args_info_type args_info;
+ 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);
+ filter->SetArgsInfo(args_info);
+ filter->SetInputVVImage(mCurrentImage);
+ filter->Update();
+ vvImage::Pointer output = filter->GetOutputVVImage();
+ std::ostringstream osstream;
+ osstream << "MIPed_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
+ AddImage(output,osstream.str());
+ QApplication::restoreOverrideCursor();
+ close();
+}
+//------------------------------------------------------------------------------
+void vvToolMIP::InputIsSelected(vvSlicerManager *m)
+{
+ mCurrentSlicerManager =m;
+ this->dimensionSpinBox->setMaximum(m->GetDimension()-1);
+}
+
+//-----------------------------------------------------------------------------
--- /dev/null
+/*=========================================================================
+
+Program: vv
+Module: $RCSfile: vvToolMIP.h,v $
+Language: C++
+Date: $Date: 2010/10/26 12:37:59 $
+Version: $Revision: 1.1 $
+Author : Joel Schaerer (joel.schaerer@gmail.com)
+
+Copyright (C) 2010
+Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+CREATIS http://www.creatis.insa-lyon.fr
+
+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/>.
+
+=========================================================================*/
+
+#ifndef VVTOOLMIP_H
+#define VVTOOLMIP_H
+
+#include <vvImage.h>
+
+#include <QtDesigner/QDesignerExportWidget>
+#include "vvToolBase.h"
+#include "QWidget"
+#include "vvToolWidgetBase.h"
+#include "ui_vvToolMIP.h"
+
+
+//------------------------------------------------------------------------------
+class vvToolMIP:
+ public vvToolWidgetBase,
+ public vvToolBase<vvToolMIP>,
+ private Ui::vvToolMIP
+{
+ Q_OBJECT
+ public:
+ vvToolMIP(vvMainWindowBase* parent=0, Qt::WindowFlags f=0);
+ ~vvToolMIP();
+
+ static void Initialize();
+ virtual void InputIsSelected(vvSlicerManager * m);
+ virtual void apply();
+ protected:
+
+ template<class PixelType,int Dim> void Update_WithDimAndPixelType(vvImage::Pointer);
+ template<class PixelType> void Update_WithPixelType(vvImage::Pointer);
+
+ Ui::vvToolMIP ui;
+
+}; // end class vvToolMIP
+//------------------------------------------------------------------------------
+
+#endif
+