9 #ifndef IMPEM_KERNEL_PARAMETERS_H
10 #define IMPEM_KERNEL_PARAMETERS_H
13 #include <boost/scoped_array.hpp>
23 #include <IMP/em/internal/RadiusDependentKernelParameters.h>
24 #include <boost/serialization/access.hpp>
25 #include <boost/serialization/split_member.hpp>
43 inline float get_rsig()
const {
return rsig_; }
71 inline float get_lim()
const {
return lim_; }
73 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
80 const internal::RadiusDependentKernelParameters& get_params(
float radius,
89 float rsig_, rsigsq_, inv_rsigsq_;
90 float sq2pi3_, rnormfac_;
91 float rkdist_, rkdistsq_, lim_;
93 typedef std::map<float, const internal::RadiusDependentKernelParameters *>
95 KernelMap radii2params_;
97 void init(
float resolution);
100 friend class boost::serialization::access;
102 template<
class Archive>
void save(Archive &ar,
const unsigned int)
const {
106 template<
class Archive>
void load(Archive &ar,
const unsigned int) {
113 BOOST_SERIALIZATION_SPLIT_MEMBER()
120 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
121 class IMPEMEXPORT Kernel3D {
124 Kernel3D(
const Kernel3D& other) {
126 dim_ext_ = other.dim_ext_;
127 data_.reset(
new double[size_]);
128 std::copy(other.data_.get(), other.data_.get() + size_, data_.get());
130 Kernel3D(
int size,
int ext) {
133 data_.reset(
new double[size_]);
135 for (
int i = 0; i < size_; i++) data_[i] = 0.;
137 double* get_data()
const {
return data_.get(); }
138 int get_size()
const {
return size_; }
139 int get_extent()
const {
return dim_ext_; }
142 boost::scoped_array<double> data_;
147 Kernel3D create_3d_gaussian(
double sigma,
double sigma_factor);
149 Kernel3D create_3d_laplacian();
152 Kernel3D get_truncated(
double* data,
int extent,
double sigmap,
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
float get_rnormfac() const
Get the Gaussian normalization factor.
Calculates and stores Gaussian kernel parameters.
Exception definitions and assertions.
A more IMP-like version of the std::vector.
#define IMP_INTERNAL_CHECK(expr, message)
An assertion to check for internal errors in IMP. An IMP::ErrorException will be thrown.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
float get_rkdist() const
Get the length of the Gaussian (sigma*number_of_sigmas_used)
float get_lim() const
Gets the value of lim parameter.
float get_rkdistsq() const
Get the squared length of the Gaussian (sigma*number_of_sigmas_used)
float get_sq2pi3() const
Get the non-sigma portion of the Gaussian normalization factor.
float get_inv_rsigsq() const
Get the inverse of sigma squared.
float get_timessig() const
Gets the number of sigma used.
Logging and error reporting support.