anatomist 6.0.4
3D neuroimaging data viewer
histoplot.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34#ifndef HISTO_PLOT_H
35#define HISTO_PLOT_H
36
38#include <QWidget>
39#include <vector>
40#include <map>
41#include <string>
42
43class RoiHistoPlot : public QWidget, public anatomist::Observer
44{
45 Q_OBJECT
46
47 public:
48 RoiHistoPlot( QWidget * parent, int nbOfBins ) ;
49 virtual ~RoiHistoPlot() ;
50
51 int nbOfBins( ) const { return myNbOfBins ; }
52 void setNbOfBins( int nbOfBins ) { myNbOfBins = nbOfBins ; }
53
54 void printHistos( const std::string& filename ) ;
55 virtual void update( const anatomist::Observable *, void * ) ;
56
57 void activate() ;
58 void deactivate() ;
59
60 public slots :
61 void nbOfBinsChanged( int ) ;
62 void lowChanged( float low ) ;
63 void highChanged( float high ) ;
65 void saveHistos() ;
67 void showHistoChange( int ) ;
69 private:
70 struct Private;
71
72 // Try and think to reparent plot curves.
73 std::vector<float>
74 getImageHisto( const std::string& image, int& nbOfPoints,
75 float& binSize, int time = 0 ) ;
76 std::map< std::string, std::vector<float> >
77 getGraphHisto( const std::string& image, const std::string& graph,
78 std::map< std::string, int>& nbOfPoints,
79 std::map< std::string, float>& meanValue,
80 std::map< std::string, float>& stdDeviation,
81 float& binSize,
82 int time = 0 ) ;
83 std::vector<float>
84 getRegionHisto( const std::string& image, const std::string& graph,
85 const std::string& region, int& nbOfPoints,
86 float& meanValue, float& stdDev,
87 float& binSize, int time = 0 ) ;
88
89 std::map< std::string, std::vector<float> > myImageHistos ;
90 std::map< std::string, int > myNbOfPoints ;
91
92
93 std::string myImage ;
94 std::string myGraph ;
95 float myIgnoreForMax ;
96 bool myUseExtrema;
97 int myNbOfBins ;
98 double myHistoMax ;
99 double myHighLevel ;
100 double myLowLevel ;
101 bool myActivate ;
102 bool myShowImageHisto ;
103
104 Private * _private ;
105} ;
106
107
108#endif
#define slots
void nbOfBinsChanged(int)
void showGraphHisto()
void setNbOfBins(int nbOfBins)
Definition histoplot.h:52
void lowChanged(float low)
void showImageHisto()
int nbOfBins() const
Definition histoplot.h:51
void showHistoChange(int)
virtual ~RoiHistoPlot()
void saveHistos()
RoiHistoPlot(QWidget *parent, int nbOfBins)
virtual void update(const anatomist::Observable *, void *)
This method is called whenever the observed object is changed.
void activate()
void printHistos(const std::string &filename)
void highChanged(float high)
void deactivate()
void ignoreUnderLowChicked(int)
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition Observable.h:68
A class can implement the Observer interface when it wants to be informed of changes in observable ob...
Definition Observer.h:55