cartodata  4.5.0
volumeformatreader.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 CARTODATA_IO_VOLUMEFORMATREADER_H
35 #define CARTODATA_IO_VOLUMEFORMATREADER_H
36 //--- soma io ----------------------------------------------------------------
41 //--- cartobase --------------------------------------------------------------
42 #include <cartobase/object/object.h> // using none()
43 #include <cartobase/smart/rcptr.h> // member
44 //--- system -----------------------------------------------------------------
45 #include <vector>
46 //----------------------------------------------------------------------------
47 
48 namespace carto
49 {
50  template<typename T> class Volume;
51  template<typename T> class VolumeRef;
52 }
53 
54 namespace soma
55 {
56  class DataSourceInfo;
57 
58  //==========================================================================
59  // R E A D E R O F V O L U M E
60  //==========================================================================
80  template<typename T>
81  class VolumeFormatReader : public FormatReader<carto::Volume<T> >
82  {
83  public:
84  virtual ~VolumeFormatReader();
85 
86  //======================================================================
87  // N E W M E T H O D S
88  //======================================================================
92  virtual void read( carto::Volume<T> & obj,
94  const AllocatorContext & context,
95  carto::Object options = carto::none() );
96 
99  void attach( carto::rc_ptr<ImageReader<T> > imr );
100 
104  virtual Volume<T>* createAndRead( carto::rc_ptr<DataSourceInfo> dsi,
105  const AllocatorContext & context,
106  carto::Object options );
107 
109  virtual void setupAndRead( Volume<T> & obj,
111  const AllocatorContext & context,
112  carto::Object options );
113 
114  virtual FormatReader<carto::Volume<T> >* clone() const;
115 
116  virtual std::string formatID() const;
117 
118  protected:
120  };
121 
122  //==========================================================================
123  // R E A D E R O F P O I N T E R T O V O L U M E
124  //==========================================================================
128  template<typename T>
129  class VolumeRefFormatReader : public FormatReader<carto::VolumeRef<T> >
130  {
131  public:
132  virtual ~VolumeRefFormatReader();
133 
134  //======================================================================
135  // N E W M E T H O D S
136  //======================================================================
140  virtual void read( carto::VolumeRef<T> & obj,
142  const AllocatorContext & context,
143  carto::Object options = carto::none() );
144 
147  void attach( carto::rc_ptr<ImageReader<T> > imr );
148 
152  virtual VolumeRef<T>* createAndRead( carto::rc_ptr<DataSourceInfo> dsi,
153  const AllocatorContext & context,
154  carto::Object options );
155 
157  virtual void setupAndRead( VolumeRef<T> & obj,
159  const AllocatorContext & context,
160  carto::Object options );
161 
162  virtual FormatReader<carto::VolumeRef<T> >* clone() const;
163  virtual std::string formatID() const;
164 
165  protected:
167  };
168 
169 }
170 #endif
4D Volume main class
FormatReader specialized for reference to 4D Volume.
virtual void setupAndRead(VolumeRef< T > &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
Full reading procedure, for an already existing object.
void attach(carto::rc_ptr< ImageReader< T > > imr)
Linking to a ImageReader Allows us to declare only once the ImageReader.
Convenient handle for a Volume - this is normally the entry point for all volumes handling...
virtual void setupAndRead(Volume< T > &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
Full reading procedure, for an already existing object.
virtual std::string formatID() const
carto::rc_ptr< ImageReader< T > > _imr
FormatReader specialized for 4D Volume.
virtual FormatReader< carto::Volume< T > > * clone() const
virtual Volume< T > * createAndRead(carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
Factory mode: creates an object and reads it.
#define soma
carto::rc_ptr< ImageReader< T > > _imr
virtual VolumeRef< T > * createAndRead(carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
Factory mode: creates an object and reads it.
virtual void read(carto::VolumeRef< T > &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options=carto::none())
FormatReader derived function This method understands a volume and calls read( buffer ) with appropri...
virtual std::string formatID() const
void attach(carto::rc_ptr< ImageReader< T > > imr)
Linking to a ImageReader Allows us to declare only once the ImageReader.
virtual FormatReader< carto::VolumeRef< T > > * clone() const
Object none()
virtual void read(carto::Volume< T > &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options=carto::none())
FormatReader derived function This method understands a volume and calls read( buffer ) with appropri...