aimsdata
5.0.5
Neuroimaging data handling
aimsGraphR.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 AIMS_IO_AIMSGRAPHR_H
35
#define AIMS_IO_AIMSGRAPHR_H
36
37
#include <
aims/io/process.h
>
38
#include <
aims/bucket/bucket.h
>
39
#include <
cartobase/object/attributed.h
>
40
#include <set>
41
42
class
Graph
;
43
44
namespace
aims
45
{
46
47
namespace
internal
48
{
49
struct
AimsGraphReader_Private;
50
struct
AimsGraphReader_ElemStruct;
51
}
52
58
class
AimsGraphReader
:
public
Process
59
{
60
public
:
61
friend
struct
internal::AimsGraphReader_Private
;
62
63
struct
Wrapper
64
{
65
friend
class
AimsGraphReader
;
66
67
virtual
~Wrapper
() {}
68
virtual
void
destroy
() {}
69
70
virtual
std::string objectType()
const
= 0;
71
virtual
std::string dataType()
const
= 0;
72
73
private
:
74
virtual
Wrapper
*extract(
int
index ) = 0;
75
};
76
77
template
<
typename
T>
struct
ObjectWrapper
:
public
Wrapper
78
{
79
ObjectWrapper
( T* x ) : data( x ) {}
80
virtual
~ObjectWrapper
() {}
81
virtual
void
destroy
() {
delete
data; }
82
83
virtual
std::string objectType()
const
;
84
virtual
std::string dataType()
const
;
85
86
T *
data
;
87
88
private
:
89
virtual
Wrapper
*extract(
int
index );
90
};
91
92
struct
ElementInfo
93
{
94
Graph
*
graph
;
95
carto::AttributedObject
*
element
;
96
std::string
attribute
;
97
Wrapper
*
object
;
98
};
99
100
class
PostProcessor
:
public
Process
101
{
102
public
:
103
friend
class
AimsGraphReader
;
104
PostProcessor
();
105
virtual
~
PostProcessor
();
106
const
ElementInfo
&
elementInfo
()
const
{
return
( info ); }
107
ElementInfo
&
elementInfo
() {
return
( info ); }
108
109
private
:
110
ElementInfo
info;
111
};
112
113
AimsGraphReader
(
const
std::string & filename );
114
virtual
~
AimsGraphReader
();
115
148
virtual
void
readElements(
Graph
& g,
int
mask
= 1 );
160
void
setReadFilter(
const
std::set<std::string> & toread );
166
void
setExcludeFilter(
const
std::set<std::string> & toexclude );
182
void
setInsertionFunction(
const
std::string & objType,
183
const
std::string & dataType,
184
ProcFunc procFunc );
196
template
<
class
T>
static
197
bool
read(
Process
&,
const
std::string &,
Finder
& );
198
200
static
void
loadAllMissingElements(
Graph
& );
201
202
private
:
203
template
<
class
T>
static
204
bool
defaultInsertFunction(
Process
&,
const
std::string &,
Finder
& );
205
virtual
void
readElement(
carto::AttributedObject
* ao,
206
internal::AimsGraphReader_ElemStruct & es );
207
208
internal::AimsGraphReader_Private
*_priv;
209
};
210
211
}
212
213
214
#endif
215
aims::AimsGraphReader::Wrapper::~Wrapper
virtual ~Wrapper()
Definition:
aimsGraphR.h:67
aims::internal::AimsGraphReader_Private
Definition:
aimsGraphR_d.h:53
aims::mask
BucketMap< Void > * mask(const BucketMap< Void > &src, const BucketMap< Void > &m, bool intersect=true)
mask src object with m.
Graph
aims::AimsGraphReader::ObjectWrapper::data
T * data
Definition:
aimsGraphR.h:86
aims::AimsGraphReader::ElementInfo::graph
Graph * graph
Definition:
aimsGraphR.h:94
aims::AimsGraphReader::ElementInfo::object
Wrapper * object
Definition:
aimsGraphR.h:97
aims::AimsGraphReader::ElementInfo::attribute
std::string attribute
Definition:
aimsGraphR.h:96
aims
The class for EcatSino data write operation.
Definition:
border.h:44
bucket.h
aims::AimsGraphReader
Reader / postprocessor for graph reading.
Definition:
aimsGraphR.h:58
aims::AimsGraphReader::ObjectWrapper::ObjectWrapper
ObjectWrapper(T *x)
Definition:
aimsGraphR.h:79
process.h
aims::Finder
Generic finder / checker for all data objects and file formats This will replace the old AimsFinder...
Definition:
finder.h:117
aims::AimsGraphReader::Wrapper
Definition:
aimsGraphR.h:63
aims::AimsGraphReader::ObjectWrapper::~ObjectWrapper
virtual ~ObjectWrapper()
Definition:
aimsGraphR.h:80
aims::AimsGraphReader::ElementInfo::element
carto::AttributedObject * element
Definition:
aimsGraphR.h:95
aims::AimsGraphReader::ElementInfo
Definition:
aimsGraphR.h:92
internal
aims::AimsGraphReader::PostProcessor::elementInfo
const ElementInfo & elementInfo() const
Definition:
aimsGraphR.h:106
carto::SyntaxedObject
aims::AimsGraphReader::ObjectWrapper::destroy
virtual void destroy()
Definition:
aimsGraphR.h:81
aims::AimsGraphReader::PostProcessor
Definition:
aimsGraphR.h:100
aims::AimsGraphReader::PostProcessor::elementInfo
ElementInfo & elementInfo()
Definition:
aimsGraphR.h:107
aims::Process
Link mechanism between the Finder and a process operating on arbitrary data types.
Definition:
process.h:199
aims::AimsGraphReader::ObjectWrapper
Definition:
aimsGraphR.h:77
aims::AimsGraphReader::Wrapper::destroy
virtual void destroy()
Definition:
aimsGraphR.h:68
attributed.h
aims
io
aimsGraphR.h
Generated by
1.8.13