#include <processor.h>
Inheritance diagram for EMAN::LocalNormProcessor:
Public Member Functions | |
void | process_inplace (EMData *image) |
To process an image in-place. | |
virtual string | get_name () const |
Get the processor's name. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
virtual TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "normalize.local" |
threshold is an isosurface threshold at which all desired features are visible, radius is a normalization size similar to an lp= value.
threshold | an isosurface threshold at which all desired features are visible | |
radius | a normalization size similar to an lp= value | |
apix | Angstrom per pixel ratio |
Definition at line 5089 of file processor.h.
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 5104 of file processor.h. 05105 { 05106 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."; 05107 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5094 of file processor.h. 05095 {
05096 return NAME;
05097 }
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::Processor. Definition at line 5109 of file processor.h. References EMAN::TypeDict::put(). 05110 { 05111 TypeDict d; 05112 d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible"); 05113 d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value"); 05114 d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio"); 05115 return d; 05116 }
|
|
Definition at line 5099 of file processor.h. 05100 { 05101 return new LocalNormProcessor(); 05102 }
|
|
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.
Implements EMAN::Processor. Definition at line 5734 of file processor.cpp. References EMAN::EMData::copy(), EMAN::EMData::div(), EMAN::EMData::get_ysize(), LOGWARN, EMAN::EMData::mult(), ny, and EMAN::EMData::process_inplace(). 05735 { 05736 if (!image) { 05737 LOGWARN("NULL Image"); 05738 return; 05739 } 05740 float apix = params["apix"]; 05741 float threshold = params["threshold"]; 05742 float radius = params["radius"]; 05743 05744 if (apix > 0) { 05745 int ny = image->get_ysize(); 05746 radius = ny * apix / radius; 05747 //printf("Norm filter radius=%1.1f\n", radius); 05748 } 05749 05750 EMData *blur = image->copy(); 05751 EMData *maskblur = image->copy(); 05752 05753 maskblur->process_inplace("threshold.binary", Dict("value", threshold)); 05754 maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 05755 // maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f)); 05756 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05757 // maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05758 05759 05760 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold)); 05761 blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 05762 // blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f)); 05763 05764 maskblur->div(*blur); 05765 image->mult(*maskblur); 05766 // maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC); 05767 05768 if( maskblur ) 05769 { 05770 delete maskblur; 05771 maskblur = 0; 05772 } 05773 05774 if( blur ) 05775 { 05776 delete blur; 05777 blur = 0; 05778 } 05779 }
|
|
Definition at line 171 of file processor.cpp. |