7#ifndef IMPEM2D_REGISTRATION_RESULT_H
8#define IMPEM2D_REGISTRATION_RESULT_H
10#include "IMP/em2d/internal/rotation_helper.h"
11#include <IMP/em2d/em2d_config.h>
20#include <cereal/access.hpp>
22IMPEM2D_BEGIN_NAMESPACE
36class IMPEM2DEXPORT RegistrationResult {
40 RegistrationResult(
double phi,
double theta,
double psi,
42 int image_index = 0,
String name =
"");
46 int projection_index = 0,
int image_index = 0,
49 inline double get_phi()
const {
return phi_; }
50 inline double get_theta()
const {
return theta_; }
51 inline double get_psi()
const {
return psi_; }
62 inline void set_projection_index(
int index) { projection_index_ = index; }
77 inline void set_ccc(
double ccc) {
79 is_optimized_result_ =
false;
86 void set_score(
double Score) {
88 is_optimized_result_ =
true;
105 inline void set_name(
String name) { name_ = name; }
114 void write(std::ostream &out = std::cout)
const;
134 bool get_is_optimized_result()
const {
return is_optimized_result_; }
148 int projection_index_;
154 bool is_optimized_result_;
157 friend class cereal::access;
159 template<
class Archive>
void serialize(Archive &ar) {
161 phi_, theta_, psi_, R_, is_optimized_result_);
A nullptr-initialized pointer to an IMP Object.
Represent a rotation in 2D space.
Simple 3D rotation class.
Class to manage registration results.
int get_projection_index() const
Projection that best matches the image after coarse registration.
double phi_
Euler angles (ZYZ).
String get_name() const
Name of the object.
void set_in_image(em::ImageHeader &header) const
Sets the registration results to the header of an image.
int get_image_index() const
Image that has been registered.
String name_
name and index of the projection compared
void set_rotation(double phi, double theta, double psi)
Rotation to apply to the model.
void set_shift(algebra::Vector2D shift)
Shift to apply to the projection to register.
void write_comment_line(std::ostream &out=std::cout) const
Writes an info line to with the contents of a result line.
algebra::Vector2D shift_
Translation in pixels and the rows first (y rows, x columns).
void read(const String &s)
read
void set_rotation(algebra::Rotation3D R)
Rotation to apply to the model.
void set_image_index(int index)
Index of the image that is registered.
void set_random_registration(unsigned int index, double maximum_shift)
Gets a random result.
int image_index_
index of the image being registered
void write(std::ostream &out=std::cout) const
Writes a parseable result.
double ccc_
Cross correlation coefficient.
algebra::Rotation3D get_rotation() const
Returns the rotation for the 3 projection angles.
void add_in_plane_transformation(algebra::Transformation2D t)
void read_from_image(const em::ImageHeader &header)
Reads the registration parameters from an image.
Rotation3D get_rotation_from_fixed_zyz(double Rot, double Tilt, double Psi)
Generate a rotation object from Euler Angles.
IMP::Vector< RegistrationResult > RegistrationResults
RegistrationResults read_registration_results(const String &filename)
Reads a set of registration results.
RegistrationResults get_evenly_distributed_registration_results(unsigned int n_projections)
void write_registration_results(String filename, const RegistrationResults &results)
Writes a set of registration results.
RegistrationResults get_random_registration_results(unsigned int n, double maximum_shift=5.0)
Provides a set of random registration results (or parameters).
std::string String
Basic string value.
#define IMP_SHOWABLE(Name)
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.