aimsdata  5.0.5
Neuroimaging data handling
bundlesSlicer.h
Go to the documentation of this file.
1 /* Copyright (c) 1995-2017 CEA
2  *
3  * This software and supporting documentation were developed by
4  * CEA/DSV/SHFJ
5  * 4 place du General Leclerc
6  * 91401 Orsay cedex
7  * France
8  *
9  * This software is governed by the CeCILL license version 2 under
10  * French law and abiding by the rules of distribution of free software.
11  * You can use, modify and/or redistribute the software under the
12  * terms of the CeCILL license version 2 as circulated by CEA, CNRS
13  * and INRIA at the following URL "http://www.cecill.info".
14  *
15  * As a counterpart to the access to the source code and rights to copy,
16  * modify and redistribute granted by the license, users are provided only
17  * with a limited warranty and the software's author, the holder of the
18  * economic rights, and the successive licensors have only limited
19  * liability.
20  *
21  * In this respect, the user's attention is drawn to the risks associated
22  * with loading, using, modifying and/or developing or reproducing the
23  * software by the user in light of its specific status of free software,
24  * that may mean that it is complicated to manipulate, and that also
25  * therefore means that it is reserved for developers and experienced
26  * professionals having in-depth computer knowledge. Users are therefore
27  * encouraged to load and test the software's suitability as regards their
28  * requirements in conditions enabling the security of their systems and/or
29  * data to be ensured and, more generally, to use and operate it in the
30  * same conditions as regards security.
31  *
32  * The fact that you are presently reading this means that you have had
33  * knowledge of the CeCILL license version 2 and that you accept its terms.
34  */
35 
36 #ifndef AIMS_FIBERS_BUNDLESSLICER_H
37 #define AIMS_FIBERS_BUNDLESSLICER_H
38 
39 
40 #include <aims/fibers/bundles.h>
41 
42 
43 namespace aims
44 {
45 
46 class BundlesSlicer;
47 
48 
49  //-------------------------//
50  // BundlesSlicerListener //
51 //-------------------------//
52 
54 {
55 public:
56 
57  virtual ~BundlesSlicerListener();
58  virtual void startBundleSlicing( BundlesSlicer &slicer,
59  const aims::BundleInfo &bundle );
60  virtual void newBundleSlice( BundlesSlicer &slicer,
61  const aims::BundleInfo &bundle, float time,
62  const std::vector< aims::FiberPoint > &points );
63  virtual void terminateBundleSlicing( BundlesSlicer &slicer,
64  const aims::BundleInfo &bundle );
65  virtual void noMoreBundleSlice( BundlesSlicer &slicer );
66 };
67 
68 
69  //-----------------//
70  // BundlesSlicer //
71 //-----------------//
72 
74 {
75 public:
76 
77  virtual ~BundlesSlicer();
78  inline void addBundlesSlicerListener( BundlesSlicerListener & );
79 
80 
81 protected:
82 
83  virtual void startBundleSlicing( const aims::BundleInfo &bundle );
84  void produceBundleSlice( const aims::BundleInfo &bundle,
85  float time,
86  const std::vector< aims::FiberPoint > &points );
87  virtual void terminateBundleSlicing( const aims::BundleInfo &bundle );
88  void stopBundleSliceProduction();
89 
90 private:
91 
92  typedef std::vector< BundlesSlicerListener * > BundlesSlicerListenerList;
93  BundlesSlicerListenerList _bundlesSlicerListeners;
94 };
95 
96 
97 
98  //-----------------------//
99  // SimpleBundlesSlicer //
100 //-----------------------//
101 
103 {
104 public:
105  SimpleBundlesSlicer( size_t numberOfSlice );
106 
107 protected:
108  void bundleStarted( const aims::BundleProducer &, const aims::BundleInfo & );
109  void bundleTerminated( const aims::BundleProducer &,
110  const aims::BundleInfo & );
111  void fiberStarted( const aims::BundleProducer &, const aims::BundleInfo &,
112  const aims::FiberInfo & );
113  void fiberTerminated( const aims::BundleProducer &, const aims::BundleInfo &,
114  const aims::FiberInfo & );
115  void newFiberPoint( const aims::BundleProducer &, const aims::BundleInfo &,
116  const aims::FiberInfo &, const aims::FiberPoint & );
117  void noMoreBundle( const aims::BundleProducer & );
118 
119 private:
120  size_t _numberOfSlice;
121  std::vector< std::vector< aims::FiberPoint > > _points;
122  aims::Polyline _currentCurve;
123 };
124 
125 
126  //----------------------//
127  // BundleSlicesToMesh //
128 //----------------------//
129 
131 {
132 public:
136 
137  inline const TimeMesh_t &getMesh() const { return _timeMesh; }
138 
139 protected:
140  void startBundleSlicing( BundlesSlicer &slicer,
141  const aims::BundleInfo &bundle );
142  void newBundleSlice( BundlesSlicer &slicer,
143  const aims::BundleInfo &bundle, float time,
144  const std::vector< aims::FiberPoint > &points );
146  const aims::BundleInfo &bundle );
147  void noMoreBundleSlice( BundlesSlicer &slicer );
148 
149 private:
150  TimeMesh_t _timeMesh;
151 };
152 
153 
154 
155 
156  //-------------------------//
157  // BundlesSlicerListener //
158 //-------------------------//
159 
160 //-----------------------------------------------------------------------------
162 
163 
164  //-----------------//
165  // BundlesSlicer //
166 //-----------------//
167 
168 
169 //-----------------------------------------------------------------------------
171  listener )
172 {
173  _bundlesSlicerListeners.push_back( &listener );
174 }
175 
176 
177 
178 } // namespace aims
179 
180 #endif // ifndef AIMS_FIBERS_BUNDLESSLICER_H
AimsTimeSurface< 2, Void > TimeMesh_t
virtual void terminateBundleSlicing(BundlesSlicer &slicer, const aims::BundleInfo &bundle)
Serial processing of bundles.
Definition: bundles.h:152
virtual void newBundleSlice(BundlesSlicer &slicer, const aims::BundleInfo &bundle, float time, const std::vector< aims::FiberPoint > &points)
The class for EcatSino data write operation.
Definition: border.h:44
void addBundlesSlicerListener(BundlesSlicerListener &)
const TimeMesh_t & getMesh() const
AimsVector< uint32_t, 2 > Polygon_t
Serial processing of bundles.
Definition: bundles.h:185
virtual void startBundleSlicing(BundlesSlicer &slicer, const aims::BundleInfo &bundle)
The template class to manage a mesh.
Definition: surface.h:56
virtual void noMoreBundleSlice(BundlesSlicer &slicer)
AimsSurface< 2, Void > Mesh_t