#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 5340 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 5363 of file processor.h. 05364 { 05365 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."; 05366 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5345 of file processor.h. References NAME. 05346 { 05347 return NAME; 05348 }
|
|
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 5355 of file processor.h. References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING. 05356 { 05357 TypeDict d; 05358 d.put("filename", EMObject::STRING, "mask image file name"); 05359 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"); 05360 return d; 05361 }
|
|
Definition at line 5350 of file processor.h. 05351 { 05352 return new IndexMaskFileProcessor(); 05353 }
|
|
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 6038 of file processor.cpp. References EMAN::EMUtil::is_same_size(), LOGERR, LOGWARN, EMAN::Processor::params, EMAN::EMData::process_inplace(), and EMAN::EMData::read_image(). 06039 { 06040 if (!image) { 06041 LOGWARN("NULL Image"); 06042 return; 06043 } 06044 06045 const char *filename = params["filename"]; 06046 EMData *msk = new EMData(); 06047 msk->read_image(filename); 06048 if (!EMUtil::is_same_size(image, msk)) { 06049 LOGERR("IndexMaskFileProcessor: Mask size different than image"); 06050 return; 06051 } 06052 06053 if ((int) params["ismaskset"] != 0) { 06054 msk->process_inplace("threshold.binaryrange", Dict("low", 0.5f, "high", 1.5f)); 06055 } 06056 06057 image->mult(*msk); 06058 if( msk ) 06059 { 06060 delete msk; 06061 msk = 0; 06062 } 06063 }
|
|
Definition at line 5368 of file processor.h. Referenced by get_name(). |