00001 /** 00002 * \file converters.h 00003 * \brief Converters of density values 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 * 00007 */ 00008 00009 #ifndef IMPEM_CONVERTERS_H 00010 #define IMPEM_CONVERTERS_H 00011 00012 #include "em_config.h" 00013 #include <IMP/base_types.h> 00014 #include <IMP/macros.h> 00015 #include "DensityMap.h" 00016 #include "SampledDensityMap.h" 00017 #include <IMP/Particle.h> 00018 #include "IMP/core/XYZ.h" 00019 #include "IMP/algebra/Vector3D.h" 00020 00021 IMPEM_BEGIN_NAMESPACE 00022 00023 //! Converts a density grid to a set of paritlces 00024 /** 00025 Each such particle will be have xyz attributes and a density_val attribute of 00026 type Float. 00027 \param[in] dmap the density map 00028 \param[in] threshold only voxels with density above the given threshold will 00029 be converted to particles 00030 \param[in] m model to store the new particles 00031 \return particles corresponding to all voxels above the threshold 00032 */ 00033 IMPEMEXPORT Particles density2particles(DensityMap &dmap, Float threshold, 00034 Model *m); 00035 00036 00037 //! Resample a set of particles into a density grid 00038 /** 00039 Each such particle should be have xyz radius and weight attributes 00040 \param[in] ps the particles to sample 00041 \param[in] resolution the resolution of the new sampled map 00042 \param[in] apix the voxel size of the sampled map 00043 \param[in] sig_cutoff sigma cutoff used in sampling 00044 \param[in] rad_key the radius attribute key of the particles 00045 \param[in] weight_key the weight attribute key of the particles 00046 \return the sampled density grid 00047 \relatesalso SampledDensityMap 00048 */ 00049 IMPEMEXPORT SampledDensityMap * particles2density( 00050 Particles &ps, 00051 Float resolution, Float apix, 00052 int sig_cutoff=3, 00053 const FloatKey &rad_key=IMP::core::XYZR::get_default_radius_key(), 00054 const FloatKey &weight_key=IMP::atom::Mass::get_mass_key()); 00055 IMPEM_END_NAMESPACE 00056 #endif /* IMPEM_CONVERTERS_H */