34 #ifndef CARTODATA_VOLUME_VOLUMEPROXY_D_H 35 #define CARTODATA_VOLUME_VOLUMEPROXY_D_H 45 template <
typename T >
64 template <
typename T >
69 while(
_size.size() < 4 )
82 template <
typename T >
89 if(
header().hasProperty(
"volume_dimension" ) )
91 if(
header().hasProperty(
"sizeX" ) )
93 if(
header().hasProperty(
"sizeY" ) )
95 if(
header().hasProperty(
"sizeZ" ) )
97 if(
header().hasProperty(
"sizeT" ) )
109 template <
typename T >
115 template <
typename T >
126 if(
header().hasProperty(
"sizeX" ) )
128 if(
header().hasProperty(
"sizeY" ) )
130 if(
header().hasProperty(
"sizeZ" ) )
132 if(
header().hasProperty(
"sizeT" ) )
140 template <
typename T >
144 size_t i, n =
_size.size();
145 std::vector<float> voxelsize( n, 1. );
150 if( vso->size() < n )
155 voxelsize[i] = float( vso->getArrayItem(i)->getScalar() );
157 catch( std::exception & )
161 catch( std::exception & )
170 template <
typename T >
176 std::set<std::string> forbidden;
177 forbidden.insert(
"sizeX" );
178 forbidden.insert(
"sizeY" );
179 forbidden.insert(
"sizeZ" );
180 forbidden.insert(
"sizeT" );
181 forbidden.insert(
"volume_dimension" );
185 Object it = other->objectIterator();
186 while( it->isValid() )
188 if( forbidden.find( it->key() ) == forbidden.end() )
void addBuiltinProperty(const std::string &, T &)
VolumeProxy< T > & operator=(const VolumeProxy< T > &other)
virtual bool removeProperty(const std::string &key)
VolumeProxy(int sizeX=1, int sizeY=1, int sizeZ=1, int sizeT=1)
VolumeProxy is the base class for volumes.
virtual void copyHeaderFrom(const PropertySet &other)
copy properties from other to this, avoiding forbidden properties like size.
void setProperty(const std::string &, const T &)
void changeBuiltinProperty(const std::string &, T &)
std::vector< float > getVoxelSize() const
get the voxel size from the header, with 4 values defaulting to 1.mm if not present ...
bool getProperty(const std::string &, T &) const