#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "misc.localnorm" |
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 5264 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 5279 of file processor.h. 05280 { 05281 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 normalization size similar to an lp= value."; 05282 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5269 of file processor.h. References NAME. 05270 { 05271 return NAME; 05272 }
|
|
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 5284 of file processor.h. References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put(). 05285 { 05286 TypeDict d; 05287 d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible"); 05288 d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value"); 05289 d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio"); 05290 return d; 05291 }
|
|
Definition at line 5274 of file processor.h. 05275 { 05276 return new LocalNormProcessor(); 05277 }
|
|
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 5765 of file processor.cpp. References EMAN::EMData::copy(), EMAN::EMData::div(), EMAN::EMData::get_ysize(), EMAN::EMUtil::IMAGE_MRC, LOGWARN, EMAN::EMData::mult(), EMAN::Processor::params, EMAN::EMData::process_inplace(), and EMAN::EMData::write_image(). 05766 { 05767 if (!image) { 05768 LOGWARN("NULL Image"); 05769 return; 05770 } 05771 float apix = params["apix"]; 05772 float threshold = params["threshold"]; 05773 float radius = params["radius"]; 05774 05775 if (apix > 0) { 05776 int ny = image->get_ysize(); 05777 radius = ny * apix / radius; 05778 //printf("Norm filter radius=%1.1f\n", radius); 05779 } 05780 05781 EMData *blur = image->copy(); 05782 EMData *maskblur = image->copy(); 05783 05784 maskblur->process_inplace("threshold.binary", Dict("value", threshold)); 05785 maskblur->process_inplace("eman1.filter.lowpass.gaussian", Dict("lowpass", radius)); 05786 maskblur->process_inplace("eman1.filter.highpass.tanh", Dict("highpass", -10.0f)); 05787 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05788 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05789 05790 05791 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold)); 05792 blur->process_inplace("eman1.filter.lowpass.gaussian", Dict("lowpass", radius)); 05793 blur->process_inplace("eman1.filter.highpass.tanh", Dict("highpass", -10.0f)); 05794 05795 maskblur->div(*blur); 05796 image->mult(*maskblur); 05797 maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC); 05798 05799 if( maskblur ) 05800 { 05801 delete maskblur; 05802 maskblur = 0; 05803 } 05804 05805 if( blur ) 05806 { 05807 delete blur; 05808 blur = 0; 05809 } 05810 }
|
|
Definition at line 5293 of file processor.h. Referenced by get_name(). |