|
| Grid3 () |
| Default constructor. More...
|
|
| Grid3 (int width, int height, int depth=1, double x_spacing=1.0, double y_spacing=1.0, double z_spacing=1.0) |
| Construct a grid with given dimensions. More...
|
|
| Grid3 (Vec3i dimensions, Vec3d spacing=Vec3d(1.0, 1.0, 1.0)) |
| Construct a grid with given dimensions. More...
|
|
void | Init (int width, int height, int depth=1, double x_spacing=1.0, double y_spacing=1.0, double z_spacing=1.0) |
| Initialize the grid with given dimensions. Any previous data in the grid will be overwritten. More...
|
|
int | GetWidth () |
| Return the number of grid columns. More...
|
|
int | GetHeight () |
| Return the number of grid rows. More...
|
|
int | GetDepth () |
| Return the number of grid slices. More...
|
|
Vec3i | GetDimensions () |
| Return a vector containing the grid dimensions. More...
|
|
double | GetSpacingX () |
| Return the spacing along X. More...
|
|
double | GetSpacingY () |
| Return the spacing along Y. More...
|
|
double | GetSpacingZ () |
| Return the spacing along Z. More...
|
|
Vec3d | GetSpacing () |
| Return the spacing along all three dimesions. More...
|
|
void | SetSpacing (double x_spacing, double y_spacing, double z_spacing) |
| Set spacing. More...
|
|
void | SetSpacing (Vec3d spacing) |
| Set spacing. More...
|
|
Vec3d | WorldToGrid (Vec3d p) |
| Transform point p from world coordinates to grid coordinates. More...
|
|
Vec3d | GridToWorld (Vec3d p) |
| Transform point p from grid coordinates to world coordinates. More...
|
|
MetaDataContainer | GetMetaData () |
| Returns a MetaDataContainer with the current image meta data. More...
|
|
void | SetMetaData (MetaDataContainer md) |
| Set image meta data. All current meta data is overwritten. More...
|
|
int | NumberOfElements () |
| Return the total number of grid points. More...
|
|
T * | Data () |
| Returns a pointer to the beginning of the internal data array. The called object owns the pointer. More...
|
|
std::string | GetDataType () |
| Return a string representation of the voxel type. More...
|
|
int | Offset (int x, int y, int z) |
| Returns the index of a specified coordinate in the internal data array. More...
|
|
int | Offset (Vec3i p) |
| Returns the index of a specified coordinate in the internal data array. More...
|
|
Vec3i | Coordinate (long index) |
| Returns the coordinate corresponding to a specified index in the internal data array. More...
|
|
bool | IsInside (int x, int y, int z) |
| Test if the given grid point is within the bounds of the grid. More...
|
|
bool | IsInside (Vec3i p) |
| Test if the given grid point is within the bounds of the grid. More...
|
|
T & | Background () |
| Access to the the background value of the grid. This is the value that is returned when trying to read a value outside of the grid, with boundary mode set to "CONSTANT". More...
|
|
T & | operator[] (long index) |
| Access to the grid value at a specified index. The passed index is assumed to be within the grid bounds. More...
|
|
T & | operator() (int x, int y, int z=0, bool Safe=false, BoundaryMode mode=REPLICATE) |
| Access to the grid value at a specified coordinate. If "Safe" is false, the passed coordinate is assumed to be within the grid bounds. If "Safe" is true, the behaviour for out-of-bounds coordinates depends on the "mode" parameter. If "mode" is set to "REPLICATE" a reference to the closest grid point is returned for out-of-bounds coordinates. If "mode" is set to "CONSTANT", a reference to the background value is returned. More...
|
|
T & | operator() (Vec3i p, bool Safe=false, BoundaryMode mode=REPLICATE) |
| Access to the grid value at a specified coordinate. If "Safe" is false, the passed coordinate is assumed to be within the grid bounds. If "Safe" is true, the behaviour for out-of-bounds coordinates depends on the "mode" parameter. If "mode" is set to "REPLICATE" a reference to the closest grid point is returned for out-of-bounds coordinates. If "mode" is set to "CONSTANT", a reference to the background value is returned. More...
|
|
T | LinearAt (double x, double y, double z, BoundaryMode mode=REPLICATE) |
| Get the grid value at a specified coordinate using trilinear interpolation. The "mode" parameter determines the behaviour for coordinates outside the grid bounds, see the documentation of the () operator. More...
|
|
T | LinearAt (Vec3d p, BoundaryMode mode=REPLICATE) |
| Get the grid value at a specified coordinate using trilinear interpolation. The "mode" parameter determines the behaviour for coordinates outside the grid bounds, see the documentation of the () operator. More...
|
|
void | Get6Neighbors (long index, vector< long > &n) |
| Fill the vector n with the indices of the 6-neighbors of the gridpoint at the specified index. More...
|
|
void | Get6Neighbors (Vec3i p, vector< Vec3i > &n) |
| Fill the vector n with the coordinates of the 6-neighbors of the gridpoint at the specified coordinate. More...
|
|
void | Fill (T value) |
| Set all points in the grid to a specified value. More...
|
|
T | GetMaxValue () |
| Return the maximum value in the grid. More...
|
|
T | GetMinValue () |
| Return the minimum value in the grid. More...
|
|
void | CopyDataFrom (Grid3< T > &src) |
| Replace the current grid data with that of another grid. If the two grids do not have the same NumberOfElements(), nothing happens. More...
|
|
void | SwapContentsWith (Grid3< T > &v) |
| Swap the contents of two grids. If the two grids do not have the same NumberOfElements(), nothing happens. More...
|
|
bool | CreateFromFile (std::string filename) |
| Construct grid from an image file. More...
|
|
bool | ReadVTK (std::string filename) |
| Construct grid from an image file in VTK legacy format. More...
|
|
bool | WriteVTK (std::string filename) |
| Save grid in VTK legacy format. More...
|
|
bool | ReadMetaImage (std::string filename) |
| Construct grid from an image file in MetaImage format. More...
|
|
bool | WriteMetaImage (std::string filename) |
| Save grid in MetaImage format. More...
|
|
bool | ReadNIFTI (std::string filename) |
| Construct grid from an image file in NIFTI format. More...
|
|
bool | WriteNIFTI (std::string filename) |
| Save grid in NIFTI format. More...
|
|
bool | ReadDICOM (std::string filename) |
| Construct grid from an image file in DICOM format. More...
|
|
template<> |
std::string | GetDataType () |
|
template<> |
std::string | GetDataType () |
|
template<> |
std::string | GetDataType () |
|
template<> |
std::string | GetDataType () |
|
template<> |
std::string | GetDataType () |
|
template<> |
std::string | GetDataType () |
|
template<class T>
class Grid3< T >
Class representing a 3D image grid, each voxel being of type T.