#include <processor.h>
Inheritance diagram for EMAN::IndexMaskFileProcessor:
Public Member Functions | |
virtual void | process_inplace (EMData *image) |
To process an image in-place. | |
virtual string | get_name () const |
Get the processor's name. | |
virtual TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "mask.fromfile" |
The images must be same size. If 'ismaskset=' is 1, it will take a file containing a set of masks and apply the first mask to the image.
filename | mask image file name | |
ismaskset | If set to 1, it will take a file containing a set of masks and apply the first mask to the image |
Definition at line 5300 of file processor.h.
virtual string EMAN::IndexMaskFileProcessor::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 5323 of file processor.h.
05324 { 05325 return "Multiplies the image by the specified file using pixel indices. The images must be same size. If 'ismaskset=' is 1, it will take a file containing a set of masks and apply the first mask to the image."; 05326 }
virtual string EMAN::IndexMaskFileProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 5305 of file processor.h.
References NAME.
05306 { 05307 return NAME; 05308 }
virtual TypeDict EMAN::IndexMaskFileProcessor::get_param_types | ( | ) | const [inline, virtual] |
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 5315 of file processor.h.
References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.
05316 { 05317 TypeDict d; 05318 d.put("filename", EMObject::STRING, "mask image file name"); 05319 d.put("ismaskset", EMObject::INT, "If set to 1, it will take a file containing a set of masks and apply the first mask to the image"); 05320 return d; 05321 }
static Processor* EMAN::IndexMaskFileProcessor::NEW | ( | ) | [inline, static] |
Definition at line 5310 of file processor.h.
05311 { 05312 return new IndexMaskFileProcessor(); 05313 }
void IndexMaskFileProcessor::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 5931 of file processor.cpp.
References EMAN::EMUtil::is_same_size(), LOGERR, LOGWARN, EMAN::Processor::params, EMAN::EMData::process_inplace(), and EMAN::EMData::read_image().
05932 { 05933 if (!image) { 05934 LOGWARN("NULL Image"); 05935 return; 05936 } 05937 05938 const char *filename = params["filename"]; 05939 EMData *msk = new EMData(); 05940 msk->read_image(filename); 05941 if (!EMUtil::is_same_size(image, msk)) { 05942 LOGERR("IndexMaskFileProcessor: Mask size different than image"); 05943 return; 05944 } 05945 05946 if ((int) params["ismaskset"] != 0) { 05947 msk->process_inplace("threshold.binaryrange", Dict("low", 0.5f, "high", 1.5f)); 05948 } 05949 05950 image->mult(*msk); 05951 if( msk ) 05952 { 05953 delete msk; 05954 msk = 0; 05955 } 05956 }
const string IndexMaskFileProcessor::NAME = "mask.fromfile" [static] |