61 const plm_long dim[3],
62 const float origin[3],
63 const float spacing[3],
64 const float direction_cosines[9],
69 const plm_long dim[3],
70 const float origin[3],
71 const float spacing[3],
84 plm_long
index (plm_long i, plm_long j, plm_long k)
const {
88 plm_long
index (plm_long ijk[3])
const {
93 const plm_long new_dim[3],
94 const float origin[3],
95 const float spacing[3],
96 const float direction_cosines[9],
107 Volume::Pointer clone ();
116 Volume::Pointer clone_empty ();
125 const float* get_origin (
void)
const;
126 void get_origin (
float *)
const;
131 void set_origin (
const float origin[3]);
139 const float* get_spacing (
void)
const;
140 void get_spacing (
float *)
const;
144 void set_spacing (
const float spacing[3]);
152 return direction_cosines;
155 return direction_cosines;
169 void set_direction_cosines (
const float direction_cosines[9]);
180 template<
class T> T* get_raw ();
181 template<
class T>
const T* get_raw ()
const;
187 const float* get_step (
void)
const;
192 const float* get_proj (
void)
const;
195 void position (
float xyz[3],
const plm_long ijk[3]) {
207 float get_ijk_value (
const float xyz[3])
const;
208 void get_xyz_from_ijk (
double xyz[3],
const plm_long ijk[3]);
210 plm_long get_idx_from_xyz (
const float xyz[3],
bool* in);
211 void get_ijk_from_xyz (plm_long ijk[3],
const float xyz[3],
bool* in);
212 void get_ijk_from_xyz (
float ijk[3],
const float xyz[3],
bool* in);
215 bool is_inside (
const float ijk[3])
const;
220 void move_origin_to_idx (
const plm_long ijk[3]);
224 void scale_inplace (
float scale);
227 void direction_cosines_debug ();
229 void allocate (
void);
236 void operator= (
const Volume&);
Definition direction_cosines.h:23
const float * get_matrix() const
Definition direction_cosines.cxx:188
The Volume class represents a three-dimensional volume on a uniform grid. The volume can be located a...
Definition volume.h:38
void coordinates(plm_long ijk[3], plm_long idx)
Return coordinates from index.
Definition volume.h:200
const Direction_cosines & get_direction_cosines(void) const
Definition volume.h:154
int pix_size
Definition volume.h:51
plm_long index(plm_long i, plm_long j, plm_long k) const
Return a linear index to a voxel.
Definition volume.h:84
SMART_POINTER_SUPPORT(Volume)
Direction_cosines & get_direction_cosines(void)
Get a pointer to the direction cosines. Direction cosines hold the orientation of a volume....
Definition volume.h:151
Direction_cosines direction_cosines
Definition volume.h:47
enum Volume_pixel_type pix_type
Definition volume.h:49
plm_long npix
Definition volume.h:43
float * get_direction_matrix(void)
Definition volume.h:157
const float * get_direction_matrix(void) const
Definition volume.h:160
void * img
Definition volume.h:52
void position(float xyz[3], const plm_long ijk[3])
Return a world coordinates of a voxel.
Definition volume.h:195
const plm_long * get_dim(void)
Get a pointer to the volume dimensions.
Definition volume.h:133
int vox_planes
Definition volume.h:50
plm_long index(plm_long ijk[3]) const
Return a linear index to a voxel.
Definition volume.h:88
#define PLMBASE_API
Definition plmbase_config.h:19
#define PLMBASE_C_API
Definition plmbase_config.h:18
EXTERNC void volume_convert_to_int32(Volume *ref)
Definition volume.cxx:542
EXTERNC void volume_convert_to_short(Volume *ref)
Definition volume.cxx:412
EXTERNC void volume_convert_to_float(Volume *ref)
Definition volume.cxx:379
Volume_pixel_type
Definition volume.h:17
@ PT_UCHAR
Definition volume.h:19
@ PT_UINT16
Definition volume.h:20
@ PT_UNDEFINED
Definition volume.h:18
@ PT_UCHAR_VEC_INTERLEAVED
Definition volume.h:27
@ PT_SHORT
Definition volume.h:21
@ PT_FLOAT
Definition volume.h:24
@ PT_UINT32
Definition volume.h:22
@ PT_VF_FLOAT_INTERLEAVED
Definition volume.h:25
@ PT_VF_FLOAT_PLANAR
Definition volume.h:26
@ PT_INT32
Definition volume.h:23
EXTERNC void volume_convert_to_uchar(Volume *ref)
Definition volume.cxx:443
EXTERNC void vf_convert_to_planar(Volume *ref)
Definition volume.cxx:621
EXTERNC Volume * volume_difference(Volume *vol, Volume *warped)
Definition volume.cxx:1012
EXTERNC void vf_pad_planar(Volume *vol, int size)
EXTERNC Volume * volume_clone(const Volume *ref)
Definition volume.cxx:335
EXTERNC Volume * volume_clone_empty(Volume *ref)
Definition volume.cxx:326
EXTERNC void volume_matrix3x3inverse(float *out, const float *m)
EXTERNC void volume_convert_to_uint32(Volume *ref)
Definition volume.cxx:508
EXTERNC void volume_convert_to_uint16(Volume *ref)
Definition volume.cxx:476
EXTERNC void vf_convert_to_interleaved(Volume *ref)
Definition volume.cxx:576
static plm_long volume_index(const plm_long dims[3], plm_long i, plm_long j, plm_long k)
Definition volume_macros.h:14
#define POSITION_FROM_COORDS(xyz, ijk, origin, step)
Definition volume_macros.h:82
#define COORDS_FROM_INDEX(ijk, idx, dim)
Definition volume_macros.h:33