12 #ifndef BIOPROCESSING_DATA_PARAMETERIZEDDATA_H
13 #define BIOPROCESSING_DATA_PARAMETERIZEDDATA_H
15 #include <cartobase/object/syntax.h>
16 #include <soma-io/io/formatdictionary_d.h>
17 #include <aims/io/fileFormat.h>
18 #include <cartodata/volume/volume.h>
24 template <
class DataType>
25 inline void toTypedVector(std::vector<carto::Object> src, std::vector<DataType> & dest) {
28 if (dest.capacity() < src.size())
29 dest.resize(src.size());
31 std::vector<carto::Object>::iterator it, ie = src.end();
32 for (it = src.begin(), i=0; it != ie; ++it, ++i) {
33 carto::object_to(*it, dest[i]);
37 template <
class DataType>
38 inline std::vector<DataType>
toTypedVector(std::vector<carto::Object> v) {
39 std::vector<DataType> n(v.size());
45 template <
class DataType>
46 inline void toObjectVector(std::vector<DataType> src, std::vector<carto::Object> & dest) {
49 if (dest.capacity() < src.size())
50 dest.resize(src.size());
52 typename std::vector<DataType>::iterator it, ie = src.end();
53 for (it = src.begin(), i=0; it != ie; ++it, ++i) {
54 dest[i] = carto::Object::value(*it);
59 template <
class DataType>
61 std::vector<carto::Object> n(v.size());
71 template <
class DataType>
76 std::vector<std::string> & parameters);
79 carto::VolumeRef<DataType> vol);
82 carto::VolumeRef<DataType> vol);
84 static int indexOf(carto::VolumeRef<DataType> vol,
85 const std::string & parameter);
89 carto::VolumeRef<DataType> vol,
90 const std::string & parameter,
91 int x = 0,
int y = 0,
int z = 0);
static DataType & valueOf(carto::VolumeRef< DataType > vol, const std::string ¶meter, int x=0, int y=0, int z=0)
static std::vector< std::string > getParameters(carto::VolumeRef< DataType > vol)
static std::vector< int > getOriginalSizes(carto::VolumeRef< DataType > vol)
static int indexOf(carto::VolumeRef< DataType > vol, const std::string ¶meter)
static DataType setParameters(carto::VolumeRef< DataType > vol, std::vector< std::string > ¶meters)
void toTypedVector(std::vector< carto::Object > src, std::vector< DataType > &dest)
void toObjectVector(std::vector< DataType > src, std::vector< carto::Object > &dest)