#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 5304 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 5319 of file processor.h. 05320 { 05321 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."; 05322 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5309 of file processor.h. References NAME. 05310 { 05311 return NAME; 05312 }
|
|
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 5324 of file processor.h. References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put(). 05325 { 05326 TypeDict d; 05327 d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible"); 05328 d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value"); 05329 d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio"); 05330 return d; 05331 }
|
|
Definition at line 5314 of file processor.h. 05315 { 05316 return new LocalNormProcessor(); 05317 }
|
|
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 5872 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(). 05873 { 05874 if (!image) { 05875 LOGWARN("NULL Image"); 05876 return; 05877 } 05878 float apix = params["apix"]; 05879 float threshold = params["threshold"]; 05880 float radius = params["radius"]; 05881 05882 if (apix > 0) { 05883 int ny = image->get_ysize(); 05884 radius = ny * apix / radius; 05885 //printf("Norm filter radius=%1.1f\n", radius); 05886 } 05887 05888 EMData *blur = image->copy(); 05889 EMData *maskblur = image->copy(); 05890 05891 maskblur->process_inplace("threshold.binary", Dict("value", threshold)); 05892 maskblur->process_inplace("eman1.filter.lowpass.gaussian", Dict("lowpass", radius)); 05893 maskblur->process_inplace("eman1.filter.highpass.tanh", Dict("highpass", -10.0f)); 05894 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05895 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05896 05897 05898 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold)); 05899 blur->process_inplace("eman1.filter.lowpass.gaussian", Dict("lowpass", radius)); 05900 blur->process_inplace("eman1.filter.highpass.tanh", Dict("highpass", -10.0f)); 05901 05902 maskblur->div(*blur); 05903 image->mult(*maskblur); 05904 maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC); 05905 05906 if( maskblur ) 05907 { 05908 delete maskblur; 05909 maskblur = 0; 05910 } 05911 05912 if( blur ) 05913 { 05914 delete blur; 05915 blur = 0; 05916 } 05917 }
|
|
Definition at line 5333 of file processor.h. Referenced by get_name(). |