Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::TomoCccCmp Class Reference

This implements the technique of Mike Schmid where by the cross correlation is normalized in an effort to remove the effects of the missing wedge. More...

#include <cmp.h>

Inheritance diagram for EMAN::TomoCccCmp:

Inheritance graph
[legend]
Collaboration diagram for EMAN::TomoCccCmp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual float cmp (EMData *image, EMData *with) const
 To compare 'image' with another image passed in through its parameters.
virtual string get_name () const
 Get the Cmp's name.
virtual string get_desc () const
TypeDict get_param_types () const
 Get Cmp parameter information in a dictionary.

Static Public Member Functions

CmpNEW ()

Static Public Attributes

const string NAME = "ccc.tomo"

Detailed Description

This implements the technique of Mike Schmid where by the cross correlation is normalized in an effort to remove the effects of the missing wedge.

Somewhat of a heuristic solution, but it seems to work. Basiaclly it relies on the observation that 'good' matchs will conentrate the correlation signal in the peak, wheras 'bad' correlations will distribute the signal.

Author:
John Flanagan (a port of Mike Schmid's code - Mike Schmid is the intellectual author)
Date:
2010-10-18
Parameters:
norm Normalize the ccf (you need to do this if a missing wedge is present)
ccf Supply your own ccf function (can be used for speedups)
searchx The maximum acceptable tx from the origin
searchy The maximum acceptable ty from the origin
searchz The maximum acceptable tz from the origin

Definition at line 314 of file cmp.h.


Member Function Documentation

float TomoCccCmp::cmp EMData image,
EMData with
const [virtual]
 

To compare 'image' with another image passed in through its parameters.

An optional transformation may be used to transform the 2 images.

Parameters:
image The first image to be compared.
with The second image to be comppared.
Returns:
The comparison result. Smaller better by default

Implements EMAN::Cmp.

Definition at line 582 of file cmp.cpp.

References EMAN::EMData::calc_ccf(), EMAN::EMData::calc_max_location_wrap(), EMAN::EMData::get_value_at_wrap(), norm(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), and EMAN::Dict::set_default().

00583 {
00584         ENTERFUNC;
00585         EMData* ccf = params.set_default("ccf",(EMData*) NULL);
00586         bool ccf_ownership = false;
00587         if (!ccf) {
00588                 ccf = image->calc_ccf(with);
00589                 ccf_ownership = true;
00590         }
00591         bool norm = params.set_default("norm",true);
00592         bool zeroori = params.set_default("zeroori",false);
00593         
00594         if (norm) ccf->process_inplace("normalize");
00595 
00596         IntPoint point;
00597         if (zeroori) {
00598                 point[0] = 0; point[1] = 0; point[2] = 0;
00599         } else {
00600                 int searchx = params.set_default("searchx",-1); 
00601                 int searchy = params.set_default("searchy",-1); 
00602                 int searchz = params.set_default("searchz",-1);
00603                 point = ccf->calc_max_location_wrap(searchx,searchy,searchz);
00604         }
00605         
00606         //this is to prevent us from doing a ccf twice
00607         float tx = (float)point[0]; float ty = (float)point[1]; float tz = (float)point[2];
00608         image->set_attr("tx", tx);
00609         image->set_attr("ty", ty);
00610         image->set_attr("tz", tz);
00611         
00612         float best_score = ccf->get_value_at_wrap(tx,ty,tz);
00613         if (ccf_ownership) delete ccf; ccf = 0;
00614         
00615         return -best_score;
00616 
00617 }

virtual string EMAN::TomoCccCmp::get_desc  )  const [inline, virtual]
 

Implements EMAN::Cmp.

Definition at line 324 of file cmp.h.

00325                 {
00326                         return "Ccc with consideration given for the missing wedge";
00327                 }

virtual string EMAN::TomoCccCmp::get_name  )  const [inline, virtual]
 

Get the Cmp's name.

Each Cmp is identified by a unique name.

Returns:
The Cmp's name.

Implements EMAN::Cmp.

Definition at line 319 of file cmp.h.

00320                 {
00321                         return NAME;
00322                 }

TypeDict EMAN::TomoCccCmp::get_param_types  )  const [inline, virtual]
 

Get Cmp parameter information in a dictionary.

Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.

Returns:
A dictionary containing the parameter info.

Implements EMAN::Cmp.

Definition at line 334 of file cmp.h.

References EMAN::TypeDict::put().

00335                 {
00336                         TypeDict d;
00337                         d.put("norm", EMObject::BOOL,"Whether the cross correlation image should be normalized (should be for normalized images). Default is true.");
00338                         d.put("ccf", EMObject::EMDATA,"The ccf image, can be provided if it already exists to avoid recalculating it");
00339                         d.put("searchx", EMObject::INT, "The maximum range of the peak location in the x direction. Default is sizex/4");
00340                         d.put("searchy", EMObject::INT, "The maximum range of the peak location in the y direction. Default is sizey/4");
00341                         d.put("searchz", EMObject::INT, "The maximum range of the peak location in the z direction. Default is sizez/4");
00342                         d.put("zeroori", EMObject::FLOAT,"When using the ccc.tomo aligner, use the peak at origin (use only with refine3D aligner).");
00343                         return d;
00344                 }

Cmp* EMAN::TomoCccCmp::NEW  )  [inline, static]
 

Definition at line 329 of file cmp.h.

00330                 {
00331                         return new TomoCccCmp();
00332                 }


Member Data Documentation

const string TomoCccCmp::NAME = "ccc.tomo" [static]
 

Definition at line 47 of file cmp.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 13:47:18 2010 for EMAN2 by  doxygen 1.3.9.1