IMP  2.1.1
The Integrative Modeling Platform
density_analysis.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/density_analysis.h
3  * \brief density analysis tools, such as histogram and segmentation
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_DENSITY_ANALYSIS_H
10 #define IMPMULTIFIT_DENSITY_ANALYSIS_H
11 
13 #include <IMP/em/DensityMap.h>
14 #include <IMP/multifit/multifit_config.h>
15 #include <boost/graph/adjacency_list.hpp>
16 #include <boost/pending/disjoint_sets.hpp>
17 #include <boost/graph/incremental_components.hpp>
18 #include <boost/graph/graph_utility.hpp>
19 
20 IMPMULTIFIT_BEGIN_NAMESPACE
21 
22 //! Get a histogram of density values
23 IMPMULTIFITEXPORT statistics::Histogram get_density_histogram(
24  const em::DensityMap *dmap, float threshold,int num_bins);
25 
26 //! Returns a map containing all density without the background
27 /**
28 \param[in] dmap the density map to segment
29 \param[in] threshold consider only voxels above this threshold
30 \param[in] edge_threshold consider only voxels above this threshold
31 \return the segmented map
32  */
33 IMPMULTIFITEXPORT em::DensityMap* remove_background(em::DensityMap *dmap,
34  float threshold,float edge_threshold);
35 
36 
37 //! Return connected components based on density values
38 /**
39  \param[in] dmap the density map to analyze
40  \param[in] threshold consider only voxels above this threshold
41  \param[in] edge_threshold an edge is added between
42  two neighboring voxels if their density difference is below this threshold
43  \return List of indexes for each connected component
44 */
45 IMPMULTIFITEXPORT
47  em::DensityMap *dmap,
48  float threshold,float edge_threshold);
49 
50 //! Segment a density map using the anchor graph.
51 /** All voxels above the threshold are segmented into the given number
52  of clusters, and neighboring clusters are linked.
53 
54  \param[in] dmap the density map to segment
55  \param[in] apix the map spacing in angstroms per pixel
56  \param[in] density_threshold consider only voxels over this threshold
57  \param[in] num_means the number of segments to generate
58  \param[in] pdb_filename write cluster centers as CA atoms in PDB format
59  \param[in] cmm_filename if not empty, write clusters in CMM format
60  \param[in] seg_filename if not empty, write segments in MRC format
61  \param[in] txt_filename if not empty, write anchors in text format
62  */
63 IMPMULTIFITEXPORT
64 void get_segmentation(em::DensityMap *dmap, double apix,
65  double density_threshold, int num_means,
66  const std::string pdb_filename,
67  const std::string cmm_filename,
68  const std::string seg_filename,
69  const std::string txt_filename);
70 
71 IMPMULTIFIT_END_NAMESPACE
72 #endif /* IMPMULTIFIT_DENSITY_ANALYSIS_H */
IntsList get_connected_components(em::DensityMap *dmap, float threshold, float edge_threshold)
Return connected components based on density values.
em::DensityMap * remove_background(em::DensityMap *dmap, float threshold, float edge_threshold)
Returns a map containing all density without the background.
statistics::Histogram get_density_histogram(const em::DensityMap *dmap, float threshold, int num_bins)
Get a histogram of density values.
Holds a histogram.
Class for handling density maps.
void get_segmentation(em::DensityMap *dmap, double apix, double density_threshold, int num_means, const std::string pdb_filename, const std::string cmm_filename, const std::string seg_filename, const std::string txt_filename)
Segment a density map using the anchor graph.
IMP::base::Vector< Ints > IntsList
Standard way to pass a bunch of Ints values.
Definition: base/types.h:56