EMAN2
processor_template.h
Go to the documentation of this file.
1/*
2 * Author: Steven Ludtke, 04/10/2003 (sludtke@bcm.edu)
3 * Copyright (c) 2000-2006 Baylor College of Medicine
4 *
5 * This software is issued under a joint BSD/GNU license. You may use the
6 * source code in this file under either license. However, note that the
7 * complete EMAN2 and SPARX software packages have some GPL dependencies,
8 * so you are responsible for compliance with the licenses of these packages
9 * if you opt to use BSD licensing. The warranty disclaimer below holds
10 * in either instance.
11 *
12 * This complete copyright notice must be included in any revised version of the
13 * source code. Additional authorship citations may be added, but existing
14 * author citations must be preserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *
30 * */
31
32#ifndef eman_processor_template_h__
33#define eman_processor_template_h__ 1
34
35#include "processor.h"
36#include "emdata.h"
37
38namespace EMAN
39{
40
49 {
50 public:
51 void process_inplace(EMData * image);
52
53 string get_name() const
54 {
55 return NAME;
56 }
57
58 static Processor *NEW()
59 {
60 return new XYZProcessor();
61 }
62
63 string get_desc() const
64 {
65 return "add your documentation here.";
66 }
67
77 {
78 TypeDict d;
79 d.put("value1", EMObject::INT);
80 d.put("value2", EMObject::FLOAT);
81 return d;
82 }
83
84 static const string NAME;
85 };
86
87
88// class SubstituteZeroPixelsProcessor:public Processor
89// {
90// public:
91// void process_inplace(EMData * image);
92//
93// string get_name() const
94// {
95// return "substitute.zeropixels";
96// }
97//
98// static Processor *NEW()
99// {
100// return new SubstituteZeroPixelsProcessor();
101// }
102//
103// string get_desc() const
104// {
105// return "Replaces zero pixels in the image with corresponding (coordinate-wise) pixel values in the EMData object specified in the parameters.";
106// }
107//
108// TypeDict get_param_types() const
109// {
110// TypeDict d;
111// d.put("image", EMObject::EMDATA, "EMData object that contains useful image data");
112// return d;
113// }
114// };
115
118// class FilterFactoryExt
119// {
120// public:
121// FilterFactoryExt()
122// {
123// Factory < Processor >::add<XYZProcessor>();
125// }
126// };
127//
128// static FilterFactoryExt filter_factory_ext;
129
130}
131
132
133#endif //eman_processor_template_h__
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
Typical usage of Processors are as follows:
Definition: processor.h:90
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330
XYZProcessor is a processor template for defining new processors.
string get_name() const
Get the processor's name.
static Processor * NEW()
static const string NAME
string get_desc() const
Get the descrition of this specific processor.
TypeDict get_param_types() const
Add your processor parameter names and types in get_param_types().
void process_inplace(EMData *image)
define your Processor operation
E2Exception class.
Definition: aligner.h:40