diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 1a2eb6b147..0d77175930 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,53 +1,54 @@ IF(MITK_USE_BLUEBERRY) SET(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) SET(_mitk_bundles_default ) IF(QT4_FOUND) LIST(APPEND _mitk_bundles_default "org.mitk.gui.qt.imagenavigator") # BlueBerry depends on CTK which depends on Qt, so we # need the Qt include direcotries INCLUDE(${QT_USE_FILE}) ENDIF() SET(PLUGIN_EXCLUDE_LIST org.mitk.core.ext org.mitk.gui.qt.volumetry org.mitk.core.jobs org.mitk.diffusionimaging org.mitk.gui.qt.diffusionimaging org.mitk.gui.qt.ext org.mitk.gui.qt.extapplication org.mitk.gui.qt.datamanager org.mitk.gui.qt.regiongrowing org.mitk.gui.qt.segmentation org.mitk.planarfigure org.mitk.gui.qt.igtnavigationtoolmanager org.mitk.gui.qt.igttrackingtoolbox org.mitk.gui.qt.igttoolpairnavigation org.mitk.gui.qt.basicimageprocessing org.mitk.gui.qt.colourimageprocessing org.mitk.gui.qt.navigationdataplayer org.mitk.gui.qt.tofutil org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.moviemaker org.mitk.gui.qt.deformableregistration org.mitk.gui.qt.rigidregistration + org.mitk.gui.qt.imagestatistics ) MACRO_COLLECT_PLUGINS(OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtBundles CACHE_PLUGIN_SOURCE_DIRS MITK_MODULES_PLUGIN_SOURCE_DIRS CACHE_PLUGIN_OUTPUT_DIRS MITK_MODULES_PLUGIN_OUTPUT_DIRS CACHE_PLUGIN_TARGETS MITK_MODULES_ENABLED_PLUGINS BUNDLE_LIST_PATH "${MITK_BINARY_DIR}/Bundles/MITKModulesBundleList.cmake" CMAKE_CACHE_PREFIX "MITK" PLUGIN_DEFAULT_ON ${_mitk_bundles_default} PLUGIN_EXCLUDES ${PLUGIN_EXCLUDE_LIST} ${MITK_BUILD_ALL_PLUGINS_OPTION}) ENDIF(MITK_USE_BLUEBERRY) diff --git a/Modules/Bundles/PluginList.cmake b/Modules/Bundles/PluginList.cmake index 6ac1c79c8e..e97af96345 100644 --- a/Modules/Bundles/PluginList.cmake +++ b/Modules/Bundles/PluginList.cmake @@ -1,23 +1,24 @@ SET(MITK_EXT_PLUGINS org.mitk.core.ext:ON org.mitk.core.jobs:OFF org.mitk.diffusionimaging:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.ext:ON org.mitk.gui.qt.extapplication:ON org.mitk.gui.qt.segmentation:OFF org.mitk.planarfigure:ON org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.igtnavigationtoolmanager:OFF org.mitk.gui.qt.igttoolpairnavigation:ON org.mitk.gui.qt.igttrackingtoolbox:OFF org.mitk.gui.qt.regiongrowing:OFF org.mitk.gui.qt.navigationdataplayer:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.colourimageprocessing:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.imagenavigator:ON - org.mitk.gui.qt.moviemaker:ON + org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.deformableregistration:ON org.mitk.gui.qt.rigidregistration:ON + org.mitk.gui.qt.imagestatistics:OFF ) diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/CMakeLists.txt index 8b366ec0a6..88a3aa635c 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/CMakeLists.txt @@ -1,2 +1,9 @@ +# The project name must correspond to the directory name of your plug-in +# and must not contain periods. +PROJECT(org_mitk_gui_qt_imagestatistics) -MACRO_CREATE_MITK_PLUGIN(QmitkExt PlanarFigure) +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE IMAGESTATISTICS_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt PlanarFigure +) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/META-INF/MANIFEST.MF deleted file mode 100644 index 37c1f96e34..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: Image Statistics -Bundle-SymbolicName: org.mitk.gui.qt.imagestatistics -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common -Bundle-Activator: diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/files.cmake b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/files.cmake index 5866196472..435c14747d 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/files.cmake @@ -1,37 +1,37 @@ SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES QmitkImageStatisticsView.cpp - + mitkImageStatisticsPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkImageStatisticsViewControls.ui ) SET(MOC_H_FILES + src/internal/mitkImageStatisticsPluginActivator.h src/internal/QmitkImageStatisticsView.h ) -SET(RESOURCE_FILES +SET(CACHED_RESOURCE_FILES resources/stats.png resources/ImageStatistic_24.png + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES # uncomment the following line if you want to use Qt resources resources/QmitkImageStatisticsView.qrc ) -SET(CPP_FILES manifest.cpp) foreach(file ${SRC_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/internal/${file}) -endforeach(file ${INTERNAL_CPP_FILES}) - +endforeach(file ${INTERNAL_CPP_FILES}) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest.cpp deleted file mode 100644 index 4df00a915a..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-05 11:31:02 +0200 (Di, 05 Mai 2009) $ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include - -#include -#include "src/internal/QmitkImageStatisticsView.h" - - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkImageStatistics) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest_headers.cmake new file mode 100644 index 0000000000..d6a1b99509 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "MITK Image Statistics") +set(Plugin-Version "0.9") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/plugin.xml index 43046ef0c7..4ec77645d7 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/plugin.xml @@ -1,11 +1,11 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/ImageStatisticsDll.h b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/ImageStatisticsDll.h deleted file mode 100644 index f2f0e39614..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/ImageStatisticsDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-28 20:08:26 +0200 (Do, 28 Mai 2009) $ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef _IMAGESTATISTICS_EXPORT_DLL_H_ -#define _IMAGESTATISTICS_EXPORT_DLL_H_ - - -// -// The following block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the org_mitk_gui_qt_imagestatistics_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// org_mitk_gui_qt_imagestatistics_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_imagestatistics_EXPORTS) - #define IMAGESTATISTICS_EXPORT __declspec(dllexport) - #else - #define IMAGESTATISTICS_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(IMAGESTATISTICS_EXPORT) - #define IMAGESTATISTICS_EXPORT -#endif - -#endif /*_IMAGESTATISTICS_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h index e52fc837a4..82563f4815 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h @@ -1,163 +1,168 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 20:08:26 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 10185 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkImageStatisticsView_H__INCLUDED) #define QmitkImageStatisticsView_H__INCLUDED #include "QmitkFunctionality.h" -#include "../ImageStatisticsDll.h" +#include #include "ui_QmitkImageStatisticsViewControls.h" #include "QmitkStepperAdapter.h" #include "mitkImageStatisticsCalculator.h" #include #include #include #include "mitkPlanarLine.h" /*! \brief QmitkImageStatistics \sa QmitkFunctionality \ingroup Functionalities */ -class IMAGESTATISTICS_EXPORT QmitkImageStatistics : public QmitkFunctionality +class QmitkImageStatistics : public QmitkFunctionality { Q_OBJECT public: /*! \ Convenient typedefs */ typedef mitk::DataStorage::SetOfObjects ConstVector; typedef ConstVector::ConstPointer ConstVectorPointer; typedef ConstVector::ConstIterator ConstVectorIterator; /*! \brief default constructor */ QmitkImageStatistics(QObject *parent=0, const char *name=0); + QmitkImageStatistics(const QmitkImageStatistics& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } /*! \brief default destructor */ virtual ~QmitkImageStatistics(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); bool IsExclusiveFunctionality() const; virtual bool event( QEvent *event ); void OnSelectionChanged( std::vector nodes ); protected slots: void ClipboardHistogramButtonClicked(); void ClipboardStatisticsButtonClicked(); void IgnoreZerosCheckboxClicked( ); protected: void StdMultiWidgetAvailable( QmitkStdMultiWidget& stdMultiWidget ); void FillStatisticsTableView( const mitk::ImageStatisticsCalculator::Statistics &s, const mitk::Image *image ); void InvalidateStatisticsTableView(); /** \brief Issues a request to update statistics by sending an event to the * Qt event processing queue. * * Statistics update should only be executed after program execution returns * to the Qt main loop. This mechanism also prevents multiple execution of * updates where only one is required.*/ void RequestStatisticsUpdate(); /** \brief Recalculate statistics for currently selected image and mask and * update the GUI. */ void UpdateStatistics(); /** \brief Listener for progress events to update progress bar. */ void UpdateProgressBar(); /** \brief Removes any cached images which are no longer referenced elsewhere. */ void RemoveOrphanImages(); /** \brief Computes an Intensity Profile along line and updates the histogram widget with it. */ void ComputeIntensityProfile( mitk::PlanarLine* line ); void Visible( ); typedef std::map< mitk::Image *, mitk::ImageStatisticsCalculator::Pointer > ImageStatisticsMapType; /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkImageStatisticsViewControls *m_Controls; QmitkStepperAdapter* m_TimeStepperAdapter; unsigned int m_CurrentTime; QString m_Clipboard; // Image and mask data mitk::DataNode *m_SelectedImageNode; mitk::Image *m_SelectedImage; mitk::DataNode *m_SelectedMaskNode; mitk::Image *m_SelectedImageMask; mitk::PlanarFigure *m_SelectedPlanarFigure; long m_ImageObserverTag; long m_ImageMaskObserverTag; long m_PlanarFigureObserverTag; // Hash map for associating one image statistics calculator with each iamge // (so that previously calculated histograms / statistics can be recovered // if a recalculation is not required) ImageStatisticsMapType m_ImageStatisticsMap; mitk::ImageStatisticsCalculator::Pointer m_CurrentStatisticsCalculator; bool m_CurrentStatisticsValid; bool m_StatisticsUpdatePending; }; #endif // !defined(QmitkImageStatistics_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.cpp new file mode 100644 index 0000000000..9981228026 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.cpp @@ -0,0 +1,21 @@ +#include "mitkImageStatisticsPluginActivator.h" + +#include + +#include "QmitkImageStatisticsView.h" + +namespace mitk { + + void ImageStatisticsPluginActivator::start(ctkPluginContext* context) + { + BERRY_REGISTER_EXTENSION_CLASS(QmitkImageStatistics, context) + } + + void ImageStatisticsPluginActivator::stop(ctkPluginContext* context) + { + Q_UNUSED(context) + } + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_imagestatistics, mitk::ImageStatisticsPluginActivator) \ No newline at end of file diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.h new file mode 100644 index 0000000000..28e7af7c44 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/mitkImageStatisticsPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKIMAGESTATISTICSPLUGINACTIVATOR_H +#define MITKIMAGESTATISTICSPLUGINACTIVATOR_H + +#include + +namespace mitk { + + class ImageStatisticsPluginActivator : + public QObject, public ctkPluginActivator + { + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + + public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + + }; // ImageStatisticsPluginActivator + +} + +#endif // MITKIMAGESTATISTICSPLUGINACTIVATOR_H \ No newline at end of file