Esempio n. 1
0
IMPEM2D_BEGIN_NAMESPACE

em2d::Images get_projections(const ParticlesTemp &ps,
                             const algebra::SphericalVector3Ds &vs, int rows,
                             int cols, const ProjectingOptions &options,
                             Strings names) {
  IMP_LOG_VERBOSE("Generating projections from spherical vectors" << std::endl);
  unsigned long n_projs = vs.size();
  RegistrationResults registration_values(n_projs);
  for (unsigned long i = 0; i < n_projs; ++i) {
    algebra::Rotation3D R =
        em2d::internal::get_rotation_from_projection_direction(vs[i]);
    algebra::Vector2D shift(0.0, 0.0);
    RegistrationResult rr(R, shift);
    registration_values[i] = rr;
  }
  return get_projections(ps, registration_values, rows, cols, options, names);
}
Esempio n. 2
0
//! process the options of the parameter --proj_dist and return a set of
//! projection values. n_projections is the number of requested projections
em2d::RegistrationResults get_registration_values(
                  const std::vector<str> &proj_dist_opt,
                  const unsigned int n_projections) {
  em2d::RegistrationResults registration_values(n_projections);
  str distribution_type = proj_dist_opt[0];
  if(distribution_type == "unif" ) {
    // Generate uniform distribution of projection directions
    registration_values =
        em2d::get_evenly_distributed_registration_results(n_projections);
  } else if(distribution_type == "rand" ) {
    // Generate random distribution of projections
    registration_values=em2d::get_random_registration_results(n_projections);
  } else if(distribution_type == "read") {
    // Read the file of with the parameters for the requested projections
    registration_values=em2d::read_registration_results(proj_dist_opt[1]);
  }
  return registration_values;
}