#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 | |
| Processor * | NEW () |
Static Public Attributes | |
| 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 5266 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 5289 of file processor.h. 05290 {
05291 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.";
05292 }
|
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5271 of file processor.h. 05272 {
05273 return NAME;
05274 }
|
|
|
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 5281 of file processor.h. References EMAN::TypeDict::put(). 05282 {
05283 TypeDict d;
05284 d.put("filename", EMObject::STRING, "mask image file name");
05285 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");
05286 return d;
05287 }
|
|
|
Definition at line 5276 of file processor.h. 05277 {
05278 return new IndexMaskFileProcessor();
05279 }
|
|
|
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 5966 of file processor.cpp. References EMAN::EMUtil::is_same_size(), LOGERR, LOGWARN, EMAN::EMData::mult(), EMAN::EMData::process_inplace(), and EMAN::EMData::read_image(). 05967 {
05968 if (!image) {
05969 LOGWARN("NULL Image");
05970 return;
05971 }
05972
05973 const char *filename = params["filename"];
05974 EMData *msk = new EMData();
05975 msk->read_image(filename);
05976 if (!EMUtil::is_same_size(image, msk)) {
05977 LOGERR("IndexMaskFileProcessor: Mask size different than image");
05978 return;
05979 }
05980
05981 if ((int) params["ismaskset"] != 0) {
05982 msk->process_inplace("threshold.binaryrange", Dict("low", 0.5f, "high", 1.5f));
05983 }
05984
05985 image->mult(*msk);
05986 if( msk )
05987 {
05988 delete msk;
05989 msk = 0;
05990 }
05991 }
|
|
|
Definition at line 177 of file processor.cpp. |
1.3.9.1