anatomist  5.1.2
3D neuroimaging data viewer
surfMatcher.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 ANATOMIST_SURFMATCHER_SURFMATCHER_H
36 #define ANATOMIST_SURFMATCHER_SURFMATCHER_H
37 
38 
41 #include <vector>
42 
43 
44 namespace anatomist
45 {
46  template<int D> class ASurface;
47  typedef ASurface<3> ATriangulated;
48  //class ATriangulated;
50  struct ASurfMatcher_processData;
52  struct ASurfMatcher_ctrlPts;
53 
54 
56  class ASurfMatcher : public ObjectVector
57  {
58  public:
60  virtual ~ASurfMatcher();
61 
62  virtual int MType() const { return type(); }
63  virtual bool CanRemove( AObject* obj );
64 
65  virtual Tree* optionTree() const;
66 
67  static int classType() { return _classType; }
69  static void surfMatchControl( const std::set<AObject *> & );
70 
72  bool ascending() const { return _ascending; }
73  virtual void setAscending( bool asc );
74  virtual void processStep();
75  bool processFinished() const { return _processFinished; }
76  bool record() const { return _record; }
77  virtual void setRecord( bool r ) { _record = r; }
78  virtual Tree parameters();
79  virtual Tree parameters() const;
80  virtual void setParameters( const Tree & par );
81  virtual carto::SyntaxSet paramSyntax() const;
83  virtual void resetProcess();
85  void setOrgControlPoints( const std::vector<unsigned> & pts );
87  void setDestControlPoints( const std::vector<Point3df> & pts );
88  const std::vector<unsigned> & orgControlPoints() const;
89  std::vector<unsigned> & orgControlPoints();
90  const std::vector<Point3df> & destControlPoints() const;
91  std::vector<Point3df> & destControlPoints();
97  void moveOrgCtrlPoints( unsigned oldtime, unsigned time );
98 
99  static Tree* _optionTree;
100 
101  protected:
102  void prepareNeighbourhood( ATriangulated* s, unsigned time );
103  void computeLength( ATriangulated* s, unsigned time );
104 
107  bool _record;
108  ASurfMatcher_processData *_mdata;
109  ASurfMatcher_ctrlPts *_ctrlPts;
110 
111  private:
113  static int registerClass();
114 
115  static int _classType;
116  };
117 
118 }
119 
120 
121 #endif
Base Anatomist object (abstract)
Definition: Object.h:96
int type() const
Object type identifier.
Definition: Object.h:158
Fusion object to match 2 surfaces.
Definition: surfMatcher.h:57
virtual Tree parameters() const
virtual void setRecord(bool r)
Definition: surfMatcher.h:77
std::vector< Point3df > & destControlPoints()
const std::vector< unsigned > & orgControlPoints() const
virtual void setParameters(const Tree &par)
virtual bool CanRemove(AObject *obj)
void computeLength(ATriangulated *s, unsigned time)
virtual Tree parameters()
virtual carto::SyntaxSet paramSyntax() const
ATriangulated * destSurface() const
ATriangulated * orgSurface() const
virtual void setAscending(bool asc)
ATriangulated * movingSurface() const
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual void processStep()
static int classType()
Definition: surfMatcher.h:67
ASurfMatcher_ctrlPts * _ctrlPts
Definition: surfMatcher.h:109
void setDestControlPoints(const std::vector< Point3df > &pts)
sets control points on the destination surface (given in 3D coords)
virtual int MType() const
Precise type of multi-object.
Definition: surfMatcher.h:62
void moveOrgCtrlPoints(unsigned oldtime, unsigned time)
void prepareNeighbourhood(ATriangulated *s, unsigned time)
void setOrgControlPoints(const std::vector< unsigned > &pts)
sets control points on the source surface (given in vertex indices)
ASurfMatcher_processData * _mdata
Definition: surfMatcher.h:108
ASurfMatcher(AObject *o1, AObject *o2)
std::vector< unsigned > & orgControlPoints()
static Tree * _optionTree
Definition: surfMatcher.h:99
static void surfMatchControl(const std::set< AObject * > &)
Opens the surfmatcher control window.
virtual void resetProcess()
resets the moving surface and associated cached data
const std::vector< Point3df > & destControlPoints() const
bool processFinished() const
Definition: surfMatcher.h:75
bool ascending() const
true if direction is matching ascending (object 1 -> object 2)
Definition: surfMatcher.h:72
it's a list, in fact...
Definition: objectVector.h:212
ASurface< 3 > ATriangulated
Definition: triangulated.h:42
std::map< std::string, Syntax > SyntaxSet