RNifti
Fast R and C++ Access to NIfTI Images
|
Inner class referring to a subset of an image. More...
#include <NiftiImage.h>
Public Member Functions | |
Block (const NiftiImage &image, const int dimension, const dim_t index) | |
Standard constructor for this class. More... | |
Block & | operator= (const NiftiImage &source) |
Copy assignment operator, which allows a block in one image to be replaced with the contents of another image. More... | |
NiftiImageData | data () const |
Obtain the data within the block. More... | |
template<typename TargetType > | |
std::vector< TargetType > | getData (const bool useSlope=true) const |
Extract a vector of data from a block, casting it to any required element type. More... | |
Public Attributes | |
const NiftiImage & | image |
The parent image. | |
const int | dimension |
The dimension along which the block applies (which should be the last) | |
const dim_t | index |
The location along dimension . | |
Inner class referring to a subset of an image.
Currently must refer to the last dimension in the image, i.e., a volume in a 4D parent image, or a slice in a 3D image
|
inline |
Standard constructor for this class.
image | The parent image |
dimension | The dimension along which the block applies (which should be the last) |
index | The location along dimension |
runtime_error | If dimension is not the last dimension in the image |
|
inline |
Obtain the data within the block.
NiftiImageData
object encapsulating the data std::vector<TargetType> RNifti::NiftiImage::Block::getData | ( | const bool | useSlope = true | ) | const |
Extract a vector of data from a block, casting it to any required element type.
useSlope | If true , the default, then the data will be adjusted for the slope and intercept stored with the image, if any |
|
inline |
Copy assignment operator, which allows a block in one image to be replaced with the contents of another image.
source | A NiftiImage, containing the data to replace the block with |
runtime_error | If the source is incompatible with the block in size or datatype |