#include <processor.h>
Inheritance diagram for EMAN::NormalizeRampNormVar:
Public Member Functions | |
string | get_name () const |
Get the processor's name. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
void | process_inplace (EMData *image) |
To process an image in-place. | |
Static Public Member Functions | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "normalize.ramp.normvar" |
Ramps are removed first, then mean and sigma becomes 0 and 1 respectively This is essential Pawel Penczek's preferred method of particle normalization
Definition at line 4250 of file processor.h.
string EMAN::NormalizeRampNormVar::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 4263 of file processor.h.
04264 { 04265 return "First call filter.ramp on the image, then make the mean 0 and norm 1"; 04266 }
string EMAN::NormalizeRampNormVar::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 4253 of file processor.h.
References NAME.
04254 { 04255 return NAME; 04256 }
static Processor* EMAN::NormalizeRampNormVar::NEW | ( | ) | [inline, static] |
Definition at line 4258 of file processor.h.
04259 { 04260 return new NormalizeRampNormVar(); 04261 }
void NormalizeRampNormVar::process_inplace | ( | EMData * | image | ) | [virtual] |
To process an image in-place.
For those processors which can only be processed out-of-place, override this function to just print out some error message to remind user call the out-of-place version.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 3680 of file processor.cpp.
References EMAN::EMData::add(), EMAN::EMData::get_xsize(), infomask(), EMAN::EMData::is_complex(), LOGWARN, EMAN::EMData::mult(), EMAN::EMData::process_inplace(), and EMAN::EMData::update().
03681 { 03682 if (!image) { 03683 LOGWARN("cannot do normalization on NULL image"); 03684 return; 03685 } 03686 03687 if (image->is_complex()) { 03688 LOGWARN("cannot do normalization on complex image"); 03689 return; 03690 } 03691 03692 image->process_inplace( "filter.ramp" ); 03693 int nx = image->get_xsize(); 03694 EMData mask(nx,nx); 03695 mask.process_inplace("testimage.circlesphere", Dict("radius",nx/2-2,"fill",1)); 03696 03697 vector<float> rstls = Util::infomask( image, &mask, false); 03698 image->add((float)-rstls[0]); 03699 image->mult((float)1.0/rstls[1]); 03700 image->update(); 03701 }
const string NormalizeRampNormVar::NAME = "normalize.ramp.normvar" [static] |