functions and classes related to image data input/output More...
#include "image.h"
Classes | |
class | Buffer |
Public Types | |
using | value_type = ValueType |
Public Member Functions | |
void * | operator new (std::size_t size) |
void * | operator new[] (std::size_t size) |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
Image () | |
Image (const Image &)=default | |
Image (Image &&)=default | |
Image & | operator= (const Image &image)=default |
Image & | operator= (Image &&)=default |
~Image () | |
Image (const std::shared_ptr< Buffer > &, const Stride::List &=Stride::List()) | |
used internally to instantiate Image objects More... | |
bool | valid () const |
bool | operator! () const |
const KeyValues & | keyval () const |
get generic key/value text attributes More... | |
const std::string & | name () const |
const transform_type & | transform () const |
size_t | ndim () const |
ssize_t | size (size_t axis) const |
default_type | spacing (size_t axis) const |
ssize_t | stride (size_t axis) const |
size_t | offset () const |
offset to current voxel from start of data More... | |
void | reset () |
reset index to zero (origin) More... | |
ssize_t | get_index (size_t axis) const |
get position of current voxel location along axis More... | |
void | move_index (size_t axis, ssize_t increment) |
move position of current voxel location along axis More... | |
bool | is_direct_io () const |
ValueType | get_value () const |
get voxel value at current location More... | |
void | set_value (ValueType val) |
set voxel value at current location More... | |
std::string | dump_to_mrtrix_file (std::string filename, bool use_multi_threading=true) const |
write out the contents of a direct IO image to file More... | |
Image | with_direct_io (Stride::List with_strides=Stride::List()) |
return a new Image using direct IO More... | |
Image | with_direct_io (int axis) |
return a new Image using direct IO More... | |
ValueType * | address () const |
return RAM address of current voxel More... | |
Static Public Member Functions | |
static Image | open (const std::string &image_name, bool read_write_if_existing=false) |
static Image | create (const std::string &image_name, const Header &template_header, bool add_to_command_history=true) |
static Image | scratch (const Header &template_header, const std::string &label="scratch image") |
Public Attributes | |
std::shared_ptr< Buffer > | buffer |
shared reference to header/buffer More... | |
Protected Attributes | |
void * | data_pointer |
pointer to data address whether in RAM or MMap More... | |
vector< ssize_t > | x |
voxel indices More... | |
Stride::List | strides |
voxel indices More... | |
size_t | data_offset |
offset to currently pointed-to voxel More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Image &V) |
use for debugging More... | |
functions and classes related to image data input/output
using MR::Image< ValueType >::value_type = ValueType |
MR::Image< ValueType >::Image | ( | ) |
|
inlinedefault |
MR::Image< ValueType >::Image | ( | const std::shared_ptr< Buffer > & | , |
const Stride::List & | = Stride::List() |
||
) |
used internally to instantiate Image objects
|
inline |
std::string MR::Image< ValueType >::dump_to_mrtrix_file | ( | std::string | filename, |
bool | use_multi_threading = true |
||
) | const |
write out the contents of a direct IO image to file
returns the name of the image - needed by display() to get the name of the temporary file to supply to MRView.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinedefault |
|
inlinedefault |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return a new Image using direct IO
this is a convenience function, performing the same function as with_direct_io(Stride::List). The difference is that the axis argument specifies which axis should be contiguous, or if axis is negative, that the spatial axes should be contiguous (the SpatiallyContiguous
constexpr, set to -1, is provided for clarity). In other words:
is equivalent to:
and
is equivalent to:
Image MR::Image< ValueType >::with_direct_io | ( | Stride::List | with_strides = Stride::List() | ) |
return a new Image using direct IO
this will preload the data into RAM if the datatype on file doesn't match that on file (or if any scaling is applied to the data). The optional with_strides argument is used to additionally enforce preloading if the strides aren't compatible with those specified.
Example:
|
friend |
|
protected |
|
protected |
|
protected |