/usr/include/minc_io_4d_volume.h is in libminc-dev 2.3.00-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | /* ----------------------------- MNI Header -----------------------------------
@NAME :
@DESCRIPTION: Simplified 4D volume
@COPYRIGHT :
Copyright 2007 Vladimir Fonov, McConnell Brain Imaging Centre,
Montreal Neurological Institute, McGill University.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies. The author and McGill University
make no representations about the suitability of this
software for any purpose. It is provided "as is" without
express or implied warranty.
---------------------------------------------------------------------------- */
#ifndef MINC_IO_4D_VOLUME_H
#include "minc_io_simple_volume.h"
#include <vector>
#include <cstring>
namespace minc
{
//! simple 4D volume - collection of 3D volumes
template<class T> class simple_4d_volume
{
protected:
enum {ndims=3};
typedef fixed_vec<ndims,int> idx;
typedef fixed_vec<ndims,double> vect;
double _start_t;
double _step_t;
void allocate(int n,const idx& sz)
{
_volumes.resize(n);
for(int i=0;i<n;i++)
{
_volumes[i].resize(sz);
}
}
public:
typedef simple_volume<T> volume;
typedef std::vector<volume> volume_list;
int dim(int i) const
{
return _volumes[0].dim(i);
}
vect voxel_to_world(const idx& iii) const
{
return _volumes[0].voxel_to_world(iii);
}
idx world_to_voxel(const vect& iii) const
{
return _volumes[0].world_to_voxel(iii);
}
void resize(int x,int y,int z,int t)
{
allocate(t,IDX<int>(x,y,z));
}
//! number of temporal frames
size_t frames(void) const
{
return _volumes.size();
}
T& at(int x,int y,int z,int t)
{
return _volumes[t].at(x,y,z);
}
const T& get(int x,int y,int z,int t) const
{
return _volumes[t].get(x,y,z);
}
void set(int x,int y,int z,int t,const T& v)
{
_volumes[t].set(x,y,z,v);
}
T& at(const idx& i,int t)
{
return _volumes[t].at(i);
}
const T& get(const idx& i,int t) const
{
return _volumes[t].get(i);
}
void set(const idx& i,int t,const T& v)
{
_volumes[t].set(i,v);
}
volume& frame(int t)
{
return _volumes[t];
}
const volume& frame(int t) const
{
return _volumes[t];
}
vect& start(void)
{
return _volumes[0].start();
}
const vect& start(void) const
{
return _volumes[0].start();
}
vect& step(void)
{
return _volumes[0].step();
}
const vect& step(void) const
{
return _volumes[0].step();
}
vect& direction_cosines(int i)
{
return _volumes[0].direction_cosines(i);
}
const vect& direction_cosines(int i) const
{
return _volumes[0].direction_cosines(i);
}
double & t_step(void)
{
return _step_t;
}
double t_step(void) const
{
return _step_t;
}
double & t_start(void)
{
return _start_t;
}
double t_start(void) const
{
return _start_t;
}
protected:
volume_list _volumes;
};
}
#endif //MINC_IO_4D_VOLUME_H
|