EMAN2
processor.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.edge
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_h__
33#define eman_processor_h__ 1
34
35#include "emobject.h"
36#include "util.h"
37#include "geometry.h"
38#include "transform.h"
39#include "emdata.h"
40#include "gorgon/skeletonizer.h"
41
42#include <cfloat>
43#include <climits>
44#include <cstring>
45
46using std::vector;
47using std::map;
48using std::string;
49
50namespace EMAN
51{
52 class EMData;
53
90 {
91 public:
92 virtual ~ Processor()
93 {
94 }
95
101 virtual void process_inplace(EMData *image) = 0;
102
109 virtual EMData* process(const EMData * const image);
110
114 virtual void process_list_inplace(vector < EMData * > & images)
115 {
116 for (size_t i = 0; i < images.size(); i++) {
118 }
119 }
120
124 virtual string get_name() const = 0;
125
129 virtual Dict get_params() const
130 {
131 return params;
132 }
133
137 virtual void set_params(const Dict & new_params)
138 {
139 params = new_params;
140 }
141
148 virtual TypeDict get_param_types() const
149 {
150 return TypeDict();
151 }
152
159 static string get_group_desc()
160 {
161 return "EMAN processors are in-place image processors. You may apply a processor to process a single image or process multiple images. Processor class is the base class for all processor. <br> \
162The basic design of EMAN Processors: <br>\
163 1) Each Processor class defines an image-processinging algorithm. <br>\
164 2) All the Processor classes in EMAN are managed by a Factory pattern. So each Processor class must define: <br> a) a unique name to idenfity itself in the factory. <br>b) a static method to register itself in the factory.<br>\
165 3) Each Processor class defines its own parameter set.<br>\
166 4) Each Processor class defines functions to return its documentation including parameter information, and processor description. These functions enable EMAN to generate processor manuals dynamically.";
167 }
168
174 virtual string get_desc() const = 0;
175
206 };
207
232 static void
234 bool doInPlace = true;
235 EMFourierFilterFunc(fimage, params, doInPlace);
236 }
237
263 static EMData*
265 bool doInPlace = false;
266 return EMFourierFilterFunc(fimage, params, doInPlace);
267 }
268
269 private:
305 static EMData*
306 EMFourierFilterFunc(EMData* fimage, Dict params, bool doInPlace=true);
307
308 protected:
309 mutable Dict params;
310 };
311
313 {
314 public:
315 void process_inplace(EMData * image);
316
317 static string get_group_desc()
318 {
319 return "An Image Processor defines a way to create a processor image. The processor image is used to multiply the input-image in the fourier space. ImageFilter class is the base class. Each specific ImageFilter class must define function create_processor_image(). ";
320 }
321
322 protected:
323 virtual EMData * create_processor_image() const = 0;
324 };
325
333 {
334 public:
335 void process_inplace(EMData * image);
336
337 static string get_group_desc()
338 {
339 return "Fourier Filter processors are a group of processor in the frequency domain. Before using such processors on an image, the image must be transformed from real space to the fourier space. FourierProcessor class is the base class of fourier space processors. Each specific processor is either a lowpass filter processor, or a highpass filter processor, or neighter. The unit of lowpass and highpass parameters are in terms of Nyquist, valid range is [0,0.5]. ";
340 }
341
343 {
344 TypeDict d;
345 d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
346 d.put("cutoff_pixels", EMObject::FLOAT, " Width in Fourier pixels (0 - size()/2)");
347 d.put("cutoff_freq", EMObject::FLOAT, "1/Resolution in 1/A (0 - 1 / 2*apix). eg - a 20 A filter is cutoff_freq=0.05");
348 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
349 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
350 return d;
351 }
352
353 protected:
354 virtual void preprocess(EMData *image) {
355 if(params.has_key("apix")) {
356 image->set_attr("apix_x", (float)params["apix"]);
357 image->set_attr("apix_y", (float)params["apix"]);
358 image->set_attr("apix_z", (float)params["apix"]);
359 }
360
361 const Dict dict = image->get_attr_dict();
362 if( params.has_key("sigma")) {
363 params["cutoff_abs"] = (float)params["sigma"];
364 }
365 else if( params.has_key("cutoff_abs") ) {
366 params["sigma"] = (float)params["cutoff_abs"];
367 }
368 else if( params.has_key("cutoff_freq") ) {
369 float val = (float)params["cutoff_freq"] * (float)dict["apix_x"];
370 params["cutoff_abs"] = val;
371 params["sigma"] = val;
372 }
373 else if( params.has_key("cutoff_pixels") ) {
374 float val = ((float)params["cutoff_pixels"] / (float)dict["nx"]);
375 params["cutoff_abs"] = val;
376 params["sigma"] = val;
377 }
378
379 }
380 virtual void create_radial_func(vector < float >&radial_mask) const = 0;
381 };
382
391 {
392 public:
393 void process_inplace(EMData * image);
394
395 static string get_group_desc()
396 {
397 return "Fourier Filter processors are a group of processor in the frequency domain. Before using such processors on an image, the image must be transformed from real space to the fourier space. FourierProcessor class is the base class of fourier space processors. Each specific processor is either a lowpass filter processor, or a highpass filter processor, or neighter. The unit of lowpass and highpass parameters are in terms of Nyquist, valid range is [0,0.5]. ";
398 }
399
401 {
402 TypeDict d;
403 d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
404 d.put("cutoff_pixels", EMObject::FLOAT, " Width in Fourier pixels (0 - size()/2)");
405 d.put("cutoff_freq", EMObject::FLOAT, "1/Resolution in 1/A (0 - 1 / 2*apix). eg - a 20 A filter is cutoff_freq=0.05");
406 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
407 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
408 d.put("interpolate", EMObject::BOOL, "Whether or not to interpolate the radial scaling function. Default=false. Prb should be true.");
409 return d;
410 }
411
412 protected:
413 virtual void preprocess(EMData *) {}
414 virtual void create_radial_func(vector < float >&radial_mask,EMData *image) const = 0;
415 };
416
422 {
423 public:
424 void process_inplace(EMData * image);
425
426 string get_name() const
427 {
428 return NAME;
429 }
430
431 static Processor *NEW()
432 {
433 return new AzSharpProcessor();
434 }
435
436 string get_desc() const
437 {
438 return "Typical linear filters are radial, but certain operations can lead to inhomogeneities so the balance between radial and azimuthal power is off. This processor permits enhancing or suppressing azimuthal contrast in Fourier space.";
439 }
440
442 {
443 TypeDict d;
444 d.put("az_scale", EMObject::FLOAT, "Scale factor, >1 enhances contrast <1 decreases");
445 return d;
446 }
447
448 static const string NAME;
449
450 };
451
452
456 {
457 public:
458 string get_name() const
459 {
460 return NAME;
461 }
462
463 void process_inplace(EMData * image);
464
465 void set_params(const Dict & new_params)
466 {
467 params = new_params;
468// sum = params["sum"];
469// dosqrt = params["sqrt"];
470// printf("%s %f\n",params.keys()[0].c_str(),lowpass);
471 }
472
474 {
475 TypeDict d;
476// d.put("sum", EMObject::EMDATA, "Adds the weights to sum for normalization");
477// d.put("sqrt", EMObject::INT, "Weights using sqrt of the amplitude if set");
478 return d;
479 }
480
481 static Processor *NEW()
482 {
483 return new SNREvalProcessor();
484 }
485
486 string get_desc() const
487 {
488 return "Evaluates the SNR of the particle using a masking method similar to that used in the CTF analysis process. The image is not changed. The resulting value is placed in the particle dictionary as eval_maskedsnr";
489 }
490
491 static const string NAME;
492
493 protected:
496 };
497
501 {
502 public:
503 string get_name() const
504 {
505 return NAME;
506 }
507
508 void process_inplace(EMData * image);
509
510 void set_params(const Dict & new_params)
511 {
512 params = new_params;
513 }
514
516 {
517 TypeDict d;
518 d.put("x", EMObject::INT, "If set, zeroes along X axis. Default True.");
519 d.put("y", EMObject::INT, "If set, zeroes along Y axis. Default True.");
520 d.put("neighbor", EMObject::INT, "If set, interpolates neighbor values rather than zeroing");
521 d.put("neighbornorm", EMObject::INT, "In neighbor mode it sums the neighboring 2 (complex) pixels, then divides by this factor. default = sqrt(2), which is good for very noisy images");
522 return d;
523 }
524
525 static Processor *NEW()
526 {
527 return new Axis0FourierProcessor();
528 }
529
530 string get_desc() const
531 {
532 return "Sets values along X/Y Fourier axes to 0, except origin";
533 }
534
535 static const string NAME;
536
537 protected:
538 };
539
543 {
544 public:
545 string get_name() const
546 {
547 return NAME;
548 }
549
550 void process_inplace(EMData * image);
551
552 void set_params(const Dict & new_params)
553 {
554 params = new_params;
555 }
556
558 {
559 TypeDict d;
560 d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
561 d.put("cutoff_pixels", EMObject::FLOAT, " Width in Fourier pixels (0 - size()/2)");
562 d.put("cutoff_freq", EMObject::FLOAT, "1/Resolution in 1/A (0 - 1 / 2*apix). eg - a 20 A filter is cutoff_freq=0.05");
563 d.put("hppix", EMObject::FLOAT, "If specified will also apply a high pass filter with the specified radius in pixels");
564 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
565 d.put("centerfreq", EMObject::FLOAT, "center of filter frequency at z");
566 d.put("xynoz", EMObject::INT, "If set, filters the X-Y plane instead of Z");
567 return d;
568 }
569
570 static Processor *NEW()
571 {
572 return new GaussZFourierProcessor();
573 }
574
575 string get_desc() const
576 {
577 return "Applies a Gaussian lowpass filter (or its inverse), but only along the Z axis (or X-Y). May be useful in anisotropic filtering of tomograms.";
578 }
579
580 static const string NAME;
581
582 protected:
583 };
584
585
586
592 {
593 public:
594 string get_name() const
595 {
596 return NAME;
597 }
598
599 void process_inplace(EMData * image);
600
601 void set_params(const Dict & new_params)
602 {
603 params = new_params;
604 sum = params["sum"];
605 dosqrt = params["sqrt"];
606// printf("%s %f\n",params.keys()[0].c_str(),lowpass);
607 }
608
610 {
611 TypeDict d;
612 d.put("sum", EMObject::EMDATA, "Adds the weights to sum for normalization");
613 d.put("sqrt", EMObject::INT, "Weights using sqrt of the amplitude if set");
614 return d;
615 }
616
617 static Processor *NEW()
618 {
619 return new AmpweightFourierProcessor();
620 }
621
622 string get_desc() const
623 {
624 return "Multiplies each Fourier pixel by its amplitude";
625 }
626
627 static const string NAME;
628
629 protected:
632 };
640 {
641 public:
643
644 string get_name() const
645 {
646 return NAME;
647 }
648
649 void process_inplace(EMData *image);
650
651 static Processor *NEW()
652 {
653 return new ConvolutionProcessor();
654 }
655
656 string get_desc() const
657 {
658 return "Performs Fourier space convolution. Maintains the space that the image is in - i.e. if image is real, the result is real and vice versa.";
659 }
660
662 {
663 TypeDict d;
664 d.put("with", EMObject::EMDATA, "The image that will convolute the other image");
665 return d;
666 }
667
668 static const string NAME;
669 };
670
682 {
683 public:
685
686 string get_name() const
687 {
688 return NAME;
689 }
690
691 void process_inplace(EMData *image) { throw InvalidCallException("inplace not supported"); }
692
693 virtual EMData* process(const EMData* const image);
694
695 static Processor *NEW()
696 {
697 return new HarmonicProcessor();
698 }
699
700 string get_desc() const
701 {
702 return "Computes invariants including relative phase in harmonic series";
703 }
704
706 {
707 TypeDict d;
708 d.put("hn", EMObject::INT, "Computes a single translational invariant for the nth harmonic, 1 is a normal power spectrum");
709 d.put("rn", EMObject::INT, "Computes a single rot/trans invariant for the nth rotational harmonic, requires hn to be non zero");
710 d.put("rfp", EMObject::INT, "Returns a non square 2-D image with translational invariants, y=radial, x=aziumth. Used for rotational alignment.");
711 d.put("fp", EMObject::INT, "Returns a non-square 2-D image containing n harmonics for each R&T component. R&T invariant. Min 2, default 4");
712// d.put("fb", EMObject::INT, "Fourier Bessel");
713 d.put("size", EMObject::INT, "If specified, will determine the number of rotational samples in the bispectrum. If not set, a size is selected automatically");
714 return d;
715 }
716
717 static const string NAME;
718 };
719
720
735 {
736 public:
738
739 string get_name() const
740 {
741 return NAME;
742 }
743
744 void process_inplace(EMData *image) { throw InvalidCallException("inplace not supported"); }
745
746 virtual EMData* process(const EMData* const image);
747
748 static Processor *NEW()
749 {
750 return new BispecSliceProcessor();
751 }
752
753 string get_desc() const
754 {
755 return "Computes a 2-D slice of the 4-D bispectrum of a 2-D image. Returns zero outside of source image. Input may be real or complex, but output is always complex. kx,ky OR jkx,jky OR k OR fp OR ffp";
756 }
757
759 {
760 TypeDict d;
761 d.put("kx", EMObject::INT, "Kx location of the slice in Fourier pixels");
762 d.put("ky", EMObject::INT, "Ky location of the slice in Fourier pixels");
763 d.put("jkx", EMObject::INT, "Jx+Kx location of the slice in Fourier pixels");
764 d.put("jky", EMObject::INT, "Jy+Ky location of the slice in Fourier pixels");
765 d.put("k", EMObject::FLOAT, "Radius of slice in Fourier pixels, integrates over angle.");
766 d.put("prbk", EMObject::FLOAT, "Radius of slice in Fourier pixels, integrates over angle.");
767 d.put("prbkv2", EMObject::FLOAT, "Radius of slice in Fourier pixels, integrates over angle. k>|q+k|>q");
768 d.put("prb3D", EMObject::FLOAT, "Radius of maximum slic. Returns volume, integrates over angle. k>|q+k|>q");
769 d.put("rfp", EMObject::INT, "Returns a non square 2-D image containing translatinal invariants organized such that X=azimuth. Used for rotational alignment.");
770 d.put("fp", EMObject::INT, "Returns a non-square 2-D image containing n rotationally integrated planes. R&T invariant.");
771 d.put("ffp", EMObject::INT, "Returns a 3-D volume containing n rotationally integrated planes. R&T invariant. This is normally further processed with CTF info to produce fp equivalent.");
772 d.put("size", EMObject::INT, "If specified, will determine the size (x/y) of the real-space bispectrum image. If not set, a size is selected automatically");
773 return d;
774 }
775
776 static const string NAME;
777 };
778
786 {
787 public:
789
790 string get_name() const
791 {
792 return NAME;
793 }
794
795 virtual void process_inplace(EMData *image);
796
797 virtual EMData* process(const EMData* const image);
798
799 static Processor *NEW()
800 {
801 return new EnhanceProcessor();
802 }
803
804 string get_desc() const
805 {
806 return "Visual enhancement filter useful for localizing particles. Results not designed for reconstruction.";
807 }
808
810 {
811 TypeDict d;
812// d.put("kx", EMObject::INT, "Kx location of the slice in Fourier pixels");
813// d.put("ky", EMObject::INT, "Ky location of the slice in Fourier pixels");
814// d.put("jkx", EMObject::INT, "Jx+Kx location of the slice in Fourier pixels");
815// d.put("jky", EMObject::INT, "Jy+Ky location of the slice in Fourier pixels");
816// d.put("k", EMObject::FLOAT, "Radius of slice in Fourier pixels, integrates over angle.");
817// d.put("rfp", EMObject::INT, "Returns a non square 2-D image containing rotational invariants organized such that X=azimuth. Used for rotational alignment.");
818// d.put("fp", EMObject::INT, "Returns a non-square 2-D image containing n rotationally integrated planes. R&T invariant.");
819// d.put("ffp", EMObject::INT, "Returns a 3-D volume containing n rotationally integrated planes. R&T invariant. This is normally further processed with CTF info to produce fp equivalent.");
820// d.put("size", EMObject::INT, "If specified, will determine the size (x/y) of the real-space bispectrum image. If not set, a size is selected automatically");
821 return d;
822 }
823
824 static const string NAME;
825 };
826
836 {
837 public:
839
840 string get_name() const
841 {
842 return NAME;
843 }
844
845 void process_inplace(EMData *image) { throw InvalidCallException("inplace operation not supported"); }
846
847 virtual EMData* process(const EMData* const image);
848
849 static Processor *NEW()
850 {
851 return new MaskPackProcessor();
852 }
853
854 string get_desc() const
855 {
856 return "Given a mask, will return a 1-D image containing values from the original image inside the mask. If unpack is set, then the inverse operation is performed.";
857 }
858
860 {
861 TypeDict d;
862 d.put("unpack", EMObject::INT, "If set, image should be 1-D and return will match the dimensions of the mask");
863 d.put("mask", EMObject::EMDATA, "The mask indicating which pixels to extract. Required");
864 return d;
865 }
866
867 static const string NAME;
868 };
869
870
878 {
879 public:
881
882 string get_name() const
883 {
884 return NAME;
885 }
886
887 void process_inplace(EMData *image);
888
889 static Processor *NEW()
890 {
891 return new XGradientProcessor();
892 }
893
894 string get_desc() const
895 {
896 return "Determines the image gradient in the x direction";
897 }
898
900 {
901 TypeDict d;
902 return d;
903 }
904
905 static const string NAME;
906 };
907
909 {
910 public:
912
913 string get_name() const
914 {
915 return NAME;
916 }
917
918 void process_inplace(EMData *image);
919
920 static Processor *NEW()
921 {
922 return new YGradientProcessor();
923 }
924
925 string get_desc() const
926 {
927 return "Determines the image gradient in the y direction";
928 }
929
930
932 {
933 TypeDict d;
934 return d;
935 }
936
937 static const string NAME;
938 };
939
941 {
942 public:
944
945 string get_name() const
946 {
947 return NAME;
948 }
949
950 void process_inplace(EMData *image);
951
952 static Processor *NEW()
953 {
954 return new ZGradientProcessor();
955 }
956
957 string get_desc() const
958 {
959 return "Determines the image gradient in the z direction";
960 }
961
963 {
964 TypeDict d;
965 return d;
966 }
967
968 static const string NAME;
969 };
970
977 {
978 public:
980
981 string get_name() const
982 {
983 return NAME;
984 }
985
986 void process_inplace(EMData *image);
987
988 static Processor *NEW()
989 {
990 return new ImageDivergenceProcessor();
991 }
992
993 string get_desc() const
994 {
995 return "Determines the divergence of a 2D image.";
996 }
997
999 {
1000 TypeDict d;
1001 return d;
1002 }
1003
1004 static const string NAME;
1005 };
1006
1013 {
1014 public:
1016
1017 string get_name() const
1018 {
1019 return NAME;
1020 }
1021
1022 void process_inplace(EMData *image);
1023
1024 static Processor *NEW()
1025 {
1026 return new GradientMagnitudeProcessor();
1027 }
1028
1029 string get_desc() const
1030 {
1031 return "Determines the magnitude of the gradient of a 2D image.";
1032 }
1033
1035 {
1036 TypeDict d;
1037 return d;
1038 }
1039
1040 static const string NAME;
1041 };
1042
1049 {
1050 public:
1052
1053 string get_name() const
1054 {
1055 return NAME;
1056 }
1057
1058 void process_inplace(EMData *image);
1059
1060 static Processor *NEW()
1061 {
1062 return new GradientDirectionProcessor();
1063 }
1064
1065 string get_desc() const
1066 {
1067 return "Determines the direction of the gradient of a 2D image.";
1068 }
1069
1071 {
1072 TypeDict d;
1073 return d;
1074 }
1075
1076 static const string NAME;
1077 };
1078
1085 {
1086 public:
1088
1089 string get_name() const
1090 {
1091 return NAME;
1092 }
1093
1094 void process_inplace(EMData *image);
1095
1096 static Processor *NEW()
1097 {
1098 return new LaplacianMagnitudeProcessor();
1099 }
1100
1101 string get_desc() const
1102 {
1103 return "Determines the magnitude of the laplacian of a 2D image.";
1104 }
1105
1107 {
1108 TypeDict d;
1109 return d;
1110 }
1111
1112 static const string NAME;
1113 };
1114
1121 {
1122 public:
1124
1125 string get_name() const
1126 {
1127 return NAME;
1128 }
1129
1130 void process_inplace(EMData *image);
1131
1132 static Processor *NEW()
1133 {
1134 return new LaplacianDirectionProcessor();
1135 }
1136
1137 string get_desc() const
1138 {
1139 return "Determines the direction of the laplacian of a 2D image.";
1140 }
1141
1143 {
1144 TypeDict d;
1145 return d;
1146 }
1147
1148 static const string NAME;
1149 };
1150
1157 {
1158 public:
1160
1161 string get_name() const
1162 {
1163 return NAME;
1164 }
1165
1166 void process_inplace(EMData *image);
1167
1168 static Processor *NEW()
1169 {
1170 return new SDGDProcessor();
1171 }
1172
1173 string get_desc() const
1174 {
1175 return "Determines the second derivative of a 2D image in the gradient direction.";
1176 }
1177
1179 {
1180 TypeDict d;
1181 return d;
1182 }
1183
1184 static const string NAME;
1185 };
1186
1194 {
1195 public:
1197
1198 string get_name() const
1199 {
1200 return NAME;
1201 }
1202
1203 virtual EMData* process(const EMData * const image);
1204
1205 void process_inplace(EMData * image);
1206
1207 static Processor *NEW()
1208 {
1209 return new ManhattanDistanceProcessor();
1210 }
1211
1212 string get_desc() const
1213 {
1214 return "Sets pixel values in a binary image equal to their element wise manhattan distance.";
1215 }
1216
1218 {
1219 TypeDict d;
1220 //d.put("threshold", EMObject::FLOAT,"Only considers densities above the threshold");
1221 return d;
1222 }
1223
1224 static const string NAME;
1225 };
1226
1227
1234 {
1235 public:
1237
1238 string get_name() const
1239 {
1240 return NAME;
1241 }
1242
1243 virtual EMData* process(const EMData * const image);
1244
1245 void process_inplace(EMData *image);
1246
1247 static Processor *NEW()
1248 {
1249 return new BinaryDilationProcessor();
1250 }
1251
1252 string get_desc() const
1253 {
1254 return "Performs a morphological dilation of a (binary) image.";
1255 }
1256
1258 {
1259 TypeDict d;
1260 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1261 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1262 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1263 return d;
1264 }
1265
1266 static const string NAME;
1267 };
1268
1275 {
1276 public:
1278
1279 string get_name() const
1280 {
1281 return NAME;
1282 }
1283
1284 virtual EMData* process(const EMData * const image);
1285
1286 void process_inplace(EMData *image);
1287
1288 static Processor *NEW()
1289 {
1290 return new BinaryErosionProcessor();
1291 }
1292
1293 string get_desc() const
1294 {
1295 return "Performs a morphological k-pixel erosion of a (binary) image.";
1296 }
1297
1299 {
1300 TypeDict d;
1301 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1302 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1303 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1304 return d;
1305 }
1306
1307 static const string NAME;
1308 };
1309
1310
1317 {
1318 public:
1320
1321 string get_name() const
1322 {
1323 return NAME;
1324 }
1325
1326 virtual EMData* process(const EMData * const image);
1327
1328 void process_inplace(EMData *image);
1329
1330 static Processor *NEW()
1331 {
1332 return new BinaryClosingProcessor();
1333 }
1334
1335 string get_desc() const
1336 {
1337 return "Performs a morphological k-pixel closing of a (binary) image/volume. Note the box must be large enough to accommodate the dilation to work properly. iter(dilate) -> iter(erode)";
1338 }
1339
1341 {
1342 TypeDict d;
1343 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1344 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1345 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1346 return d;
1347 }
1348
1349 static const string NAME;
1350 };
1351
1352
1359 {
1360 public:
1362
1363 string get_name() const
1364 {
1365 return NAME;
1366 }
1367
1368 virtual EMData* process(const EMData * const image);
1369
1370 void process_inplace(EMData *image);
1371
1372 static Processor *NEW()
1373 {
1374 return new BinaryOpeningProcessor();
1375 }
1376
1377 string get_desc() const
1378 {
1379 return "Performs a morphological k-pixel opening of a (binary) image/volume. iter(erode) -> iter(dilate)";
1380 }
1381
1383 {
1384 TypeDict d;
1385 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1386 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1387 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1388 return d;
1389 }
1390
1391 static const string NAME;
1392 };
1393
1394
1401 {
1402 public:
1404
1405 string get_name() const
1406 {
1407 return NAME;
1408 }
1409
1410 virtual EMData* process(const EMData * const image);
1411
1412 void process_inplace(EMData *image);
1413
1414 static Processor *NEW()
1415 {
1417 }
1418
1419 string get_desc() const
1420 {
1421 return "Computes an internal morphological graduent using k-pixel-width operations on a (binary) image.";
1422 }
1423
1425 {
1426 TypeDict d;
1427 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1428 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1429 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1430 return d;
1431 }
1432
1433 static const string NAME;
1434 };
1435
1436
1443 {
1444 public:
1446
1447 string get_name() const
1448 {
1449 return NAME;
1450 }
1451
1452 virtual EMData* process(const EMData * const image);
1453
1454 void process_inplace(EMData *image);
1455
1456 static Processor *NEW()
1457 {
1459 }
1460
1461 string get_desc() const
1462 {
1463 return "Computes an external morphological graduent using k-pixel-width operations on a (binary) image.";
1464 }
1465
1467 {
1468 TypeDict d;
1469 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1470 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1471 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1472 return d;
1473 }
1474
1475 static const string NAME;
1476 };
1477
1478
1485 {
1486 public:
1488
1489 string get_name() const
1490 {
1491 return NAME;
1492 }
1493
1494 virtual EMData* process(const EMData * const image);
1495
1496 void process_inplace(EMData *image);
1497
1498 static Processor *NEW()
1499 {
1500 return new BinaryMorphGradientProcessor();
1501 }
1502
1503 string get_desc() const
1504 {
1505 return "Computes the morphological graduent using k-pixel-width operations on a (binary) image.";
1506 }
1507
1509 {
1510 TypeDict d;
1511 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1512 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1513 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1514 return d;
1515 }
1516
1517 static const string NAME;
1518 };
1519
1520
1527 {
1528 public:
1530
1531 string get_name() const
1532 {
1533 return NAME;
1534 }
1535
1536 virtual EMData* process(const EMData * const image);
1537
1538 void process_inplace(EMData *image);
1539
1540 static Processor *NEW()
1541 {
1542 return new BinaryTopHatProcessor();
1543 }
1544
1545 string get_desc() const
1546 {
1547 return "Performs a morphological top hat operation on a (binary) image.";
1548 }
1549
1551 {
1552 TypeDict d;
1553 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1554 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1555 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1556 return d;
1557 }
1558
1559 static const string NAME;
1560 };
1561
1562
1569 {
1570 public:
1572
1573 string get_name() const
1574 {
1575 return NAME;
1576 }
1577
1578 virtual EMData* process(const EMData * const image);
1579
1580 void process_inplace(EMData *image);
1581
1582 static Processor *NEW()
1583 {
1584 return new BinaryBlackHatProcessor();
1585 }
1586
1587 string get_desc() const
1588 {
1589 return "Performs a morphological black hat operation on a (binary) image.";
1590 }
1591
1593 {
1594 TypeDict d;
1595 d.put("radius", EMObject::INT, "The number of pixels (radius) to dilate the input image.");
1596 d.put("iters",EMObject::INT, "The number of times to apply this process to the input image.");
1597 d.put("thresh", EMObject::FLOAT,"Only considers densities above the threshold");
1598 return d;
1599 }
1600
1601 static const string NAME;
1602 };
1603
1613 {
1614 public:
1615 string get_name() const
1616 {
1617 return NAME;
1618 }
1619
1620 virtual EMData* process(const EMData * const image);
1621
1622 void process_inplace(EMData *image);
1623
1624 void set_params(const Dict & new_params)
1625 {
1626 params = new_params;
1627 bgsize = params["size"];
1628// printf("%s %f\n",params.keys()[0].c_str(),lowpass);
1629 }
1630
1632 {
1633 TypeDict d;
1634 d.put("size", EMObject::INT, "Size in pixels of the boxes to chop the image into");
1635 return d;
1636 }
1637
1638 static Processor *NEW()
1639 {
1640 return new Wiener2DAutoAreaProcessor();
1641 }
1642
1643 string get_desc() const
1644 {
1645 return "Automatically detrmines the background for the image then uses this to perform Wiener filters on overlapping subregions of the image, which are then combined using linear interpolation";
1646 }
1647
1648 static const string NAME;
1649
1650 protected:
1652 };
1653
1661 {
1662 public:
1663 string get_name() const
1664 {
1665 return NAME;
1666 }
1667
1668 virtual EMData* process(const EMData * const image);
1669 void process_inplace( EMData * image);
1670
1672 {
1673 TypeDict d ;
1674 d.put("minratio",EMObject::FLOAT,"The ratio of the smallest amplitude segment to locate relative to the strongest peak (default=0.5)");
1675 d.put("maxnseg",EMObject::INT,"Maximum number of segments to return (default = unlimited)");
1676 d.put("width",EMObject::FLOAT,"Required: full width of Gaussians in A at 1/e (FWHM). Also used to determine map prefiltration.");
1677 d.put("mask",EMObject::EMDATA,"Optional: mask to apply to map after filtration to limit where centers are placed");
1678 d.put("skipseg",EMObject::INT,"Normally the returned map is a segmentation map, but this is unnecessary if only the center coordinates are needed. If 1, the returned map will be a residual volume, not a segmentation map. If 2, it will be the filtered map before segmentation");
1679 d.put("verbose",EMObject::INT,"Be verbose while running");
1680 return d;
1681 }
1682
1683 static Processor *NEW()
1684 {
1685 return new GaussSegmentProcessor();
1686 }
1687
1688 string get_desc() const
1689 {
1690 return "Segments a volume by sequentially finding and subtracting Gaussians at a specified resolvability.";
1691 }
1692
1693 static const string NAME;
1694
1695 };
1696
1704 {
1705 public:
1706 string get_name() const
1707 {
1708 return NAME;
1709 }
1710
1711 virtual EMData* process(const EMData * const image);
1712 void process_inplace( EMData * image);
1713
1715 {
1716 TypeDict d ;
1717 d.put("thr",EMObject::FLOAT,"Optional : Isosurface threshold value. Pixels below this will not be segment centers (default = 0.9)");
1718 d.put("minsegsep",EMObject::FLOAT,"Required: Minimum segment separation in pixels. Segments too close will trigger a reseed");
1719 d.put("maxsegsep",EMObject::FLOAT,"Required: Maximum segment separation in pixels. Segments too close will trigger a reseed");
1720 d.put("verbose",EMObject::INT,"Be verbose while running");
1721 return d;
1722 }
1723
1724 static Processor *NEW()
1725 {
1726 return new DistanceSegmentProcessor();
1727 }
1728
1729 string get_desc() const
1730 {
1731 return "Segments a volume into pieces separated by distances in the specified range.";
1732 }
1733
1734 static const string NAME;
1735
1736 };
1737
1745 {
1746 public:
1747 string get_name() const
1748 {
1749 return NAME;
1750 }
1751
1752 virtual EMData* process(const EMData * const image);
1753 void process_inplace( EMData * image);
1754
1756 {
1757 TypeDict d ;
1758 d.put("nseg", EMObject::INT, "Number of segments to divide the image into. default=12" );
1759 d.put("thr",EMObject::FLOAT,"Isosurface threshold value. Pixels below this will not be segmented");
1760 d.put("ampweight",EMObject::INT,"If set, will weight centers by voxel amplitude. default = 1");
1761 d.put("maxsegsize",EMObject::FLOAT,"Maximum radial distance from segment center to member voxel. Default=10000");
1762 d.put("minsegsep",EMObject::FLOAT,"Minimum segment separation. Segments too close will trigger a reseed");
1763 d.put("maxiter",EMObject::FLOAT,"Maximum number of iterations to run before stopping. Default=100");
1764 d.put("maxvoxmove",EMObject::FLOAT,"Maximum number of voxels that can move before quitting. Default=25");
1765 d.put("verbose",EMObject::INT,"Be verbose while running");
1771 d.put("pseudoatom",EMObject::BOOL,"Doing pseudoatom generation");
1772 d.put("sep",EMObject::FLOAT,"Separation distance, used only in pseudoatom generation. Default=3.78");
1773 return d;
1774 }
1775
1776 static Processor *NEW()
1777 {
1778 return new KmeansSegmentProcessor();
1779 }
1780
1781 string get_desc() const
1782 {
1783 return "Performs K-means segmentation on a volume. Note that this method uses random seeds, and thus will return different results each time it is run. Returned map contains number of segment for each voxel (or 0 for unsegmented voxels). Segmentation centers are stored in 'segmentcenters' attribute, consisting of a list of 3n floats in x,y,z triples.";
1784 }
1785
1786 static const string NAME;
1787
1788 };
1789
1790
1805 {
1806 public:
1807 string get_name() const
1808 {
1809 return NAME;
1810 }
1811
1812 virtual EMData* process(const EMData * const image);
1813
1814 void process_inplace(EMData *image);
1815
1817 {
1818 TypeDict d;
1819 d.put("purectf", EMObject::BOOL, "If set, replaces image with simulated CTF instead of multiplying image by CTF");
1820 d.put("defocus", EMObject::FLOAT, "Defocus in microns (underfocus positive)");
1821 d.put("ampcont", EMObject::FLOAT, "% amplitude contrast (0-100)");
1822 d.put("bfactor", EMObject::FLOAT, "B-factor in A^2, uses MRC convention rather than EMAN1 convention");
1823 d.put("noiseamp", EMObject::FLOAT, "Amplitude of the added empirical pink noise");
1824// d.put("noiseampwhite", EMObject::FLOAT, "Amplitude of added white noise");
1825 d.put("voltage", EMObject::FLOAT, "Microscope voltage in KV");
1826 d.put("cs", EMObject::FLOAT, "Cs of microscope in mm");
1827 d.put("apix", EMObject::FLOAT, "A/pix of data");
1828 d.put("phaseflip", EMObject::INT, "If not true, applies fabs(CTF). default true");
1829 d.put("bispectrumfp", EMObject::INT, "If set, the input must be the result of math.bispectrum.slice ffp= mode. Returns something comparable to fp=mode.");
1830 return d;
1831 }
1832
1833 static Processor *NEW()
1834 {
1835 return new CtfSimProcessor();
1836 }
1837
1838 string get_desc() const
1839 {
1840 return "Applies a simulated CTF with noise to an image. Astigmatism is always zero. The added noise is either white or based on an empirical curve generated from cryoEM data. ";
1841 }
1842
1843 static const string NAME;
1844
1845// protected:
1846 };
1847
1848
1856 {
1857 public:
1858 string get_name() const
1859 {
1860 return NAME;
1861 }
1862
1863 virtual EMData* process(const EMData * const image);
1864
1865 void process_inplace(EMData *image);
1866
1867 void set_params(const Dict & new_params)
1868 {
1869 params = new_params;
1870 ctf = params["ctf"];
1871// printf("%s %f\n",params.keys()[0].c_str(),lowpass);
1872 }
1873
1875 {
1876 TypeDict d;
1877 d.put("ctf", EMObject::EMDATA, "Ctf object to use for Wiener filter parameters");
1878 return d;
1879 }
1880
1881 static Processor *NEW()
1882 {
1883 return new Wiener2DFourierProcessor();
1884 }
1885
1886 string get_desc() const
1887 {
1888 return "Applies a 2-D Wiener filter to an image based on its Ctf parameters";
1889 }
1890
1891 static const string NAME;
1892
1893 protected:
1895 };
1896
1898 {
1899 public:
1900 virtual string get_name() const
1901 {
1902 return NAME;
1903 }
1904
1905 virtual string get_desc() const
1906 {
1907 return "";
1908 }
1909
1910 static Processor *NEW()
1911 {
1912 return new LinearRampFourierProcessor();
1913 }
1914
1915 static const string NAME;
1916
1917 protected:
1918 virtual void create_radial_func(vector < float >&radial_mask) const ;
1919 };
1920
1921
1925 {
1926 public:
1927 string get_name() const
1928 { return NAME; }
1929 static Processor *NEW() { return new LowpassRandomPhaseProcessor(); }
1930 string get_desc() const
1931 {
1932 return "Above the cutoff frequency, phases will be completely randomized, but amplitudes will be unchanged. Used for testing for noise bias. If you can reconstruct information that isn't there, then you have noise bias problems.";
1933 }
1934 void process_inplace(EMData * image);
1935 void create_radial_func(vector < float >&radial_mask) const;
1936
1937 static const string NAME;
1938 };
1939
1940
1944 {
1945 public:
1946 string get_name() const
1947 {
1948 return NAME;
1949 }
1950
1951 static Processor *NEW()
1952 {
1953 return new LowpassAutoBProcessor();
1954 }
1955
1956 string get_desc() const
1957 {
1958 return "This processor sharpens a map based on the concept that the power spectrum should be roughly flat over the ~15 A-Nyquist resolution range, then combines this inverse B-factor with the specified low-pass Gaussian filter parameters to produce a single aggregate Gaussian filter.";
1959 }
1960
1961 static const string NAME;
1962
1964 {
1966 d.put("bfactor", EMObject::FLOAT, "B-factor in terms of e^-(B s^2/4)");
1967 d.put("noisecutoff", EMObject::FLOAT, "Spatial frequency past which inverse-B will not be applied, default=1/6A");
1968// d.put("adaptnoise", EMObject::INT, "Dual linear fit separating lower resolution signal from higher resolution noise. Noise region not upweighted.");
1969 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
1970 d.put("verbose", EMObject::INT, "Print information about the determined B-factor");
1971 return d;
1972 }
1973
1974 protected:
1975 virtual void preprocess(EMData * image) {
1976 if(params.has_key("apix")) {
1977 image->set_attr("apix_x", (float)params["apix"]);
1978 image->set_attr("apix_y", (float)params["apix"]);
1979 image->set_attr("apix_z", (float)params["apix"]);
1980 }
1981 float apix=(float)image->get_attr("apix_x");
1982 params["bfactor"] = pow(apix/(float)params["cutoff_abs"],0.0f);
1983
1984 const Dict dict = image->get_attr_dict();
1985 if (params.has_key("cutoff_abs")) {
1986 params["bfactor"] = pow(apix/(float)params["cutoff_abs"],2.0f);
1987 }
1988 else if( params.has_key("cutoff_freq") ) {
1989 float val = (float)params["cutoff_freq"] * apix;
1990 params["cutoff_abs"] = val;
1991 params["bfactor"] = pow(apix/(float)params["cutoff_abs"],2.0f);
1992 }
1993 else if( params.has_key("cutoff_pixels") ) {
1994 float val = (float)params["cutoff_pixels"] / (float)dict["nx"];
1995 params["cutoff_abs"] = val;
1996 params["bfactor"] = pow(apix/(float)params["cutoff_abs"],2.0f);
1997 }
1998 }
1999
2000 void create_radial_func(vector < float >&radial_mask,EMData *image) const;
2001 };
2002
2006 {
2007 public:
2008 string get_name() const
2009 {
2010 return NAME;
2011 }
2012 static Processor *NEW()
2013 {
2014 return new HighpassAutoPeakProcessor();
2015 }
2016
2017 string get_desc() const
2018 {
2019 return "Attempts to automatically remove the low resolution peak present in virtually all cryoEM data.";
2020 }
2021
2022 static const string NAME;
2023
2024 protected:
2025 void create_radial_func(vector < float >&radial_mask, EMData *image) const;
2026 virtual void preprocess(EMData * image);
2028 };
2029
2035 {
2036 public:
2038 {
2039 }
2040
2041 string get_name() const
2042 {
2043 return NAME;
2044 }
2045 static Processor *NEW()
2046 {
2047 return new LinearRampProcessor();
2048 }
2049
2050 string get_desc() const
2051 {
2052 return "processor radial function: f(x) = slope * x + intercept;";
2053 }
2054
2055 void set_params(const Dict & new_params)
2056 {
2057 params = new_params;
2058 intercept = params["intercept"];
2059 slope = params["slope"];
2060 }
2061
2063 {
2064 TypeDict d;
2065 d.put("intercept", EMObject::FLOAT, "intercept in 'f(x) = slope * x + intercept'");
2066 d.put("slope", EMObject::FLOAT, "slope in 'f(x) = slope * x + intercept'");
2067 return d;
2068 }
2069
2070 static const string NAME;
2071
2072 protected:
2073 void create_radial_func(vector < float >&radial_mask) const;
2074
2075 private:
2077 float slope;
2078 };
2079
2084 {
2085 public:
2087 {
2088 }
2089
2090 string get_name() const
2091 {
2092 return NAME;
2093 }
2094 static Processor *NEW()
2095 {
2096 return new LoGFourierProcessor();
2097 }
2098
2099 string get_desc() const
2100 {
2101 return "processor radial function: f(x) = ((x^2 - s^2)/s^4)e^-(x^2/2s^2)";
2102 }
2103
2104 void set_params(const Dict & new_params)
2105 {
2106 params = new_params;
2107 sigma = params["sigma"];
2108 }
2109
2111 {
2112 TypeDict d;
2113 d.put("sigma", EMObject::FLOAT, "LoG sigma");
2114 return d;
2115 }
2116
2117 static const string NAME;
2118
2119 protected:
2120 void create_radial_func(vector < float >&radial_mask) const;
2121
2122 private:
2123 float sigma;
2124 };
2125
2131 {
2132 public:
2134 {
2135 }
2136
2137 string get_name() const
2138 {
2139 return NAME;
2140 }
2141 static Processor *NEW()
2142 {
2143 return new DoGFourierProcessor();
2144 }
2145
2146 string get_desc() const
2147 {
2148 return "processor radial function: f(x) = 1/sqrt(2*pi)*[1/sigma1*exp-(x^2/2*sigma1^2) - 1/sigma2*exp-(x^2/2*sigma2^2)]";
2149 }
2150
2151 void set_params(const Dict & new_params)
2152 {
2153 params = new_params;
2154 sigma1 = params["sigma1"];
2155 sigma2 = params["sigma2"];
2156 }
2157
2159 {
2160 TypeDict d;
2161 d.put("sigma1", EMObject::FLOAT, "DoG sigma1");
2162 d.put("sigma2", EMObject::FLOAT, "DoG sigma2");
2163 return d;
2164 }
2165
2166 static const string NAME;
2167
2168 protected:
2169 void create_radial_func(vector < float >&radial_mask) const;
2170
2171 private:
2172 float sigma1;
2173 float sigma2;
2174 };
2175
2179 {
2180 public:
2182 {
2183 }
2184 void process_inplace(EMData * image);
2185
2186 virtual void set_params(const Dict & new_params)
2187 {
2188 params = new_params;
2189 if (params.size() == 1) {
2190 vector < EMObject > dict_values = params.values();
2191 value = dict_values[0];
2192 }
2193 }
2194
2195 static string get_group_desc()
2196 {
2197 return "The base class for real space processor working on individual pixels. The processor won't consider the pixel's coordinates and neighbors.";
2198 }
2199
2200 protected:
2201 virtual void process_pixel(float *x) const = 0;
2202 virtual void calc_locals(EMData *)
2203 {
2204 }
2205 virtual void normalize(EMData *) const
2206 {
2207 }
2208
2209 float value;
2210 float maxval;
2211 float mean;
2212 float sigma;
2213 };
2214
2219 {
2220 public:
2221 string get_name() const
2222 {
2223 return NAME;
2224 }
2225 static Processor *NEW()
2226 {
2227 return new CCCSNRProcessor();
2228 }
2229
2231 {
2232 TypeDict d;
2233 d.put("wiener", EMObject::INT, "If set, returns Wiener image, default returns SNR");
2234 d.put("scalesnr", EMObject::FLOAT, "Scales SSNR by provided value prior to return or use in Wiener calculation. Default 2 (compensates for FSC on 1/2 volumes)");
2235 return d;
2236 }
2237
2238 string get_desc() const
2239 {
2240 return "Converts an image containing normalized CCC values to SNR or Wiener filter values. scalesnr defaults to 2, which\
2241 uses the SNR of the average of the two half-image volumes. ie - if scalesnr is 2: SNR = 2*FSC/(1-FSC)";
2242 }
2243
2244 void process_inplace(EMData * image);
2245
2246 static const string NAME;
2247
2248 };
2249
2250
2254 {
2255 public:
2256 string get_name() const
2257 {
2258 return NAME;
2259 }
2260 static Processor *NEW()
2261 {
2262 return new AbsoluteValueProcessor();
2263 }
2264
2265 static const string NAME;
2266
2267 protected:
2268 void process_pixel(float *x) const
2269 {
2270 *x = fabs(*x);
2271 }
2272
2273 string get_desc() const
2274 {
2275 return "f(x) = |x|";
2276 }
2277 };
2278
2282 {
2283 public:
2284 string get_name() const
2285 {
2286 return NAME;
2287 }
2288 static Processor *NEW()
2289 {
2290 return new FloorValueProcessor();
2291 }
2292
2293 static const string NAME;
2294
2295 protected:
2296 void process_pixel(float *x) const
2297 {
2298 *x = floor(*x);
2299 }
2300
2301 string get_desc() const
2302 {
2303 return "f(x) = floor(x)";
2304 }
2305 };
2306
2310 {
2311 public:
2312 string get_name() const
2313 {
2314 return NAME;
2315 }
2316 static Processor *NEW()
2317 {
2318 return new FixSignProcessor();
2319 }
2320
2321 static const string NAME;
2322
2323 void set_params(const Dict & new_params)
2324 {
2325 params = new_params;
2326 if (params.set_default("byte_stou",0)) mode=1;
2327 else if (params.set_default("byte_utos",1)) mode=2;
2328 else mode=0;
2329 }
2330
2332 {
2333 TypeDict d;
2334 d.put("byte_stou", EMObject::BOOL, "8 bit data signed read -> unsigned");
2335 d.put("byte_utos", EMObject::BOOL, "8 bit data unsigned read -> signed");
2336 return d;
2337 }
2338
2339 protected:
2340 void process_pixel(float *x) const
2341 {
2342 switch (mode) {
2343 case 1:
2344 if (*x<0) *x+=256;
2345 break;
2346 case 2:
2347 if (*x>127) *x-=256;
2348 break;
2349 }
2350
2351 }
2352
2353 string get_desc() const
2354 {
2355 return "Fixes errors with reading signed/unsigned data. Need to specify the correct mode.";
2356 }
2357
2358 int mode;
2359 };
2360
2361
2365 {
2366 public:
2367 string get_name() const
2368 {
2369 return NAME;
2370 }
2371 static Processor *NEW()
2372 {
2373 return new BooleanProcessor();
2374 }
2375
2376 string get_desc() const
2377 {
2378 return "f(x) = 0 if x = 0; f(x) = 1 if x != 0;";
2379 }
2380
2381 static const string NAME;
2382
2383 protected:
2384 void process_pixel(float *x) const
2385 {
2386 if (*x != 0)
2387 {
2388 *x = 1.0;
2389 }
2390 }
2391 };
2392
2397 {
2398 public:
2399 string get_name() const
2400 {
2401 return NAME;
2402 }
2403 static Processor *NEW()
2404 {
2405 return new RecipCarefullyProcessor();
2406 }
2407
2408 void set_params(const Dict & new_params)
2409 {
2410 params = new_params;
2411 zero_to = params.set_default("zero_to",0.0f);
2412 }
2413
2415 {
2416 TypeDict d;
2417 d.put("zero_to", EMObject::FLOAT, "Inverted zero values are set to this value, default is 0.");
2418 return d;
2419 }
2420
2421 string get_desc() const
2422 {
2423 return "if f(x) != 0: f(x) = 1/f(x) else: f(x) = zero_to";
2424 }
2425
2426 static const string NAME;
2427
2428 protected:
2429 void process_pixel(float *x) const
2430 {
2431 if (*x == 0.0) *x = zero_to;
2432 else *x = 1.0f/(*x);
2433 }
2434 private:
2435 float zero_to;
2436 };
2437
2442 {
2443 public:
2444 string get_name() const
2445 {
2446 return NAME;
2447 }
2448 static Processor *NEW()
2449 {
2450 return new ValuePowProcessor();
2451 }
2452
2453 void set_params(const Dict & new_params)
2454 {
2455 params = new_params;
2456 pwr = params["pow"];
2457 }
2458
2460 {
2461 TypeDict d;
2462 d.put("pow", EMObject::FLOAT, "Each pixel is raised to this power");
2463 return d;
2464 }
2465
2466 string get_desc() const
2467 {
2468 return "f(x) = x ^ pow;";
2469 }
2470
2471 static const string NAME;
2472
2473 protected:
2474 void process_pixel(float *x) const
2475 {
2476 if (*x<0 && pwr!=(int)pwr) *x=0;
2477 else (*x) = pow(*x,pwr);
2478 }
2479 private:
2480 float pwr;
2481 };
2482
2486 {
2487 public:
2488 string get_name() const
2489 {
2490 return NAME;
2491 }
2492 static Processor *NEW()
2493 {
2494 return new ValueSquaredProcessor();
2495 }
2496
2497
2498 string get_desc() const
2499 {
2500 return "f(x) = x * x;";
2501 }
2502
2503 static const string NAME;
2504
2505 protected:
2506 void process_pixel(float *x) const
2507 {
2508 (*x) *= (*x);
2509 }
2510 };
2511
2515 {
2516 public:
2517 string get_name() const
2518 {
2519 return NAME;
2520 }
2521 static Processor *NEW()
2522 {
2523 return new ValueSqrtProcessor();
2524 }
2525
2526 string get_desc() const
2527 {
2528 return "f(x) = sqrt(x)";
2529 }
2530
2531 static const string NAME;
2532
2533 protected:
2534 void process_pixel(float *x) const
2535 {
2536 *x = sqrt(*x);
2537 }
2538 };
2539
2540
2542 {
2543 public:
2544 string get_name() const
2545 {
2546 return NAME;
2547 }
2548 static Processor *NEW()
2549 {
2550 return new DiscritizeProcessor();
2551 }
2552
2553 void set_params(const Dict & new_params)
2554 {
2555 params = new_params;
2556 if (params.has_key("center")) center=params["center"];
2557 else center=0.0;
2558 if (params.has_key("step")) center=params["step"];
2559 else step=1.0;
2560 if (step<=0) step=1.0;
2561 }
2562
2564 {
2565 TypeDict d;
2566 d.put("center", EMObject::FLOAT, "Center value from which number of standard deviations is computed (default = 0)");
2567 d.put("step", EMObject::FLOAT, "Stepsize in terms of sigma. ie - 1.5 will discritize to 1.5*sigma steps (default = 1.0)");
2568 return d;
2569 }
2570
2571 string get_desc() const
2572 {
2573 return "Converts each pixel value to the integral number of standard deviations from the specified center. Rounds to the nearest integer, -0.5*sigma<x<0.5*sigma -> 0.0 ";
2574 }
2575
2576 static const string NAME;
2577
2578 protected:
2580
2581 void process_pixel(float *x) const
2582 {
2583 *x = Util::fast_floor((*x-center)/(step*sigma)+0.5)*step;
2584 }
2585 };
2586
2591 {
2592 public:
2593 string get_name() const
2594 {
2595 return NAME;
2596 }
2597 static Processor *NEW()
2598 {
2599 return new ToZeroProcessor();
2600 }
2602 {
2603 TypeDict d;
2604 d.put("minval", EMObject::FLOAT, "Everything below this value is set to zero");
2605 return d;
2606 }
2607
2608 string get_desc() const
2609 {
2610 return "f(x) = x if x >= minval; f(x) = 0 if x < minval.";
2611 }
2612
2613 static const string NAME;
2614
2615 protected:
2616 inline void process_pixel(float *x) const
2617 {
2618 if (*x < value) {
2619 *x = 0;
2620 }
2621 }
2622 };
2623
2628 {
2629 public:
2630 string get_name() const
2631 {
2632 return NAME;
2633 }
2634 static Processor *NEW()
2635 {
2636 return new AboveToZeroProcessor();
2637 }
2639 {
2640 TypeDict d;
2641 d.put("maxval", EMObject::FLOAT, "Everything above this value is set to zero");
2642 return d;
2643 }
2644
2645 string get_desc() const
2646 {
2647 return "f(x) = x if x <= maxval; f(x) = 0 if x > maxval.";
2648 }
2649
2650 static const string NAME;
2651
2652 protected:
2653 inline void process_pixel(float *x) const
2654 {
2655 if (*x > value) {
2656 *x = 0;
2657 }
2658 }
2659 };
2660
2666 {
2667 public:
2669 {
2670 }
2671
2672 string get_name() const
2673 {
2674 return NAME;
2675 }
2676
2677 static Processor *NEW()
2678 {
2679 return new RangeZeroProcessor();
2680 }
2681
2682 virtual void process_inplace(EMData * image);
2683
2684
2686 {
2687 TypeDict d;
2688 d.put("minval", EMObject::FLOAT, "Lower threshold (required)");
2689 d.put("maxval", EMObject::FLOAT, "Upper threshold (required)");
2690 d.put("gauss_width", EMObject::FLOAT, "Range will be narrowed around zero based on a radial Gaussian falloff modeled on math.gausskernelfix. Disabled if set to 0.");
2691 return d;
2692 }
2693
2694 void set_params(const Dict & new_params)
2695 {
2696 params = new_params;
2697 minval = params["minval"]; // using existing variable as a convenience
2698 maxval = params["maxval"];
2699 }
2700
2701 string get_desc() const
2702 {
2703 return "Sets values in a range to zero. Opposite of threshold.clampminmax. \nf(x) = x if x > maxval or x < minval; f(x) = 0 for min <= x <= max. If gauss_width set nozero, applies a radial correction factor to both min and max.";
2704 }
2705
2706 static const string NAME;
2707
2708 protected:
2710 };
2711
2717 {
2718 public:
2719 string get_name() const
2720 {
2721 return NAME;
2722 }
2723
2724 static Processor *NEW()
2725 {
2726 return new AddShapeProcessor();
2727 }
2728
2730
2732 {
2733 TypeDict d;
2734 d.put("shape", EMObject::STRING, "Name of the shape to add (");
2735 d.put("x", EMObject::FLOAT, "X coordinate of object center");
2736 d.put("y", EMObject::FLOAT, "Y coordinate of object center");
2737 d.put("z", EMObject::FLOAT, "Z coordinate of object center");
2738 d.put("size1", EMObject::FLOAT, "Size of the object. Meaning varies by shape.");
2739 d.put("size2", EMObject::FLOAT, "2nd axis size of the object. Meaning varies by shape.");
2740 d.put("size3", EMObject::FLOAT, "3rd axis size of the object. Meaning varies by shape.");
2741 d.put("val1", EMObject::FLOAT, "First pixel value. Meaning varies by shape.");
2742 d.put("val2", EMObject::FLOAT, "2nd pixel value. Meaning varies with shape");
2743
2744 return d;
2745 }
2746
2747 string get_desc() const
2748 {
2749 return "Adds a specified shape to a volume.";
2750 }
2751
2752 static const string NAME;
2753 };
2754
2756 {
2757 public:
2758 string get_name() const
2759 {
2760 return NAME;
2761 }
2762 static Processor *NEW()
2763 {
2764 return new SetBitsProcessor();
2765 }
2766
2767 void process_inplace(EMData *image);
2768
2770 {
2771 TypeDict d;
2772 d.put("bits", EMObject::INT, "Number of bits to retain (default 5)");
2773 d.put("nsigma", EMObject::FLOAT, "Number of standard deviations to include in the n bit mapping. eg - max=min(mean+nsigma*sigma,max)");
2774 d.put("floatbits", EMObject::INT, "If set to a >0 number, alters the algorithm, so the specified number of significant floating point bits is retained. The floating point exponent is not modified. This will produce less compressible data, but the values will be less perturbed.");
2775 return d;
2776 }
2777
2778 string get_desc() const
2779 {
2780 return "Converts each pixel value to an integer using the specified number of total bits. This will make the data more compressible, and allows you to handle conversion to integer data modes.\
2781The data itself will remain stored in single precision floating point format, so using >23 bits would be a bad idea.";
2782 }
2783
2784 static const string NAME;
2785
2786 };
2787
2788
2795 {
2796 public:
2797 string get_name() const
2798 {
2799 return NAME;
2800 }
2801 static Processor *NEW()
2802 {
2803 return new Rotate180Processor();
2804 }
2805
2809 void process_inplace(EMData* image);
2810
2811 string get_desc() const
2812 {
2813 return "The 2D image is rotated by 180 degree by carefully swapping image pixel values. No explicit matrix multiplication is performed. If image dimensions are even will change pixels along x=0 and y=0. Works for all combinations of even and oddness.";
2814 }
2815
2816 static const string NAME;
2817 };
2818
2826 {
2827 public:
2828 virtual string get_name() const
2829 {
2830 return NAME;
2831 }
2832 static Processor *NEW()
2833 {
2834 return new TransformProcessor();
2835 }
2836
2841 virtual void process_inplace(EMData* image);
2842
2847 virtual EMData* process(const EMData* const image);
2848
2850 {
2851 TypeDict d;
2852 d.put("transform", EMObject::TRANSFORM, "The Transform object that will be applied to the image" );
2853 d.put("alpha", EMObject::FLOAT, "2-D alpha angle" );
2854 d.put("az", EMObject::FLOAT, "3-D Azimuth" );
2855 d.put("alt", EMObject::FLOAT, "3-D Altitude" );
2856 d.put("phi", EMObject::FLOAT, "3-D Phi" );
2857 d.put("tx", EMObject::FLOAT, "x translation" );
2858 d.put("ty", EMObject::FLOAT, "y translation" );
2859 d.put("tz", EMObject::FLOAT, "y translation" );
2860 d.put("zerocorners",EMObject::INT,"If set, corners (anything beyond radius/2-1) may be zeroed out in real or Fourier space. This will produce a considerable speedup in Fourier rotations. ");
2861 return d;
2862 }
2863
2864 virtual string get_desc() const
2865 {
2866 return "The image is transformed using transform parameter, or alternatively specific numbers alpha,tx,ty or az,alt,phi,tx,ty,tz (shortcut for convenience)";
2867 }
2868
2869 static const string NAME;
2870
2871 float* transform(const EMData* const image, const Transform& t) const;
2872 private:
2873 // This function became redundant if favor of EMData::scale_pixel
2874 //void update_emdata_attributes(EMData* const image, const Dict& attr_dict, const float& scale) const;
2875
2876
2877 void assert_valid_aspect(const EMData* const image) const;
2878 };
2879
2888 {
2889 public:
2890 virtual string get_name() const
2891 {
2892 return NAME;
2893 }
2894
2895 static Processor *NEW()
2896 {
2897 return new IntTranslateProcessor();
2898 }
2899
2904 virtual void process_inplace(EMData* image);
2905
2910 virtual EMData* process(const EMData* const image);
2911
2913 {
2914 TypeDict d;
2915 d.put("trans", EMObject::INTARRAY, "The displacement array, can be length 1-3" );
2916 return d;
2917 }
2918
2919 virtual string get_desc() const
2920 {
2921 return "The image is translated an integer amount";
2922 }
2923
2924 static const string NAME;
2925
2926 private:
2930 void assert_valid_aspect(const vector<int>& translation, const EMData* const image) const;
2931
2937 Region get_clip_region(vector<int>& translation, const EMData* const image) const;
2938 };
2939
2946 {
2947 public:
2948 virtual string get_name() const
2949 {
2950 return NAME;
2951 }
2952
2953 static Processor *NEW()
2954 {
2955 return new ApplySymProcessor();
2956 }
2957
2958 virtual void process_inplace(EMData* image);
2959
2960 virtual EMData* process(const EMData* const image);
2961
2963 {
2964 TypeDict d;
2965 d.put("sym", EMObject::STRING, "The symmetry under which to do the alignment, Default=c1" );
2966 d.put("averager", EMObject::STRING, "Name of an Averager to use. default=mean" );
2967 return d;
2968 }
2969
2970 virtual string get_desc() const
2971 {
2972 return "Symmetry is imposed on a 2-D image (Cn only) or 3-D volume";
2973 }
2974
2975 static const string NAME;
2976
2977 };
2978
2986 {
2987 public:
2988 virtual string get_name() const
2989 {
2990 return NAME;
2991 }
2992 static Processor *NEW()
2993 {
2994 return new ScaleTransformProcessor();
2995 }
3000 virtual void process_inplace(EMData* image);
3001
3006 virtual EMData* process(const EMData* const image);
3007
3009 {
3010 TypeDict d;
3011 d.put("scale", EMObject::FLOAT, "The amount by which to scale" );
3012 d.put("clip", EMObject::INT, "The length of each output dimension. Non sophisticated, output dimensions can't be different" );
3015 return d;
3016 }
3017
3018 virtual string get_desc() const
3019 {
3020 return "The image is scaled with the clip variable in mind, being sure to preserve as much pixel information as possible.";
3021 }
3022
3023 static const string NAME;
3024 };
3025
3033 {
3034 public:
3036
3037 string get_name() const
3038 {
3039 return NAME;
3040 }
3041 static Processor *NEW()
3042 {
3043 return new ClampingProcessor();
3044 }
3045
3046 void process_inplace(EMData *image);
3047
3049 {
3050 TypeDict d;
3051 d.put("minval", EMObject::FLOAT, "The pixel values that bounds the smallest pixel value in the output image" );
3052 d.put("maxval", EMObject::FLOAT, "The pixel values that bounds the largest pixel value in the output image" );
3053 d.put("tomean", EMObject::BOOL, "Replace outlying pixels values with the mean pixel value instead" );
3054 d.put("tozero", EMObject::BOOL, "Replace outlying pixels values with zero" );
3055 return d;
3056 }
3057
3058 string get_desc() const
3059 {
3060 return "This function clamps the min and max vals in the image at minval and maxval, respectively. In a sense this a bi-truncation of the data.";
3061 }
3062
3063 static const string NAME;
3064
3065 protected:
3067 };
3068
3075 {
3076 public:
3078
3079 string get_name() const
3080 {
3081 return NAME;
3082 }
3083
3084 static Processor *NEW()
3085 {
3086 return new NSigmaClampingProcessor();
3087 }
3088
3090 {
3091 TypeDict d;
3092 d.put("nsigma", EMObject::FLOAT, "The number (n) of sigmas to clamp min and max vals at, so that the clamped boundaries are mean-n*sigma and mean+n*sigma" );
3093 d.put("tomean", EMObject::BOOL, "Replace outlying pixels values with the mean pixel value instead" );
3094 d.put("tozero", EMObject::BOOL, "Replace outlying pixels values with zero" );
3095 return d;
3096 }
3097
3098 void process_inplace(EMData *image);
3099
3100 string get_desc() const
3101 {
3102 return "This function clamps the min and max vals in the image at minval and maxval at mean-n*sigma and mean+n*sigma, respectively. The parameter specified by the user is n, the default value of n is 2.";
3103 }
3104
3105 static const string NAME;
3106
3107 protected:
3109 };
3110
3115 {
3116 public:
3117 string get_name() const
3118 {
3119 return NAME;
3120 }
3121 static Processor *NEW()
3122 {
3123 return new ToMinvalProcessor();
3124 }
3125
3126 void process_inplace(EMData *image);
3127
3129 {
3130 TypeDict d;
3131 d.put("minval", EMObject::FLOAT, "Everything below this value is set to this value");
3132 d.put("newval", EMObject::FLOAT, "If set, values below minval will be set to newval instead of minval ");
3133 return d;
3134 }
3135
3136 string get_desc() const
3137 {
3138 return "f(x) = x if x >= minval; f(x) = minval|newval if x < minval.";
3139 }
3140
3141 static const string NAME;
3142
3143 protected:
3144
3145 };
3146
3147
3148
3153 {
3154 public:
3155 string get_name() const
3156 {
3157 return NAME;
3158 }
3159 static Processor *NEW()
3160 {
3161 return new CutToZeroProcessor();
3162 }
3164 {
3165 TypeDict d;
3166 d.put("minval", EMObject::FLOAT, "the value that will be set to zero - all values below will also be set to zero. Values above get minval subtracted from them" );
3167 return d;
3168 }
3169
3170 string get_desc() const
3171 {
3172 return "f(x) = x-minval if x >= minval; f(x) = 0 if x < minval.";
3173 }
3174
3175 static const string NAME;
3176
3177 protected:
3178 void process_pixel(float *x) const
3179 {
3180 *x = *x - value;
3181 if (*x < 0) {
3182 *x = 0;
3183 }
3184 }
3185 };
3186
3191 {
3192 public:
3193 string get_name() const
3194 {
3195 return NAME;
3196 }
3197 static Processor *NEW()
3198 {
3199 return new BinarizeProcessor();
3200 }
3202 {
3203 TypeDict d;
3204 d.put("value", EMObject::FLOAT, "The thresholding value. If a pixel value is equal to or above the threshold it is set to 1. If it is below it is set to 0" );
3205 return d;
3206 }
3207
3208 string get_desc() const
3209 {
3210 return "f(x) = 0 if x < value; f(x) = 1 if x >= value.";
3211 }
3212
3213 static const string NAME;
3214
3215 protected:
3216 void process_pixel(float *x) const
3217 {
3218 if (*x < value)
3219 {
3220 *x = 0;
3221 }
3222 else
3223 {
3224 *x = 1;
3225 }
3226 }
3227 };
3228
3237 {
3238 public:
3239 virtual string get_name() const
3240 {
3241 return NAME;
3242 }
3243 static Processor *NEW()
3244 {
3245 return new BinarizeFourierProcessor();
3246 }
3247
3252 virtual void process_inplace(EMData* image);
3253
3255 {
3256 TypeDict d;
3257 d.put("value", EMObject::FLOAT, "The Fourier amplitude threshold cutoff" );
3258 return d;
3259 }
3260
3261 virtual string get_desc() const
3262 {
3263 return "f(k) = 0 + 0i if ||f(k)|| < value; f(k) = a + bi if ||f(k)|| >= value.";
3264 }
3265
3266 static const string NAME;
3267 };
3268
3274 {
3275 public:
3276 string get_name() const
3277 {
3278 return NAME;
3279 }
3280 static Processor *NEW()
3281 {
3282 return new CollapseProcessor();
3283 }
3284
3285 void set_params(const Dict & new_params)
3286 {
3287 params = new_params;
3288 range = params["range"];
3289 value = params["value"];
3290 }
3291
3293 {
3294 TypeDict d;
3295 d.put("range", EMObject::FLOAT, "The range about 'value' which will be collapsed to 'value'");
3296 d.put("value", EMObject::FLOAT, "The pixel value where the focus of the collapse operation is");
3297 d.put("clamponly", EMObject::BOOL, "Leaves values outside the collapse range at their original value, setting pixels in the range to 'value'");
3298 return d;
3299 }
3300
3301 string get_desc() const
3302 {
3303 return "f(x): if v-r<x<v+r -> v; if x>v+r -> x-r; if x<v-r -> x+r";
3304 }
3305
3306 static const string NAME;
3307
3308 protected:
3309 void process_pixel(float *x) const
3310 {
3311 if (*x>value+range) *x-=range;
3312 else if (*x<value-range) *x+=range;
3313 else *x=value;
3314 }
3315 float range;
3316 };
3317
3323 {
3324 public:
3326 {
3327 }
3328
3329 string get_name() const
3330 {
3331 return NAME;
3332 }
3333 static Processor *NEW()
3334 {
3335 return new LinearXformProcessor();
3336 }
3337
3338 void set_params(const Dict & new_params)
3339 {
3340 params = new_params;
3341 shift = params.get("shift");
3342 scale = params.get("scale");
3343 }
3344
3346 {
3347 TypeDict d;
3348 d.put("shift", EMObject::FLOAT, "The amount to shift pixel values by after scaling");
3349 d.put("scale", EMObject::FLOAT, "The scaling factor to be applied to pixel values");
3350 return d;
3351 }
3352
3353 string get_desc() const
3354 {
3355 return "linear transform processor: f(x) = x * scale + shift. This is equivalent to a regular contrast stretching operation";
3356 }
3357
3358 static const string NAME;
3359
3360 protected:
3361 void process_pixel(float *x) const
3362 {
3363 *x = (*x) * scale + shift;
3364 }
3365
3366 private:
3367 float shift;
3368 float scale;
3369 };
3370
3376 {
3377 public:
3379 {
3380 }
3381
3382 string get_name() const
3383 {
3384 return NAME;
3385 }
3386
3387 static Processor *NEW()
3388 {
3389 return new ExpProcessor();
3390 }
3391
3392 void set_params(const Dict & new_params)
3393 {
3394 params = new_params;
3395 low = params.set_default("low",1.0f);
3396 high = params.set_default("high",0.0f);
3397 }
3398
3400 {
3401 TypeDict d;
3402 d.put("low", EMObject::FLOAT, "Pixels are divided by low then high is subtracted prior to the exponential operation, default 1.0");
3403 d.put("high", EMObject::FLOAT, "Pixels are divided by low then high is subtracted prior to the exponential operation, default 0.0");
3404 return d;
3405 }
3406
3407 string get_desc() const
3408 {
3409 return "f(x) = exp( x / low - high)";
3410 }
3411
3412 static const string NAME;
3413
3414 protected:
3418 void process_pixel(float *x) const
3419 {
3420 float v = *x / low - high;
3421 if (v > 40) {
3422 v = 40;
3423 }
3424 *x = exp(v);
3425 }
3426
3427 private:
3428 float low;
3429 float high;
3430 };
3431
3436 {
3437 public:
3439 {
3440 }
3441
3442 string get_name() const
3443 {
3444 return NAME;
3445 }
3446
3447 static Processor *NEW()
3448 {
3449 return new FiniteProcessor();
3450 }
3451
3452 void set_params(const Dict & new_params)
3453 {
3454 if (new_params.has_key("to") )
3455 to = params["to"];
3456 }
3457
3459 {
3460 TypeDict d;
3461 d.put("to", EMObject::FLOAT, "Pixels which are not finite will be set to this value");
3462 return d;
3463 }
3464
3465 string get_desc() const
3466 {
3467 return "f(x) = f(x) if f(x) is finite | to if f(x) is not finite";
3468 }
3469
3470 static const string NAME;
3471
3472 protected:
3476 void process_pixel(float *x) const;
3477 private:
3478 float to;
3479 };
3480
3486 {
3487 public:
3489 {
3490 }
3491
3492 string get_name() const
3493 {
3494 return NAME;
3495 }
3496 static Processor *NEW()
3497 {
3498 return new RangeThresholdProcessor();
3499 }
3500
3501 void set_params(const Dict & new_params)
3502 {
3503 params = new_params;
3504 low = params.get("low");
3505 high = params.get("high");
3506 }
3507
3509 {
3510 TypeDict d;
3511 d.put("low", EMObject::FLOAT, "The lower limit of the range that will be set to 1");
3512 d.put("high", EMObject::FLOAT, "The upper limit of the range that will be set to 1");
3513 return d;
3514 }
3515
3516 string get_desc() const
3517 {
3518 return "Range thresholding. A range of values is set to 1, all else is set to 0. f(x) = 1 if (low <= x <= high); else f(x) = 0";
3519 }
3520
3521 static const string NAME;
3522
3523 protected:
3524 void process_pixel(float *x) const
3525 {
3526 if (*x >= low && *x <= high) {
3527 *x = 1;
3528 }
3529 else {
3530 *x = 0;
3531 }
3532 }
3533 private:
3534 float low;
3535 float high;
3536
3537 };
3538
3544 {
3545 public:
3546 string get_name() const
3547 {
3548 return NAME;
3549 }
3550 static Processor *NEW()
3551 {
3552 return new SigmaProcessor();
3553 }
3554
3555 void set_params(const Dict & new_params)
3556 {
3557 params = new_params;
3558 value1 = params.get("value1");
3559 value2 = params.get("value2");
3560 }
3561
3563 {
3564 TypeDict d;
3565 d.put("value1", EMObject::FLOAT, "A number reflecting total standard deviations in the right direction");
3566 d.put("value2", EMObject::FLOAT, "A number reflecting total standard deviations in the left direction");
3567 return d;
3568 }
3569
3570 string get_desc() const
3571 {
3572 return "f(x) = mean if x<(mean-v2*sigma) or x>(mean+v1*sigma); else f(x) = x;";
3573 }
3574
3575 static const string NAME;
3576
3577 protected:
3578 void process_pixel(float *x) const
3579 {
3580 if (*x < (mean - value2 * sigma) || *x > (mean + value1 * sigma))
3581 {
3582 *x = mean;
3583 }
3584 }
3585
3586 private:
3587 float value1;
3588 float value2;
3589 };
3590
3594 {
3595 public:
3596 string get_name() const
3597 {
3598 return NAME;
3599 }
3600 static Processor *NEW()
3601 {
3602 return new LogProcessor();
3603 }
3604
3605 string get_desc() const
3606 {
3607 return "f(x) = log10(x) if x > 0; else f(x) = 0;";
3608 }
3609
3610 static const string NAME;
3611
3612 protected:
3613 void process_pixel(float *x) const
3614 {
3615 if (*x > 0)
3616 {
3617 *x = log10(*x);
3618 }
3619 else
3620 {
3621 *x = 0;
3622 }
3623 }
3624 };
3625
3629 {
3630 public:
3631 CoordinateProcessor():nx(0), ny(0), nz(0), mean(0), sigma(0), maxval(0), is_complex(false)
3632 {
3633 }
3634 void process_inplace(EMData * image);
3635
3636 static string get_group_desc()
3637 {
3638 return "CoordinateProcessor applies processing based on a pixel's value and it coordinates. This is the base class. Specific coordinate processor should implement process_pixel().";
3639 }
3640
3641 protected:
3642 virtual void process_pixel(float *pixel, int xi, int yi, int zi) const = 0;
3643 virtual void calc_locals(EMData *)
3644 {
3645 }
3646 virtual bool is_valid() const
3647 {
3648 return true;
3649 }
3650
3651 int nx;
3652 int ny;
3653 int nz;
3654 float mean;
3655 float sigma;
3656 float maxval;
3657
3659 };
3660
3668 {
3669 public:
3670
3671 void process_inplace(EMData * image);
3672
3673 static Processor *NEW()
3674 {
3675 return new MaskAzProcessor();
3676 }
3677
3678 string get_name() const
3679 {
3680 return NAME;
3681 }
3682
3683 static const string NAME;
3684
3685 string get_desc() const
3686 {
3687 return "Masks out an angular arc in circular/cylindrical coordinates with a sharp edge.";
3688 }
3689
3691 {
3692 TypeDict d;
3693
3694 d.put("phicen", EMObject::FLOAT,"Angle in degrees ccw from the x-axis. Center of the region to NOT set to zero.");
3695 d.put("phirange", EMObject::FLOAT,"Angle in degrees. Region phicen+-phirange will not be zeroed");
3696 d.put("phitrirange", EMObject::FLOAT,"Angle in degrees. With phitriangle, width outside phirange to fall from 1 to 0.");
3697 d.put("phitriangle", EMObject::BOOL, "If set mask will fall from 1 at phicen+-phirange to 0 at +-phitrirange");
3698 d.put("cx", EMObject::FLOAT,"Mask X center. Default nx/2");
3699 d.put("cy", EMObject::FLOAT,"Mask Y center. Default ny/2");
3700 d.put("zmin", EMObject::FLOAT,"Minimum Z to include");
3701 d.put("zmax", EMObject::FLOAT,"Maximum Z to include");
3702 d.put("ztriangle", EMObject::FLOAT,"1/2 width in pixels of linear falloff in Z margin. Centered on specified zmin/zmax.");
3703 d.put("inner_radius", EMObject::INT, "inner mask radius. optional. Default 0");
3704 d.put("outer_radius", EMObject::INT, "outer mask radius. optional. Default nx+ny. Negative value -> box radius + outer_radius +1");
3705
3706 return d;
3707 }
3708 protected:
3709
3710
3711 };
3712
3721 {
3722 public:
3724 outer_radius_square(0), dx(0), dy(0), dz(0), xc(0), yc(0), zc(0)
3725 {
3726 }
3727
3728 void set_params(const Dict & new_params)
3729 {
3730 params = new_params;
3731
3732 if (params.has_key("inner_radius")) {
3733 inner_radius = params["inner_radius"];
3735 }
3736 else {
3737 inner_radius = -1;
3739 }
3740
3741 if (params.has_key("outer_radius")) {
3742 outer_radius = params["outer_radius"];
3744 }
3745 else {
3746 outer_radius = INT_MAX;
3747 outer_radius_square = INT_MAX;
3748 }
3749
3750 if (params.has_key("dx")) dx = params["dx"];
3751 if (params.has_key("dy")) dy = params["dy"];
3752 if (params.has_key("dz")) dz = params["dz"];
3753 }
3754
3755 string get_desc() const
3756 {
3757 return "CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circular mask processors.Its subclass must implement process_dist_pixel().";
3758 }
3759
3761 {
3762 TypeDict d;
3763
3764 d.put("inner_radius", EMObject::FLOAT, "inner mask radius. optional");
3765 d.put("outer_radius", EMObject::FLOAT, "outer mask radius. Negative value -> box radius + outer_radius +1");
3766
3767 d.put("dx", EMObject::FLOAT,
3768 "Modify mask center by dx relative to the default center nx/2");
3769 d.put("dy", EMObject::FLOAT,
3770 "Modify mask center by dy relative to the default center ny/2");
3771 d.put("dz", EMObject::FLOAT,
3772 "Modify mask center by dz relative to the default center nz/2");
3773
3774 return d;
3775 }
3776 protected:
3777 void calc_locals(EMData * image);
3778
3779 bool is_valid() const
3780 {
3781 return (!is_complex);
3782 }
3783
3784 void process_pixel(float *pixel, int xi, int yi, int zi) const
3785 {
3786 float dist = (xi - xc) * (xi - xc) + (yi - yc) * (yi - yc) + (zi - zc) * (zi - zc);
3787 process_dist_pixel(pixel, dist);
3788 }
3789
3790 virtual void process_dist_pixel(float *pixel, float dist) const = 0; // note that this function gets the distance SQUARED !
3791
3796 float dx, dy, dz;
3797 float xc, yc, zc;
3798 };
3799
3804 {
3805 public:
3807 {
3808 }
3809
3810 string get_name() const
3811 {
3812 return NAME;
3813 }
3814 static Processor *NEW()
3815 {
3816 return new MaskSharpProcessor();
3817 }
3818
3819 void set_params(const Dict & new_params)
3820 {
3822 value = params.set_default("value",0.0f);
3823 }
3824
3826 {
3828 d.put("value", EMObject::FLOAT, "step cutoff to this value. Default is 0.");
3829 return d;
3830 }
3831
3832 string get_desc() const
3833 {
3834 return "step cutoff to a user-given value in both inner and outer circles.";
3835 }
3836
3837 static const string NAME;
3838
3839 protected:
3840 void process_dist_pixel(float *pixel, float dist) const
3841 {
3842 if (dist >= outer_radius_square || dist < inner_radius_square)
3843 {
3844 *pixel = value;
3845 }
3846 }
3847
3848 float value;
3849 };
3850
3855 {
3856 public:
3858 {
3859 }
3860
3861 string get_name() const
3862 {
3863 return NAME;
3864 }
3865 static Processor *NEW()
3866 {
3867 return new MaskSoftProcessor();
3868 }
3869
3870 void set_params(const Dict & new_params)
3871 {
3873 value = params.set_default("value",0.0f);
3874 width = params.set_default("width",4.0f);
3875 }
3876
3878 {
3880 d.put("value", EMObject::FLOAT, "cutoff to this value. default=0");
3881 d.put("width", EMObject::FLOAT, "1/e width of Gaussian falloff (both inner and outer) in pixels. default=4");
3882 return d;
3883 }
3884
3885 string get_desc() const
3886 {
3887 return "Outer (optionally also inner) mask to a user-provided value with a soft Gaussian edge.";
3888 }
3889
3890 static const string NAME;
3891
3892 protected:
3893 void process_dist_pixel(float *pixel, float dist) const
3894 {
3895 if (dist>=inner_radius_square && dist<=outer_radius_square) return;
3896
3897 if (dist<inner_radius_square) *pixel=value+(*pixel-value)*exp(-pow((inner_radius-sqrt(dist))/width,2.0f));
3898 else *pixel=value+(*pixel-value)*exp(-pow((sqrt(dist)-outer_radius)/width,2.0f));
3899 }
3900
3902 };
3903
3908 { // 6
3909 public:
3910 string get_name() const
3911 {
3912 return NAME;
3913 }
3914 static Processor *NEW()
3915 {
3916 return new MaskEdgeMeanProcessor();
3917 }
3918
3919 void set_params(const Dict & new_params)
3920 {
3922 ring_width = params["ring_width"];
3923 if (ring_width == 0) {
3924 ring_width = 1;
3925 }
3926 }
3927
3929 {
3931 d.put("ring_width", EMObject::INT, "The width of the mask ring.");
3932 return d;
3933 }
3934
3935 string get_desc() const
3936 {
3937 return "A step cutoff to the the mean value in a ring centered on the outer radius";
3938 }
3939
3940 static const string NAME;
3941
3942 protected:
3943 void calc_locals(EMData * image);
3944
3945
3946 void process_dist_pixel(float *pixel, float dist) const
3947 {
3948 if (dist >= outer_radius_square || dist < inner_radius_square){
3949 *pixel = ring_avg;
3950 }
3951 }
3952
3953 private:
3956 };
3957
3961 {
3962 public:
3963 string get_name() const
3964 {
3965 return NAME;
3966 }
3967 static Processor *NEW()
3968 {
3969 return new MaskNoiseProcessor();
3970 }
3971
3972 string get_desc() const
3973 {
3974 return "fills masked region";
3975 }
3976
3977 static const string NAME;
3978
3979 protected:
3980 void process_dist_pixel(float *pixel, float dist) const
3981 {
3982 if (dist >= outer_radius_square || dist < inner_radius_square)
3983 {
3984 *pixel = Util::get_gauss_rand(mean, sigma);
3985 }
3986 }
3987 };
3988
3992 {
3993 public:
3994 string get_name() const
3995 {
3996 return NAME;
3997 }
3998 static Processor *NEW()
3999 {
4000 return new MaskGaussProcessor();
4001 }
4002
4003 void set_params(const Dict & new_params)
4004 {
4006 exponent = params["exponent"];
4007 if (exponent <= 0.0) {
4008 exponent = 2.0;
4009 }
4010 }
4011
4013 {
4015 d.put("exponent", EMObject::FLOAT, "The exponent, f in e^-Bs^f. default 2.0, producing a Gaussian");
4016 return d;
4017 }
4018
4019 string get_desc() const
4020 {
4021 return "a gaussian falloff to zero, radius is the 1/e of the width. If inner_radius>0, then \
4022outer radius specifies width of Gaussian starting at inner_radius rather than total radius.";
4023 }
4024
4025 static const string NAME;
4026
4027 protected:
4029 void process_dist_pixel(float *pixel, float dist) const
4030 {
4031 if (inner_radius_square>0) {
4032 if (dist>inner_radius_square) {
4033 if (exponent==2.0f) (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,2.0f) / outer_radius_square);
4034 else (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,exponent) / pow((float)outer_radius_square,exponent/2.0f));
4035 }
4036 }
4037 else {
4038 if (exponent==2.0f) (*pixel) *= exp(-dist / outer_radius_square);
4039 else (*pixel) *= exp(-pow(dist,exponent/2.0f) / pow((float)outer_radius_square,exponent/2.0f));
4040 }
4041 }
4042 };
4043
4051 {
4052 public:
4054 {
4055 }
4056
4057 void set_params(const Dict & new_params)
4058 {
4059 params = new_params;
4060
4061 if (params.has_key("radius_x")) radius_x=params["radius_x"];
4062 else radius_x=5.0;
4063
4064 if (params.has_key("radius_y")) radius_y=params["radius_y"];
4065 else radius_y=5.0;
4066
4067 if (params.has_key("radius_z")) radius_z=params["radius_z"];
4068 else radius_z=5.0;
4069
4070 dx=dy=dz=0.0;
4071 if (params.has_key("dx")) dx=params["dx"];
4072 if (params.has_key("dy")) dy=params["dy"];
4073 if (params.has_key("dz")) dz=params["dz"];
4074
4075 if (params.has_key("gauss_width")) gauss_width=params["gauss_width"];
4076 else gauss_width=0.05f;
4077 }
4078
4080 {
4081 TypeDict d;
4082
4083 d.put("radius_x", EMObject::INT, "x-axis radius");
4084 d.put("radius_y", EMObject::INT, "y-axis radius");
4085 d.put("radius_z", EMObject::INT, "z-axis radius");
4086 d.put("gauss_width", EMObject::FLOAT, "Gaussian falloff width, relative to each radius, default 0.05");
4087
4088 d.put("dx", EMObject::FLOAT,
4089 "Modify mask center by dx relative to the default center nx/2");
4090 d.put("dy", EMObject::FLOAT,
4091 "Modify mask center by dy relative to the default center ny/2");
4092 d.put("dz", EMObject::FLOAT,
4093 "Modify mask center by dz relative to the default center nz/2");
4094
4095
4096 return d;
4097 }
4098
4099 string get_name() const
4100 {
4101 return NAME;
4102 }
4103 static Processor *NEW()
4104 {
4105 return new MaskGaussNonuniformProcessor();
4106 }
4107
4108 string get_desc() const
4109 {
4110 return "A Gaussian falloff to zero. Anisotropic, specify inner radius for x,y,z and Gaussian falloff width. Falloff \
4111width is also anisotropic and relative to the radii, with 1 being equal to the radius on that axis.";
4112 }
4113
4114 static const string NAME;
4115
4116 protected:
4117 void process_pixel(float *pixel, int xi, int yi, int zi) const
4118 {
4119 float dist = pow((xi - (nx/2+dx))/radius_x,2.0f) + pow((yi - (ny/2+dy))/radius_y,2.0f) + pow((zi - (nz/2+dz))/radius_z,2.0f);
4120 if (dist>1.0) (*pixel)*=exp(-pow((sqrt(dist)-1.0f)/gauss_width,2.0f));
4121 }
4122
4124 };
4125
4131 {
4132 public:
4134 {
4135// TypeDict d = CircularMaskProcessor::get_param_types();
4136 TypeDict d;
4137 d.put("gauss_width", EMObject::FLOAT, "Used to calculate the constant factor - gauss_width / (ny*ny)" );
4138// d.put("ring_width", EMObject::INT, "The width of the mask ring.");
4139 return d;
4140 }
4141
4142 string get_name() const
4143 {
4144 return NAME;
4145 }
4146
4147 static Processor *NEW()
4148 {
4149 return new MaskGaussInvProcessor();
4150 }
4151
4152 string get_desc() const
4153 {
4154 return "f(x) = f(x) / exp(-radius*radius * gauss_width / (ny*ny))";
4155 }
4156
4157 static const string NAME;
4158
4159 protected:
4161 {
4162 xc = Util::fast_floor(nx/2.0f) + dx;
4163 yc = Util::fast_floor(ny/2.0f) + dy;
4164 zc = Util::fast_floor(nz/2.0f) + dz;
4165
4166 float gauss_width = params["gauss_width"];
4167 slice_value = gauss_width / (ny * ny);
4168 }
4169
4170 void process_dist_pixel(float *pixel, float dist) const
4171 {
4172 (*pixel) /= exp(-dist * slice_value);
4173 }
4174 private:
4176 };
4177
4183 {
4184 public:
4185 string get_name() const
4186 {
4187 return NAME;
4188 }
4189
4190 void process_inplace(EMData *image);
4191
4192 static Processor *NEW()
4193 {
4194 return new GridKernelFixProcessor();
4195 }
4196
4198 {
4199 TypeDict d;
4200 d.put("mode", EMObject::STRING);
4201 return d;
4202 }
4203
4204 string get_desc() const
4205 {
4206 return "This corrects the real-space effects of using one of the gridding insertion functions on the Fourier reconstructor. Valid options for mode are 'gridding_5' and 'gridding7'.";
4207 }
4208
4209 static const string NAME;
4210 };
4211
4212
4218 {
4219 public:
4220 string get_name() const
4221 {
4222 return NAME;
4223 }
4224
4225 void process_inplace(EMData *image);
4226
4227 static Processor *NEW()
4228 {
4229 return new LinearPyramidProcessor();
4230 }
4231
4233 {
4234 TypeDict d;
4235 d.put("x0", EMObject::FLOAT);
4236 d.put("y0", EMObject::FLOAT);
4237 d.put("z0", EMObject::FLOAT);
4238 d.put("xwidth", EMObject::FLOAT);
4239 d.put("ywidth", EMObject::FLOAT);
4240 d.put("zwidth", EMObject::FLOAT);
4241 return d;
4242 }
4243
4244 string get_desc() const
4245 {
4246 return "Multiplies image by a 'linear pyramid' in 1-3 dimensions. The origin and total base width of the pyramid can be specified. Default is centered with the total image size.";
4247 }
4248
4249 static const string NAME;
4250 };
4251
4252
4256 {
4257 public:
4258 string get_name() const
4259 {
4260 return NAME;
4261 }
4262 static Processor *NEW()
4263 {
4264 return new MakeRadiusSquaredProcessor();
4265 }
4266
4267 string get_desc() const
4268 {
4269 return "overwrites input, f(x) = radius * radius";
4270 }
4271
4272 static const string NAME;
4273
4274 protected:
4275 void process_dist_pixel(float *pixel, float dist) const
4276 {
4277 *pixel = dist;
4278 }
4279 };
4280
4284 {
4285 public:
4286 string get_name() const
4287 {
4288 return NAME;
4289 }
4290 static Processor *NEW()
4291 {
4292 return new MakeRadiusProcessor();
4293 }
4294
4295 string get_desc() const
4296 {
4297 return "overwrites input, f(x) = radius;";
4298 }
4299
4300 static const string NAME;
4301
4302 protected:
4303 void process_dist_pixel(float *pixel, float dist) const
4304 {
4305 *pixel = sqrt(dist);
4306 }
4307 };
4308
4312 {
4313 public:
4314 void process_inplace(EMData * image);
4315
4316 static string get_group_desc()
4317 {
4318 return "The base class for fourier space processor working on individual pixels. ri2ap() is called before processing, so individual pixels will be A/P rather than R/I. The processor won't consider the pixel's coordinates and neighbors.";
4319 }
4320
4321 protected:
4322 virtual void process_pixel(float *x) const = 0;
4323 };
4324
4328 {
4329 public:
4330 string get_name() const
4331 {
4332 return NAME;
4333 }
4334 static Processor *NEW()
4335 {
4336 return new ComplexNormPixel();
4337 }
4338
4339 string get_desc() const
4340 {
4341 return "Each Fourier pixel will be normalized. ie - amp=1, phase=unmodified. Useful for performing phase-residual-like computations with dot products.";
4342 }
4343
4344 static const string NAME;
4345
4346 protected:
4347 void process_pixel(float *x) const
4348 {
4349 *x=1.0;
4350 }
4351 };
4352
4357 {
4358 public:
4359 AreaProcessor():areasize(0), kernel(0), nx(0), ny(0), nz(0)
4360 {
4361 }
4362
4363 void process_inplace(EMData * image);
4364
4365 void set_params(const Dict & new_params)
4366 {
4367 params = new_params;
4368 areasize = params["areasize"];
4369 }
4370
4372 {
4373 TypeDict d;
4374 d.put("areasize", EMObject::INT, "The width of the area to process (not radius)");
4375 return d;
4376 }
4377
4378 string get_desc() const
4379 {
4380 return "AreaProcessor use pixel values and coordinates of a real-space square area. This is the base class. Specific AreaProcessor needs to implement function create_kernel().";
4381 }
4382
4383 protected:
4384 virtual void process_pixel(float *pixel, float, float, float, float *area_matrix) const
4385 {
4386 for (int i = 0; i < matrix_size; i++)
4387 {
4388 *pixel += area_matrix[i] * kernel[i];
4389 }
4390 }
4391
4392 virtual void create_kernel() const = 0;
4393
4396 float *kernel;
4397 int nx;
4398 int ny;
4399 int nz;
4400 };
4401
4405 {
4406 public:
4407 string get_name() const
4408 {
4409 return NAME;
4410 }
4411
4412 void process_inplace(EMData *image);
4413
4414 static Processor *NEW()
4415 {
4416 return new LaplacianProcessor();
4417 }
4418
4419 string get_desc() const
4420 {
4421 return "Discrete approximation to Laplacian. Edge enchancement, but works poorly in the presence of noise. Laplacian processor (x -> d^2/dx^2 + d^2/dy^2 + d^2/dz^2).";
4422 }
4423
4424 static const string NAME;
4425
4426
4427 protected:
4428 void create_kernel() const;
4429
4430 };
4431
4435 {
4436 public:
4437 string get_name() const
4438 {
4439 return NAME;
4440 }
4441 static Processor *NEW()
4442 {
4443 return new ZeroConstantProcessor();
4444 }
4445
4446 string get_desc() const
4447 {
4448 return "Contraction of data, if any nearest neighbor is 0, value -> 0, generally used iteratively";
4449 }
4450
4451 static const string NAME;
4452
4453 protected:
4454 void process_pixel(float *pixel, float, float, float, float *matrix) const
4455 {
4456 if (*pixel != 0)
4457 {
4458 if (*pixel == matrix[1] || *pixel == matrix[3] || *pixel == matrix[5] ||
4459 *pixel == matrix[7] || matrix[1] == 0 || matrix[3] == 0 ||
4460 matrix[5] == 0 || matrix[7] == 0) {
4461 *pixel = 0;
4462 }
4463 }
4464 }
4465
4466 void create_kernel() const
4467 {
4468 }
4469 };
4470
4480 {
4481 public:
4482 virtual void process_inplace(EMData * image);
4483 virtual EMData *process(EMData * image);
4484
4485 static string get_group_desc()
4486 {
4487 return "BoxStatProcessor files are real-space neighborhood processors. These processors compute every output pixel using information from a reduced region on the neighborhood of the input pixel. The classical form are the 3x3 processors. BoxStatProcessors could perform diverse tasks ranging from noise reduction, to differential , to mathematical morphology. BoxStatProcessor class is the base class. Specific BoxStatProcessor needs to define process_pixel(float *pixel, const float *array, int n).";
4488 }
4489
4491 {
4492 TypeDict d;
4493 d.put("radius", EMObject::INT, "The 'radius' of the (square/cube) search box, eg - 1 -> 3x3 box");
4494 d.put("xsize", EMObject::INT, "+- range on X axis, 0 uses the value only, 1 -> -1,0,+1, ...");
4495 d.put("ysize", EMObject::INT, "+- range on Y axis");
4496 d.put("zsize", EMObject::INT, "+- range on Z axis)");
4497 return d;
4498 }
4499
4500 protected:
4501 virtual void process_pixel(float *pixel, const float *array, int n) const = 0;
4502 };
4503
4504
4508 {
4509 public:
4510 string get_name() const
4511 {
4512 return NAME;
4513 }
4514 static Processor *NEW()
4515 {
4516 return new BoxMedianProcessor();
4517 }
4518
4519 string get_desc() const
4520 {
4521 return "A processor for noise reduction. pixel = median of values surrounding pixel.";
4522 }
4523
4524 static const string NAME;
4525
4526 protected:
4527 void process_pixel(float *pixel, const float *array, int n) const
4528 {
4529 float *data = new float[n];
4530 memcpy(data, array, sizeof(float) * n);
4531
4532 for (int i = 0; i <= n / 2; i++)
4533 {
4534 for (int j = i + 1; j < n; j++)
4535 {
4536 if (data[i] < data[j]) {
4537 float t = data[i];
4538 data[i] = data[j];
4539 data[j] = t;
4540 }
4541 }
4542 }
4543
4544 if (n % 2 != 0)
4545 {
4546 *pixel = data[n / 2];
4547 }
4548 else {
4549 *pixel = (data[n / 2] + data[n / 2 - 1]) / 2;
4550 }
4551 if( data )
4552 {
4553 delete[]data;
4554 data = 0;
4555 }
4556 }
4557 };
4558
4562 {
4563 public:
4564 string get_name() const
4565 {
4566 return NAME;
4567 }
4568 static Processor *NEW()
4569 {
4570 return new BoxSigmaProcessor();
4571 }
4572
4573 string get_desc() const
4574 {
4575 return "pixel = standard deviation of values surrounding pixel.";
4576 }
4577
4578 static const string NAME;
4579
4580 protected:
4581 void process_pixel(float *pixel, const float *data, int n) const
4582 {
4583 float sum = 0;
4584 float square_sum = 0;
4585 for (int i = 0; i < n; i++)
4586 {
4587 sum += data[i];
4588 square_sum += data[i] * data[i];
4589 }
4590
4591 float mean = sum / n;
4592 *pixel = sqrt(square_sum / n - mean * mean);
4593 }
4594 };
4595
4599 {
4600 public:
4601 string get_name() const
4602 {
4603 return NAME;
4604 }
4605 static Processor *NEW()
4606 {
4607 return new BoxMaxProcessor();
4608 }
4609
4610 string get_desc() const
4611 {
4612 return "peak processor: pixel = max of values surrounding pixel in a square/cube with specified 1/2 size.";
4613 }
4614
4615 static const string NAME;
4616
4617 protected:
4618 void process_pixel(float *pixel, const float *data, int n) const
4619 {
4620 float maxval = -FLT_MAX;
4621 for (int i = 0; i < n; i++)
4622 {
4623 if (data[i] > maxval) {
4624 maxval = data[i];
4625 }
4626 }
4627 *pixel = maxval;
4628 }
4629 };
4630
4632 {
4633 public:
4634 string get_name() const
4635 {
4636 return NAME;
4637 }
4638 static Processor *NEW()
4639 {
4640 return new LocalMinAbsProcessor();
4641 }
4642
4643 string get_desc() const
4644 {
4645 return "Takes the actual value of the pixel in the local region with the smallest absolute value. This can be used for an effect somewhat like binary erosion with continuous data.";
4646 }
4647
4648 static const string NAME;
4649
4650 protected:
4651 void process_pixel(float *pixel, const float *data, int n) const
4652 {
4653 float minval = FLT_MAX;
4654 for (int i = 0; i < n; i++)
4655 {
4656 if (fabs(data[i]) < fabs(minval)) minval=data[i];
4657 }
4658 *pixel = minval;
4659 }
4660 };
4661
4662
4666 {
4667 public:
4668 string get_name() const
4669 {
4670 return NAME;
4671 }
4672 static Processor *NEW()
4673 {
4674 return new MinusPeakProcessor();
4675 }
4676
4677 string get_desc() const
4678 {
4679 return "peak processor: pixel = pixel - max of values surrounding pixel. This is a sort of positive peak-finding algorithm.";
4680 }
4681
4682 static const string NAME;
4683
4684 protected:
4685 void process_pixel(float *pixel, const float *data, int n) const
4686 {
4687 float maxval = -FLT_MAX;
4688 for (int i = 0; i < n; i++)
4689 {
4690 if (data[i] > maxval) {
4691 maxval = data[i];
4692 }
4693 }
4694 *pixel -= maxval;
4695 }
4696 };
4697
4702 {
4703 public:
4704 string get_name() const
4705 {
4706 return NAME;
4707 }
4708 static Processor *NEW()
4709 {
4710 return new PeakOnlyProcessor();
4711 }
4712 void set_params(const Dict & new_params)
4713 {
4714 params = new_params;
4715 npeaks = params["npeaks"];
4716 if (npeaks == 0) {
4717 npeaks = 1;
4718 }
4719 }
4720
4722 {
4723 TypeDict d;
4724 d.put("npeaks", EMObject::INT, "The number of pixels adjacent to the pixel under consideration which may be higher and still be a valid peak. If 0, finds pure peaks");
4725 d.put("usemean", EMObject::BOOL, "Count all pixels with value higher than the mean of adjacent pixels as peaks. Overwrite npeaks.");
4726 return d;
4727 }
4728
4729 string get_desc() const
4730 {
4731 return "Zeros all pixels with adjacent pixels >= the value being considered. That is, it leaves behind only local maxima.";
4732 }
4733
4734 static const string NAME;
4735
4736 protected:
4737 void process_pixel(float *pixel, const float *data, int n) const
4738 {
4739 if (params["usemean"]){
4740 float mean=0;
4741 for (int i = 0; i < n; i++)
4742 {
4743 mean+=data[i];
4744 }
4745
4746 if (*pixel < mean/float(n))
4747 {
4748 *pixel = 0;
4749 }
4750 }
4751 else{
4752 int r = 0;
4753
4754 for (int i = 0; i < n; i++)
4755 {
4756 if (data[i] >= *pixel) {
4757 r++;
4758 }
4759 }
4760
4761 if (r > npeaks)
4762 {
4763 *pixel = 0;
4764 }
4765 }
4766 }
4767 private:
4769 };
4770
4776 {
4777 public:
4778 void process_inplace(EMData * image);
4779
4780 string get_name() const
4781 {
4782 return NAME;
4783 }
4784 static Processor *NEW()
4785 {
4786 return new DiffBlockProcessor();
4787 }
4788
4789 string get_desc() const
4790 {
4791 return "averages over cal_half_width, then sets the value in a local block";
4792 }
4793
4795 {
4796 TypeDict d;
4797 d.put("cal_half_width", EMObject::FLOAT, "cal_half_width is dx/dy for calculating an average");
4798 d.put("fill_half_width", EMObject::FLOAT, "fill_half_width is dx/dy for fill/step");
4799 return d;
4800 }
4801
4802 static const string NAME;
4803 };
4804
4810 {
4811 public:
4812 void process_inplace(EMData * image);
4813
4814 string get_name() const
4815 {
4816 return NAME;
4817 }
4818 static Processor *NEW()
4819 {
4820 return new CutoffBlockProcessor();
4821 }
4822
4824 {
4825 TypeDict d;
4826 d.put("value1", EMObject::FLOAT, "val1 is dx/dy");
4827 d.put("value2", EMObject::FLOAT, "val2 is lowpass freq cutoff in pixels");
4828 return d;
4829 }
4830
4831 string get_desc() const
4832 {
4833 return "Block processor, val1 is dx/dy, val2 is lp freq cutoff in pixels. Mystery processor.";
4834 }
4835
4836 static const string NAME;
4837 };
4838
4845 {
4846 protected:
4854 template<class LogicOp>
4855 EMData* process(const EMData *const image, Dict& params);
4856
4863 template<class LogicOp>
4864 void process_inplace(EMData * image, Dict& params);
4865
4866 };
4867
4877 {
4878 public:
4885 virtual EMData* process(const EMData *const image)
4886 {
4887 return BooleanShrinkProcessor::process<GreaterThan>(image, params);
4888 }
4889
4890 // resizes the image
4891 virtual void process_inplace(EMData * image)
4892 {
4893 BooleanShrinkProcessor::process_inplace<GreaterThan>(image, params);
4894 }
4895
4896 string get_desc() const
4897 {
4898 return "Shrink an image by a given amount (default 2), using the maximum value found in the pixel neighborhood.";
4899 }
4900
4901 string get_name() const
4902 {
4903 return NAME;
4904 }
4905 static Processor *NEW()
4906 {
4907 return new MaxShrinkProcessor();
4908 }
4909
4911 {
4912 TypeDict d;
4913 d.put("n", EMObject::INT, "The shrink factor");
4914 d.put("search", EMObject::INT, "The search area (cubic volume width, usually the same as shrink)");
4915 return d;
4916 }
4917
4918 static const string NAME;
4919
4920 private:
4922 {
4923 inline bool operator()(float left,float right) const { return left > right; }
4924 inline float get_start_val() { return -10000000; }
4925 };
4926 };
4927
4937 {
4938 public:
4945 virtual EMData* process(const EMData *const image)
4946 {
4947 return BooleanShrinkProcessor::process<LessThan>(image, params);
4948 }
4949
4950 // resizes the image
4951 virtual void process_inplace(EMData * image)
4952 {
4953 BooleanShrinkProcessor::process_inplace<LessThan>(image, params);
4954 }
4955 string get_desc() const
4956 {
4957 return "Shrink an image by a given amount (default 2), using the minimum value found in the pixel neighborhood.";
4958 }
4959
4960 string get_name() const
4961 {
4962 return NAME;
4963 }
4964 static Processor *NEW()
4965 {
4966 return new MinShrinkProcessor();
4967 }
4968
4970 {
4971 TypeDict d;
4972 d.put("n", EMObject::INT, "The shrink factor");
4973 d.put("search", EMObject::INT, "The search area (cubic volume width, usually the same as shrink)");
4974 return d;
4975 }
4976
4977 static const string NAME;
4978
4979 private:
4981 {
4982 inline bool operator()(float left,float right) const { return left < right; }
4983 inline float get_start_val() { return 9999999999.0f; }
4984 };
4985 };
4986
4994 {
4995 public:
5006 virtual EMData* process(const EMData *const image);
5007
5014 virtual void process_inplace(EMData * image);
5015
5016 string get_desc() const
5017 {
5018 return "Shrink an image by a given amount , using the mean value found in the pixel neighborhood.";
5019 }
5020
5021 virtual string get_name() const
5022 {
5023 return NAME;
5024 }
5025 static Processor *NEW()
5026 {
5027 return new MeanShrinkProcessor();
5028 }
5029
5031 {
5032 TypeDict d;
5033 d.put("n", EMObject::FLOAT, "The shrink factor");
5034 return d;
5035 }
5036
5037 static const string NAME;
5038
5039 private:
5047 void accrue_mean(EMData* to, const EMData *const from, const int shrinkfactor);
5048
5055 void accrue_mean_one_p_five(EMData* to, const EMData * const from);
5056 };
5057
5058
5066 {
5067 public:
5078 virtual EMData* process(const EMData *const image);
5079
5086 virtual void process_inplace(EMData * image);
5087
5088 string get_desc() const
5089 {
5090 return "Shrink an image by a given amount , using the median value found in the pixel neighborhood.";
5091 }
5092
5093 virtual string get_name() const
5094 {
5095 return NAME;
5096 }
5097 static Processor *NEW()
5098 {
5099 return new MedianShrinkProcessor();
5100 }
5101
5103 {
5104 TypeDict d;
5105 d.put("n", EMObject::INT, "The shrink factor");
5106 return d;
5107 }
5108
5109 static const string NAME;
5110
5111 private:
5119 void accrue_median(EMData* to, const EMData* const from,const int shrink_factor);
5120 };
5121
5131 {
5132 public:
5133 virtual EMData* process(const EMData *const image);
5134
5135 virtual void process_inplace(EMData * image);
5136
5137 string get_desc() const
5138 {
5139 return "Robust resampling of an image by clipping its Fourier transform.";
5140 }
5141
5142 string get_name() const
5143 {
5144 return NAME;
5145 }
5146 static Processor *NEW()
5147 {
5148 return new FFTResampleProcessor();
5149 }
5150
5152 {
5153 TypeDict d;
5154 d.put("n", EMObject::FLOAT, "The sample rate. Less than one enlarges the image, greater than one shrinks it.");
5155 return d;
5156 }
5157
5158 static const string NAME;
5159
5160 private:
5167 void fft_resample(EMData* to, const EMData *const from, const float& sample_rate);
5168
5169 };
5170
5174 {
5175 public:
5176 void process_inplace(EMData * image);
5177
5178 string get_name() const
5179 {
5180 return NAME;
5181 }
5182 static Processor *NEW()
5183 {
5184 return new GradientRemoverProcessor();
5185 }
5186
5187 string get_desc() const
5188 {
5189 return "Gradient remover, does a rough plane fit to find linear gradients.";
5190 }
5191
5192 static const string NAME;
5193 };
5194
5204 {
5205 public:
5206 void process_inplace(EMData * image);
5207
5208 string get_name() const
5209 {
5210 return NAME;
5211 }
5212 static Processor *NEW()
5213 {
5214 return new GradientPlaneRemoverProcessor();
5215 }
5216
5217 string get_desc() const
5218 {
5219 return "Remove gradient by least square plane fit";
5220 }
5221
5223 {
5224 TypeDict d;
5225 d.put("mask", EMObject::EMDATA, "mask object: nonzero pixel positions will be used to fit plane. default = 0");
5226 d.put("changeZero", EMObject::INT, "if zero pixels are modified when removing gradient. default = 0");
5227 d.put("planeParam", EMObject::FLOATARRAY, "fitted plane parameters output");
5228 return d;
5229 }
5230
5231 static const string NAME;
5232 };
5233
5240 {
5241 public:
5242 void process_inplace(EMData * image);
5243
5244 string get_name() const
5245 {
5246 return NAME;
5247 }
5248 static Processor *NEW()
5249 {
5250 return new NonConvexProcessor();
5251 }
5252
5253 string get_desc() const
5254 {
5255 return "Makes a curve or plane monotonically decreasing and non-convex. Useful in generating background curves from power spectra. Anchored at edges and (in 2d) at the center. If local value > mean(surrounding values) => mean(surrounding values).";
5256 }
5257
5259 {
5260 TypeDict d;
5261/* d.put("mask", EMObject::EMDATA, "mask object: nonzero pixel positions will be used to fit plane. default = 0");
5262 d.put("changeZero", EMObject::INT, "if zero pixels are modified when removing gradient. default = 0");
5263 d.put("planeParam", EMObject::FLOATARRAY, "fitted plane parameters output");*/
5264 return d;
5265 }
5266
5267 static const string NAME;
5268 };
5269
5277 {
5278 public:
5279 void process_inplace(EMData * image);
5280
5281 string get_name() const
5282 {
5283 return NAME;
5284 }
5285
5286 static Processor *NEW()
5287 {
5288 return new FlattenBackgroundProcessor();
5289 }
5290
5291 string get_desc() const
5292 {
5293 return "Flattens the background by subtracting the local mean";
5294 }
5295
5297 {
5298 TypeDict d;
5299 d.put("mask", EMObject::EMDATA, "A mask the defines the local neighborhood that will be used to find the local mean. Exclusive of the radius argument");
5300 d.put("radius", EMObject::INT, "The radius of circle/sphere that defines the local neighborhood. Exclusive of the mask argument");
5301 return d;
5302 }
5303
5304 static const string NAME;
5305 };
5306
5307
5311 {
5312 public:
5313 void process_inplace(EMData * image);
5314
5315 string get_name() const
5316 {
5317 return NAME;
5318 }
5319 static Processor *NEW()
5320 {
5321 return new RampProcessor();
5322 }
5323
5324 string get_desc() const
5325 {
5326 return "Ramp processor -- Fits a least-squares plane "
5327 "to the picture, and subtracts the plane from "
5328 "the picture. A wedge-shaped overall density "
5329 "profile can thus be removed from the picture.";
5330 }
5331
5332 static const string NAME;
5333 };
5334
5338 {
5339 public:
5340 void process_inplace(EMData * image);
5341
5342 string get_name() const
5343 {
5344 return NAME;
5345 }
5346
5347 static Processor *NEW()
5348 {
5349 return new VerticalStripeProcessor();
5350 }
5351
5352 string get_desc() const
5353 {
5354 return "Tries to fix images scanned on the zeiss for poor ccd normalization.";
5355 }
5356
5357 static const string NAME;
5358 };
5359
5363 {
5364 public:
5365 void process_inplace(EMData *image);
5366
5367 string get_name() const
5368 {
5369 return NAME;
5370 }
5371
5372 static Processor *NEW()
5373 {
5374 return new RealToFFTProcessor();
5375 }
5376
5377 string get_desc() const
5378 {
5379 return "This will replace the image with a full-circle 2D fft amplitude rendering. Note that this renders amplitude, when intensity is more common.";
5380 }
5381
5382 static const string NAME;
5383 };
5384
5388 {
5389 public:
5390 void process_inplace(EMData * image);
5391
5392 string get_name() const
5393 {
5394 return NAME;
5395 }
5396 static Processor *NEW()
5397 {
5398 return new FFTPeakProcessor();
5399 }
5400
5401 string get_desc() const
5402 {
5403 return "Identifies pixels corresponding to peaks in Fourier space based on the mean & standard deviation of the corresponding Fourier amplitude in each ring/shell. These pixels are masked out or in depending on options.";
5404 }
5405
5407 {
5408 TypeDict d;
5409 d.put("thresh_sigma", EMObject::FLOAT, "Values above mean + thresh_sigma * sigma are identified. Default 1.0");
5410 d.put("removepeaks", EMObject::BOOL, "Instead of keeping peaks and removing everything else, this will remove peaks and keep everything else.");
5411 d.put("to_mean", EMObject::BOOL, "Instead of setting identified pixels to zero, set the amplitude to the mean amplitude.");
5412 return d;
5413 }
5414
5415 static const string NAME;
5416 };
5417
5421 {
5422 public:
5423 void process_inplace(EMData * image);
5424
5425 string get_name() const
5426 {
5427 return NAME;
5428 }
5429 static Processor *NEW()
5430 {
5431 return new FFTConeProcessor();
5432 }
5433
5434 string get_desc() const
5435 {
5436 return "Sets a cone to zero in Fourier space around the +-Z axis to (somewhat) emulate the missing cone in an RCT experiment. Angles are measured using X/Y/Z expressed as a fraction of Nyquist, for sensible results on non-cubic images";
5437 }
5438
5440 {
5441 TypeDict d;
5442 d.put("angle", EMObject::FLOAT, "Angular range in degrees from the Z axis to zero. (default 15)");
5443 d.put("rmin", EMObject::FLOAT, "Radius in Fourier pixels at which to start zeroing. This permits some very low resolution to be preserved. (default 1)");
5444 return d;
5445 }
5446
5447 static const string NAME;
5448 };
5449
5453 {
5454 public:
5455 void process_inplace(EMData * image);
5456
5457 string get_name() const
5458 {
5459 return NAME;
5460 }
5461 static Processor *NEW()
5462 {
5463 return new FFTWedgeProcessor();
5464 }
5465
5466 string get_desc() const
5467 {
5468 return "Sets a wedge to zero in Fourier space around the +-Z axis along X as a tilt axis to (somewhat) emulate the missing wedge in a tomography experiment. For example, anglemin=-30, anglemax=30 to roughly emulate at -60 to +60 tilt series";
5469 }
5470
5472 {
5473 TypeDict d;
5474 d.put("anglemin", EMObject::FLOAT, "Minimum angle (degrees) in Y-Z plane to zero (default -30)");
5475 d.put("anglemax", EMObject::FLOAT, "Maximum angle (degrees) in Y-Z plane to zero (default 30)");
5476 d.put("rmin", EMObject::FLOAT, "Radius in Fourier pixels at which to start zeroing. This permits some very low resolution to be preserved. (default 1)");
5477 return d;
5478 }
5479
5480 static const string NAME;
5481 };
5482
5483
5487 {
5488 public:
5489 void process_inplace(EMData * image);
5490
5491 string get_name() const
5492 {
5493 return NAME;
5494 }
5495 static Processor *NEW()
5496 {
5497 return new WedgeFillProcessor();
5498 }
5499
5500 string get_desc() const
5501 {
5502 return "Identifies missing wedge voxels and fills them with data extracted from another image";
5503 }
5504
5506 {
5507 TypeDict d;
5508 d.put("fillsource", EMObject::EMDATA, "The image from which to draw the missing values. If omitted, will fill wedge with zero.");
5509 d.put("thresh_sigma", EMObject::FLOAT, "Multiplied by the standard deviation in each Fourier shell as a threshold for identifying 'missing' data.");
5510 d.put("maxtilt", EMObject::FLOAT, "Assumes Y is exact tilt axis, with 0 tilt in X-Y. Symmetrically fills region beyond +-maxtilt in degrees. Default=disabled");
5511 return d;
5512 }
5513
5514 static const string NAME;
5515 };
5516
5517
5521 {
5522 public:
5523 void process_inplace(EMData * image);
5524
5525 string get_name() const
5526 {
5527 return NAME;
5528 }
5529 static Processor *NEW()
5530 {
5531 return new SigmaZeroEdgeProcessor();
5532 }
5533
5534 string get_desc() const
5535 {
5536 return "Fill zeroes at edges with nearest horizontal/vertical value.";
5537 }
5538
5540 {
5541 TypeDict d;
5542 d.put("nonzero", EMObject::BOOL, "If set, will look for constant non-zero values to fill");
5543 return d;
5544 }
5545
5546 static const string NAME;
5547 };
5548
5554 {
5555 public:
5556 void process_inplace(EMData * image);
5557
5558 string get_name() const
5559 {
5560 return NAME;
5561 }
5562
5563 static Processor *NEW()
5564 {
5565 return new OutlierProcessor();
5566 }
5567
5569 {
5570 TypeDict d;
5571 d.put("fix_zero", EMObject::BOOL, "If set, any pixels that are exactly zero are considered to be outliers, default=false");
5572 d.put("sigma", EMObject::FLOAT, "outliers are defined as mean+-x*sigma where x is the specified value, default=3.0");
5573 return d;
5574 }
5575
5576 string get_desc() const
5577 {
5578 return "Identifies any pixels that are outliers and adjusts them to be the average of any nearby non-outlier pixels. Operates iteratively when required, so large 'outlier' areas can be corrected.";
5579 }
5580
5581 static const string NAME;
5582 };
5583
5590 {
5591 public:
5592 void process_inplace(EMData * image);
5593
5594 string get_name() const
5595 {
5596 return NAME;
5597 }
5598
5599 static Processor *NEW()
5600 {
5601 return new BeamstopProcessor();
5602 }
5603
5604 string get_desc() const
5605 {
5606 return "Try to eliminate beamstop in electron diffraction patterns. value1=sig multiplier; value2,value3 are x,y of center, if value1<0 also does radial subtract.";
5607 }
5608
5610 {
5611 TypeDict d;
5612 d.put("value1", EMObject::FLOAT, "sig multiplier");
5613 d.put("value2", EMObject::FLOAT, "x of center");
5614 d.put("value3", EMObject::FLOAT, "y of center");
5615 return d;
5616 }
5617
5618 static const string NAME;
5619 };
5620
5624 {
5625 public:
5626 void process_inplace(EMData * image);
5627
5628 string get_name() const
5629 {
5630 return NAME;
5631 }
5632
5633 static Processor *NEW()
5634 {
5635 return new MeanZeroEdgeProcessor();
5636 }
5637
5638 string get_desc() const
5639 {
5640 return "Fill zeroes at edges with nearest horizontal/vertical value damped towards Mean2.";
5641 }
5642
5643 static const string NAME;
5644 };
5645
5646
5650 {
5651 public:
5652 void process_inplace(EMData * image);
5653
5654 string get_name() const
5655 {
5656 return NAME;
5657 }
5658
5659 static Processor *NEW()
5660 {
5661 return new AverageXProcessor();
5662 }
5663
5664 string get_desc() const
5665 {
5666 return "Average along Y and replace with average";
5667 }
5668
5669 static const string NAME;
5670 };
5671
5676 {
5677 public:
5678 void process_inplace(EMData * image);
5679 string get_name() const
5680 {
5681 return NAME;
5682 }
5683
5684 static Processor *NEW()
5685 {
5686 return new DecayEdgeProcessor();
5687 }
5688
5689 string get_desc() const
5690 {
5691 return "Decay edges of image to zero";
5692 }
5693
5695 {
5696 TypeDict d;
5697 d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels");
5698 return d;
5699 }
5700
5701 static const string NAME;
5702 };
5703
5711 {
5712 public:
5713 void process_inplace(EMData * image);
5714 string get_name() const
5715 {
5716 return NAME;
5717 }
5718
5719 static Processor *NEW()
5720 {
5721 return new ZeroEdgeRowProcessor();
5722 }
5723
5724 string get_desc() const
5725 {
5726 return "zero edges of image on top and bottom, and on left and right.";
5727 }
5728
5730 {
5731 TypeDict d;
5732 d.put("x0", EMObject::INT, "The number of columns to zero from left");
5733 d.put("x1", EMObject::INT, "The number of columns to zero from right");
5734 d.put("y0", EMObject::INT, "The number of rows to zero from the bottom");
5735 d.put("y1", EMObject::INT, "The number of rows to zero from the top");
5736 d.put("apodize", EMObject::INT, "Number of layers linearly apodized to zero, but only on edges where >0 layers are zeroed. Default 0");
5737 return d;
5738 }
5739
5740 static const string NAME;
5741 };
5742
5752 {
5753 public:
5754 void process_inplace(EMData * image);
5755 string get_name() const
5756 {
5757 return NAME;
5758 }
5759
5760 static Processor *NEW()
5761 {
5762 return new ZeroEdgePlaneProcessor();
5763 }
5764
5765 string get_desc() const
5766 {
5767 return "zero edges of volume on all sides";
5768 }
5769
5771 {
5772 TypeDict d;
5773 d.put("x0", EMObject::INT, "The number of columns to zero from left");
5774 d.put("x1", EMObject::INT, "The number of columns to zero from right");
5775 d.put("y0", EMObject::INT, "The number of rows to zero from the bottom");
5776 d.put("y1", EMObject::INT, "The number of rows to zero from the top");
5777 d.put("z0", EMObject::INT, "The number of slices to zero from the bottom");
5778 d.put("z1", EMObject::INT, "The number of slices to zero from the top");
5779 return d;
5780 }
5781
5782 static const string NAME;
5783 };
5784
5785
5793 {
5794 public:
5795 void process_inplace(EMData * image);
5796 string get_name() const
5797 {
5798 return NAME;
5799 }
5800
5801 string get_desc() const
5802 {
5803 return "Bilateral processing on 2D or 3D volume data. Bilateral processing does non-linear weighted averaging processing within a certain window. ";
5804 }
5805
5806 static Processor *NEW()
5807 {
5808 return new BilateralProcessor();
5809 }
5810
5812 {
5813 TypeDict d;
5814 d.put("distance_sigma", EMObject::FLOAT, "means how large the voxel has impact on its neighbors in spatial domain. The larger it is, the more blurry the resulting image.");
5815 d.put("value_sigma", EMObject::FLOAT, "means how large the voxel has impact on its in range domain. The larger it is, the more blurry the resulting image.");
5816 d.put("niter", EMObject::INT, "how many times to apply this processing on your data.");
5817 d.put("half_width", EMObject::INT, "processing window size = (2 * half_widthh + 1) ^ 3.");
5818 return d;
5819 }
5820
5821 static const string NAME;
5822 };
5823
5827 {
5828 public:
5829 void process_inplace(EMData * image);
5830
5831 static string get_group_desc()
5832 {
5833 return "Base class for normalization processors. Each specific normalization processor needs to define how to calculate mean and how to calculate sigma.";
5834 }
5835
5836 protected:
5837 virtual float calc_sigma(EMData * image) const;
5838 virtual float calc_mean(EMData * image) const = 0;
5839 };
5840
5844 {
5845 public:
5846 string get_name() const
5847 {
5848 return NAME;
5849 }
5850
5851 static Processor *NEW()
5852 {
5853 return new NormalizeUnitProcessor();
5854 }
5855
5856 string get_desc() const
5857 {
5858 return "Normalize an image so its vector length is 1.0.";
5859 }
5860
5861 static const string NAME;
5862
5863 protected:
5864 float calc_sigma(EMData * image) const;
5865 float calc_mean(EMData * image) const;
5866 };
5867
5868 inline float NormalizeUnitProcessor::calc_mean(EMData *) const { return 0; }
5869
5873 {
5874 public:
5875 string get_name() const
5876 {
5877 return NAME;
5878 }
5879
5880 static Processor *NEW()
5881 {
5882 return new NormalizeUnitSumProcessor();
5883 }
5884
5885 string get_desc() const
5886 {
5887 return "Normalize an image so its elements sum to 1.0 (fails if mean=0)";
5888 }
5889
5890 static const string NAME;
5891
5892 protected:
5893 float calc_sigma(EMData * image) const;
5894 float calc_mean(EMData * image) const;
5895 };
5896
5897 inline float NormalizeUnitSumProcessor::calc_mean(EMData *) const { return 0; }
5898
5899
5903 {
5904 public:
5905 string get_name() const
5906 {
5907 return NAME;
5908 }
5909
5910 static Processor *NEW()
5911 {
5912 return new NormalizeStdProcessor();
5913 }
5914
5915 string get_desc() const
5916 {
5917 return "do a standard normalization on an image (mean=0, sigma=1).";
5918 }
5919
5920 static const string NAME;
5921
5922 protected:
5923 float calc_mean(EMData * image) const;
5924 };
5925
5929 {
5930 public:
5931 string get_name() const
5932 {
5933 return NAME;
5934 }
5935
5936 static Processor *NEW()
5937 {
5938 return new NormalizeHistPeakProcessor();
5939 }
5940
5941 string get_desc() const
5942 {
5943 return "Normalize an image so the estimated histogram peak is zero and sigma=1. Only works if the histogram peak is within +-2*sigma of the mean";
5944 }
5945
5946 static const string NAME;
5947
5948 protected:
5949 float calc_mean(EMData * image) const;
5950 };
5951
5952
5959 {
5960 public:
5961 void process_inplace(EMData * image);
5962
5963 string get_name() const
5964 {
5965 return NAME;
5966 }
5967
5968 string get_desc() const
5969 {
5970 return "Uses a 1/0 mask defining a region to use for the zero-normalization.if no_sigma is 1, standard deviation not modified.";
5971 }
5972
5973 static Processor *NEW()
5974 {
5975 return new NormalizeMaskProcessor();
5976 }
5977
5979 {
5980 TypeDict d;
5981 d.put("mask", EMObject::EMDATA, "The 0-1 mask defining the region for the normalization. Any non-zero values will be considered");
5982 d.put("no_sigma", EMObject::INT, "If set, the mean will be set to zero, but sigma will not be modified");
5983 d.put("apply_mask", EMObject::INT, "If set, the mask will also be applied (multiplied) to the volume");
5984 return d;
5985 }
5986
5987 static const string NAME;
5988
5989 };
5990
5997 {
5998 public:
5999 string get_name() const
6000 {
6001 return NAME;
6002 }
6003
6004 static Processor *NEW()
6005 {
6006 return new NormalizeRampNormVar();
6007 }
6008
6009 string get_desc() const
6010 {
6011 return "First call filter.ramp on the image, then make the mean 0 and norm 1";
6012 }
6013
6014 void process_inplace(EMData * image);
6015
6016 static const string NAME;
6017 };
6018
6028 {
6029 public:
6030 string get_name() const
6031 {
6032 return NAME;
6033 }
6034
6035 static Processor *NEW()
6036 {
6037 return new NormalizeByMassProcessor();
6038 }
6039
6040 string get_desc() const
6041 {
6042 return "Normalize the mass of the image assuming a density of 1.35 g/ml (0.81 Da/A^3) (3D only)";
6043 }
6044
6046 {
6047 TypeDict d;
6048 d.put("apix", EMObject::FLOAT,"Angstrom per pixel of the image. If not set will use the apix_x attribute of the image");
6049 d.put("mass", EMObject::FLOAT,"The approximate mass of protein/structure in kilodaltons");
6050 d.put("thr", EMObject::FLOAT,"The isosurface threshold which encapsulates the structure");
6051 d.put("verbose", EMObject::INT,"If set will give details about the normalization");
6052 return d;
6053 }
6054
6055 void process_inplace(EMData * image);
6056
6057 static const string NAME;
6058 };
6059
6060
6064 {
6065 public:
6066 string get_name() const
6067 {
6068 return NAME;
6069 }
6070
6071 static Processor *NEW()
6072 {
6073 return new NormalizeEdgeMeanProcessor();
6074 }
6075
6076 string get_desc() const
6077 {
6078 return "normalizes an image, mean value equals to edge mean.";
6079 }
6080
6081 static const string NAME;
6082
6083 protected:
6084 float calc_mean(EMData * image) const;
6085 };
6086
6090 {
6091 public:
6092 string get_name() const
6093 {
6094 return NAME;
6095 }
6096
6097 static Processor *NEW()
6098 {
6099 return new NormalizeCircleMeanProcessor();
6100 }
6101
6102 string get_desc() const
6103 {
6104 return "normalizes an image, mean value equals to mean of 2 pixel circular radius or of the circular border if no radius is set.";
6105 }
6106
6108 {
6109 TypeDict d;
6110 d.put("radius", EMObject::FLOAT,"Radius (pixels) of inner edge of circular ring");
6111 d.put("width", EMObject::FLOAT,"width (pixels) of ring to average over, default 2");
6112 return d;
6113 }
6114
6115 static const string NAME;
6116
6117 protected:
6118 float calc_mean(EMData * image) const;
6119 };
6120
6124 {
6125 public:
6126 string get_name() const
6127 {
6128 return NAME;
6129 }
6130
6131 static Processor *NEW()
6132 {
6133 return new NormalizeLREdgeMeanProcessor();
6134 }
6135
6136 string get_desc() const
6137 {
6138 return "normalizes an image, uses 2 pixels on left and right edge";
6139 }
6140
6141 static const string NAME;
6142
6143 protected:
6144 float calc_mean(EMData * image) const;
6145 };
6146
6150 {
6151 public:
6152 string get_name() const
6153 {
6154 return NAME;
6155 }
6156
6157 static Processor *NEW()
6158 {
6159 return new NormalizeMaxMinProcessor();
6160 }
6161
6162 string get_desc() const
6163 {
6164 return "normalizes an image. mean -> (maxval-minval)/2; std dev = (maxval+minval)/2;";
6165 }
6166
6167 static const string NAME;
6168
6169 protected:
6170 float calc_sigma(EMData * image) const;
6171 float calc_mean(EMData * image) const;
6172 };
6173
6177 {
6178 public:
6179 string get_name() const
6180 {
6181 return NAME;
6182 }
6183
6184 static Processor *NEW()
6185 {
6186 return new NormalizeRowProcessor();
6187 }
6188
6190 {
6191 TypeDict d;
6192 d.put("unitlen",EMObject::BOOL, "Adjusts the length of the 'row vector' to be 1.0 without adjusting the mean");
6193 return d;
6194 }
6195
6196 string get_desc() const
6197 {
6198 return "Modifies each row in the image individually. Default behavior is to divide each value by the mean value of the row, as long as the mean>0.";
6199 }
6200
6201 static const string NAME;
6202
6203 void process_inplace(EMData * image);
6204 };
6205
6218 {
6219 public:
6220 virtual void process_inplace(EMData *image);
6221 virtual EMData* process(const EMData * const image);
6222
6223 string get_name() const
6224 {
6225 return NAME;
6226 }
6227
6228 static Processor *NEW()
6229 {
6230 return new SubtractOptProcessor();
6231 }
6232
6234 {
6235 TypeDict d;
6236 d.put("ref", EMObject::EMDATA, "Reference image to subtract");
6237 d.put("actual", EMObject::EMDATA, "If specified, ref is used for normalization, but actual is subtracted.");
6238 d.put("low_cutoff_frequency", EMObject::FLOAT, "Absolute [0,0.5] low cut-off frequency.");
6239 d.put("high_cutoff_frequency", EMObject::FLOAT, "Absolute [0,0.5] high cut-off frequency.");
6240 d.put("ctfweight",EMObject::BOOL, "Filter the image by CTF before subtraction");
6241 d.put("return_fft",EMObject::BOOL, "Skips the final IFT, and returns the FFT of the subtracted image");
6242 d.put("return_subim", EMObject::BOOL, "Instead of returning the image after subtraction, returns the filtered image which would have been subtracted from the image.");
6243 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
6244 d.put("return_presigma", EMObject::BOOL, "Return the sigma of the pre-subtracted image in real-space with the specified filter applied as sigma_presub. This is an expensive option.");
6245 return d;
6246 }
6247
6248 string get_desc() const
6249 {
6250 return "This will filter/scale 'ref' optimally and subtract it from image using ring dot products in Fourier space for normalization. Cutoff frequencies apply a bandpass tophat filter to the output.";
6251 }
6252
6253 static const string NAME;
6254 };
6255
6256
6263 {
6264 public:
6265 void process_inplace(EMData * image);
6266
6267 string get_name() const
6268 {
6269 return NAME;
6270 }
6271
6272 static Processor *NEW()
6273 {
6275 }
6276
6278 {
6279 TypeDict d;
6280 d.put("to", EMObject::EMDATA, "reference image normalize to");
6281 d.put("fourieramp", EMObject::INT, "If set, performs normalization using Fourier amplitudes instead of real-space image. Default = False.");
6282 d.put("ignore_zero", EMObject::BOOL, "If set, ignores any pixels which are exactly zero in either image. Defaut = True.");
6283 d.put("ignore_lowsig", EMObject::FLOAT, "If >0, then any pixels closer to the mean than val*sigma in either image excluded");
6284 d.put("low_threshold", EMObject::FLOAT, "only take into account the reference image's pixel value between high and low threshold (zero is always ignored)");
6285 d.put("high_threshold", EMObject::FLOAT, "only take into account the reference image's pixel value between high and low threshold (zero is always ignored)");
6286 d.put("debug", EMObject::BOOL, "This is a debugging flag which will cause various diagnostic files to be written.");
6287 return d;
6288 }
6289
6290 string get_desc() const
6291 {
6292 return "This will use a pixel vs pixel least squares fit to normalize one image to optimally match a second image, with various options for excluding some pixels. norm_mult and norm_add will be set in the header of the result.";
6293 }
6294
6295 static const string NAME;
6296 };
6297
6301 {
6302 public:
6303 void process_inplace(EMData * image);
6304
6305 string get_name() const
6306 {
6307 return NAME;
6308 }
6309
6310 static Processor *NEW()
6311 {
6312 return new RotationalAverageProcessor();
6313 }
6314
6315 string get_desc() const
6316 {
6317 return "Makes image circularly/spherically symmetric.";
6318 }
6319
6320 static const string NAME;
6321 };
6322
6326 {
6327 public:
6328 virtual void process_inplace(EMData * image);
6329
6330 virtual string get_name() const
6331 {
6332 return NAME;
6333 }
6334
6335 static Processor *NEW()
6336 {
6337 return new RotationalSubstractProcessor();
6338 }
6339
6340 virtual string get_desc() const
6341 {
6342 return "subtracts circularly/spherically symmetric part of an image.";
6343 }
6344
6345 static const string NAME;
6346 };
6347
6354 {
6355 public:
6356
6361 virtual void process_inplace(EMData * image);
6362
6367 virtual EMData* process(const EMData * const image);
6368
6369 virtual string get_name() const
6370 {
6371 return NAME;
6372 }
6373
6374 static Processor *NEW()
6375 {
6376 return new TransposeProcessor();
6377 }
6378
6380 {
6381 TypeDict d;
6382 return d;
6383 }
6384
6385 virtual string get_desc() const
6386 {
6387 return "Get the transpose of an image. Works for 2D only";
6388 }
6389
6390 static const string NAME;
6391 };
6392
6397 {
6398 public:
6399 virtual void process_inplace(EMData * image);
6400
6401 virtual string get_name() const
6402 {
6403 return NAME;
6404 }
6405
6406 static Processor *NEW()
6407 {
6408 return new FlipProcessor();
6409 }
6410
6412 {
6413 TypeDict d;
6414 d.put("axis", EMObject::STRING, "'x', 'y', or 'z' axis.");
6415 return d;
6416 }
6417
6418 virtual string get_desc() const
6419 {
6420 return "Flips an image along the specified axis, preserving the center. This will introduce a plane of 0's for even box sizes. Use 'xform.reverse' processor to avoid the zero plane, but not preserve the center.";
6421 }
6422
6423 static const string NAME;
6424 };
6425
6430 {
6431 public:
6432 virtual void process_inplace(EMData * image);
6433
6434 virtual string get_name() const
6435 {
6436 return NAME;
6437 }
6438
6439 static Processor *NEW()
6440 {
6441 return new ReverseProcessor();
6442 }
6443
6445 {
6446 TypeDict d;
6447 d.put("axis", EMObject::STRING, "'x', 'y', or 'z' axis.");
6448 return d;
6449 }
6450
6451 virtual string get_desc() const
6452 {
6453 return "Mirrors (reverses) an image along the specified axis, preserving the center. This will NOT introduce a plane of 0's for even box sizes. Use 'xform.mirror' or 'xform.flip' processor to include the zero plane and preserve the center.";
6454 }
6455
6456 static const string NAME;
6457 };
6458
6459 /*class FlipProcessor1:public Processor
6460 {
6461 public:
6462 void process_inplace(EMData * image);
6463
6464 string get_name() const
6465 {
6466 return "xform.flip1";
6467 }
6468
6469 static Processor *NEW()
6470 {
6471 return new FlipProcessor1();
6472 }
6473
6474 TypeDict get_param_types() const
6475 {
6476 TypeDict d;
6477 d.put("axis", EMObject::STRING, "'x', 'y', or 'z' axis. 'x' means horizonal flip; 'y' means vertical flip;");
6478 return d;
6479 }
6480
6481 string get_desc() const
6482 {
6483 return "flip an image around an axis.";
6484 }
6485
6486 };*/
6487
6493 {
6494 public:
6495 virtual void process_inplace(EMData * image);
6496
6497 virtual string get_name() const
6498 {
6499 return NAME;
6500 }
6501
6502 static Processor *NEW()
6503 {
6504 return new AddNoiseProcessor();
6505 }
6506
6508 {
6509 TypeDict d;
6510 d.put("noise", EMObject::FLOAT, "noise factor used to generate Gaussian distribution random noise");
6511 d.put("seed", EMObject::INT, "seed for random number generator");
6512 return d;
6513 }
6514
6515 virtual string get_desc() const
6516 {
6517 return "add gaussian (white) noise to an image with mean='noise' and sigma='noise/2'";
6518 }
6519
6520 static const string NAME;
6521
6522 protected:
6523 virtual float get_sigma(EMData *)
6524 {
6525 return 1.0;
6526 }
6527 };
6528
6532 {
6533 public:
6534 virtual string get_name() const
6535 {
6536 return NAME;
6537 }
6538
6539 static Processor *NEW()
6540 {
6541 return new AddSigmaNoiseProcessor();
6542 }
6543
6544 virtual string get_desc() const
6545 {
6546 return "add sigma noise.";
6547 }
6548
6549 static const string NAME;
6550
6551 protected:
6552 float get_sigma(EMData * image);
6553 };
6554
6564 {
6565 public:
6566 virtual void process_inplace(EMData * image);
6567
6568 virtual string get_name() const
6569 {
6570 return NAME;
6571 }
6572
6573 static Processor *NEW()
6574 {
6575 return new AddRandomNoiseProcessor();
6576 }
6577
6579 {
6580 TypeDict d;
6581 d.put("n", EMObject::INT);
6582 d.put("x0", EMObject::FLOAT);
6583 d.put("dx", EMObject::FLOAT);
6584 d.put("y", EMObject::FLOATARRAY);
6585 d.put("interpolation", EMObject::INT);
6586 d.put("seed", EMObject::INT, "seed for random number generator");
6587 return d;
6588 }
6589
6590 virtual string get_desc() const
6591 {
6592 return "add spectral noise to a complex image.";
6593 }
6594
6595 static const string NAME;
6596 };
6597
6604 {
6605 public:
6611 virtual void process_inplace(EMData * image);
6612
6613 virtual string get_name() const
6614 {
6615 return NAME;
6616 }
6617
6618 static Processor *NEW()
6619 {
6620 return new FourierToCornerProcessor();
6621 }
6622
6623 virtual string get_desc() const
6624 {
6625 return "Undoes the xform.fourierorigin.tocenter processor";
6626 }
6627
6628 static const string NAME;
6629 };
6630
6631
6644 {
6645 public:
6651 virtual void process_inplace(EMData * image);
6652
6653 virtual string get_name() const
6654 {
6655 return NAME;
6656 }
6657
6658 static Processor *NEW()
6659 {
6660 return new FourierToCenterProcessor();
6661 }
6662
6663 virtual string get_desc() const
6664 {
6665 return "Translates the origin in Fourier space from the corner to the center in y and z - works in 2D and 3D";
6666 }
6667
6668 static const string NAME;
6669 };
6670
6681 {
6682 protected:
6695 void swap_corners_180(EMData * image);
6696
6708 void swap_central_slices_180(EMData * image);
6709
6716 void fourier_phaseshift180(EMData * image);
6717
6718 };
6719
6730 {
6731 public:
6732 virtual void process_inplace(EMData * image);
6733
6734 virtual string get_name() const
6735 {
6736 return NAME;
6737 }
6738
6739 static Processor *NEW()
6740 {
6741 return new PhaseToCenterProcessor();
6742 }
6743
6744 virtual string get_desc() const
6745 {
6746 return "Undoes the effect of the xform.phaseorigin.tocorner processor";
6747 }
6748
6749 static const string NAME;
6750 };
6751
6760 {
6761 public:
6762 virtual void process_inplace(EMData * image);
6763
6764 virtual string get_name() const
6765 {
6766 return NAME;
6767 }
6768
6769 static Processor *NEW()
6770 {
6771 return new PhaseToCornerProcessor();
6772 }
6773
6774 virtual string get_desc() const
6775 {
6776 return "Translates a centered image to the corner in a forward fashion";
6777 }
6778
6779 static const string NAME;
6780 };
6781
6787 {
6788 public:
6789 virtual void process_inplace(EMData * image);
6790
6791 virtual string get_name() const
6792 {
6793 return NAME;
6794 }
6795
6796 static Processor *NEW()
6797 {
6798 return new AutoMask2DProcessor();
6799 }
6800
6802 {
6803 TypeDict d;
6804 d.put("radius", EMObject::INT,"Pixel radius of a ball which is used to seed the flood filling operation. ");
6805 d.put("nmaxseed",EMObject::INT,"Use the n highest valued pixels in the map as a seed. Alternative to radius. Useful for viruses.");
6806 d.put("threshold", EMObject::FLOAT, "An isosurface threshold that suitably encases the mass.");
6807 d.put("sigma", EMObject::FLOAT, "Alternative to threshold based on mean + x*sigma");
6808 d.put("nshells", EMObject::INT, "The number of dilation operations");
6809 d.put("nshellsgauss", EMObject::INT, "number of Gaussian pixels to expand, following the dilation operations");
6810 d.put("return_mask", EMObject::BOOL, "If true the result of the operation will produce the mask, not the masked volume.");
6811 d.put("verbose", EMObject::INT, "How verbose to be (stdout)");
6812 return d;
6813 }
6814
6815 virtual string get_desc() const
6816 {
6817 return "2D version of mask.auto3d";
6818 }
6819
6820 static const string NAME;
6821 };
6822
6823
6831 {
6832 public:
6833 virtual void process_inplace(EMData * image);
6834
6835 virtual string get_name() const
6836 {
6837 return NAME;
6838 }
6839
6840 static Processor *NEW()
6841 {
6842 return new AutoMaskAsymUnit();
6843 }
6844
6846 {
6847 TypeDict d;
6848 d.put("symavg", EMObject::INT, "Cn symmetry only. If set, the mask for a single subunit will follow a linear falloff to the neighboring subunit. After applying, symmetrizing the map should produce a smooth symmetrized average of the masked subunit (and partially its two neighbors).");
6849 d.put("au", EMObject::INT, "The asymmetric unit to mask out. If this is -1 will mask all asymmetric units, giving each a unique number.");
6850 d.put("sym", EMObject::STRING, "The symmetry, for example, d7");
6851 return d;
6852 }
6853
6854 virtual string get_desc() const
6855 {
6856 return "Masks out a specific asymmetric unit of the given symmetry. If the au parameter is -1 will mask all asymmetric units, assigning the asymetric unit number to the masked area.";
6857 }
6858
6859 static const string NAME;
6860 };
6861
6867 {
6868 public:
6869 virtual void process_inplace(EMData * image);
6870
6871 virtual string get_name() const
6872 {
6873 return NAME;
6874 }
6875
6876 static Processor *NEW()
6877 {
6878 return new AutoMaskDustProcessor();
6879 }
6880
6882 {
6883 TypeDict d;
6884 d.put("threshold", EMObject::FLOAT,"Only considers densities above the threshold");
6885 d.put("voxels", EMObject::INT,"If a connected mass is smaller than this many voxels it is removed");
6886 d.put("verbose", EMObject::INT, "Level of verbosity, 0 default. 1 will print each non-excluded zone");
6887 return d;
6888 }
6889
6890 virtual string get_desc() const
6891 {
6892 return "A dust removal filter which will remove above threshold densities smaller than a given size";
6893 }
6894
6895 static const string NAME;
6896
6897 protected:
6900 };
6901
6907 {
6908 public:
6909 virtual void process_inplace(EMData * image);
6910
6911 virtual string get_name() const
6912 {
6913 return NAME;
6914 }
6915
6916 static Processor *NEW()
6917 {
6918 return new AutoMask3DProcessor();
6919 }
6920
6922 {
6923 TypeDict d;
6924 d.put("threshold1", EMObject::FLOAT, "High initial threshold for seeding.");
6925 d.put("threshold2", EMObject::FLOAT, "Lower secondary threshold to define boundary.");
6926 d.put("nshells", EMObject::INT, "Number of 1-voxel shells to expand the mask by.");
6927 d.put("nshellsgauss", EMObject::INT, "Width in voxels of a Gaussian decay at the edge of the mask.");
6928 d.put("return_mask", EMObject::BOOL, "If true the result of the operation will produce the mask, not the masked volume.");
6929
6930 return d;
6931 }
6932
6933 virtual string get_desc() const
6934 {
6935 return "Tries to mask out only interesting density";
6936 }
6937
6938 static const string NAME;
6939 };
6940
6949 {
6950 public:
6951 virtual void process_inplace(EMData * image);
6952
6953 virtual string get_name() const
6954 {
6955 return NAME;
6956 }
6957
6958 static Processor *NEW()
6959 {
6960 return new AutoMask3D2Processor();
6961 }
6962
6963 virtual string get_desc() const
6964 {
6965 return "This will mask a 3-D volume using a 'flood filling' approach. It begins with a seed generated either as a sphere with \
6966specified 'radius' or with the 'nmaxseed' highest values. It then includes any mass connected to the seed with value higher than 'threshold'.\
6967Next, the mask is expanded by 'nshells'+'nshellsgauss'/2 voxels. Finally a gaussian low-pass filter is applied with a width of 'nshellsgauss'.";
6968 }
6969
6971 {
6972 TypeDict d;
6973 d.put("radius", EMObject::INT,"Pixel radius of a ball which is used to seed the flood filling operation. ");
6974 d.put("nmaxseed",EMObject::INT,"Use the n highest valued pixels in the map as a seed. Alternative to radius. Useful for viruses.");
6975 d.put("threshold", EMObject::FLOAT, "An isosurface threshold that suitably encases the mass.");
6976 d.put("sigma", EMObject::FLOAT, "Alternative to threshold based on mean + x*sigma");
6977 d.put("nshells", EMObject::INT, "Number of 1-voxel shells to expand the mask by.");
6978 d.put("nshellsgauss", EMObject::INT, "Width in voxels of a Gaussian decay at the edge of the mask.");
6979 d.put("return_mask", EMObject::BOOL, "If true the result of the operation will produce the mask, not the masked volume.");
6980 d.put("verbose", EMObject::INT, "How verbose to be (stdout)");
6981 return d;
6982 }
6983
6984 static const string NAME;
6985 };
6986
6991 {
6992 public:
6993 virtual void process_inplace(EMData * image);
6994
6995 virtual string get_name() const
6996 {
6997 return NAME;
6998 }
6999
7000 virtual string get_desc() const
7001 {
7002 return "A multilevel mask has an integer value at each pixel location. -1 indicates unmasked regions. 0-n-1 are individual masks. Expands the masked regions into unmasked areas by nshells.";
7003 }
7004
7005 static Processor *NEW()
7006 {
7007 return new IterMultiMaskProcessor();
7008 }
7009
7011 {
7012 TypeDict d;
7013 d.put("nshells", EMObject::INT, "number of shells to add");
7014 return d;
7015 }
7016
7017 static const string NAME;
7018 };
7019
7024 {
7025 public:
7026 virtual void process_inplace(EMData * image);
7027
7028 virtual string get_name() const
7029 {
7030 return NAME;
7031 }
7032
7033 virtual string get_desc() const
7034 {
7035 return "Add additional shells/rings to an existing 1/0 mask image";
7036 }
7037
7038 static Processor *NEW()
7039 {
7040 return new AddMaskShellProcessor();
7041 }
7042
7044 {
7045 TypeDict d;
7046 d.put("nshells", EMObject::INT, "number of shells to add");
7047 return d;
7048 }
7049
7050 static const string NAME;
7051 };
7052
7058 {
7059 public:
7060 virtual void process_inplace(EMData * image);
7061
7062 virtual string get_name() const
7063 {
7064 return NAME;
7065 }
7066
7067 static Processor *NEW()
7068 {
7069 return new PhaseToMassCenterProcessor();
7070 }
7071
7072 virtual string get_desc() const
7073 {
7074 return "centers the image the center of mass, which is calculated using Fourier phases, ignores old dx, dy.";
7075 }
7076
7078 {
7079 TypeDict d;
7080 d.put("int_shift_only", EMObject::INT, "If set, will only shift by integer amounts to avoid interpolation");
7081 return d;
7082 }
7083
7084 static const string NAME;
7085 };
7086
7091 {
7092 public:
7093 virtual void process_inplace(EMData * image);
7094
7095 virtual string get_name() const
7096 {
7097 return NAME;
7098 }
7099
7100 static Processor *NEW()
7101 {
7102 return new ToCenterProcessor();
7103 }
7104
7105 virtual string get_desc() const
7106 {
7107 return "Centers similar to the way a human would, by identifying the shape of the object and centering its sillouette. May be inaccurate if sillouette cannot be clearly identified. ";
7108 }
7109
7111 {
7112 TypeDict d;
7113// d.put("int_shift_only", EMObject::INT, "set to 1 only shift by integer, no interpolation");
7114// d.put("threshold", EMObject::FLOAT, "Only values larger than the threshold are included in the center of mass computation. Default is 0.");
7115// d.put("positive", EMObject::INT, "uses only densities >0 for the calculatton");
7116 return d;
7117 }
7118
7119 static const string NAME;
7120 };
7121
7127 {
7128 public:
7129 virtual void process_inplace(EMData * image);
7130
7131 virtual string get_name() const
7132 {
7133 return NAME;
7134 }
7135
7136 static Processor *NEW()
7137 {
7138 return new ToMassCenterProcessor();
7139 }
7140
7141 virtual string get_desc() const
7142 {
7143 return "ToMassCenterProcessor centers image at center of mass, with a threshold. Only values higher than the threshold are considered.";
7144 }
7145
7147 {
7148 TypeDict d;
7149 d.put("int_shift_only", EMObject::INT, "set to 1 only shift by integer, no interpolation");
7150 d.put("threshold", EMObject::FLOAT, "Only values larger than the threshold are included in the center of mass computation. Default is 0.");
7151 d.put("powercenter", EMObject::INT, "If set, squares pixel values before computing the center. The threshold is with respect to the squared values.");
7152// d.put("positive", EMObject::INT, "uses only densities >0 for the calculatton");
7153 return d;
7154 }
7155
7156 static const string NAME;
7157 };
7158
7163 {
7164 public:
7165 virtual void process_inplace(EMData * image);
7166
7167 virtual string get_name() const
7168 {
7169 return NAME;
7170 }
7171
7172 static Processor *NEW()
7173 {
7174 return new ACFCenterProcessor();
7175 }
7176
7177 virtual string get_desc() const
7178 {
7179 return "Center image using self-convolution.";
7180 }
7181
7183 {
7184 TypeDict d;
7185 return d;
7186 }
7187
7188 static const string NAME;
7189 };
7190
7191
7199 {
7200 public:
7201 virtual EMData* process(EMData const *image);
7202 virtual void process_inplace(EMData *image);
7203
7204 virtual string get_name() const
7205 {
7206 return NAME;
7207 }
7208
7209 static Processor *NEW()
7210 {
7211 return new FSCFourierProcessor();
7212 }
7213
7214 virtual string get_desc() const
7215 {
7216 return "This processor will apply a Wiener filter to a volume based on a provided FSC curve. The assumption is that the FSC curve represents \
7217a gold standard FSC between two 1/2 sets, and that the filter is being applied to the combined average. Hence the default fscmult of 2, \
7218since the SSNR is being computed as FSC/(1-FSC). Ie - the SSNR of the combined halves is twice as high.";
7219 }
7220
7222 {
7223 TypeDict d;
7224 d.put("snrmult", EMObject::FLOAT, "This multiplier is applied to the computed SNR before Wiener filtration. This permits the filter to be applied to 1/2 images, etc. Default=2.0");
7225 d.put("sscale", EMObject::FLOAT, "This rescales the S axis to produce empirical under/overfiltration. sscale=1.1 for example will extend the resolution (underfilter) by 10%. Default=1.0");
7226 d.put("maxfreq", EMObject::FLOAT, "This acts as a high resolution limit to prevent FSC artifacts from iteratively reinforcing themselves. Above this spatial frequency, the FSC is forced to decrease monotonically. Default=1.0");
7227 d.put("fscfile", EMObject::STRING, "filename of a file containing the FSC curve to use for the SNR computation");
7228 return d;
7229 }
7230
7231 static const string NAME;
7232 };
7233
7240 {
7241 public:
7242 virtual void process_inplace(EMData * image);
7243
7244 virtual string get_name() const
7245 {
7246 return NAME;
7247 }
7248
7249 static Processor *NEW()
7250 {
7251 return new CTFCorrProcessor();
7252 }
7253
7254 virtual string get_desc() const
7255 {
7256 return "One of the strongest visual impacts of CTF on a structure is the low resolution high-pass filter effect caused by \
7257phase contrast. This Processor performs a simple linear filter to roughly correct for this. This is not a substitution or replacement \
7258for the full CTF correction routine available for single particle work in EMAN, but if you are in a situation where accurate CTF \
7259correction is not possible, this will allow you to approximate the correction to relieve some of the visual artifacts. Circularly \
7260symmetric phase flipping can optionally be performed.";
7261 }
7262
7264 {
7265 TypeDict d;
7266 d.put("defocus", EMObject::FLOAT, "Mean defocus to correct for in microns");
7267 d.put("ac", EMObject::FLOAT, "Amplitude contrast in % (default 10%)");
7268 d.put("cs", EMObject::FLOAT, "Microscope Cs, default 2.7 mm");
7269 d.put("voltage", EMObject::FLOAT, "Microscope Voltage in Kv (default 300)");
7270 d.put("apix", EMObject::FLOAT, "A/pix (default value from image header)");
7271 d.put("hppix", EMObject::FLOAT, "Optional high pass filter radius in pixels to prevent gradient amplification, default disabled");
7272 d.put("phaseflip", EMObject::INT, "Also flip phases if set, default false");
7273 d.put("useheader", EMObject::INT,"Use CTF header values if present, instead of individual values, default false");
7274 return d;
7275 }
7276
7277 static const string NAME;
7278 };
7279
7280
7286 {
7287 public:
7288 virtual void process_inplace(EMData * image);
7289
7290 virtual string get_name() const
7291 {
7292 return NAME;
7293 }
7294
7295 static Processor *NEW()
7296 {
7297 return new SNRProcessor();
7298 }
7299
7300 virtual string get_desc() const
7301 {
7302 return "Process the images by the estimated SNR in each image.if parameter 'wiener' is 1, then wiener processor the images using the estimated SNR with CTF amplitude correction.";
7303 }
7304
7306 {
7307 TypeDict d;
7308 d.put("wiener", EMObject::INT, "if set to 1, then use wiener processor to process the images using the estimated SNR with CTF amplitude correction");
7309 d.put("snrfile", EMObject::STRING, "structure factor file name");
7310 return d;
7311 }
7312
7313 static const string NAME;
7314 };
7315
7320 {
7321 public:
7322 virtual void process_inplace(EMData * image);
7323
7324 virtual string get_name() const
7325 {
7326 return NAME;
7327 }
7328
7329 virtual string get_desc() const
7330 {
7331 return "A fourier processor specified in a 2 column text file.";
7332 }
7333
7334 static Processor *NEW()
7335 {
7336 return new FileFourierProcessor();
7337 }
7338
7340 {
7341 TypeDict d;
7342 d.put("filename", EMObject::STRING, "file name for a 2 column text file which specified a radial function data array.");
7343 return d;
7344 }
7345
7346 static const string NAME;
7347 };
7348
7360 {
7361 public:
7362 virtual void process_inplace(EMData * image);
7363
7364 virtual string get_name() const
7365 {
7366 return NAME;
7367 }
7368
7369 virtual string get_desc() const
7370 {
7371 return "Identifiy the best symmetry in the given symmetry list for each pixel and then apply the best symmetry to each pixel.";
7372 }
7373
7374 static Processor *NEW()
7375 {
7376 return new SymSearchProcessor();
7377 }
7378
7380 {
7381 TypeDict d;
7382 d.put("sym", EMObject::STRINGARRAY, "the list of symmetries to search");
7383 d.put("thresh", EMObject::FLOAT, "the minimal level of symmetry to be accepted (0-1)");
7384 d.put("output_symlabel", EMObject::INT, "if output the symmetry label map in which the pixel value is the index of symmetry in the symmetry list");
7385 d.put("symlabel_map", EMObject::EMDATA, "the optional return map when output_symlabel=1");
7386 return d;
7387 }
7388
7389 static const string NAME;
7390 };
7391
7397 {
7398 public:
7399 void process_inplace(EMData * image);
7400
7401 virtual string get_name() const
7402 {
7403 return NAME;
7404 }
7405
7406 static Processor *NEW()
7407 {
7408 return new BadLineXYProcessor();
7409 }
7410
7411 virtual string get_desc() const
7412 {
7413 return "This processor will correct defective pixel columns/rows by averaging adjacent pixel values";
7414 }
7415
7417 {
7418 TypeDict d;
7419 d.put("cols", EMObject::INTARRAY, "X coordinates of bad vertical lines");
7420 d.put("rows", EMObject::INTARRAY, "Y coordinates of bad horizontal lines.");
7421 d.put("neighbornorm", EMObject::INT, "Interpolate neighboring pixels, then divides by this factor. Default = 1.0.");
7422 return d;
7423 }
7424
7425 static const string NAME;
7426 };
7427
7434 {
7435 public:
7436 void process_inplace(EMData * image);
7437
7438 virtual string get_name() const
7439 {
7440 return NAME;
7441 }
7442
7443 static Processor *NEW()
7444 {
7445 return new StripeXYProcessor();
7446 }
7447
7448 virtual string get_desc() const
7449 {
7450 return "This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS readout. In theory this should be done by dark/gain correction, but in many cases, there are residual effects that this will help eliminate. This can produce high-pass filter-like effects, so generally large length values are suggested. Integration covers +-xlen/ylen. Y and X axes are corrected sequentially, not simultaneously, Y first";
7451 }
7452
7454 {
7455 TypeDict d;
7456 d.put("xlen", EMObject::INT, "Integration 1/2 length on x axis in pixels. Default=10");
7457 d.put("ylen", EMObject::INT, "Integration 1/2 length on y axis in pixels. Default=10");
7458 return d;
7459 }
7460
7461 static const string NAME;
7462 };
7463
7464
7471 {
7472 public:
7473 void process_inplace(EMData * image);
7474
7475 virtual string get_name() const
7476 {
7477 return NAME;
7478 }
7479
7480 static Processor *NEW()
7481 {
7482 return new LocalNormProcessor();
7483 }
7484
7485 virtual string get_desc() const
7486 {
7487 return "This processor attempts to perform a 'local normalization' so low density and high density features will be on a more even playing field in an isosurface display. threshold is an isosurface threshold at which all desired features are visible, radius is a feature size over which to equalize.";
7488 }
7489
7491 {
7492 TypeDict d;
7493 d.put("threshold", EMObject::FLOAT, "Only values above the threshold will be used to compute the normalization. Generally a good isosurface value.");
7494 d.put("radius", EMObject::FLOAT, "Fourier filter radius expressed in pixels in Fourier space. cutoff_pixels in filter.lowpass.gauss");
7495 d.put("apix", EMObject::FLOAT, "Angstroms per pixel");
7496 return d;
7497 }
7498
7499 static const string NAME;
7500 };
7501
7507 {
7508 public:
7509 virtual void process_inplace(EMData * image);
7510
7511 virtual string get_name() const
7512 {
7513 return NAME;
7514 }
7515
7516 static Processor *NEW()
7517 {
7518 return new IndexMaskFileProcessor();
7519 }
7520
7522 {
7523 TypeDict d;
7524 d.put("filename", EMObject::STRING, "mask image file name");
7525 d.put("image", EMObject::EMDATA, "The actual mask image (instead of the filename).");
7526 d.put("maskset", EMObject::INT, "One common way to store multiple masks in a single image is to assign a single integer value to each mask. For files of this type, will set values N-0.5<X<N+0.5 to 1, and other values to zero, before applying the mask.");
7527 return d;
7528 }
7529
7530 virtual string get_desc() const
7531 {
7532 return "Multiplies the image by the specified filename or image object. Note that 'image' should be specified rather than filename for e2proc2d or e2proc3d, as these programs automatically read image filenames when specified as parameters. So-called multi-level masks are also supported via the 'maskset' option.";
7533 }
7534
7535 static const string NAME;
7536 };
7537
7541// class CoordinateMaskFileProcessor:public Processor
7542// {
7543// public:
7544// virtual void process_inplace(EMData * image);
7545//
7546// virtual string get_name() const
7547// {
7548// return NAME;
7549// }
7550//
7551// static Processor *NEW()
7552// {
7553// return new CoordinateMaskFileProcessor();
7554// }
7555//
7556// virtual string get_desc() const
7557// {
7558// return "Multiplies the image by the specified file using pixel coordinates instead of pixel indices. The images can be different size.";
7559// }
7560//
7561// virtual TypeDict get_param_types() const
7562// {
7563// TypeDict d;
7564// d.put("filename", EMObject::STRING, "mask image file name");
7565// return d;
7566// }
7567//
7568// static const string NAME;
7569// };
7570
7582 {
7583 public:
7584 PaintProcessor():x(0), y(0), z(0),r1(0), v1(0.0), r2(0), v2(0.0)
7585 {
7586 }
7587
7588 virtual string get_name() const
7589 {
7590 return NAME;
7591 }
7592
7593 static Processor *NEW()
7594 {
7595 return new PaintProcessor();
7596 }
7597
7598 virtual string get_desc() const
7599 {
7600 return "Paints a circle with a decaying edge into the image. r<r1 -> v1, r1<r<r2 -> (v1,v2), r>r2 unchanged";
7601 }
7602
7604 {
7605 TypeDict d;
7606 d.put("x", EMObject::INT, "x coordinate for Center of circle");
7607 d.put("y", EMObject::INT, "y coordinate for Center of circle");
7608 d.put("z", EMObject::INT, "z coordinate for Center of circle");
7609 d.put("r1", EMObject::INT, "Inner radius");
7610 d.put("v1", EMObject::FLOAT, "Inner value");
7611 d.put("r2", EMObject::INT, "Outter radius");
7612 d.put("v2", EMObject::FLOAT, "Outer Value");
7613 return d;
7614 }
7615
7616 virtual void set_params(const Dict & new_params)
7617 {
7618 params = new_params;
7619
7620 if (params.has_key("x")) x = params["x"];
7621 if (params.has_key("y")) y = params["y"];
7622 if (params.has_key("z")) z = params["z"];
7623 if (params.has_key("r1")) r1 = params["r1"];
7624 if (params.has_key("r2")) r2 = params["r2"];
7625 if (params.has_key("v1")) v1 = params["v1"];
7626 if (params.has_key("v2")) v2 = params["v2"];
7627 }
7628
7629 static const string NAME;
7630
7631 protected:
7632 virtual void process_inplace(EMData *image);
7633
7634 int x,y,z,r1;
7635 float v1;
7636 int r2;
7637 float v2;
7638
7639 };
7640
7641
7647 {
7648 public:
7649 virtual string get_name() const
7650 {
7651 return NAME;
7652 }
7653
7654 static Processor *NEW()
7655 {
7656 return new DirectionalSumProcessor();
7657 }
7658
7662 virtual EMData* process(const EMData* const image);
7663
7667 virtual void process_inplace(EMData*) {
7668 throw InvalidCallException("The directional sum processor does not work inplace");
7669 }
7670
7672 {
7673 TypeDict d;
7674 d.put("axis", EMObject::STRING,"The direction of the sum, either x,y or z. Returned axes are xy, xz or zy.");
7675 d.put("first", EMObject::INT,"The first position along the speficied axis to use in the sum. Neg val -> nx/y/z+first (default=0)");
7676 d.put("last", EMObject::INT,"The last position along the speficied axis to use in the sum. Neg val -> nx/y/z+last (default=-1)");
7677 return d;
7678 }
7679
7680 string get_desc() const
7681 {
7682 return "Calculates the projection of the image along one of the axial directions, either x, y or z";
7683 }
7684
7685 static const string NAME;
7686 };
7687
7696 {
7697 public:
7698 virtual EMData* process(const EMData* const image);
7699 virtual void process_inplace(EMData*);
7700
7701 virtual string get_name() const
7702 {
7703 return NAME;
7704 }
7705
7706 static Processor *NEW()
7707 {
7708 return new WatershedProcessor();
7709 }
7710
7711 virtual string get_desc() const
7712 {
7713 return "Watershed segmentation. Warning: uses up to 2.5x the map size in RAM. This will segment all voxels above threshold except for a 1-voxel wide border on all edges.";
7714 }
7715
7717 {
7718 TypeDict d;
7719 d.put("nseg", EMObject::INT, "Number of segments to (attempt) to produce. The actual number may be fewer. (default=12)" );
7720 d.put("thr",EMObject::FLOAT,"Isosurface threshold value. Pixels below this value will not be segmented. All voxels above this value will be segmented. (default=0.5)");
7721 d.put("segbymerge", EMObject::INT, "If set, will achieve the specified number of segments by progressively merging the most connected segments. Can produce very different results." );
7722 d.put("verbose", EMObject::INT, "If set, will print console output while running" );
7723 return d;
7724 }
7725
7726 static const string NAME;
7727
7728// private:
7729
7730 };
7731
7737 {
7738 public:
7739 virtual void process_inplace(EMData * image);
7740
7741 virtual string get_name() const
7742 {
7743 return NAME;
7744 }
7745
7746 virtual string get_desc() const
7747 {
7748 return "This will attempt to mask out a single subunit from a symmetric structure. There may be some ambiguity at the intersection, so the result may not be unambiguous.";
7749 }
7750
7751 static Processor *NEW()
7752 {
7753 return new SegmentSubunitProcessor();
7754 }
7755
7757 {
7758 TypeDict d;
7759 d.put("thr", EMObject::FLOAT, "Minimum density to consider for extraction");
7760 d.put("sym", EMObject::STRING, "Symmetry");
7761// d.put("seed", EMObject::EMDATA, "An (optional) single level mask volume to use as a seed after symmetrizing");
7762 return d;
7763 }
7764
7765 static const string NAME;
7766 };
7767
7768
7769
7779 template<class Type>
7781 public:
7786 virtual void process_inplace(EMData * image) {
7787 if ( ! params.has_key("with") ) throw InvalidParameterException("You must supply the \"with\" parameter");
7788 EMData* with = params["with"];
7789
7790 if ( with->get_xsize() != image->get_xsize() || with->get_ysize() != image->get_ysize() || with->get_zsize() != image->get_zsize() )
7791 throw ImageDimensionException("The images you are operating on do not have the same dimensions");
7792
7793 float* image_data = image->get_data();
7794 float* with_data = with->get_data();
7795
7796 std::transform(image_data,image_data+image->get_size(),with_data,image_data,Type::binary_operate);
7797 image->update();
7798 }
7799
7800 virtual string get_name() const
7801 {
7802 return op.get_name();
7803 }
7804
7805 virtual string get_desc() const
7806 {
7807 return op.get_desc();
7808 }
7809
7810 static Processor *NEW()
7811 {
7812 return new BinaryOperateProcessor<Type>();
7813 }
7814
7816 {
7817 TypeDict d;
7818 d.put("with", EMObject::EMDATA,"The second image");
7819 return d;
7820 }
7821
7822 static const string NAME;
7823 private:
7824 Type op;
7825 };
7826
7828 public:
7829 string get_name() const
7830 {
7831 return NAME;
7832 }
7833
7834 string get_desc() const
7835 {
7836 return "Compares pixels in two images, returning an image with the maximum pixel value in each pixel location";
7837 }
7838
7839 static float binary_operate(const float& left, const float& right) {
7840 if (left > right) return left;
7841 return right;
7842 }
7843
7844 static const string NAME;
7845 };
7846
7848 public:
7849 string get_name() const
7850 {
7851 return NAME;
7852 }
7853
7854 string get_desc() const
7855 {
7856 return "Compares pixels in two images, returning an image with the minimum pixel value in each pixel location";
7857 }
7858
7859 static float binary_operate(const float& left, const float& right) {
7860 if (left < right) return left;
7861 return right;
7862 }
7863
7864 static const string NAME;
7865 };
7866
7871 {
7872 public:
7873
7874 virtual string get_name() const
7875 {
7876 return NAME;
7877 }
7878
7879 virtual string get_desc() const
7880 {
7881 return "Filters the image so its 1-D power spectrum matches a second image. Optionally can incorporate a dot product to better match noise.";
7882 }
7883
7884 static Processor *NEW()
7885 {
7886 return new MatchSFProcessor();
7887 }
7888
7890 {
7891 TypeDict d;
7892 d.put("to", EMObject::EMDATA, "The image to match with. Make sure apix values are correct.");
7893 d.put("bydot", EMObject::BOOL, "Rather than matching the intensity profile, uses the complex dot product as a function of resolution to match only the portion that agrees.");
7894 d.put("keephires", EMObject::BOOL, "If the reference being matched is heavily filtered, total information loss may occur at some resolutions. This insures that some information is kept at all resolutions.");
7895 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
7896 d.put("interpolate", EMObject::BOOL, "Whether or not to interpolate the radial scaling function. Default=true");
7897 return d;
7898 }
7899
7900 static const string NAME;
7901
7902 protected:
7903 void create_radial_func(vector < float >&radial_mask, EMData *image) const;
7904 };
7905
7906
7912 {
7913 public:
7914
7915 virtual string get_name() const
7916 {
7917 return NAME;
7918 }
7919
7920 virtual string get_desc() const
7921 {
7922 return "Filters the image so its 1-D power spectrum matches a supplied S,Y curve. If the S axis does not extend to Nyquist, only a uniform scaling will be applied beyond the end of the supplied curve. ";
7923 }
7924
7925 static Processor *NEW()
7926 {
7927 return new SetSFProcessor();
7928 }
7929
7931 {
7932 TypeDict d;
7933 d.put("strucfac", EMObject::XYDATA, "An XYData object contaning the intensity (not amplitude) to be imposed as a function of S");
7934 d.put("filename", EMObject::STRING, "Filename of a text file containing s,y data as an alternative to passing an XYData object.");
7935 d.put("scale", EMObject::XYDATA, "A constant to multiply strucfac by to rescale the output. Setting to 1/ny^3 provides an alternative normalization. default = 1.0");
7936 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
7937 return d;
7938 }
7939
7940 static const string NAME;
7941
7942 protected:
7943 void create_radial_func(vector < float >&radial_mask, EMData *image) const;
7944 };
7945
7951 {
7952 public:
7953
7954 void process_inplace(EMData * image);
7955
7956 virtual string get_name() const
7957 {
7958 return NAME;
7959 }
7960
7961 virtual string get_desc() const
7962 {
7963 return "Forces a map/image to have an isotropic radial power distribution. Unlike filter.setstrucfac, which produces a filtered, but anisotropic map, this forces the radial power to be the same in all directions. Phases are unchanged.";
7964 }
7965
7966 static Processor *NEW()
7967 {
7968 return new SetIsoPowProcessor();
7969 }
7970
7972 {
7973 TypeDict d;
7974 d.put("strucfac", EMObject::XYDATA, "An XYData object contaning the intensity (not amplitude) to be imposed as a function of S");
7975 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
7976 return d;
7977 }
7978
7979 static const string NAME;
7980
7981 };
7982
7987 {
7988 public:
7989 virtual void process_inplace(EMData * image);
7990
7991 virtual string get_name() const
7992 {
7993 return NAME;
7994 }
7995
7996 static Processor *NEW()
7997 {
7998 return new SmartMaskProcessor();
7999 }
8000
8001 virtual string get_desc() const
8002 {
8003 return "Smart mask processor.";
8004 }
8005
8007 {
8008 TypeDict d;
8009 d.put("mask", EMObject::FLOAT, "mask value");
8010 return d;
8011 }
8012
8013 static const string NAME;
8014 };
8015
8021 {
8022 public:
8023 virtual void process_inplace(EMData * image);
8024
8025 virtual string get_name() const
8026 {
8027 return NAME;
8028 }
8029
8030 virtual string get_desc() const
8031 {
8032 return "Iterative expansion of a binary mask, val1 is number of pixels to expand, if val2!=0 will make a soft Gaussian edge starting after val2 pixels.";
8033 }
8034
8035 static Processor *NEW()
8036 {
8037 return new IterBinMaskProcessor();
8038 }
8039
8041 {
8042 TypeDict d;
8043 d.put("val1", EMObject::FLOAT, "number of pixels to expand");
8044 d.put("val2", EMObject::FLOAT, "number of Gaussian pixels to expand, following the first expansion");
8045 return d;
8046 }
8047
8048 static const string NAME;
8049 };
8050
8054 {
8055 public:
8056 static string get_group_desc()
8057 {
8058 return "Base class for a group of 'processors' used to create test image.";
8059 }
8060
8061 protected:
8062 void preprocess(EMData * image);
8063 int nx, ny, nz; //this is the size of the source image
8064 };
8065
8075 {
8076 public:
8077 virtual void process_inplace(EMData * image);
8078
8079 virtual string get_name() const
8080 {
8081 return NAME;
8082 }
8083
8084 virtual string get_desc() const
8085 {
8086 return "Replace a source image as a strict Gaussian ";
8087 }
8088
8089 static Processor * NEW()
8090 {
8091 return new TestImagePureGaussian();
8092 }
8093
8095 {
8096 TypeDict d;
8097 d.put("x_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on x direction");
8098 d.put("y_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on y direction");
8099 d.put("z_sigma", EMObject::FLOAT, "sigma value for this Gaussian blob on z direction");
8100 d.put("x_center", EMObject::FLOAT, "center for this Gaussian blob on x direction" );
8101 d.put("y_center", EMObject::FLOAT, "center for this Gaussian blob on y direction" );
8102 d.put("z_center", EMObject::FLOAT, "center for this Gaussian blob on z direction" );
8103 return d;
8104 }
8105
8106 static const string NAME;
8107 };
8108
8113 {
8114 public:
8115 virtual void process_inplace(EMData * image);
8116
8117 virtual string get_name() const
8118 {
8119 return NAME;
8120 }
8121
8122 virtual string get_desc() const
8123 {
8124 return "Replace a source image with pink Fourier noise, based on a Gaussian. Random phase.";
8125 }
8126
8127 static Processor * NEW()
8128 {
8129 return new TestImageFourierNoiseGaussian();
8130 }
8131
8133 {
8134 TypeDict d;
8135 d.put("sigma", EMObject::FLOAT, "sigma value");
8136 return d;
8137 }
8138
8139 static const string NAME;
8140 };
8141
8147 {
8148 public:
8149 virtual void process_inplace(EMData * image);
8150
8151 virtual string get_name() const
8152 {
8153 return NAME;
8154 }
8155
8156 virtual string get_desc() const
8157 {
8158 return "Replace a source image with a single radial Fourier band with a (truncated) Gaussian profile. f(s)=exp(-(s-c/w)^2). width=sqrt(2) is the minimum width to produce a flat sum with a spacing of 1 pixel.";
8159 }
8160
8161 static Processor * NEW()
8162 {
8163 return new TestImageFourierGaussianBand();
8164 }
8165
8167 {
8168 TypeDict d;
8169 d.put("center", EMObject::FLOAT, "center of the band in Fourier pixels. required");
8170 d.put("width", EMObject::FLOAT, "1/2e width of Gaussian in Fourier pixels. default = sqrt(2)");
8171 return d;
8172 }
8173
8174 static const string NAME;
8175 };
8176
8177
8183 {
8184 public:
8185 virtual void process_inplace(EMData * image);
8186
8187 virtual string get_name() const
8188 {
8189 return NAME;
8190 }
8191
8192 virtual string get_desc() const
8193 {
8194 return "Replace a source image with Fourier noise using amplitude information that is stored in a profile.";
8195 }
8196
8197 static Processor * NEW()
8198 {
8199 return new TestImageFourierNoiseProfile();
8200 }
8201
8203 {
8204 TypeDict d;
8205 d.put("profile", EMObject::FLOATARRAY, "The noise profile, squared amplitude. As in, what is the EMAN2CTF.background attribute");
8206 return d;
8207 }
8208
8209 static const string NAME;
8210 };
8211
8212
8218 {
8219 public:
8220 virtual void process_inplace(EMData * image);
8221
8222 virtual string get_name() const
8223 {
8224 return NAME;
8225 }
8226
8227 virtual string get_desc() const
8228 {
8229 return "Weight the amplitudes of an image based on radial noise and snr curves ";
8230 }
8231
8232 static Processor * NEW()
8233 {
8234 return new CTFSNRWeightProcessor();
8235 }
8236
8238 {
8239 TypeDict d;
8240 d.put("noise", EMObject::FLOATARRAY, "The noise profile, squared amplitude. As in, what is the EMAN2CTF.background attribute");
8241 d.put("snr", EMObject::FLOATARRAY, "Squared amplitude divided by squared noise amplitude. As in, what is the EMAN2CTF.snr attribute");
8242 d.put("boost", EMObject::FLOAT, "Multiplicative signal boost");
8243 return d;
8244 }
8245
8246 static const string NAME;
8247 };
8248
8249
8250
8256 {
8257 public:
8258 virtual void process_inplace(EMData * image);
8259
8260 virtual string get_name() const
8261 {
8262 return NAME;
8263 }
8264
8265 virtual string get_desc() const
8266 {
8267 return "Insert an oscillating sine wave into the pixel data";
8268 }
8269
8270 static Processor * NEW()
8271 {
8272 return new TestImageLineWave();
8273 }
8274
8276 {
8277 TypeDict d;
8278 d.put("period", EMObject::FLOAT, "The period of the oscillating sine wave. Default 10.");
8279 return d;
8280 }
8281
8282 static const string NAME;
8283 };
8284
8285
8294 {
8295 public:
8299 virtual void process_inplace(EMData * image);
8300
8301 virtual string get_name() const
8302 {
8303 return NAME;
8304 }
8305
8306 virtual string get_desc() const
8307 {
8308 return "Make an image consisting various objects, useful for tomographic testing";
8309 }
8310
8311 static Processor * NEW()
8312 {
8313 return new TestTomoImage();
8314 }
8315
8316 static const string NAME;
8317
8318 private:
8319 void insert_solid_ellipse( EMData* image, const Region& region, const float& value, const Transform& t3d = Transform() );
8320 void insert_hollow_ellipse( EMData* image, const Region& region, const float& value, const int& radius, const Transform& t3d = Transform() );
8321 void insert_rectangle( EMData* image, const Region& region, const float& value, const Transform& t3d = Transform() );
8322 };
8323
8332 {
8333 public:
8334 virtual void process_inplace(EMData * image);
8335
8336 virtual string get_name() const
8337 {
8338 return NAME;
8339 }
8340
8341 virtual string get_desc() const
8342 {
8343 return "Make a gradient image of the form y=mx+b, where x is any of the image axes.";
8344 }
8345
8346 static Processor * NEW()
8347 {
8348 return new TestImageGradient();
8349 }
8350
8352 {
8353 TypeDict d;
8354 d.put("axis", EMObject::STRING, "The axis the will be used to determine pixel values. Must be x,y or z");
8355 d.put("m", EMObject::FLOAT, "m in the equation m*axis+b. Default is 1.0");
8356 d.put("b", EMObject::FLOAT, "b in the equation m*axis+b. Default is 0.0");
8357 return d;
8358 }
8359
8360 static const string NAME;
8361 };
8362
8371 {
8372 public:
8377 virtual void process_inplace(EMData * image);
8378
8379 virtual string get_name() const
8380 {
8381 return NAME;
8382 }
8383
8384 virtual string get_desc() const
8385 {
8386 return "Make an image consisting of a single cross";
8387 }
8388
8389 static Processor * NEW()
8390 {
8391 return new TestImageAxes();
8392 }
8393
8395 {
8396 TypeDict d;
8397 d.put("int", EMObject::FLOAT, "radius of the lines emanating from the origin");
8398 d.put("fill", EMObject::FLOAT, "value to make non-zero pixels");
8399 return d;
8400 }
8401
8402 static const string NAME;
8403 };
8404
8411 {
8412 public:
8413 virtual void process_inplace(EMData * image);
8414
8415 virtual string get_name() const
8416 {
8417 return NAME;
8418 }
8419
8420 virtual string get_desc() const
8421 {
8422 return "Replace a source image as a Gaussian Blob";
8423 }
8424
8425 static Processor * NEW()
8426 {
8427 return new TestImageGaussian();
8428 }
8429
8431 {
8432 TypeDict d;
8433 d.put("sigma", EMObject::FLOAT, "sigma value for this Gaussian blob");
8434 d.put("axis", EMObject::STRING, "specify a major axis for asymmetric features");
8435 d.put("c", EMObject::FLOAT, "distance between focus and the center of an ellipse");
8436 return d;
8437 }
8438
8439 static const string NAME;
8440 };
8441
8445 {
8446 public:
8447 virtual void process_inplace(EMData * image);
8448
8449 virtual string get_name() const
8450 {
8451 return NAME;
8452 }
8453
8454 virtual string get_desc() const
8455 {
8456 return "Replace a source image with a lumpy S-curve used for alignment testing";
8457 }
8458
8459 static Processor * NEW()
8460 {
8461 return new TestImageScurve();
8462 }
8463
8465 {
8466 TypeDict d;
8467 return d;
8468 }
8469
8470 static const string NAME;
8471 };
8472
8481 {
8482 public:
8483 virtual void process_inplace(EMData * image);
8484
8485 virtual string get_name() const
8486 {
8487 return NAME;
8488 }
8489
8490 virtual string get_desc() const
8491 {
8492 return "Replace a source image in 2d or 3d with a spherical wave cos(2*pi*r/wavelength+phase) also 1/r (2d) or 1/r^2 (3d)";
8493 }
8494
8495 static Processor * NEW()
8496 {
8497 return new TestImageSphericalWave();
8498 }
8499
8501 {
8502 TypeDict d;
8503 d.put("wavelength", EMObject::FLOAT, "cos(2*pi*r/wavelength+phase)");
8504 d.put("phase", EMObject::FLOAT, "in radians");
8505 d.put("x", EMObject::FLOAT, "center of the spherical wave");
8506 d.put("y", EMObject::FLOAT, "center of the spherical wave");
8507 d.put("z", EMObject::FLOAT, "center of the spherical wave");
8508 return d;
8509 }
8510
8511 static const string NAME;
8512 };
8513
8514
8524 {
8525 public:
8526 virtual void process_inplace(EMData * image);
8527
8528 virtual string get_name() const
8529 {
8530 return NAME;
8531 }
8532
8533 virtual string get_desc() const
8534 {
8535 return "Replace a source image as a sine wave in specified wave length";
8536 }
8537
8538 static Processor * NEW()
8539 {
8540 return new TestImageSinewave();
8541 }
8542
8544 {
8545 TypeDict d;
8546 d.put("wavelength", EMObject::FLOAT, "wavelength in equation sin(x*2*PI/wavelength - phase*180/PI)");
8547 d.put("axis", EMObject::STRING, "(optional) specify a major axis for asymmetric features, default x axis");
8548 d.put("phase", EMObject::FLOAT, "(optional) the phase in radians");
8549 d.put("az", EMObject::FLOAT, "(optional) angle in degree. for 2D image, this is the rotated angle of the image, \
8550 in 3D image, it's az for euler angle. default is zero");
8551 d.put("alt", EMObject::FLOAT, "(optional) angle in degree. only in 3D case, alt for euler angle, default is zero");
8552 d.put("phi", EMObject::FLOAT, "(optional) angle in degree. only in 3D case, phi for euler angle, default is zero");
8553 return d;
8554 }
8555
8556 static const string NAME;
8557 };
8558
8566 {
8567 public:
8568 virtual void process_inplace(EMData * image);
8569
8570 virtual string get_name() const
8571 {
8572 return NAME;
8573 }
8574
8575 virtual string get_desc() const
8576 {
8577 return "Replace a source image as a circular sine wave in specified wave length";
8578 }
8579
8580 static Processor * NEW()
8581 {
8582 return new TestImageSinewaveCircular();
8583 }
8584
8586 {
8587 TypeDict d;
8588 d.put("wavelength", EMObject::FLOAT, "(required)this value is the d in function |sin(x/d)|, unit: pixel");
8589 d.put("axis", EMObject::STRING, "specify a major axis for asymmetric features");
8590 d.put("c", EMObject::FLOAT, "distance between focus and the center of an ellipse");
8591 d.put("phase", EMObject::FLOAT, "(optional)phase for sine wave, default is 0");
8592 return d;
8593 }
8594
8595 static const string NAME;
8596 };
8597
8605 {
8606 public:
8607 virtual void process_inplace(EMData * image);
8608
8609 virtual string get_name() const
8610 {
8611 return NAME;
8612 }
8613
8614 virtual string get_desc() const
8615 {
8616 return "Replace a source image as a square or cube depends on 2D or 3D of the source image";
8617 }
8618
8619 static Processor * NEW()
8620 {
8621 return new TestImageSquarecube();
8622 }
8623
8625 {
8626 TypeDict d;
8627 d.put("edge_length", EMObject::FLOAT, "edge length of the square or cube, unit: pixel");
8628 d.put("axis", EMObject::STRING, "specify a major axis for asymmetric features");
8629 d.put("odd_edge", EMObject::FLOAT, "edge length for the asymmetric axis");
8630 d.put("fill", EMObject::INT, "Flag indicating if image is filled, default filled, 1 for filled, 0 for blank");
8631 return d;
8632 }
8633
8634 static const string NAME;
8635 };
8636
8645 {
8646 public:
8647 virtual void process_inplace(EMData * image);
8648
8649 virtual string get_name() const
8650 {
8651 return NAME;
8652 }
8653
8654 virtual string get_desc() const
8655 {
8656 return "Insert an ellipse into the image.";
8657 }
8658
8659 static Processor * NEW()
8660 {
8661 return new TestImageEllipse();
8662 }
8663
8665 {
8666 TypeDict d;
8667 d.put("a", EMObject::FLOAT, "equatorial radius along x axes (major semiaxes)");
8668 d.put("b", EMObject::FLOAT, "equatorial radius along y axes (minor semiaxes)");
8669 d.put("c", EMObject::FLOAT, "polar radius for ellipsoid (x^2/a^2+y^2/b^2+z^2/c^2=1)");
8670 d.put("transform", EMObject::TRANSFORM, "Optionally transform the ellipse");
8671 d.put("fill", EMObject::FLOAT, "value you want to fill in ellipse, default to 1.0");
8672 return d;
8673 }
8674
8675 static const string NAME;
8676 };
8677
8690 {
8691 public:
8692 virtual void process_inplace(EMData * image);
8693
8694 virtual string get_name() const
8695 {
8696 return NAME;
8697 }
8698
8699 virtual string get_desc() const
8700 {
8701 return "Insert a hollow ellipse into the image.";
8702 }
8703
8704 static Processor * NEW()
8705 {
8706 return new TestImageHollowEllipse();
8707 }
8708
8710 {
8711 TypeDict d;
8712 d.put("xwidth", EMObject::FLOAT, "inner equatorial radii along x axes");
8713 d.put("ywidth", EMObject::FLOAT, "inner equatorial radii along y axes");
8714 d.put("zwidth", EMObject::FLOAT, "inner polar radius");
8715 d.put("a", EMObject::FLOAT, "outter equatorial radii along x axes");
8716 d.put("b", EMObject::FLOAT, "outter equatorial radii along y axes");
8717 d.put("c", EMObject::FLOAT, "outter polar radius");
8718 d.put("width",EMObject::FLOAT, "width - specify the width or specify each width explicitly - xwidth, ywidth, zwidth");
8719 d.put("transform", EMObject::TRANSFORM, "Optionally transform the ellipse");
8720 d.put("fill", EMObject::FLOAT, "value you want to fill in hollow ellipse, default to 1.0");
8721 return d;
8722 }
8723
8724 static const string NAME;
8725 };
8726
8734 {
8735 public:
8736 virtual void process_inplace(EMData * image);
8737
8738 virtual string get_name() const
8739 {
8740 return NAME;
8741 }
8742
8743 virtual string get_desc() const
8744 {
8745 return "Replace a source image as a circle or sphere depends on 2D or 3D of the source image";
8746 }
8747
8748 static Processor * NEW()
8749 {
8750 return new TestImageCirclesphere();
8751 }
8752
8754 {
8755 TypeDict d;
8756 d.put("radius", EMObject::FLOAT, "radius of circle or sphere, unit: pixel");
8757 d.put("axis", EMObject::STRING, "specify a major axis for asymmetric features");
8758 d.put("c", EMObject::FLOAT, "distance between focus and the center of an ellipse");
8759 d.put("fill", EMObject::INT, "Flag indicating if image is filled, default filled, 1 for filled, 0 for blank.");
8760 return d;
8761 }
8762
8763 static const string NAME;
8764 };
8765
8771 {
8772 public:
8773 virtual void process_inplace(EMData * image);
8774
8775 virtual string get_name() const
8776 {
8777 return NAME;
8778 }
8779
8780 virtual string get_desc() const
8781 {
8782 return "Replace a source image as a uniform random noise, random number generated from gsl_rng_mt19937, the pixel value is [0, 1)";
8783 }
8784
8785 static Processor * NEW()
8786 {
8787 return new TestImageNoiseUniformRand();
8788 }
8789
8791 {
8792 TypeDict d;
8793 d.put("seed", EMObject::INT, "seed for random number generator");
8794 return d;
8795 }
8796
8797 static const string NAME;
8798 };
8799
8811 {
8812 public:
8813 virtual void process_inplace(EMData * image);
8814
8815 virtual string get_name() const
8816 {
8817 return NAME;
8818 }
8819
8820 virtual string get_desc() const
8821 {
8822 return "Replace a source image as a random noise, the random value is gaussian distributed";
8823 }
8824
8825 static Processor * NEW()
8826 {
8827 return new TestImageNoiseGauss();
8828 }
8829
8831 {
8832 TypeDict d;
8833 d.put("sigma", EMObject::FLOAT, "sigma value of gausian distributed noise, default is 0.5");
8834 d.put("mean", EMObject::FLOAT, "mean value of gausian distributed noise, default is zero.");
8835 d.put("seed", EMObject::INT, "the seed for random number generator, default is not to reseed.");
8836
8837 return d;
8838 }
8839
8840 static const string NAME;
8841 };
8842
8848 {
8849 public:
8850 virtual void process_inplace(EMData * image);
8851
8852 virtual string get_name() const
8853 {
8854 return NAME;
8855 }
8856
8857 virtual string get_desc() const
8858 {
8859 return "Replace a source image as a cylinder";
8860 }
8861
8862 static Processor * NEW()
8863 {
8864 return new TestImageCylinder();
8865 }
8866
8868 {
8869 TypeDict d;
8870 d.put("radius", EMObject::FLOAT, "radius for the cylinder");
8871 d.put("height", EMObject::FLOAT, "height for the cylinder, by default it's the nz");
8872
8873 return d;
8874 }
8875
8876 static const string NAME;
8877 };
8878
8885 {
8886 public:
8887 virtual void process_inplace(EMData * image);
8888
8889 virtual string get_name() const
8890 {
8891 return NAME;
8892 }
8893
8894 virtual string get_desc() const
8895 {
8896 return "Replace source image with a disc";
8897 }
8898
8899 static Processor * NEW()
8900 {
8901 return new TestImageDisc();
8902 }
8903
8905 {
8906 TypeDict d;
8907 d.put("major", EMObject::FLOAT, "major axis length for face of disc");
8908 d.put("minor", EMObject::FLOAT, "major axis length for face of disc");
8909 d.put("height", EMObject::FLOAT, "height of disc, by default it's nz");
8910 return d;
8911 }
8912
8913 static const string NAME;
8914 };
8915
8922 {
8923 public:
8924 virtual void process_inplace(EMData * image);
8925
8926 virtual string get_name() const
8927 {
8928 return NAME;
8929 }
8930
8931 static Processor *NEW()
8932 {
8933 return new CCDNormProcessor();
8934 }
8935
8936 virtual string get_desc() const
8937 {
8938 return "normalize the 4 quadrants of a CCD image";
8939 }
8940
8942 {
8943 TypeDict d;
8944 d.put("width", EMObject::INT, "number of pixels on either side of the seam to sample");
8945 return d;
8946 }
8947
8948 static const string NAME;
8949 };
8950
8959 {
8960 public:
8961 virtual void process_inplace(EMData * image);
8962
8963 virtual string get_name() const
8964 {
8965 return NAME;
8966 }
8967
8968 static Processor *NEW()
8969 {
8970 return new WaveletProcessor();
8971 }
8972
8974 {
8975 TypeDict d;
8976 d.put("type", EMObject::STRING, "'daub', 'harr' or 'bspl'");
8977 d.put("dir", EMObject::INT, "1 for forward transform, -1 for inverse transform");
8978 d.put("ord", EMObject::INT, "Daubechies (4,6,8,...,20), for Harr (2), for B-Splines (103, 105, 202, 204, 206, 208, 301, 303, 305 307, 309)");
8979 return d;
8980 }
8981
8982 virtual string get_desc() const
8983 {
8984 return "Computes the DWT (discrete wavelet transform) of an image in one of 3 possible bases";
8985 }
8986
8987 static const string NAME;
8988 };
8989
9006 {
9007 public:
9008 virtual void process_inplace(EMData* image);
9009
9010 virtual string get_name() const
9011 {
9012 return NAME;
9013 }
9014
9015 static Processor *NEW()
9016 {
9017 return new TomoTiltEdgeMaskProcessor();
9018 }
9019
9021 {
9022 TypeDict d;
9023 d.put("biedgemean", EMObject::BOOL, "Mutually exclusive of edgemean. Experimental. Causes the pixels in the masked out areas to take the average value of both the left and right edge pixel strips");
9024 d.put("edgemean", EMObject::BOOL, "Mutually exclusive of biedgemean. Masked pixels values assume the mean edge pixel value, independently, for both sides of the image.");
9025 d.put("angle", EMObject::INT, "The angle that the image is, with respect to the zero tilt image");
9026 d.put("gauss_falloff",EMObject::INT, "Causes the edge masking to have a smooth Gaussian fall-off - this parameter specifies how many pixels the fall-off will proceed over. Default is 0.");
9027 d.put("gauss_sigma",EMObject::FLOAT,"The sigma of the Gaussian function used to smooth the edge fall-off (functional form is exp(-(pixel distance)^2/sigma^2)");
9028 d.put("angle_fim",EMObject::BOOL,"Read fim as 'from image metadata' - this causes the altitude angle stored in by the image object (i.e. as extracted from the header, as currently stored in memory) to be used as the angle. This overrides the angle argument");
9029 return d;
9030 }
9031
9032 virtual string get_desc() const
9033 {
9034 return "Masks the part of the image which is not present in the 0-tilt image. Masked areas can be 0 or set to the edgemean (of the nearest or both edges). Masked areas can also have a Gaussian fall-off to make the appearance smooth.";
9035 }
9036
9037 static const string NAME;
9038
9039 private:
9041 {
9042 public:
9043 GaussianFunctoid(const float sigma, const float mean = 0.0) : m_mean(mean), m_sigma_squared(sigma*sigma) {}
9045
9046 float operator()(const float distance )
9047 {
9048 return exp( -(distance-m_mean)*(distance-m_mean)/ (m_sigma_squared ));
9049 }
9050 private:
9052 };
9053
9054 };
9055
9071 {
9072 public:
9073 virtual void process_inplace(EMData* image);
9074
9075 virtual string get_name() const
9076 {
9077 return NAME;
9078 }
9079
9080 static Processor *NEW()
9081 {
9082 return new TomoTiltAngleWeightProcessor();
9083 }
9084
9086 {
9087 TypeDict d;
9088 d.put("angle", EMObject::INT, "The angle that the image is, with respect to the zero tilt image");
9089 d.put("angle_fim",EMObject::BOOL,"Read fim as 'from image metadata' - this causes the altitude angle stored in by the image object (i.e. as extracted from the header, as currently stored in memory) to be used as the angle. This overrides the angle argument");
9090 return d;
9091 }
9092
9093 virtual string get_desc() const
9094 {
9095 return "Weights the image by 1/cos(angle)";
9096 }
9097
9098 static const string NAME;
9099
9100 };
9101
9106 {
9107 public:
9108 void process_inplace(EMData * image);
9109
9110 string get_name() const
9111 {
9112 return NAME;
9113 }
9114
9115 static Processor *NEW()
9116 {
9117 return new FFTProcessor();
9118 }
9119
9121 {
9122 TypeDict d;
9123 d.put("dir", EMObject::INT, "1 for forward transform, -1 for inverse transform");
9124 return d;
9125 }
9126
9127 string get_desc() const
9128 {
9129 return "Computes the DFFT (Discrete Fast Fourier Transform) of an image";
9130 }
9131
9132 static const string NAME;
9133 };
9134
9142 {
9143 public:
9144// RadialProcessor():{}
9145
9146 string get_name() const
9147 {
9148 return NAME;
9149 }
9150
9151 static Processor *NEW()
9152 {
9153 return new RadialProcessor();
9154 }
9155
9156 void set_params(const Dict & new_params)
9157 {
9159 table = params["table"];;
9160 }
9162 {
9163 TypeDict d;
9164 d.put("table", EMObject::FLOATARRAY, "Radial array of floats, 1 float/pixel");
9165 return d;
9166 }
9167
9168 string get_desc() const
9169 {
9170 return "Multiply a real-space image by a radial function. 1 value / pixel, extending to corner. Missing values -> 0.";
9171 }
9172 static const string NAME;
9173 protected:
9174 void process_dist_pixel(float *pixel, float dist) const
9175 {
9176
9177// vector<float> table = params["table"];
9178 int tsize = table.size();
9179 float d = sqrt(dist);
9180 if (d>tsize-1) { *pixel=0.0f; return; }
9181
9182 int ir = int(d);
9183 float df = d - float(ir);
9184
9185 float f = table[ir] + df*(table[ir+1]-table[ir]);
9186// printf("%f\t%d\t%f\t%f\t%f\n",d, ir, f, *pixel, *pixel*f);
9187
9188 *pixel=*pixel * f;
9189 }
9190 vector<float> table;
9191
9192
9193 };
9194
9202 {
9203 public:
9205
9206 void process_inplace(EMData * image);
9207
9208 string get_name() const
9209 {
9210 return NAME;
9211 }
9212
9213 static Processor *NEW()
9214 {
9215 return new HistogramBin();
9216 }
9217
9219 {
9220 TypeDict d;
9221 d.put("nbins", EMObject::INT, "The number of bins the pixel values will be compressed into");
9222 d.put("debug", EMObject::BOOL, "Outputs debugging information (number of pixels per bin)");
9223 return d;
9224 }
9225
9226 string get_desc() const
9227 {
9228 return "Bins pixel values, similar to calculating a histogram. The histogram is comprised of 'nbins' bins, and the value assigned to each pixel in the bin is the midpoint of the bin's upper and lower limits. Defaults to 256 bins";
9229 }
9230
9231 static const string NAME;
9232
9233 protected:
9235 };
9236
9238 {
9239 protected:
9240 float radprofile(float r, int type);
9241 };
9242
9244 {
9245 public:
9246 void process_inplace(EMData * in);
9247
9248 string get_name() const
9249 {
9250 return NAME;
9251 }
9252
9253 static Processor *NEW()
9254 {
9255 return new ModelEMCylinderProcessor();
9256 }
9257
9258 string get_desc() const
9259 {
9260 return "Adds a cylinder with a radial density profile similar to that of an alpha helix.";
9261 }
9262
9264 {
9265 TypeDict d;
9266 d.put("type", EMObject::INT, "Radial profile of density method, defaults to 2: 0 = pure Gaussian falloff; 1 = Gaussian falloff + dip, so mean is zero; 2 = polynomial fitting of real helix density");
9267 d.put("length", EMObject::FLOAT, "cylinder length in angstroms, defaults to 3 turns (16.2 Angstroms)");
9268 d.put("x0", EMObject::INT, "x coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9269 d.put("y0", EMObject::INT, "y coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9270 d.put("z0", EMObject::INT, "z coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9271 //TODO: Check with Matt Baker about description strings
9272 return d;
9273 }
9274
9275 static const string NAME;
9276 };
9277
9279 {
9280 public:
9281 void process_inplace(EMData * in);
9282
9283 string get_name() const
9284 {
9285 return NAME;
9286 }
9287
9288 static Processor *NEW()
9289 {
9290 return new ApplyPolynomialProfileToHelix();
9291 }
9292
9293 string get_desc() const
9294 {
9295 return "Finds the CM of each z-axis slice and applies a polynomial radial profile about it.";
9296 }
9298 {
9299 TypeDict d;
9300 d.put("length", EMObject::FLOAT, "Helix length in angstroms.");
9301 d.put("z0", EMObject::INT, "z coordinate in pixels for the midpoint of the cylinder's axis, defaults to center of map");
9302 return d;
9303 }
9304
9305 static const string NAME;
9306 };
9307
9309 {
9310 public:
9311 virtual EMData* process(EMData * image);
9312 virtual void process_inplace(EMData * image);
9313
9314 virtual string get_name() const
9315 {
9316 return NAME;
9317// return "gorgon.binary_skel";
9318 }
9319 static Processor *NEW()
9320 {
9321 return new BinarySkeletonizerProcessor();
9322 }
9323 string get_desc() const
9324 {
9325 return "Creates a skeleton of the 3D image by considering whether density is above or below a threshold value.";
9326 }
9328 {
9329 TypeDict d;
9330 d.put("threshold", EMObject::FLOAT, "Threshold value.");
9331 d.put("min_curve_width", EMObject::INT, "Minimum curve width.");
9332 d.put("min_surface_width", EMObject::INT, "Minimum surface width.");
9333 d.put("mark_surfaces", EMObject::BOOL, "Mark surfaces with a value of 2.0f, whereas curves are 1.0f.");
9334 return d;
9335 }
9336 static const string NAME;
9337 };
9338
9340 {
9341 public:
9342 virtual EMData* process(const EMData* const image);
9343 virtual void process_inplace(EMData * image);
9344
9345 virtual string get_name() const
9346 {
9347 return NAME;
9348 }
9349 static Processor *NEW()
9350 {
9351 return new ConvolutionKernelProcessor();
9352 }
9353 string get_desc() const
9354 {
9355 return "Filters an image with a convolution kernel in real space.";
9356 }
9358 {
9359 TypeDict d;
9360 d.put("kernel", EMObject::FLOATARRAY, "the convolution kernel");
9361 return d;
9362 }
9363 static const string NAME;
9364 };
9365
9367 {
9368 public:
9369 //virtual EMData* process(const EMData* const image);
9370 virtual void process_inplace(EMData * image);
9371 virtual EMData* process(const EMData* const image);
9372
9373 virtual string get_name() const
9374 {
9375 return NAME;
9376 }
9377 static Processor *NEW()
9378 {
9379 return new RotateInFSProcessor( );
9380 }
9381 string get_desc() const
9382 {
9383 return "Rotates a Fourier object using a kernel.";
9384 }
9386 {
9387 TypeDict d;
9388 d.put("transform", EMObject::TRANSFORM, "transform");
9389 d.put("interpCutoff", EMObject::FLOAT, "cutoff for interpolation");
9390// d.put("offset", EMObject::FLOAT, "offset for FT centering");
9391// d.put("angle", EMObject::FLOAT, "angle");
9392 return d;
9393 }
9394 static const string NAME;
9395 };
9396
9397 /*
9398 * The base class for morphological processors.
9399 */
9401 {
9402 public:
9404 {
9405 }
9407
9408 virtual void set_params(const Dict & new_params)
9409 {
9410 params = new_params;
9411 if (params.size() == 1) {
9412 vector < EMObject > dict_values = params.values();
9413 value = dict_values[0];
9414 }
9415 }
9416
9417 static string get_group_desc()
9418 {
9419 return "The base class for morphological image processors.";
9420 }
9421
9422 protected:
9423 virtual void process_pixel(float *x) const = 0;
9424 virtual void calc_locals(EMData *)
9425 {
9426 }
9427 virtual void normalize(EMData *) const
9428 {
9429 }
9430
9431 float value;
9432 float maxval;
9433 float mean;
9434 float sigma;
9435 };
9436
9445 {
9446 public:
9447 virtual void process_inplace(EMData * image);
9448 virtual EMData* process(const EMData* const image);
9449
9450 virtual string get_name() const
9451 {
9452 return NAME;
9453 }
9454 static Processor *NEW()
9455 {
9457 }
9458 string get_desc() const
9459 {
9460 return "Binarize an image based on the circular average around each pixel in real space.";
9461 }
9463 {
9464 TypeDict d;
9465 d.put("thresh", EMObject::INT, "The radius threshold that the circular average of density keep dropping.");
9466 return d;
9467 }
9468 static const string NAME;
9469 };
9470
9477 {
9478 public:
9479 virtual void process_inplace(EMData * image);
9480 virtual EMData* process(const EMData* const image);
9481
9482 virtual string get_name() const
9483 {
9484 return NAME;
9485 }
9486 static Processor *NEW()
9487 {
9488 return new ObjDensityProcessor();
9489 }
9490 string get_desc() const
9491 {
9492 return "Sum of density of each object above threshold. Treats a 3D volume as 2D slices.";
9493 }
9495 {
9496 TypeDict d;
9497 d.put("thresh", EMObject::FLOAT, "The threshold to seperate objects.");
9498 return d;
9499 }
9500 static const string NAME;
9501 };
9502
9508 {
9509 public:
9510 virtual void process_inplace(EMData * image);
9511 virtual EMData* process(const EMData* const image);
9512
9513 virtual string get_name() const
9514 {
9515 return NAME;
9516 }
9517 static Processor *NEW()
9518 {
9519 return new ObjLabelProcessor();
9520 }
9521 string get_desc() const
9522 {
9523 return "Label each object above threshold. Also return the center of each object. Treats a 3D volume as 2D slices.";
9524 }
9526 {
9527 TypeDict d;
9528 d.put("write_centers", EMObject::BOOL, "Write the center of each object in the attribute obj_centers.");
9529 return d;
9530 }
9531 static const string NAME;
9532 };
9533
9539 {
9540 public:
9541 virtual void process_inplace(EMData * image);
9542 virtual EMData* process(const EMData* const image);
9543
9544 virtual string get_name() const
9545 {
9546 return NAME;
9547 }
9548 static Processor *NEW()
9549 {
9550 return new BwThinningProcessor();
9551 }
9552 string get_desc() const
9553 {
9554 return "Thinning a binary map to skelton using the Zhang-Suen thinning algorithm.";
9555 }
9556 int process_pixel(float* data, float* array, int step);
9558 {
9559 TypeDict d;
9560 d.put("thresh", EMObject::FLOAT, "The threshold to binarize the map.");
9561 d.put("verbose", EMObject::INT, "Verbose");
9562 d.put("preserve_value", EMObject::BOOL, "The value on the skeleton is the same as the original map.");
9563 d.put("ntimes", EMObject::INT, "Number of iterations in the thinning process. Default: -1 (perform thinning until the image is skeltonized");
9564 return d;
9565 }
9566 static const string NAME;
9567 };
9568
9574 {
9575 public:
9576 virtual string get_name() const
9577 {
9578 return NAME;
9579 }
9580 static Processor *NEW()
9581 {
9582 return new BwMajorityProcessor();
9583 }
9584 string get_desc() const
9585 {
9586 return "Set a pixel to white when >= N neighbors are white.";
9587 }
9589 {
9590 TypeDict d;
9591 d.put("thresh", EMObject::FLOAT, "The threshold to binarize the map.");
9592 d.put("nmaj", EMObject::INT, "Number of neighbors needed to set to white.");
9593 d.put("return_neighbor", EMObject::BOOL, "Return number of neighbor for each pixel.");
9594 return d;
9595 }
9596 static const string NAME;
9597
9598 protected:
9599 void process_pixel(float *pixel, const float *array, int n) const
9600 {
9601 float thresh=params.set_default("thresh",0);
9602 bool retnb=params.set_default("return_neighbor",false);
9603 int nmaj=params.set_default("nmaj",n/2+1);
9604 int nb=0;
9605 for (int i=0; i<n; i++){
9606 if (array[i]>thresh)
9607 nb++;
9608// nmaj--;
9609 }
9610 if (retnb)
9611 *pixel=nb;
9612 else
9613 *pixel=nb>=nmaj?1:0;
9614 }
9615 };
9616
9617
9624 {
9625 public:
9626 virtual void process_inplace(EMData * image);
9627 virtual EMData* process(const EMData* const image);
9628
9629 virtual string get_name() const
9630 {
9631 return NAME;
9632 }
9633 static Processor *NEW()
9634 {
9635 return new PruneSkeletonProcessor();
9636 }
9637 string get_desc() const
9638 {
9639 return "Prune branches from the skeleton. Remove a piece when the minimum distance through density from an endpoint to the nearest branch point is shorter than a given value.";
9640 }
9642 {
9643 TypeDict d;
9644 d.put("thresh", EMObject::FLOAT, "The threshold to binarize the map.");
9645 d.put("verbose", EMObject::INT, "Verbose");
9646 d.put("returnlength", EMObject::BOOL, "Return the distance of each white pixel to its nearest branch. Does not do the prunning.");
9647 d.put("maxdist", EMObject::INT, "Maximum distance from the endpoint to branchpoint");
9648 return d;
9649 }
9650 static const string NAME;
9651 };
9652
9658 {
9659 public:
9660 virtual void process_inplace(EMData * image);
9661 virtual EMData* process(const EMData* const image);
9662
9663 virtual string get_name() const
9664 {
9665 return NAME;
9666 }
9667 static Processor *NEW()
9668 {
9669 return new GrowSkeletonProcessor();
9670 }
9671 string get_desc() const
9672 {
9673 return "Grow a skeleton map toward a local direction.";
9674 }
9676 {
9677 TypeDict d;
9678 d.put("verbose", EMObject::INT, "Verbose");
9679 d.put("radius", EMObject::INT, "Half of the box size to determine the local direction.");
9680 return d;
9681 }
9682 static const string NAME;
9683 };
9684
9690 {
9691 public:
9692 virtual void process_inplace(EMData * image);
9693 virtual EMData* process(const EMData* const image);
9694
9695 virtual string get_name() const
9696 {
9697 return NAME;
9698 }
9699 static Processor *NEW()
9700 {
9701 return new ZThicknessProcessor();
9702 }
9703 string get_desc() const
9704 {
9705 return "Calculate the z thickness of each pixel in a binarized 3d image. For each white voxel, use the number of continus white voxels above and below this voxel in z direction as the thickness.";
9706 }
9708 {
9709 TypeDict d;
9710 d.put("thresh", EMObject::FLOAT, "Threshold for binarization");
9711 return d;
9712 }
9713 static const string NAME;
9714 };
9715
9722 {
9723 public:
9724 string get_name() const
9725 {
9726 return NAME;
9727 }
9728 static Processor *NEW()
9729 {
9730 return new ReplaceValuefromListProcessor();
9731 }
9733 {
9734 TypeDict d;
9735 d.put("colorlst", EMObject::FLOATARRAY, "Array of values to replace.");
9736 return d;
9737 }
9738 static const string NAME;
9739
9740 protected:
9741 void process_pixel(float *x) const
9742 {
9743 vector<float> lst =params["colorlst"];
9744 int num=lst.size();
9745 if (*x<num){
9746 *x=lst[int(*x)];
9747 }
9748 else{
9749 *x=0;
9750 }
9751 }
9752
9753 string get_desc() const
9754 {
9755 return "Replace the value of each pixel with a value in a given array, i.e. given an array of [3,7,9], pixels with value of 0 will become 3, 1 becomes 7, 2 becomes 9. The input image has to be int, or it will be round down. Values exceed the length of array are set to zero. Designed for labeled image coloring.";
9756 }
9757 };
9758
9759
9761 {
9762 public:
9763 virtual void process_inplace(EMData * image);
9764 virtual EMData* process(const EMData* const image);
9765
9766 virtual string get_name() const
9767 {
9768 return NAME;
9769 }
9770 static Processor *NEW()
9771 {
9772 return new AmpMultProcessor();
9773 }
9774 string get_desc() const
9775 {
9776 return "Multiply amplitude image. For reconstruction normalization.";
9777 }
9779 {
9780 TypeDict d;
9781 d.put("verbose", EMObject::INT, "Verbose");
9782 d.put("amp", EMObject::EMDATA, "Amplitude to multiply.");
9783 return d;
9784 }
9785 static const string NAME;
9786 };
9787
9788
9790 {
9791 public:
9792 PolyMaskProcessor():k0(0), k1(0), k2(0), k3(0), k4(0)
9793 {
9794 }
9795
9796 void set_params(const Dict & new_params)
9797 {
9798 params = new_params;
9799
9800 if (params.has_key("k0")) k0 = params["k0"];
9801 if (params.has_key("k1")) k1 = params["k1"];
9802 if (params.has_key("k2")) k2 = params["k2"];
9803 if (params.has_key("k3")) k3 = params["k3"];
9804 if (params.has_key("k4")) k4 = params["k4"];
9805
9806 }
9807
9809 {
9810 TypeDict d;
9811
9812 d.put("k0", EMObject::FLOAT, "constant term");
9813 d.put("k1", EMObject::FLOAT, "k x term");
9814 d.put("k2", EMObject::FLOAT, "k x^2 term");
9815 d.put("k3", EMObject::FLOAT, "k x^3 term");
9816 d.put("k4", EMObject::FLOAT, "k x^4 term");
9817 d.put("2d", EMObject::BOOL, "apply mask in 2D");
9818
9819 return d;
9820 }
9821
9822 string get_name() const
9823 {
9824 return NAME;
9825 }
9826 static Processor *NEW()
9827 {
9828 return new PolyMaskProcessor();
9829 }
9830
9831 string get_desc() const
9832 {
9833 return "Mask with polynomial falloff. k4 x^4 + k3 x^3 + k2 x^2 + k1 x + k0, where x is distance to center divided by nx/2.";
9834 }
9835
9836 static const string NAME;
9837
9838 protected:
9839 void process_pixel(float *pixel, int xi, int yi, int zi) const
9840 {
9841 float x=0.0f;
9842 if (params["2d"]){
9843 x = sqrt( pow((xi - nx/2),2.0f) + pow((yi - ny/2),2.0f) ) / (nx/2);
9844 }
9845 else{
9846 x = sqrt( pow((xi - nx/2),2.0f) + pow((yi - ny/2),2.0f) + pow((zi - nz/2),2.0f)) / (nx/2);
9847 }
9848
9849 (*pixel)*= k4*pow(x, 4.0f) + k3*pow(x, 3.0f) + k2*pow(x, 2.0f) + k1*x + k0;
9850 }
9851
9852 float k0,k1,k2,k3,k4;
9853 };
9854
9855
9856
9857
9858#ifdef SPARX_USING_CUDA
9859 /* class MPI CUDA kmeans processor
9860 * 2009-02-13 17:34:45 JB first version
9861 * 2009-09-02 11:19:10 JB for MPI version
9862 * python wrap for GPU cluster
9863 */
9864 class MPICUDA_kmeans {
9865 public:
9866 MPICUDA_kmeans();
9867 ~MPICUDA_kmeans();
9868 int setup(int extm, int extN, int extn, int extK, int extn_start);
9869 void append_flat_image(EMData* im, int pos);
9870 int init_mem(int numdev);
9871 void compute_im2();
9872 int random_ASG(long int rnd);
9873 vector<int> get_ASG();
9874 vector<int> get_asg();
9875 void compute_NC();
9876 vector<int> get_NC();
9877 void set_ASG(const vector <int>& ASG);
9878 void set_NC(const vector <int>& NC);
9879 int get_ct_im_mv();
9880 void set_T(float extT);
9881 float get_T();
9882 void compute_AVE();
9883 void set_AVE(EMData* im, int pos);
9884 vector<EMData*> get_AVE();
9885 int one_iter();
9886 //int one_iter_SSE();
9887 //int AVE_to_host();
9888 int one_iter_SA();
9889 vector<float> compute_ji();
9890 vector<float> compute_criterion(const vector <float>& Ji);
9891 int shutdown();
9892 private:
9893 // params
9894 int m;
9895 int N;
9896 int n;
9897 int K;
9898 int nb_part;
9899 int n_start;
9900 int size_im;
9901 int size_IM;
9902 int size_AVE;
9903 int size_dist;
9904 int BLOCK_SIZE;
9905 int NB;
9906 int ins_BLOCK;
9907 int ite;
9908 float T;
9909 // debug
9910 int ct_im_mv;
9911 // host memory
9912 float* h_IM;
9913 float* h_im;
9914 float* h_AVE;
9915 float* h_dist;
9916 float* h_AVE2;
9917 float* h_im2;
9918 unsigned short int* h_ASG;
9919 unsigned short int* h_asg;
9920 unsigned int* h_NC;
9921 int* params;
9922 float ttt;
9923 // device memory
9924 float* d_im;
9925 float* d_AVE;
9926 float* d_dist;
9927 //int init_dist(); // intial h_dist and d_dist for SSE
9928 float compute_tt();
9929 };
9930
9931#endif //EMAN2_USING_CUDA
9932
9933#if 0
9934
9935 class XYZProcessor:public Processor
9936 {
9937 public:
9938 void process_inplace(EMData * image);
9939
9940 string get_name() const
9941 {
9942 return NAME;
9943 }
9944
9945 static Processor *NEW()
9946 {
9947 return new XYZProcessor();
9948 }
9949
9950 string get_desc() const
9951 {
9952 return "N/A";
9953 }
9954
9956 {
9957 TypeDict d;
9958 return d;
9959 }
9960
9961 static const string NAME;
9962 };
9963
9964
9965#endif
9966
9967
9968#if 0
9969
9970 class XYZProcessor:public Processor
9971 {
9972 public:
9973 void process_inplace(EMData * image);
9974
9975 string get_name() const
9976 {
9977 return NAME;
9978 }
9979
9980 static Processor *NEW()
9981 {
9982 return new XYZProcessor();
9983 }
9984
9985 string get_desc() const
9986 {
9987 return "N/A";
9988 }
9989
9991 {
9992 TypeDict d;
9993 return d;
9994 }
9995
9996 static const string NAME;
9997 };
9998
9999
10000#endif
10001
10002
10003 int multi_processors(EMData * image, vector < string > processornames);
10004 void dump_processors();
10005 map<string, vector<string> > dump_processors_list();
10006 map<string, vector<string> > group_processors();
10007
10009}
10010
10011#endif //eman_filter_h__
Center image using auto convolution with 180 degree rotation.
Definition: processor.h:7163
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7182
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7535
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7167
static Processor * NEW()
Definition: processor.h:7172
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7177
static const string NAME
Definition: processor.h:7188
f(x) = x if x <= maxval; f(x) = 0 if x > maxval
Definition: processor.h:2628
string get_name() const
Get the processor's name.
Definition: processor.h:2630
void process_pixel(float *x) const
Definition: processor.h:2653
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2645
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2638
static Processor * NEW()
Definition: processor.h:2634
static const string NAME
Definition: processor.h:2650
void process_pixel(float *x) const
Definition: processor.h:2268
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2273
string get_name() const
Get the processor's name.
Definition: processor.h:2256
static const string NAME
Definition: processor.h:2265
static Processor * NEW()
Definition: processor.h:2260
Add additional shells/rings to an existing 1/0 mask image.
Definition: processor.h:7024
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7043
static const string NAME
Definition: processor.h:7050
static Processor * NEW()
Definition: processor.h:7038
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7028
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7033
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7165
add noise to an image
Definition: processor.h:6493
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6515
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6507
virtual float get_sigma(EMData *)
Definition: processor.h:6523
static Processor * NEW()
Definition: processor.h:6502
static const string NAME
Definition: processor.h:6520
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6497
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5853
add spectral noise to a complex image
Definition: processor.h:6564
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7010
static Processor * NEW()
Definition: processor.h:6573
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6568
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6590
static const string NAME
Definition: processor.h:6595
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6578
Rotate by 180 using pixel swapping, works for 2D only.
Definition: processor.h:2717
static const string NAME
Definition: processor.h:2752
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2731
void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:2724
string get_name() const
Get the processor's name.
Definition: processor.h:2719
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2747
add sigma noise, multiply image's sigma value to noise
Definition: processor.h:6532
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6534
float get_sigma(EMData *image)
Definition: processor.cpp:5876
static const string NAME
Definition: processor.h:6549
static Processor * NEW()
Definition: processor.h:6539
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6544
static Processor * NEW()
Definition: processor.h:9770
static const string NAME
Definition: processor.h:9785
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9766
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9774
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9778
Multiplies each Fourier pixel by its amplitude.
Definition: processor.h:592
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:601
static Processor * NEW()
Definition: processor.h:617
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1380
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:609
static const string NAME
Definition: processor.h:627
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:622
string get_name() const
Get the processor's name.
Definition: processor.h:594
string get_name() const
Get the processor's name.
Definition: processor.h:9283
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9297
void process_inplace(EMData *in)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9293
Applies a symmetry to a 3D model.
Definition: processor.h:2946
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2970
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1730
static Processor * NEW()
Definition: processor.h:2953
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2962
static const string NAME
Definition: processor.h:2975
virtual string get_name() const
Get the processor's name.
Definition: processor.h:2948
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1692
AreaProcessor use pixel values and coordinates of a real-space square area.
Definition: processor.h:4357
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2482
virtual void create_kernel() const =0
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4371
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:4365
virtual void process_pixel(float *pixel, float, float, float, float *area_matrix) const
Definition: processor.h:4384
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4378
Attempts to automatically mask out the particle, excluding other particles in the box,...
Definition: processor.h:6787
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6815
static Processor * NEW()
Definition: processor.h:6796
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6791
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6801
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:6757
static const string NAME
Definition: processor.h:6820
Tries to mask out only interesting density.
Definition: processor.h:6949
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6953
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6970
static const string NAME
Definition: processor.h:6984
static Processor * NEW()
Definition: processor.h:6958
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6963
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8621
Tries to mask out only interesting density.
Definition: processor.h:6907
static const string NAME
Definition: processor.h:6938
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6921
static Processor * NEW()
Definition: processor.h:6916
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8486
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6933
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6911
Tries to mask out only interesting density.
Definition: processor.h:6831
static const string NAME
Definition: processor.h:6859
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6845
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:6702
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6835
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6854
static Processor * NEW()
Definition: processor.h:6840
A "dust removal" filter which will remove above threshold densities smaller than a given size.
Definition: processor.h:6867
static Processor * NEW()
Definition: processor.h:6876
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8542
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6871
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6881
static const string NAME
Definition: processor.h:6895
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6890
Average along Y and replace with average.
Definition: processor.h:5650
string get_name() const
Get the processor's name.
Definition: processor.h:5654
static Processor * NEW()
Definition: processor.h:5659
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4452
static const string NAME
Definition: processor.h:5669
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5664
Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0)
Definition: processor.h:501
static Processor * NEW()
Definition: processor.h:525
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:530
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:510
static const string NAME
Definition: processor.h:535
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1250
string get_name() const
Get the processor's name.
Definition: processor.h:503
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:515
Similar to FourierProcessor, but enhances or compresses azimuthal contrast rather than the typical ra...
Definition: processor.h:422
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:441
static Processor * NEW()
Definition: processor.h:431
string get_name() const
Get the processor's name.
Definition: processor.h:426
static const string NAME
Definition: processor.h:448
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:872
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:436
This processor will remove specified bad lines from CCD/DDD images, generally due to faulty lines/row...
Definition: processor.h:7397
static Processor * NEW()
Definition: processor.h:7406
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7401
static const string NAME
Definition: processor.h:7425
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7411
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7820
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7416
Try to eliminate beamstop in electron diffraction patterns.
Definition: processor.h:5590
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5604
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4227
static const string NAME
Definition: processor.h:5618
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5609
static Processor * NEW()
Definition: processor.h:5599
string get_name() const
Get the processor's name.
Definition: processor.h:5594
Bilateral processing on 2D or 3D volume data.
Definition: processor.h:5793
string get_name() const
Get the processor's name.
Definition: processor.h:5796
static const string NAME
Definition: processor.h:5821
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5801
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5811
static Processor * NEW()
Definition: processor.h:5806
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5334
A thresholding processor for Fourier images based on the amplitude component.
Definition: processor.h:3237
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3254
virtual void process_inplace(EMData *image)
Definition: processor.cpp:5314
virtual string get_name() const
Get the processor's name.
Definition: processor.h:3239
static const string NAME
Definition: processor.h:3266
static Processor * NEW()
Definition: processor.h:3243
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3261
f(x) = 0 if x < value; f(x) = 1 if x >= value.
Definition: processor.h:3191
static Processor * NEW()
Definition: processor.h:3197
static const string NAME
Definition: processor.h:3213
void process_pixel(float *x) const
Definition: processor.h:3216
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3208
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3201
string get_name() const
Get the processor's name.
Definition: processor.h:3193
Performs a morphological black hat operation on an image.
Definition: processor.h:1569
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static const string NAME
Definition: processor.h:1601
static Processor * NEW()
Definition: processor.h:1582
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1592
void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1587
string get_name() const
Get the processor's name.
Definition: processor.h:1573
Performs a morphological closing operation on an image.
Definition: processor.h:1317
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1340
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1335
static Processor * NEW()
Definition: processor.h:1330
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:1321
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static const string NAME
Definition: processor.h:1349
Performs a morphological dilation operation on an image.
Definition: processor.h:1234
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1257
string get_name() const
Get the processor's name.
Definition: processor.h:1238
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1252
static Processor * NEW()
Definition: processor.h:1247
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static const string NAME
Definition: processor.h:1266
void process_inplace(EMData *image)
To process an image in-place.
Performs a morphological erosion operation on an image.
Definition: processor.h:1275
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1298
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1293
string get_name() const
Get the processor's name.
Definition: processor.h:1279
void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:1288
static const string NAME
Definition: processor.h:1307
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Computes an external morphological gradient operation on an image.
Definition: processor.h:1443
string get_name() const
Get the processor's name.
Definition: processor.h:1447
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1461
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1466
void process_inplace(EMData *image)
To process an image in-place.
Computes an internal morphological gradient operation on an image.
Definition: processor.h:1401
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1419
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1424
string get_name() const
Get the processor's name.
Definition: processor.h:1405
void process_inplace(EMData *image)
To process an image in-place.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Computes the morphological gradient operation on an image.
Definition: processor.h:1485
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1508
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
string get_name() const
Get the processor's name.
Definition: processor.h:1489
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1503
void process_inplace(EMData *image)
To process an image in-place.
Performs a morphological opening operation on an image.
Definition: processor.h:1359
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1382
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1377
static Processor * NEW()
Definition: processor.h:1372
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
string get_name() const
Get the processor's name.
Definition: processor.h:1363
void process_inplace(EMData *image)
To process an image in-place.
static const string NAME
Definition: processor.h:1391
Operates on two images, returning an image containing the maximum/minimum/multiplied pixel (etc,...
Definition: processor.h:7780
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7805
virtual void process_inplace(EMData *image)
Definition: processor.h:7786
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7800
static const string NAME
Definition: processor.h:7822
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7815
static Processor * NEW()
Definition: processor.h:7810
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9327
virtual EMData * process(EMData *image)
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9323
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9314
static Processor * NEW()
Definition: processor.h:9319
virtual void process_inplace(EMData *image)
To process an image in-place.
Performs a morphological top hat operation on an image.
Definition: processor.h:1527
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
string get_name() const
Get the processor's name.
Definition: processor.h:1531
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1545
void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:1540
static const string NAME
Definition: processor.h:1559
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1550
This processor computes 2-D slices of the 4-D bispectrum of a 2-D image.
Definition: processor.h:735
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:758
string get_name() const
Get the processor's name.
Definition: processor.h:739
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static Processor * NEW()
Definition: processor.h:748
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:753
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.h:744
static const string NAME
Definition: processor.h:776
f(x) = 0 if x = 0; f(x) = 1 if x != 0
Definition: processor.h:2365
string get_name() const
Get the processor's name.
Definition: processor.h:2367
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2376
void process_pixel(float *x) const
Definition: processor.h:2384
static Processor * NEW()
Definition: processor.h:2371
static const string NAME
Definition: processor.h:2381
BooleanShrinkProcessor encapsulates code common to MaxShrinkProcessor and MinShrinkProcessor - the pr...
Definition: processor.h:4845
void process_inplace(EMData *image, Dict &params)
Boolean shrink an image inplace.
Definition: processor.cpp:3465
EMData * process(const EMData *const image, Dict &params)
Boolean shrink an image, returning the processed image.
Definition: processor.cpp:3344
peak processor: pixel = max of values surrounding pixel.
Definition: processor.h:4599
void process_pixel(float *pixel, const float *data, int n) const
Definition: processor.h:4618
static Processor * NEW()
Definition: processor.h:4605
string get_name() const
Get the processor's name.
Definition: processor.h:4601
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4610
static const string NAME
Definition: processor.h:4615
A processor for noise reduction.
Definition: processor.h:4508
void process_pixel(float *pixel, const float *array, int n) const
Definition: processor.h:4527
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4519
static Processor * NEW()
Definition: processor.h:4514
string get_name() const
Get the processor's name.
Definition: processor.h:4510
static const string NAME
Definition: processor.h:4524
pixel = standard deviation of values surrounding pixel.
Definition: processor.h:4562
void process_pixel(float *pixel, const float *data, int n) const
Definition: processor.h:4581
string get_name() const
Get the processor's name.
Definition: processor.h:4564
static const string NAME
Definition: processor.h:4578
static Processor * NEW()
Definition: processor.h:4568
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4573
BoxStatProcessor files are a kind of neighborhood processors.
Definition: processor.h:4480
static string get_group_desc()
Definition: processor.h:4485
virtual EMData * process(EMData *image)
Definition: processor.cpp:2658
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2649
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4490
virtual void process_pixel(float *pixel, const float *array, int n) const =0
Set a pixel to white when >= N neighbors are white.
Definition: processor.h:9574
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9576
void process_pixel(float *pixel, const float *array, int n) const
Definition: processor.h:9599
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9588
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9584
static const string NAME
Definition: processor.h:9596
static Processor * NEW()
Definition: processor.h:9580
Thinning a binary map to skelton using the Zhang-Suen thinning algorithm.
Definition: processor.h:9539
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9544
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static Processor * NEW()
Definition: processor.h:9548
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9557
int process_pixel(float *data, float *array, int step)
static const string NAME
Definition: processor.h:9566
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9552
Convert an image containing normalized correlation coefficients to SNR or a Wiener filter value used ...
Definition: processor.h:2219
string get_name() const
Get the processor's name.
Definition: processor.h:2221
static Processor * NEW()
Definition: processor.h:2225
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2230
static const string NAME
Definition: processor.h:2246
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1203
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2238
Try to normalize the 4 quadrants of a CCD image.
Definition: processor.h:8922
static const string NAME
Definition: processor.h:8948
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8926
static Processor * NEW()
Definition: processor.h:8931
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8941
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8936
Processor the images by the estimated SNR in each image.if parameter 'wiener' is 1,...
Definition: processor.h:7240
static Processor * NEW()
Definition: processor.h:7249
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7263
static const string NAME
Definition: processor.h:7277
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7710
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7244
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7254
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8237
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8227
static const string NAME
Definition: processor.h:8246
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8222
static Processor * NEW()
Definition: processor.h:8232
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9089
Binarize an image based on the circular average around each pixel in real space.
Definition: processor.h:9445
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9458
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9450
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9462
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circula...
Definition: processor.h:3721
virtual void process_dist_pixel(float *pixel, float dist) const =0
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3728
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3755
void calc_locals(EMData *image)
Definition: processor.cpp:2382
void process_pixel(float *pixel, int xi, int yi, int zi) const
Definition: processor.h:3784
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3760
f(x) = maxval if f(x) > maxval; f(x) = minval if f(x) < minval
Definition: processor.h:3033
static const string NAME
Definition: processor.h:3063
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3048
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3058
string get_name() const
Get the processor's name.
Definition: processor.h:3037
static Processor * NEW()
Definition: processor.h:3041
void process_inplace(EMData *image)
To process an image in-place.
f(x): if v-r<x<v+r -> v; if x>v+r -> x-r; if x<v-r -> x+r
Definition: processor.h:3274
void process_pixel(float *x) const
Definition: processor.h:3309
static const string NAME
Definition: processor.h:3306
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3292
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3301
string get_name() const
Get the processor's name.
Definition: processor.h:3276
static Processor * NEW()
Definition: processor.h:3280
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3285
Each Fourier pixel will be normalized.
Definition: processor.h:4328
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4339
string get_name() const
Get the processor's name.
Definition: processor.h:4330
static const string NAME
Definition: processor.h:4344
static Processor * NEW()
Definition: processor.h:4334
void process_pixel(float *x) const
Definition: processor.h:4347
The base class for fourier space processor working on individual pixels.
Definition: processor.h:4312
static string get_group_desc()
Definition: processor.h:4316
virtual void process_pixel(float *x) const =0
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2453
static const string NAME
Definition: processor.h:9363
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9357
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9345
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static Processor * NEW()
Definition: processor.h:9349
virtual void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9353
This processor performs fast convolution in Fourier space.
Definition: processor.h:640
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:656
string get_name() const
Get the processor's name.
Definition: processor.h:644
static Processor * NEW()
Definition: processor.h:651
void process_inplace(EMData *image)
To process an image in-place.
static const string NAME
Definition: processor.h:668
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:661
CoordinateProcessor applies processing based on a pixel's value and it coordinates.
Definition: processor.h:3629
static string get_group_desc()
Definition: processor.h:3636
virtual void calc_locals(EMData *)
Definition: processor.h:3643
virtual bool is_valid() const
Definition: processor.h:3646
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2268
virtual void process_pixel(float *pixel, int xi, int yi, int zi) const =0
CTF simulation processor.
Definition: processor.h:1805
string get_name() const
Get the processor's name.
Definition: processor.h:1807
static Processor * NEW()
Definition: processor.h:1833
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:6879
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1816
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1838
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:6871
static const string NAME
Definition: processor.h:1843
Ctf is the base class for all CTF model.
Definition: ctf.h:60
f(x) = x-minval if x >= minval; f(x) = 0 if x < minval
Definition: processor.h:3153
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3163
string get_name() const
Get the processor's name.
Definition: processor.h:3155
static const string NAME
Definition: processor.h:3175
void process_pixel(float *x) const
Definition: processor.h:3178
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3170
static Processor * NEW()
Definition: processor.h:3159
Block processor, val1 is dx/dy, val2 is lp freq cutoff in pixels.
Definition: processor.h:4810
static const string NAME
Definition: processor.h:4836
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4823
static Processor * NEW()
Definition: processor.h:4818
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2761
string get_name() const
Get the processor's name.
Definition: processor.h:4814
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4831
Decay edges of image to zero.
Definition: processor.h:5676
static Processor * NEW()
Definition: processor.h:5684
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4485
static const string NAME
Definition: processor.h:5701
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5689
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5694
string get_name() const
Get the processor's name.
Definition: processor.h:5679
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
vector< EMObject > values() const
Get a vector containing copies of each of the EMObjects in this dictionary.
Definition: emobject.h:487
size_t size() const
Ask the Dictionary for its size.
Definition: emobject.h:519
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511
EMObject get(const string &key) const
Get the EMObject corresponding to the particular key Probably better to just use operator[].
Definition: emobject.h:527
averages over cal_half_width, then sets the value in a local block
Definition: processor.h:4776
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4794
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2710
static Processor * NEW()
Definition: processor.h:4784
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4789
static const string NAME
Definition: processor.h:4802
string get_name() const
Get the processor's name.
Definition: processor.h:4780
Does a projection in one the axial directions Doesn't support process_inplace (because the output has...
Definition: processor.h:7647
virtual EMData * process(const EMData *const image)
Definition: processor.cpp:8811
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7671
static Processor * NEW()
Definition: processor.h:7654
static const string NAME
Definition: processor.h:7685
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7649
virtual void process_inplace(EMData *)
Definition: processor.h:7667
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7680
string get_name() const
Get the processor's name.
Definition: processor.h:2544
static Processor * NEW()
Definition: processor.h:2548
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2571
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2563
static const string NAME
Definition: processor.h:2576
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2553
void process_pixel(float *x) const
Definition: processor.h:2581
Segment a volume about:homeinto subvolumes based on a center separation value.
Definition: processor.h:1704
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1729
static const string NAME
Definition: processor.h:1734
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1588
string get_name() const
Get the processor's name.
Definition: processor.h:1706
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1595
static Processor * NEW()
Definition: processor.h:1724
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1714
processor radial function: f(x) = 1/sqrt(2*pi)*[1/sigma1*exp-(x^2/2*sigma1^2) - 1/sigma2*exp-(x^2/2*s...
Definition: processor.h:2131
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2146
static const string NAME
Definition: processor.h:2166
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2151
static Processor * NEW()
Definition: processor.h:2141
void create_radial_func(vector< float > &radial_mask) const
Definition: processor.cpp:2189
string get_name() const
Get the processor's name.
Definition: processor.h:2137
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2158
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
This processor filters an image to improve the visibility of particles.
Definition: processor.h:786
static const string NAME
Definition: processor.h:824
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:804
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:809
static Processor * NEW()
Definition: processor.h:799
string get_name() const
Get the processor's name.
Definition: processor.h:790
f(x) = exp( x / low - high)
Definition: processor.h:3376
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3399
void process_pixel(float *x) const
'40' is used to avoid floating number overflow.
Definition: processor.h:3418
string get_name() const
Get the processor's name.
Definition: processor.h:3382
static const string NAME
Definition: processor.h:3412
static Processor * NEW()
Definition: processor.h:3387
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3392
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3407
Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.
Definition: processor.h:5421
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5439
string get_name() const
Get the processor's name.
Definition: processor.h:5425
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5434
static Processor * NEW()
Definition: processor.h:5429
static const string NAME
Definition: processor.h:5447
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:997
Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.
Definition: processor.h:5388
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5401
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5406
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:906
string get_name() const
Get the processor's name.
Definition: processor.h:5392
static Processor * NEW()
Definition: processor.h:5396
static const string NAME
Definition: processor.h:5415
Perform a FFT transform by calling EMData::do_fft() and EMData::do_ift()
Definition: processor.h:9106
static const string NAME
Definition: processor.h:9132
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9120
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9127
static Processor * NEW()
Definition: processor.h:9115
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:9110
FFTResampleProcessor resamples an image by clipping the Fourier Transform This is the same as multipy...
Definition: processor.h:5131
void fft_resample(EMData *to, const EMData *const from, const float &sample_rate)
An internal function that encapsulates a routine common to both process and process inplace.
Definition: processor.cpp:3074
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:2989
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5151
string get_name() const
Get the processor's name.
Definition: processor.h:5142
static const string NAME
Definition: processor.h:5158
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3033
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5137
static Processor * NEW()
Definition: processor.h:5146
Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.
Definition: processor.h:5453
static Processor * NEW()
Definition: processor.h:5461
static const string NAME
Definition: processor.h:5480
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1036
string get_name() const
Get the processor's name.
Definition: processor.h:5457
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5471
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5466
This processor will apply a Wiener filter to a volume based on a provided FSC curve.
Definition: processor.h:7199
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7204
virtual EMData * process(EMData const *image)
To proccess an image out-of-place.
Definition: processor.cpp:7573
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7221
static const string NAME
Definition: processor.h:7231
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7214
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7564
static Processor * NEW()
Definition: processor.h:7209
Factory is used to store objects to create new instances.
Definition: emobject.h:725
A fourier processor specified in a 2 column text file.
Definition: processor.h:7320
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7329
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7773
static Processor * NEW()
Definition: processor.h:7334
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7324
static const string NAME
Definition: processor.h:7346
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7339
f(x) = f(x) if f(x) is finite | to if f(x) is not finite
Definition: processor.h:3436
void process_pixel(float *x) const
Definition: processor.cpp:629
static const string NAME
Definition: processor.h:3470
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3452
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3458
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3465
string get_name() const
Get the processor's name.
Definition: processor.h:3442
static Processor * NEW()
Definition: processor.h:3447
This processor can be used to correct errors when reading signed data as unsigned and vice-versa.
Definition: processor.h:2310
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2353
static const string NAME
Definition: processor.h:2321
string get_name() const
Get the processor's name.
Definition: processor.h:2312
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2323
static Processor * NEW()
Definition: processor.h:2316
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2331
void process_pixel(float *x) const
Definition: processor.h:2340
Flattens the background by subtracting the local mean.
Definition: processor.h:5277
static Processor * NEW()
Definition: processor.h:5286
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5296
static const string NAME
Definition: processor.h:5304
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5291
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3622
string get_name() const
Get the processor's name.
Definition: processor.h:5281
flip/mirror an image around an axis
Definition: processor.h:6397
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6418
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6411
static Processor * NEW()
Definition: processor.h:6406
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5755
static const string NAME
Definition: processor.h:6423
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6401
string get_name() const
Get the processor's name.
Definition: processor.h:2284
static const string NAME
Definition: processor.h:2293
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2301
static Processor * NEW()
Definition: processor.h:2288
void process_pixel(float *x) const
Definition: processor.h:2296
Same as FourierProcessor, except first computes the current image radial power spectrum and passes it...
Definition: processor.h:391
virtual void preprocess(EMData *)
Definition: processor.h:413
virtual void create_radial_func(vector< float > &radial_mask, EMData *image) const =0
static string get_group_desc()
Definition: processor.h:395
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:400
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:734
base class for Fourier filters
Definition: processor.h:333
virtual void preprocess(EMData *image)
Definition: processor.h:354
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:342
virtual void create_radial_func(vector< float > &radial_mask) const =0
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:688
static string get_group_desc()
Definition: processor.h:337
Translates the origin in Fourier space from the corner to the center in y and z Handles 2D and 3D,...
Definition: processor.h:6644
virtual void process_inplace(EMData *image)
Fourier origin shift the image in the forward direction.
Definition: processor.cpp:6013
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6663
static const string NAME
Definition: processor.h:6668
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6653
static Processor * NEW()
Definition: processor.h:6658
Undo the effects of the FourierToCenterProcessor.
Definition: processor.h:6604
static Processor * NEW()
Definition: processor.h:6618
virtual void process_inplace(EMData *image)
Fourier origin shift the image in the backwards direction Should only be called after the application...
Definition: processor.cpp:5885
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6623
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6613
static const string NAME
Definition: processor.h:6628
Segment a volume by sequentially finding the highest peak and subtracting a Gaussian at that point fr...
Definition: processor.h:1661
static Processor * NEW()
Definition: processor.h:1683
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1441
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1688
static const string NAME
Definition: processor.h:1693
string get_name() const
Get the processor's name.
Definition: processor.h:1663
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1671
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1448
Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0)
Definition: processor.h:543
string get_name() const
Get the processor's name.
Definition: processor.h:545
static const string NAME
Definition: processor.h:580
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:557
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:575
static Processor * NEW()
Definition: processor.h:570
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1300
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:552
Determines the direction of an approximate image gradient using David's image gradient processors.
Definition: processor.h:1049
static const string NAME
Definition: processor.h:1076
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1065
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1070
static Processor * NEW()
Definition: processor.h:1060
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:1053
Determines the magnitude of an approximate image gradient using David's image gradient processors.
Definition: processor.h:1013
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1029
static const string NAME
Definition: processor.h:1040
void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:1024
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1034
string get_name() const
Get the processor's name.
Definition: processor.h:1017
Gradient removed by least square plane fit.
Definition: processor.h:5204
string get_name() const
Get the processor's name.
Definition: processor.h:5208
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3809
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5222
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5217
Gradient remover, does a rough plane fit to find linear gradients.
Definition: processor.h:5174
static const string NAME
Definition: processor.h:5192
static Processor * NEW()
Definition: processor.h:5182
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5187
string get_name() const
Get the processor's name.
Definition: processor.h:5178
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3582
Multiplies image by a 'linear pyramid' 1-(|x-xsize/2|*|y-ysize/2|*4/(xsize*ysize)) This is useful in ...
Definition: processor.h:4183
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4197
static const string NAME
Definition: processor.h:4209
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4204
string get_name() const
Get the processor's name.
Definition: processor.h:4185
static Processor * NEW()
Definition: processor.h:4192
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:818
Grow a skeleton map toward a local direction.
Definition: processor.h:9658
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9675
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9671
static Processor * NEW()
Definition: processor.h:9667
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9663
static const string NAME
Definition: processor.h:9682
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
This processor computes what I've dubbed the 'harmonic power spectrum'.
Definition: processor.h:682
static const string NAME
Definition: processor.h:717
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
static Processor * NEW()
Definition: processor.h:695
string get_name() const
Get the processor's name.
Definition: processor.h:686
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:705
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:700
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.h:691
This processor attempts to remove the low resolution peak present in all cryoEM data.
Definition: processor.h:2006
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2017
void create_radial_func(vector< float > &radial_mask, EMData *image) const
Definition: processor.cpp:2148
static const string NAME
Definition: processor.h:2022
static Processor * NEW()
Definition: processor.h:2012
string get_name() const
Get the processor's name.
Definition: processor.h:2008
virtual void preprocess(EMData *image)
Definition: processor.cpp:2127
Bins pixel values, similar to calculating a histogram.
Definition: processor.h:9202
string get_name() const
Get the processor's name.
Definition: processor.h:9208
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9218
void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9226
static const string NAME
Definition: processor.h:9231
static Processor * NEW()
Definition: processor.h:9213
Computes the image divergence using David's partial derivative processors.
Definition: processor.h:977
static const string NAME
Definition: processor.h:1004
static Processor * NEW()
Definition: processor.h:988
string get_name() const
Get the processor's name.
Definition: processor.h:981
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:993
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:998
void process_inplace(EMData *image)
To process an image in-place.
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:645
static string get_group_desc()
Definition: processor.h:317
virtual EMData * create_processor_image() const =0
Multiplies the image by the specified file using pixel indices.
Definition: processor.h:7507
static const string NAME
Definition: processor.h:7535
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7511
static Processor * NEW()
Definition: processor.h:7516
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8118
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7530
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7521
Translate the image an integer amount Uses EMData::clip_inplace (inplace) and EMData::get_clip (out o...
Definition: processor.h:2888
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2912
void assert_valid_aspect(const vector< int > &translation, const EMData *const image) const
Check that the particular aspect is valid.
virtual EMData * process(const EMData *const image)
virtual void process_inplace(EMData *image)
virtual string get_name() const
Get the processor's name.
Definition: processor.h:2890
static const string NAME
Definition: processor.h:2924
static Processor * NEW()
Definition: processor.h:2895
Region get_clip_region(vector< int > &translation, const EMData *const image) const
Get the clip region that will achieve the desired translation.
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2919
Iterative expansion of a binary mask, val1 is number of pixels to expand, if val2!...
Definition: processor.h:8021
static Processor * NEW()
Definition: processor.h:8035
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8030
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8025
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8745
static const string NAME
Definition: processor.h:8048
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8040
This expands a multilevel mask volume so inter-mask boundaries are preserved.
Definition: processor.h:6991
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7096
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7010
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6995
static const string NAME
Definition: processor.h:7017
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7000
static Processor * NEW()
Definition: processor.h:7005
Segment a volume into ~n subvolumes using K-means classification.
Definition: processor.h:1745
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1781
string get_name() const
Get the processor's name.
Definition: processor.h:1747
static Processor * NEW()
Definition: processor.h:1776
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1920
static const string NAME
Definition: processor.h:1786
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1755
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1739
Determines the direction of an approximate image laplacian using David's image gradient processors.
Definition: processor.h:1121
void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1137
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1142
static Processor * NEW()
Definition: processor.h:1132
string get_name() const
Get the processor's name.
Definition: processor.h:1125
Determines the direction of an approximate image laplacian using David's image gradient processors.
Definition: processor.h:1085
static Processor * NEW()
Definition: processor.h:1096
string get_name() const
Get the processor's name.
Definition: processor.h:1089
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1106
void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1101
Discrete approximation to Laplacian.
Definition: processor.h:4405
void create_kernel() const
Definition: processor.cpp:2577
static const string NAME
Definition: processor.h:4424
static Processor * NEW()
Definition: processor.h:4414
string get_name() const
Get the processor's name.
Definition: processor.h:4407
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4419
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2565
Multiplies image by a 'linear pyramid' 1-(|x-xsize/2|*|y-ysize/2|*4/(xsize*ysize)) This is useful in ...
Definition: processor.h:4218
static Processor * NEW()
Definition: processor.h:4227
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4244
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4232
string get_name() const
Get the processor's name.
Definition: processor.h:4220
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1927
static const string NAME
Definition: processor.h:4249
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1905
virtual string get_name() const
Get the processor's name.
Definition: processor.h:1900
virtual void create_radial_func(vector< float > &radial_mask) const
Definition: processor.cpp:2051
static const string NAME
Definition: processor.h:1915
static Processor * NEW()
Definition: processor.h:1910
processor radial function: f(x) = slope * x + intercept
Definition: processor.h:2035
static const string NAME
Definition: processor.h:2070
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2055
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2050
void create_radial_func(vector< float > &radial_mask) const
Definition: processor.cpp:2165
static Processor * NEW()
Definition: processor.h:2045
string get_name() const
Get the processor's name.
Definition: processor.h:2041
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2062
linear transform processor: f(x) = x * scale + shift
Definition: processor.h:3323
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3345
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3338
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3353
static const string NAME
Definition: processor.h:3358
void process_pixel(float *x) const
Definition: processor.h:3361
static Processor * NEW()
Definition: processor.h:3333
string get_name() const
Get the processor's name.
Definition: processor.h:3329
processor radial function: f(x) = ((x^2 - s^2)/s^4)e^-(x^2/2s^2)
Definition: processor.h:2084
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2099
string get_name() const
Get the processor's name.
Definition: processor.h:2090
static const string NAME
Definition: processor.h:2117
static Processor * NEW()
Definition: processor.h:2094
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2110
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2104
void create_radial_func(vector< float > &radial_mask) const
Definition: processor.cpp:2176
static Processor * NEW()
Definition: processor.h:4638
string get_name() const
Get the processor's name.
Definition: processor.h:4634
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4643
static const string NAME
Definition: processor.h:4648
void process_pixel(float *pixel, const float *data, int n) const
Definition: processor.h:4651
This processor attempts to perform a 'local normalization' so low density and high density features w...
Definition: processor.h:7471
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7952
static const string NAME
Definition: processor.h:7499
static Processor * NEW()
Definition: processor.h:7480
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7475
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7485
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7490
f(x) = log10(x) if x > 0; else f(x) = 0
Definition: processor.h:3594
static const string NAME
Definition: processor.h:3610
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3605
string get_name() const
Get the processor's name.
Definition: processor.h:3596
void process_pixel(float *x) const
Definition: processor.h:3613
static Processor * NEW()
Definition: processor.h:3600
processor radial function: if lowpass > 0, f(x) = exp(-x*x/(lowpass*lowpass)); else f(x) = exp(x*x/(l...
Definition: processor.h:1944
virtual void preprocess(EMData *image)
Definition: processor.h:1975
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1963
void create_radial_func(vector< float > &radial_mask, EMData *image) const
Definition: processor.cpp:1143
string get_name() const
Get the processor's name.
Definition: processor.h:1946
static Processor * NEW()
Definition: processor.h:1951
static const string NAME
Definition: processor.h:1961
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1956
Lowpass Phase Randomization processor applied in Fourier space.
Definition: processor.h:1925
static Processor * NEW()
Definition: processor.h:1929
string get_name() const
Get the processor's name.
Definition: processor.h:1927
void create_radial_func(vector< float > &radial_mask) const
Definition: processor.cpp:2059
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2061
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1930
overwrites input, f(x) = radius
Definition: processor.h:4284
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4295
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:4303
static const string NAME
Definition: processor.h:4300
static Processor * NEW()
Definition: processor.h:4290
string get_name() const
Get the processor's name.
Definition: processor.h:4286
overwrites input, f(x) = radius * radius
Definition: processor.h:4256
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4267
string get_name() const
Get the processor's name.
Definition: processor.h:4258
static Processor * NEW()
Definition: processor.h:4262
static const string NAME
Definition: processor.h:4272
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:4275
Sets pixel values in a binary image equal to their element wise manhattan distance.
Definition: processor.h:1194
void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:1207
static const string NAME
Definition: processor.h:1224
string get_name() const
Get the processor's name.
Definition: processor.h:1198
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1217
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1212
MaskAzProcessor masks out pixels within a specified cylindrical (or circular) arc.
Definition: processor.h:3668
string get_name() const
Get the processor's name.
Definition: processor.h:3678
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2336
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3685
static const string NAME
Definition: processor.h:3683
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3690
static Processor * NEW()
Definition: processor.h:3673
A step cutoff to the the mean value in a ring centered on the outer radius.
Definition: processor.h:3908
string get_name() const
Get the processor's name.
Definition: processor.h:3910
void calc_locals(EMData *image)
Definition: processor.cpp:2399
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3928
static Processor * NEW()
Definition: processor.h:3914
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3919
static const string NAME
Definition: processor.h:3940
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:3946
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3935
f(x) = f(x) / exp(-radius*radius * gauss_width / (ny*ny))
Definition: processor.h:4131
void calc_locals(EMData *)
Definition: processor.h:4160
string get_name() const
Get the processor's name.
Definition: processor.h:4142
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4152
static Processor * NEW()
Definition: processor.h:4147
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:4170
static const string NAME
Definition: processor.h:4157
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4133
a gaussian falloff to zero, with anisotropic widths along x,y,z
Definition: processor.h:4051
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:4057
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4079
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4108
string get_name() const
Get the processor's name.
Definition: processor.h:4099
void process_pixel(float *pixel, int xi, int yi, int zi) const
Definition: processor.h:4117
a gaussian falloff to zero, radius is the 1/e of the width.
Definition: processor.h:3992
static Processor * NEW()
Definition: processor.h:3998
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4012
static const string NAME
Definition: processor.h:4025
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:4029
string get_name() const
Get the processor's name.
Definition: processor.h:3994
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4019
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:4003
fills masked region
Definition: processor.h:3961
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:3980
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3972
static const string NAME
Definition: processor.h:3977
string get_name() const
Get the processor's name.
Definition: processor.h:3963
static Processor * NEW()
Definition: processor.h:3967
This processor will take a mask and extract the values inside the mask as a new 1-D image as well as ...
Definition: processor.h:836
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:854
string get_name() const
Get the processor's name.
Definition: processor.h:840
static const string NAME
Definition: processor.h:867
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.h:845
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:785
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:859
static Processor * NEW()
Definition: processor.h:849
step cutoff to a user-given value in both inner and outer circles.
Definition: processor.h:3804
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3825
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:3840
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3819
static const string NAME
Definition: processor.h:3837
static Processor * NEW()
Definition: processor.h:3814
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3832
string get_name() const
Get the processor's name.
Definition: processor.h:3810
step cutoff to a user-given value in both inner and outer circles.
Definition: processor.h:3855
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:3893
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3885
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3870
static Processor * NEW()
Definition: processor.h:3865
string get_name() const
Get the processor's name.
Definition: processor.h:3861
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3877
static const string NAME
Definition: processor.h:3890
Sets the structure factor To match a second provided image/volume.
Definition: processor.h:7871
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7879
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7874
void create_radial_func(vector< float > &radial_mask, EMData *image) const
Definition: processor.cpp:8226
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7889
static Processor * NEW()
Definition: processor.h:7884
static const string NAME
Definition: processor.h:7900
static const string NAME
Definition: processor.h:7844
static float binary_operate(const float &left, const float &right)
Definition: processor.h:7839
string get_name() const
Definition: processor.h:7829
string get_desc() const
Definition: processor.h:7834
MaxShrinkProcessors shrinks an image by in an integer amount, keeping the maximum pixel value - usefu...
Definition: processor.h:4877
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4896
virtual EMData * process(const EMData *const image)
The max shrink processor has its own process function to minise memory usage - if this function was n...
Definition: processor.h:4885
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.h:4891
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4910
static const string NAME
Definition: processor.h:4918
string get_name() const
Get the processor's name.
Definition: processor.h:4901
static Processor * NEW()
Definition: processor.h:4905
MeanShrinkProcessor shrinks an image by in an integer amount (and optionally by 1....
Definition: processor.h:4994
static const string NAME
Definition: processor.h:5037
virtual string get_name() const
Get the processor's name.
Definition: processor.h:5021
void accrue_mean_one_p_five(EMData *to, const EMData *const from)
Accrue the local mean in the image 'from' to the image 'to' using the the special case shrink factor ...
Definition: processor.cpp:3289
virtual void process_inplace(EMData *image)
Mean shrink inplace.
Definition: processor.cpp:3174
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5030
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5016
virtual EMData * process(const EMData *const image)
The meanshrink processor has its own process function to minise memory usage - if this function was n...
Definition: processor.cpp:3124
void accrue_mean(EMData *to, const EMData *const from, const int shrinkfactor)
Accrue the local mean in the image 'from' to the image 'to' using the given shrinkfactor An internal ...
Definition: processor.cpp:3229
static Processor * NEW()
Definition: processor.h:5025
Fill zeroes at edges with nearest horizontal/vertical value damped towards Mean2.
Definition: processor.h:5624
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4359
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5638
static Processor * NEW()
Definition: processor.h:5633
string get_name() const
Get the processor's name.
Definition: processor.h:5628
static const string NAME
Definition: processor.h:5643
MeanShrinkProcessor shrinks an image by in an integer amount taking the median of the pixel neighbour...
Definition: processor.h:5066
static const string NAME
Definition: processor.h:5109
virtual void process_inplace(EMData *image)
Median shrink the image.
Definition: processor.cpp:2842
virtual string get_name() const
Get the processor's name.
Definition: processor.h:5093
void accrue_median(EMData *to, const EMData *const from, const int shrink_factor)
Accrue the local median in the image 'from' to the image 'to' using the given shrinkfactor An interna...
Definition: processor.cpp:2911
static Processor * NEW()
Definition: processor.h:5097
virtual EMData * process(const EMData *const image)
The medianshrink processor has its own process function to minise memory usage - if this function was...
Definition: processor.cpp:2878
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5088
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5102
static const string NAME
Definition: processor.h:7864
string get_name() const
Definition: processor.h:7849
static float binary_operate(const float &left, const float &right)
Definition: processor.h:7859
string get_desc() const
Definition: processor.h:7854
MinShrinkProcessor shrinks an image by in an integer amount, keeping the minimum pixel value - useful...
Definition: processor.h:4937
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4969
static const string NAME
Definition: processor.h:4977
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4955
string get_name() const
Get the processor's name.
Definition: processor.h:4960
virtual EMData * process(const EMData *const image)
The min shrink processor has its own process function to minise memory usage - if this function was n...
Definition: processor.h:4945
static Processor * NEW()
Definition: processor.h:4964
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.h:4951
peak processor: pixel = pixel - max of values surrounding pixel.
Definition: processor.h:4666
static Processor * NEW()
Definition: processor.h:4672
void process_pixel(float *pixel, const float *data, int n) const
Definition: processor.h:4685
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4677
string get_name() const
Get the processor's name.
Definition: processor.h:4668
static const string NAME
Definition: processor.h:4682
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9263
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9258
static Processor * NEW()
Definition: processor.h:9253
void process_inplace(EMData *in)
To process an image in-place.
static const string NAME
Definition: processor.h:9275
string get_name() const
Get the processor's name.
Definition: processor.h:9248
float radprofile(float r, int type)
virtual void normalize(EMData *) const
Definition: processor.h:9427
void process_inplace(EMData *image)
To process an image in-place.
static string get_group_desc()
Definition: processor.h:9417
virtual void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:9408
virtual void calc_locals(EMData *)
Definition: processor.h:9424
virtual void process_pixel(float *x) const =0
This function clamps the min and max vals in the image at minval and maxval at mean-n*sigma and mean+...
Definition: processor.h:3075
static const string NAME
Definition: processor.h:3105
static Processor * NEW()
Definition: processor.h:3084
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3089
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:3079
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3100
Make a curve or surface non-convex (planar or concave), iteratively.
Definition: processor.h:5240
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5258
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3724
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5253
static Processor * NEW()
Definition: processor.h:5248
static const string NAME
Definition: processor.h:5267
string get_name() const
Get the processor's name.
Definition: processor.h:5244
Normalize the mass of the image assuming a density of 1.35 g/ml (0.81 Da/A^3).
Definition: processor.h:6028
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6045
static const string NAME
Definition: processor.h:6057
static Processor * NEW()
Definition: processor.h:6035
string get_name() const
Get the processor's name.
Definition: processor.h:6030
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6040
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4756
normalizes an image, mean value equals to mean of 2 pixel circular border.
Definition: processor.h:6090
float calc_mean(EMData *image) const
Definition: processor.cpp:4832
string get_name() const
Get the processor's name.
Definition: processor.h:6092
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6102
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6107
normalizes an image, mean value equals to edge mean.
Definition: processor.h:6064
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6076
static const string NAME
Definition: processor.h:6081
float calc_mean(EMData *image) const
Definition: processor.cpp:4823
static Processor * NEW()
Definition: processor.h:6071
string get_name() const
Get the processor's name.
Definition: processor.h:6066
Normalize such that the estimated histogram peak value is zero.
Definition: processor.h:5929
static const string NAME
Definition: processor.h:5946
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5941
static Processor * NEW()
Definition: processor.h:5936
string get_name() const
Get the processor's name.
Definition: processor.h:5931
float calc_mean(EMData *image) const
Definition: processor.cpp:5018
normalizes an image, uses 2 pixels on left and right edge
Definition: processor.h:6124
string get_name() const
Get the processor's name.
Definition: processor.h:6126
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6136
float calc_mean(EMData *image) const
Definition: processor.cpp:4904
Uses a 1/0 mask defining a region to use for the zero-normalization.if no_sigma is 1,...
Definition: processor.h:5959
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5978
static const string NAME
Definition: processor.h:5987
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4685
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5968
static Processor * NEW()
Definition: processor.h:5973
string get_name() const
Get the processor's name.
Definition: processor.h:5963
normalizes an image.
Definition: processor.h:6150
static Processor * NEW()
Definition: processor.h:6157
float calc_mean(EMData *image) const
Definition: processor.cpp:4893
string get_name() const
Get the processor's name.
Definition: processor.h:6152
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6162
static const string NAME
Definition: processor.h:6167
float calc_sigma(EMData *image) const
Definition: processor.cpp:4882
Base class for normalization processors.
Definition: processor.h:5827
virtual float calc_sigma(EMData *image) const
Definition: processor.cpp:4630
static string get_group_desc()
Definition: processor.h:5831
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4635
virtual float calc_mean(EMData *image) const =0
Normalize the image whilst also removing any ramps.
Definition: processor.h:5997
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6009
string get_name() const
Get the processor's name.
Definition: processor.h:5999
static Processor * NEW()
Definition: processor.h:6004
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4733
static const string NAME
Definition: processor.h:6016
normalizes each row in the image individually
Definition: processor.h:6177
string get_name() const
Get the processor's name.
Definition: processor.h:6179
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6196
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4926
static Processor * NEW()
Definition: processor.h:6184
static const string NAME
Definition: processor.h:6201
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6189
do a standard normalization on an image.
Definition: processor.h:5903
float calc_mean(EMData *image) const
Definition: processor.cpp:5009
static Processor * NEW()
Definition: processor.h:5910
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5915
static const string NAME
Definition: processor.h:5920
string get_name() const
Get the processor's name.
Definition: processor.h:5905
use least square method to normalize
Definition: processor.h:6263
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6277
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5203
string get_name() const
Get the processor's name.
Definition: processor.h:6267
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6290
Normalize an image so its vector length is 1.0.
Definition: processor.h:5844
float calc_mean(EMData *image) const
Definition: processor.h:5868
float calc_sigma(EMData *image) const
Definition: processor.cpp:4665
static const string NAME
Definition: processor.h:5861
string get_name() const
Get the processor's name.
Definition: processor.h:5846
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5856
static Processor * NEW()
Definition: processor.h:5851
Normalize an image so its elements sum to 1.0 (fails if mean=0)
Definition: processor.h:5873
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5885
static Processor * NEW()
Definition: processor.h:5880
float calc_mean(EMData *image) const
Definition: processor.h:5897
float calc_sigma(EMData *image) const
Definition: processor.cpp:4675
static const string NAME
Definition: processor.h:5890
string get_name() const
Get the processor's name.
Definition: processor.h:5875
Replace the value of each pixel with the sum of density of the object it belongs to.
Definition: processor.h:9477
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9490
static const string NAME
Definition: processor.h:9500
static Processor * NEW()
Definition: processor.h:9486
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9494
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9482
Label each object in a black-white image.
Definition: processor.h:9508
static const string NAME
Definition: processor.h:9531
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9525
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9513
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9521
static Processor * NEW()
Definition: processor.h:9517
This processor will try and remove outliers (and optionally exactly zero values), replacing any ident...
Definition: processor.h:5554
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4166
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5576
string get_name() const
Get the processor's name.
Definition: processor.h:5558
static const string NAME
Definition: processor.h:5581
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5568
static Processor * NEW()
Definition: processor.h:5563
Multiplies the image by the specified file using pixel coordinates instead of pixel indices.
Definition: processor.h:7582
static Processor * NEW()
Definition: processor.h:7593
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7588
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2304
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7603
static const string NAME
Definition: processor.h:7629
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7598
virtual void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:7616
peak processor -> if npeaks or more surrounding values >= value, value->0
Definition: processor.h:4702
static Processor * NEW()
Definition: processor.h:4708
void process_pixel(float *pixel, const float *data, int n) const
Definition: processor.h:4737
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:4721
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4729
static const string NAME
Definition: processor.h:4734
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:4712
string get_name() const
Get the processor's name.
Definition: processor.h:4704
This class is abstract.
Definition: processor.h:6681
void fourier_phaseshift180(EMData *image)
fourier_phaseshift180 - fourier phase shift by 180 this function is called internally if the argument...
Definition: processor.cpp:6159
void swap_corners_180(EMData *image)
swap_corners_180 - works on 2D and 3D images
Definition: processor.cpp:6184
void swap_central_slices_180(EMData *image)
swap_central_slices_180 - works on 2D and 3D images
Definition: processor.cpp:6281
Translates a cornered image to the center Undoes the PhaseToCornerProcessor.
Definition: processor.h:6730
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:6550
static Processor * NEW()
Definition: processor.h:6739
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6744
static const string NAME
Definition: processor.h:6749
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6734
Translates a centered image to the corner works for 1D, 2D and 3D images, for all combinations of eve...
Definition: processor.h:6760
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6774
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:6402
static const string NAME
Definition: processor.h:6779
static Processor * NEW()
Definition: processor.h:6769
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6764
ToMassCenterProcessor centers image at center of mass, ignores old dx, dy.
Definition: processor.h:7058
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7077
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7498
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7072
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7062
static Processor * NEW()
Definition: processor.h:7067
static const string NAME
Definition: processor.h:7084
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:9796
static Processor * NEW()
Definition: processor.h:9826
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9831
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9808
void process_pixel(float *pixel, int xi, int yi, int zi) const
Definition: processor.h:9839
static const string NAME
Definition: processor.h:9836
string get_name() const
Get the processor's name.
Definition: processor.h:9822
Typical usage of Processors are as follows:
Definition: processor.h:90
static void EMFourierFilterInPlace(EMData *fimage, Dict params)
Compute a Fourier-filter processed image in place.
Definition: processor.h:233
static string get_group_desc()
Get the description of this group of processors.
Definition: processor.h:159
static EMData * EMFourierFilterFunc(EMData *fimage, Dict params, bool doInPlace=true)
Compute a Fourier-filter processed image.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:637
virtual string get_desc() const =0
Get the descrition of this specific processor.
virtual void process_list_inplace(vector< EMData * > &images)
To process multiple images using the same algorithm.
Definition: processor.h:114
virtual void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:137
virtual Dict get_params() const
Get the processor parameters in a key/value dictionary.
Definition: processor.h:129
static EMData * EMFourierFilter(EMData *fimage, Dict params)
Compute a Fourier-processor processed image without altering the original image.
Definition: processor.h:264
fourier_filter_types
Fourier filter Processor type enum.
Definition: processor.h:182
@ BUTTERWORTH_HOMOMORPHIC
Definition: processor.h:194
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:148
virtual void process_inplace(EMData *image)=0
To process an image in-place.
virtual string get_name() const =0
Get the processor's name.
Prune branches from the skeleton.
Definition: processor.h:9624
static Processor * NEW()
Definition: processor.h:9633
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9629
virtual void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9637
static const string NAME
Definition: processor.h:9650
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9641
Perform a multiplication of real image with a radial table.
Definition: processor.h:9142
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9161
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9168
string get_name() const
Get the processor's name.
Definition: processor.h:9146
vector< float > table
Definition: processor.h:9190
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:9156
static Processor * NEW()
Definition: processor.h:9151
static const string NAME
Definition: processor.h:9172
void process_dist_pixel(float *pixel, float dist) const
Definition: processor.h:9174
Ramp processor – Fits a least-squares plane to the picture, and subtracts the plane from the picture.
Definition: processor.h:5311
static Processor * NEW()
Definition: processor.h:5319
string get_name() const
Get the processor's name.
Definition: processor.h:5315
void process_inplace(EMData *image)
To process an image in-place.
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5324
static const string NAME
Definition: processor.h:5332
f(x) = 1 if (low <= x <= high); else f(x) = 0
Definition: processor.h:3486
static Processor * NEW()
Definition: processor.h:3496
string get_name() const
Get the processor's name.
Definition: processor.h:3492
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3501
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3516
void process_pixel(float *x) const
Definition: processor.h:3524
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3508
static const string NAME
Definition: processor.h:3521
Set any values in a range to zero.
Definition: processor.h:2666
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2202
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2701
string get_name() const
Get the processor's name.
Definition: processor.h:2672
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2685
static const string NAME
Definition: processor.h:2706
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2694
static Processor * NEW()
Definition: processor.h:2677
The base class for real space processor working on individual pixels.
Definition: processor.h:2179
virtual void normalize(EMData *) const
Definition: processor.h:2205
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2243
virtual void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2186
virtual void calc_locals(EMData *)
Definition: processor.h:2202
virtual void process_pixel(float *x) const =0
static string get_group_desc()
Definition: processor.h:2195
This will replace the image with a full-circle 2D fft amplitude rendering.
Definition: processor.h:5363
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5377
static const string NAME
Definition: processor.h:5382
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3987
string get_name() const
Get the processor's name.
Definition: processor.h:5367
static Processor * NEW()
Definition: processor.h:5372
Reciprocal image as if f(x) != 0: f(x) = 1/f(x) else: f(x) = zero_to.
Definition: processor.h:2397
string get_name() const
Get the processor's name.
Definition: processor.h:2399
static Processor * NEW()
Definition: processor.h:2403
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2408
void process_pixel(float *x) const
Definition: processor.h:2429
static const string NAME
Definition: processor.h:2426
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2421
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2414
Region defines a 2D or 3D rectangular region specified by its origin coordinates and all edges' sizes...
Definition: geometry.h:497
Replace the value of each pixel with a value in a given array.
Definition: processor.h:9722
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9753
void process_pixel(float *x) const
Definition: processor.h:9741
string get_name() const
Get the processor's name.
Definition: processor.h:9724
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9732
mirror an image around an axis (reverse pixels)
Definition: processor.h:6430
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6451
virtual void process_inplace(EMData *image)
To process an image in-place.
static const string NAME
Definition: processor.h:6456
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6444
static Processor * NEW()
Definition: processor.h:6439
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6434
Rotate by 180 using pixel swapping, works for 2D only.
Definition: processor.h:2795
string get_name() const
Get the processor's name.
Definition: processor.h:2797
static const string NAME
Definition: processor.h:2816
void process_inplace(EMData *image)
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2811
static Processor * NEW()
Definition: processor.h:2801
virtual void process_inplace(EMData *image)
To process an image in-place.
static const string NAME
Definition: processor.h:9394
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9373
static Processor * NEW()
Definition: processor.h:9377
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9385
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9381
makes image circularly symmetric.
Definition: processor.h:6301
static Processor * NEW()
Definition: processor.h:6310
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5595
string get_name() const
Get the processor's name.
Definition: processor.h:6305
static const string NAME
Definition: processor.h:6320
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6315
subtracts circularly symmetric part of an image.
Definition: processor.h:6326
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6340
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5688
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6330
Determines the second derivative in the gradient direction using David's image gradient processors.
Definition: processor.h:1157
string get_name() const
Get the processor's name.
Definition: processor.h:1161
static const string NAME
Definition: processor.h:1184
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1178
static Processor * NEW()
Definition: processor.h:1168
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1173
void process_inplace(EMData *image)
To process an image in-place.
Evaluate individual particle images using a tenchique similar to that used for CTF evaluation.
Definition: processor.h:456
static const string NAME
Definition: processor.h:491
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1218
static Processor * NEW()
Definition: processor.h:481
string get_name() const
Get the processor's name.
Definition: processor.h:458
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:465
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:486
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:473
Processor the images by the estimated SNR in each image.if parameter 'wiener' is 1,...
Definition: processor.h:7286
static Processor * NEW()
Definition: processor.h:7295
static const string NAME
Definition: processor.h:7313
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7627
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7305
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7290
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7300
Scale the image with control over the output dimensions.
Definition: processor.h:2986
virtual EMData * process(const EMData *const image)
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3008
static const string NAME
Definition: processor.h:3023
static Processor * NEW()
Definition: processor.h:2992
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3018
virtual void process_inplace(EMData *image)
virtual string get_name() const
Get the processor's name.
Definition: processor.h:2988
This tries to extract a single subunit from a symmetric structure.
Definition: processor.h:7737
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7756
static Processor * NEW()
Definition: processor.h:7751
static const string NAME
Definition: processor.h:7765
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7238
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7746
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7741
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2778
static const string NAME
Definition: processor.h:2784
string get_name() const
Get the processor's name.
Definition: processor.h:2758
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2769
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2599
static Processor * NEW()
Definition: processor.h:2762
Makes the radial power distribution spherically symmetric with a profile defined by "strucfac".
Definition: processor.h:7951
static const string NAME
Definition: processor.h:7979
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7971
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7956
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8311
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7961
static Processor * NEW()
Definition: processor.h:7966
Sets the structure factor based on a 1D s/intensity curve as an XYData object.
Definition: processor.h:7912
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7930
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7915
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7920
static const string NAME
Definition: processor.h:7940
void create_radial_func(vector< float > &radial_mask, EMData *image) const
Definition: processor.cpp:8376
static Processor * NEW()
Definition: processor.h:7925
f(x) = mean if x<(mean-v2*sigma) or x>(mean+v1*sigma); else f(x) = x;
Definition: processor.h:3544
static const string NAME
Definition: processor.h:3575
static Processor * NEW()
Definition: processor.h:3550
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3570
void process_pixel(float *x) const
Definition: processor.h:3578
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3562
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:3555
string get_name() const
Get the processor's name.
Definition: processor.h:3546
Fill zeroes at edges with nearest horizontal/vertical value.
Definition: processor.h:5521
string get_name() const
Get the processor's name.
Definition: processor.h:5525
static Processor * NEW()
Definition: processor.h:5529
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5534
static const string NAME
Definition: processor.h:5546
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4045
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5539
Smart mask processor.
Definition: processor.h:7987
static const string NAME
Definition: processor.h:8013
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8006
static Processor * NEW()
Definition: processor.h:7996
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8001
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7991
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8431
This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS re...
Definition: processor.h:7434
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7438
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7899
static const string NAME
Definition: processor.h:7461
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7448
static Processor * NEW()
Definition: processor.h:7443
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7453
Sorry for the pun.
Definition: processor.h:6218
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6233
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6248
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:5188
static const string NAME
Definition: processor.h:6253
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:5059
string get_name() const
Get the processor's name.
Definition: processor.h:6223
static Processor * NEW()
Definition: processor.h:6228
Identifiy the best symmetry in the given symmetry list for each pixel and then apply the best symmetr...
Definition: processor.h:7360
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7369
static const string NAME
Definition: processor.h:7389
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7379
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7364
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8000
static Processor * NEW()
Definition: processor.h:7374
Make an image consisting of a single cross, with lines going in the axial directions,...
Definition: processor.h:8371
static const string NAME
Definition: processor.h:8402
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8384
virtual void process_inplace(EMData *image)
Make an image where the axes (where x,y and z=0) are some nono zero value.
Definition: processor.cpp:9401
static Processor * NEW()
Definition: processor.h:8389
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8379
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8394
Replace a source image as a circle or sphere depends on 2D or 3D of the source image.
Definition: processor.h:8734
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9811
static const string NAME
Definition: processor.h:8763
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8738
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8753
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8743
static Processor * NEW()
Definition: processor.h:8748
Replace a source image with a cylinder.
Definition: processor.h:8848
static Processor * NEW()
Definition: processor.h:8862
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8857
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8852
static const string NAME
Definition: processor.h:8876
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8867
virtual void process_inplace(EMData *image)
To process an image in-place.
Replace source image with a disc (generalized cylinder)
Definition: processor.h:8885
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8889
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8894
virtual void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:8899
static const string NAME
Definition: processor.h:8913
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8904
Generate an ellipse or ellipsoid image.
Definition: processor.h:8645
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9964
static const string NAME
Definition: processor.h:8675
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8649
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8664
static Processor * NEW()
Definition: processor.h:8659
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8654
Replace a source image with a Gaussian band in Fourier space with a given center and width.
Definition: processor.h:8147
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8935
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8156
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8166
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8151
Replace a source image as a strict Gaussian.
Definition: processor.h:8113
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8132
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:8994
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8117
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8122
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9180
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8192
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8202
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8187
Replace a source image as a Gaussian Blob.
Definition: processor.h:8411
static Processor * NEW()
Definition: processor.h:8425
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8415
static const string NAME
Definition: processor.h:8439
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8420
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9303
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8430
Put a gradient in the image of the form y = mx+b : "x" is a string indicating any of the image axes,...
Definition: processor.h:8332
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8351
static Processor * NEW()
Definition: processor.h:8346
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9357
static const string NAME
Definition: processor.h:8360
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8341
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8336
Generate an ellipse/ellipsoid image with an inner hollow ellipse/ellipsoid.
Definition: processor.h:8690
static const string NAME
Definition: processor.h:8724
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9881
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8709
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8694
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8699
static Processor * NEW()
Definition: processor.h:8704
Treats the pixels as though they are 1D (even if the image is 2D or 3D), inserting a sine wave of pix...
Definition: processor.h:8256
static const string NAME
Definition: processor.h:8282
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8265
static Processor * NEW()
Definition: processor.h:8270
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9288
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8275
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8260
Replace a source image with gaussian distributed random noise If you don't provide a seed at all,...
Definition: processor.h:8811
static const string NAME
Definition: processor.h:8840
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8820
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8830
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8815
virtual void process_inplace(EMData *image)
To process an image in-place.
static Processor * NEW()
Definition: processor.h:8825
Replace a source image as a uniform random noise, random number generated from gsl_rng_mt19937,...
Definition: processor.h:8771
static const string NAME
Definition: processor.h:8797
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8790
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8775
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8780
static Processor * NEW()
Definition: processor.h:8785
Base class for a group of 'processor' used to create test image.
Definition: processor.h:8054
void preprocess(EMData *image)
Definition: processor.cpp:8923
static string get_group_desc()
Definition: processor.h:8056
Replace a source image as a strict Gaussian.
Definition: processor.h:8075
static const string NAME
Definition: processor.h:8106
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8084
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8094
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9509
static Processor * NEW()
Definition: processor.h:8089
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8079
Replace a source image with a lumpy S-curve used for alignment testing.
Definition: processor.h:8445
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8464
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8449
static const string NAME
Definition: processor.h:8470
static Processor * NEW()
Definition: processor.h:8459
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9483
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8454
Replace a source image as a circular sine wave in specified wave length.
Definition: processor.h:8566
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9688
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8575
static const string NAME
Definition: processor.h:8595
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8585
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8570
static Processor * NEW()
Definition: processor.h:8580
Replace a source image as a sine wave in specified wave length.
Definition: processor.h:8524
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8543
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8533
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9601
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8528
static const string NAME
Definition: processor.h:8556
static Processor * NEW()
Definition: processor.h:8538
Replace a source image as a sine wave in specified wave length.
Definition: processor.h:8481
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9552
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8490
static const string NAME
Definition: processor.h:8511
static Processor * NEW()
Definition: processor.h:8495
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8485
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8500
Replace a source image as a square or cube depends on 2D or 3D of the source image.
Definition: processor.h:8605
static Processor * NEW()
Definition: processor.h:8619
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:9741
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8614
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8609
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8624
static const string NAME
Definition: processor.h:8634
Make an image useful for tomographic reconstruction testing this is a 3D phantom image based on the 2...
Definition: processor.h:8294
virtual void process_inplace(EMData *image)
Make a useful tomographic phantom image.
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8301
static Processor * NEW()
Definition: processor.h:8311
static const string NAME
Definition: processor.h:8316
void insert_solid_ellipse(EMData *image, const Region &region, const float &value, const Transform &t3d=Transform())
void insert_rectangle(EMData *image, const Region &region, const float &value, const Transform &t3d=Transform())
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8306
void insert_hollow_ellipse(EMData *image, const Region &region, const float &value, const int &radius, const Transform &t3d=Transform())
ToCenterProcessor centers image, ignores old dx, dy.
Definition: processor.h:7091
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7331
static Processor * NEW()
Definition: processor.h:7100
static const string NAME
Definition: processor.h:7119
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7110
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7105
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7095
ToMassCenterProcessor centers image at center of mass, ignores old dx, dy.
Definition: processor.h:7127
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7141
static Processor * NEW()
Definition: processor.h:7136
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7131
virtual void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:7423
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7146
static const string NAME
Definition: processor.h:7156
f(x) = x if x >= minval; f(x) = minval if x < minval
Definition: processor.h:3115
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2429
string get_name() const
Get the processor's name.
Definition: processor.h:3117
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:3136
static const string NAME
Definition: processor.h:3141
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:3128
static Processor * NEW()
Definition: processor.h:3121
f(x) = x if x >= minval; f(x) = 0 if x < minval
Definition: processor.h:2591
static const string NAME
Definition: processor.h:2613
string get_name() const
Get the processor's name.
Definition: processor.h:2593
static Processor * NEW()
Definition: processor.h:2597
void process_pixel(float *x) const
Definition: processor.h:2616
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2601
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2608
A processor that can be used to weight an image by 1/cos(angle) This processor evolved originally as ...
Definition: processor.h:9071
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9075
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9093
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9085
GaussianFunctoid(const float sigma, const float mean=0.0)
Definition: processor.h:9043
A processor designed specifically for tomographic tilt series data.
Definition: processor.h:9006
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9020
virtual void process_inplace(EMData *image)
To process an image in-place.
static const string NAME
Definition: processor.h:9037
static Processor * NEW()
Definition: processor.h:9015
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9032
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9010
Transform the image using a Transform object.
Definition: processor.h:2826
static Processor * NEW()
Definition: processor.h:2832
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2864
static const string NAME
Definition: processor.h:2869
virtual string get_name() const
Get the processor's name.
Definition: processor.h:2828
float * transform(const EMData *const image, const Transform &t) const
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2849
virtual void process_inplace(EMData *image)
void assert_valid_aspect(const EMData *const image) const
virtual EMData * process(const EMData *const image)
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
Transpose a 2D image.
Definition: processor.h:6354
virtual EMData * process(const EMData *const image)
See Processor comments for more details.
Definition: processor.cpp:5722
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:6379
static const string NAME
Definition: processor.h:6390
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:6385
virtual void process_inplace(EMData *image)
See Processor comments for more details.
Definition: processor.cpp:5738
static Processor * NEW()
Definition: processor.h:6374
virtual string get_name() const
Get the processor's name.
Definition: processor.h:6369
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
static int fast_floor(float x)
A fast way to calculate a floor, which is largest integral value not greater than argument.
Definition: util.h:874
static float get_gauss_rand(float mean, float sigma)
Get a Gaussian random number.
Definition: util.cpp:845
Do a math power operation on image, f(x) = x ^ pow;.
Definition: processor.h:2442
static const string NAME
Definition: processor.h:2471
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2466
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:2453
void process_pixel(float *x) const
Definition: processor.h:2474
static Processor * NEW()
Definition: processor.h:2448
string get_name() const
Get the processor's name.
Definition: processor.h:2444
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:2459
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2526
static const string NAME
Definition: processor.h:2531
string get_name() const
Get the processor's name.
Definition: processor.h:2517
void process_pixel(float *x) const
Definition: processor.h:2534
static Processor * NEW()
Definition: processor.h:2521
Do a square operation on image, f(x) = x * x;.
Definition: processor.h:2486
string get_name() const
Get the processor's name.
Definition: processor.h:2488
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:2498
void process_pixel(float *x) const
Definition: processor.h:2506
static Processor * NEW()
Definition: processor.h:2492
static const string NAME
Definition: processor.h:2503
Tries to fix images scanned on the zeiss for poor ccd normalization.
Definition: processor.h:5338
static Processor * NEW()
Definition: processor.h:5347
static const string NAME
Definition: processor.h:5357
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:3956
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5352
string get_name() const
Get the processor's name.
Definition: processor.h:5342
'paints' a circle into the image at x,y,z with values inside r1 set to v1, values between r1 and r2 w...
Definition: processor.h:7696
static Processor * NEW()
Definition: processor.h:7706
static const string NAME
Definition: processor.h:7726
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
virtual string get_name() const
Get the processor's name.
Definition: processor.h:7701
virtual void process_inplace(EMData *)
To process an image in-place.
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:7711
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:7716
Perform a Wavelet transform using GSL.
Definition: processor.h:8959
static const string NAME
Definition: processor.h:8987
virtual string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:8982
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:8973
virtual string get_name() const
Get the processor's name.
Definition: processor.h:8963
static Processor * NEW()
Definition: processor.h:8968
virtual void process_inplace(EMData *image)
To process an image in-place.
Fill missing wedge with information from another image.
Definition: processor.h:5487
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1077
string get_name() const
Get the processor's name.
Definition: processor.h:5491
static Processor * NEW()
Definition: processor.h:5495
static const string NAME
Definition: processor.h:5514
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5505
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5500
Automatically determines the background for the image then uses this to perform Wiener filters on ove...
Definition: processor.h:1613
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1955
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1631
static const string NAME
Definition: processor.h:1648
string get_name() const
Get the processor's name.
Definition: processor.h:1615
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:1624
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:1982
static Processor * NEW()
Definition: processor.h:1638
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1643
Wiener filter based on a Ctf object either in the image header.
Definition: processor.h:1856
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:2043
string get_name() const
Get the processor's name.
Definition: processor.h:1858
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Definition: processor.cpp:1991
static Processor * NEW()
Definition: processor.h:1881
static const string NAME
Definition: processor.h:1891
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:1874
void set_params(const Dict &new_params)
Set the processor parameters using a key/value dictionary.
Definition: processor.h:1867
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:1886
Determines the partial derivatives in the x direction Does this by constructing edge kernels in real ...
Definition: processor.h:878
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:882
static const string NAME
Definition: processor.h:905
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:899
static Processor * NEW()
Definition: processor.h:889
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:894
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
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:931
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:925
static Processor * NEW()
Definition: processor.h:920
string get_name() const
Get the processor's name.
Definition: processor.h:913
static const string NAME
Definition: processor.h:937
void process_inplace(EMData *image)
To process an image in-place.
string get_name() const
Get the processor's name.
Definition: processor.h:945
void process_inplace(EMData *image)
To process an image in-place.
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:962
static const string NAME
Definition: processor.h:968
static Processor * NEW()
Definition: processor.h:952
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:957
Calculate the z thickness of each pixel in a binarized 3d image.
Definition: processor.h:9690
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:9703
static const string NAME
Definition: processor.h:9713
static Processor * NEW()
Definition: processor.h:9699
virtual TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:9707
virtual string get_name() const
Get the processor's name.
Definition: processor.h:9695
virtual void process_inplace(EMData *image)
To process an image in-place.
virtual EMData * process(const EMData *const image)
To proccess an image out-of-place.
Contraction of data, if any nearest neighbor is 0, value -> 0, generally used iteratively.
Definition: processor.h:4435
static Processor * NEW()
Definition: processor.h:4441
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:4446
void process_pixel(float *pixel, float, float, float, float *matrix) const
Definition: processor.h:4454
static const string NAME
Definition: processor.h:4451
string get_name() const
Get the processor's name.
Definition: processor.h:4437
zero edges of volume on all sides
Definition: processor.h:5752
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5770
static const string NAME
Definition: processor.h:5782
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4576
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5765
static Processor * NEW()
Definition: processor.h:5760
string get_name() const
Get the processor's name.
Definition: processor.h:5755
zero edges of image on top and bottom, and on left and right.
Definition: processor.h:5711
string get_name() const
Get the processor's name.
Definition: processor.h:5714
static const string NAME
Definition: processor.h:5740
void process_inplace(EMData *image)
To process an image in-place.
Definition: processor.cpp:4537
TypeDict get_param_types() const
Get processor parameter information in a dictionary.
Definition: processor.h:5729
string get_desc() const
Get the descrition of this specific processor.
Definition: processor.h:5724
static Processor * NEW()
Definition: processor.h:5719
EMData * sqrt() const
return square root of current image
EMData * log10() const
return base 10 logarithm image for a image
#define InvalidParameterException(desc)
Definition: exception.h:361
#define ImageDimensionException(desc)
Definition: exception.h:166
#define InvalidCallException(desc)
Definition: exception.h:348
E2Exception class.
Definition: aligner.h:40
map< string, vector< string > > group_processors()
int multi_processors(EMData *image, vector< string > processornames)
void dump_processors()
map< string, vector< string > > dump_processors_list()
#define x(i)
Definition: projector.cpp:1517
#define images(i, j, k)
Definition: projector.cpp:1897
bool operator()(float left, float right) const
Definition: processor.h:4923
bool operator()(float left, float right) const
Definition: processor.h:4982