anatomist  5.1.2
3D neuroimaging data viewer
connectivitymatrix.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 
35 #ifndef ANA_SPARSEMATRIX_CONNECTIVITYMATRIX_H
36 #define ANA_SPARSEMATRIX_CONNECTIVITYMATRIX_H
37 
38 
41 #include <QObject>
42 
43 template <typename T> class TimeTexture;
44 
45 namespace anatomist
46 {
47 
48  class ATexture;
49  class ConnectivityMatrixProcessingThread;
50 
51 
63  class AConnectivityMatrix : public QObject, public ObjectVector
64  {
65  Q_OBJECT
66 
67  public:
68  enum PatchMode
69  {
70  ONE,
74  };
75 
76  AConnectivityMatrix( const std::vector<AObject *> & obj );
78 
79  virtual int MType() const { return( type() ); }
80  virtual bool render( PrimList &, const ViewState & );
81  virtual void update( const Observable *observable, void *arg );
82 
83  void buildTexture( int mesh_index, uint32_t vertex, float time_pos = 0 );
84  void buildColumnTexture( int mesh_index, uint32_t vertex,
85  float time_pos = 0 );
86  void buildPatchTexture( int mesh_index, uint32_t vertex,
87  float time_pos = 0 );
88  void buildColumnPatchTexture( int mesh_index, uint32_t vertex,
89  float time_pos = 0 );
90 
91  std::vector<carto::rc_ptr<ATriangulated> > meshes() const;
92  std::vector<carto::rc_ptr<ATexture> > textures() const;
94 
95  static bool checkObjects( const std::set<AObject *> & objects,
96  AObject * & matrix,
97  std::list<ATriangulated *> & meshes,
98  std::list<ATexture *> & patch_textures,
99  std::list<ATexture *> & basin_textures,
100  PatchMode & pmode, std::set<int> & patches,
101  bool & transpose );
102  void cancelThread();
103  virtual bool boundingBox( std::vector<float> & bmin,
104  std::vector<float> & bmax ) const;
105 
106  private:
107  struct Private;
108  Private *d;
110 
111  void buildPatchIndices();
112  void buildPatchTextureThread();
113  void buildPatchMeshes( const std::vector<int16_t> & pvals,
115  int mesh_index );
116 
117  private slots:
118  void releaseAnaCursor();
119 
120  signals:
122  void processingProgress( AConnectivityMatrix*, int current, int count );
123  };
124 
125 
126 }
127 
128 #endif
129 
130 
#define slots
Connectivity matix object: fusions sparse matrix, white mesh, and optionally a gyrus patch texture.
virtual bool render(PrimList &, const ViewState &)
rendering (generally 2D or 3D using OpenGL).
AConnectivityMatrix(const std::vector< AObject * > &obj)
virtual bool boundingBox(std::vector< float > &bmin, std::vector< float > &bmax) const
Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates.
const carto::rc_ptr< ATriangulated > marker() const
friend class anatomist::ConnectivityMatrixProcessingThread
void buildPatchTexture(int mesh_index, uint32_t vertex, float time_pos=0)
void processingProgress(AConnectivityMatrix *, int current, int count)
void texturesUpdated(AConnectivityMatrix *)
virtual int MType() const
Precise type of multi-object.
virtual void update(const Observable *observable, void *arg)
This class is an Observer of each of the AObject it groups.
static bool checkObjects(const std::set< AObject * > &objects, AObject *&matrix, std::list< ATriangulated * > &meshes, std::list< ATexture * > &patch_textures, std::list< ATexture * > &basin_textures, PatchMode &pmode, std::set< int > &patches, bool &transpose)
std::vector< carto::rc_ptr< ATexture > > textures() const
void buildColumnPatchTexture(int mesh_index, uint32_t vertex, float time_pos=0)
void buildColumnTexture(int mesh_index, uint32_t vertex, float time_pos=0)
void buildTexture(int mesh_index, uint32_t vertex, float time_pos=0)
std::vector< carto::rc_ptr< ATriangulated > > meshes() const
Base Anatomist object (abstract)
Definition: Object.h:96
int type() const
Object type identifier.
Definition: Object.h:158
it's a list, in fact...
Definition: objectVector.h:212
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition: Observable.h:68
std::list< carto::rc_ptr< GLItem > > PrimList
Definition: Object.h:72
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:67