EMAN2
fundamentals.h
Go to the documentation of this file.
00001 
00005 /*
00006  * Author: Pawel A.Penczek, 09/09/2006 (Pawel.A.Penczek@uth.tmc.edu)
00007  * Copyright (c) 2000-2006 The University of Texas - Houston Medical School
00008  *
00009  * This software is issued under a joint BSD/GNU license. You may use the
00010  * source code in this file under either license. However, note that the
00011  * complete EMAN2 and SPARX software packages have some GPL dependencies,
00012  * so you are responsible for compliance with the licenses of these packages
00013  * if you opt to use BSD licensing. The warranty disclaimer below holds
00014  * in either instance.
00015  *
00016  * This complete copyright notice must be included in any revised version of the
00017  * source code. Additional authorship citations may be added, but existing
00018  * author citations must be preserved.
00019  *
00020  * This program is free software; you can redistribute it and/or modify
00021  * it under the terms of the GNU General Public License as published by
00022  * the Free Software Foundation; either version 2 of the License, or
00023  * (at your option) any later version.
00024  *
00025  * This program is distributed in the hope that it will be useful,
00026  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00027  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00028  * GNU General Public License for more details.
00029  *
00030  * You should have received a copy of the GNU General Public License
00031  * along with this program; if not, write to the Free Software
00032  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00033  *
00034  */
00035 
00036 #ifndef eman_fundamentals_h
00037 #define eman_fundamentals_h
00038 
00039 #include <cstddef>
00040 
00041 
00056 namespace EMAN
00057 {
00058         class EMData;
00066         enum fp_flag {
00067                 CIRCULANT = 1,
00068                 CIRCULANT_NORMALIZED = 2,
00069                 PADDED = 3,
00070                 PADDED_NORMALIZED = 4,
00071                 PADDED_LAG = 5,
00072                 PADDED_NORMALIZED_LAG = 6
00073         };
00074 
00075         // You probably don't need to use these next two directly.
00076         enum fp_type {
00077                 CORRELATION,
00078                 CONVOLUTION,
00079                 SELF_CORRELATION,
00080                 AUTOCORRELATION
00081         };
00082 
00103         EMData* fourierproduct(EMData* f, EMData* g, fp_flag myflag,
00104                         fp_type mytype, bool center);
00123         inline EMData* correlation(EMData* f, EMData* g, fp_flag myflag, bool center) {
00124                 return fourierproduct(f, g, myflag, CORRELATION, center);
00125         }
00144         inline EMData* convolution(EMData* f, EMData* g, fp_flag myflag, bool center) {
00145                 return fourierproduct(f, g, myflag, CONVOLUTION, center);
00146         }
00160         EMData* rsconvolution(EMData* f, EMData* K);
00170         EMData* rscp(EMData* f);
00187         inline EMData* autocorrelation(EMData* f, fp_flag myflag, bool center) {
00188                 return fourierproduct(f, NULL, myflag, AUTOCORRELATION, center);
00189         }
00206         inline EMData* self_correlation(EMData* f, fp_flag myflag, bool center) {
00207                 return fourierproduct(f, NULL, myflag, SELF_CORRELATION, center);
00208         }
00225         EMData* periodogram(EMData* f);
00226 
00227         enum kernel_shape {
00228                 BLOCK = 1,
00229                 CIRCULAR = 2,
00230                 CROSS = 3
00231         };
00232 
00233         EMData* filt_median_(EMData* f, int nxk, int nyk, int nzk, kernel_shape myshape);
00254         enum morph_type {
00255                 BINARY = 1,
00256                 GRAYLEVEL = 2
00257         };
00258 
00259         EMData* filt_dilation_(EMData* f, EMData* K, morph_type mydilation);
00276         EMData* filt_erosion_(EMData* f, EMData* K, morph_type myerosion);
00292 }
00293 
00294 
00295 #endif // eman_fundamentals_h
00296 
00297 /* vim: set ts=4 noet: */