GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
medianplugin.cxx
Go to the documentation of this file.
1 /*=========================================================================
2  Author: $Author$ // Author of last commit
3  Version: $Rev$ // Revision of last commit
4  Date: $Date$ // Date of last commit
5 =========================================================================*/
6 
7 /*=========================================================================
8  Authors: The GoFigure Dev. Team.
9  at Megason Lab, Systems biology, Harvard Medical school, 2009
10 
11  Copyright (c) 2009, President and Fellows of Harvard College.
12  All rights reserved.
13 
14  Redistribution and use in source and binary forms, with or without
15  modification, are permitted provided that the following conditions are met:
16 
17  Redistributions of source code must retain the above copyright notice,
18  this list of conditions and the following disclaimer.
19  Redistributions in binary form must reproduce the above copyright notice,
20  this list of conditions and the following disclaimer in the documentation
21  and/or other materials provided with the distribution.
22  Neither the name of the President and Fellows of Harvard College
23  nor the names of its contributors may be used to endorse or promote
24  products derived from this software without specific prior written
25  permission.
26 
27  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
29  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
31  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
32  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
33  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
34  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
36  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
37  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 
39 =========================================================================*/
40 #include "medianplugin.h"
41 
42 #include <QAction>
43 #include <iostream>
44 
45 Q_EXPORT_PLUGIN2(QGoIdentityImageFilterPlugin, medianplugin)
46 
48 {
49  this->SetAllRequiredInformation();
50  preprocess = new QCellPreprocess();
51  QObject::connect( preprocess, SIGNAL( Done(std::vector< vtkImageData * > ) ),
52  this, SIGNAL( Done(std::vector< vtkImageData * > ) ) );
53 }
54 
56 {}
57 
58 std::vector< QAction * > medianplugin::Actions()
59 {
60  QAction *action = new QAction(tr("&Median"), this);
61 
62  QObject::connect( action, SIGNAL(triggered),
63  this, SLOT( Process() ) );
64 
65  std::vector< QAction * > oActionList;
66  oActionList.push_back(action);
67 
68  return oActionList;
69 }
70 
72 {
73  return 0;
74 }
75 
77 {
78  return 0;
79 }
80 
82 {
83  return 0;
84 }
85 
87 {
88  return 0;
89 }
90 
91 std::list< GoFigure::TabDimensionType >
93 {
94  std::list< GoFigure::TabDimensionType > oCompatibility;
95  oCompatibility.push_back(GoFigure::TWO_D);
96  oCompatibility.push_back(GoFigure::THREE_D);
97 
98  return oCompatibility;
99 }
100 
102 {
104  preprocess->setVisible(true);
105 // m_VTKOutput = preprocess->GetOutput();
106  std::cout << "medianplugin::Process" << std::endl;
107 }
108 
110 {
111  this->m_Information.Name = "MedianFiltering";
112  this->m_Information.Version = "1.0";
114  this->m_Information.Distributor = "Megason Lab";
115  this->m_Information.Copyright = "Harvard Medical School";
116  this->m_Information.License = "BSD";
117  this->m_Information.Description = "Test: plugin which median filters the input";
118 }
virtual QToolBar * ToolBar()
virtual void setVisible(bool visible)
virtual QWidget * AdditionalWidget()
QCellPreprocess * preprocess
Definition: medianplugin.h:78
QString tr(const char *sourceText, const char *disambiguation, int n)
PluginInformationBase m_Information
contains all information related to the plugin.
Definition: QGoPlugin.h:121
virtual QDockWidget * DockWidget()
std::vector< vtkImageData * > m_VTKInput
virtual std::list< GoFigure::TabDimensionType > TabElementCompatibility() const
virtual std::vector< QAction * > Actions()
void SetInput(std::vector< vtkImageData * > &iImg)
virtual ~medianplugin()
virtual void Process()
virtual QMenu * Menu()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void SetAllRequiredInformation()
Set all required information (name, version, license...).