SIRF
3.4.0
|
Forward declarations. More...
#include "NiftiBasedRegistration.h"
Public Member Functions | |
NiftiImageData3D () | |
Constructor. | |
NiftiImageData3D (const NiftiImageData< dataType > &general) | |
Construct 3D from general case. | |
NiftiImageData3D (const std::string &filename) | |
Filename constructor. | |
NiftiImageData3D (const nifti_image &image_nifti) | |
Nifti constructor. | |
template<class inputType > | |
NiftiImageData3D (const inputType *const data, const VoxelisedGeometricalInfo3D &geom) | |
Construct from array. | |
NiftiImageData3D (const ImageData &id) | |
Construct from any other image data (e.g., STIRImageData) | |
virtual ObjectHandle< DataContainer > * | new_data_container_handle () const |
std::unique_ptr< NiftiImageData3D > | clone () const |
Clone and return as unique pointer. | |
![]() | |
NiftiImageData () | |
Constructor. | |
virtual | ~NiftiImageData () |
Destructor. | |
NiftiImageData (const NiftiImageData &to_copy) | |
Copy constructor. | |
NiftiImageData & | operator= (const NiftiImageData &to_copy) |
Assignment. | |
NiftiImageData (const ImageData &to_copy) | |
Copy constructor. | |
NiftiImageData & | operator= (const ImageData &to_copy) |
Assignment. | |
NiftiImageData (const std::string &filename) | |
Filename constructor. | |
NiftiImageData (const nifti_image &image_nifti) | |
Nifti constructor. | |
template<class inputType > | |
NiftiImageData (const inputType *const data, const VoxelisedGeometricalInfo3D &geom, const bool is_tensor=false) | |
Construct from array. | |
bool | operator== (const NiftiImageData &other) const |
Equality operator. | |
bool | operator!= (const NiftiImageData &other) const |
Equality operator. | |
NiftiImageData & | operator+= (const NiftiImageData &rhs) |
Addition operator. | |
NiftiImageData & | operator-= (const NiftiImageData &rhs) |
Subtraction operator. | |
NiftiImageData & | operator+= (const float) |
Addition operator. | |
NiftiImageData & | operator-= (const float) |
Subtraction operator. | |
NiftiImageData & | operator*= (const float) |
Multiplication operator. | |
NiftiImageData & | operator*= (const NiftiImageData &rhs) |
Multiplication operator. | |
NiftiImageData & | operator/= (const float) |
Division operator. | |
NiftiImageData & | operator/= (const NiftiImageData &rhs) |
float | operator() (const int index) const |
Access data element via 1D index (const) | |
float & | operator() (const int index) |
Access data element via 1D index. | |
float | operator() (const int index[7]) const |
Access data element via 7D index (const) | |
float & | operator() (const int index[7]) |
Access data element via 7D index. | |
float | operator() (const int x, const int y, const int z, const int t=0, const int u=0, const int v=0, const int w=0) const |
Access data element via 7D index (const) | |
float & | operator() (const int x, const int y, const int z, const int t=0, const int u=0, const int v=0, const int w=0) |
Access data element via 7D index. | |
bool | is_initialised () const |
Is the image initialised? (Should be unless default constructor was used.) | |
std::shared_ptr< const nifti_image > | get_raw_nifti_sptr () const |
Get image as nifti as const. | |
std::shared_ptr< nifti_image > | get_raw_nifti_sptr () |
Get image as nifti. | |
virtual void | write (const std::string &filename, const int datatype) const |
virtual void | write (const std::string &filename) const |
Write. | |
float | get_max () const |
Get max. | |
float | get_min () const |
Get min. | |
float | get_mean () const |
Get mean. | |
float | get_variance () const |
Get variance. | |
float | get_standard_deviation () const |
Get standard deviation. | |
float | get_sum () const |
Get sum. | |
unsigned | get_nan_count () const |
Get nan count. | |
void | fill (const float v) |
Fill. | |
void | fill (const dataType *v) |
Fill from array. | |
void | fill (const NiftiImageData &im) |
Fill from array. | |
float | get_norm (const NiftiImageData &) const |
Get norm. | |
const int * | get_dimensions () const |
Get data size in each dimension. | |
size_t | get_num_voxels () const |
Get total number of voxels. | |
void | print_header () const |
Print header info. More... | |
void | crop (const int min_index[7], const int max_index[7]) |
Crop. Set to -1 to leave unchanged. | |
void | pad (const int min_index[7], const int max_index[7], const dataType val=0) |
Pad image with value. Give number of voxels to increase in min and max directions. Set values to -1 to leave unchanged. | |
int | get_1D_index (const int idx[7]) const |
get 1D index from ND index | |
int | get_original_datatype () const |
Get original datatype. | |
bool | is_in_bounds (const int index[7]) const |
Point is in bounds? | |
bool | is_in_bounds (const int index) const |
Point is in bounds? | |
bool | is_same_size (const NiftiImageData &im) const |
Images are same size. | |
void | set_voxel_spacing (const float factors[3], const int interpolation_order) |
void | kernel_convolution (const float sigma, NREG_CONV_KERNEL_TYPE conv_type=GAUSSIAN_KERNEL) |
Kernel convolution. | |
bool | get_contains_nans () const |
Does the image contain any NaNs? | |
void | flip_along_axis (const unsigned axis) |
Flip the image along a given axis (Rotation of 180 degrees about axis) | |
void | mirror_along_axis (const unsigned axis) |
Mirror the image along a given axis (This will change handedness of image) | |
dataType | get_inner_product (const NiftiImageData &other) const |
Inner product of two images. | |
void | normalise_zero_and_one () |
Normalise image between 0 and 1. | |
void | standardise () |
Standardise (subtract mean and divide by standard deviation). | |
std::unique_ptr< NiftiImageData > | clone () const |
Clone and return as unique pointer. | |
virtual Iterator & | begin () |
virtual Iterator_const & | begin () const |
virtual Iterator & | end () |
virtual Iterator_const & | end () const |
virtual void | set_up_geom_info () |
Set up the geometrical info. Use qform preferentially over sform. | |
![]() | |
virtual bool | ordered () const |
void | copy (Iterator_const &src, Iterator &dst, Iterator &end) const |
void | fill (const ImageData &im) |
virtual bool | operator== (const ImageData &id) const |
Write image to file. | |
virtual bool | operator!= (const ImageData &id) const |
std::shared_ptr< const VoxelisedGeometricalInfo3D > | get_geom_info_sptr () const |
Get geometrical info. | |
std::unique_ptr< ImageData > | clone () const |
Clone and return as unique pointer. | |
virtual bool | is_complex () const |
Is complex? Unless overwridden (Gadgetron), assume not complex. | |
virtual void | reorient (const VoxelisedGeometricalInfo3D &) |
Reorient image. Requires that dimesions and spacing match. | |
![]() | |
bool | is_empty () const |
std::unique_ptr< DataContainer > | clone () const |
void | conjugate () |
overwrites this container's complex data with complex conjugate values | |
std::unique_ptr< DataContainer > | conjugate () const |
returns unique pointer to the complex-conjugated copy of this container | |
Protected Member Functions | |
virtual NiftiImageData3D * | clone_impl () const |
Clone helper function. Don't use. | |
![]() | |
void | check_dimensions (const enum NiftiImageDataType image_type=_general) |
Check dimensions. Don't require anything for this class. | |
void | set_up_data (const int original_datatype) |
Set up datatype. Set to float if not already, store the original type. | |
void | maths (const NiftiImageData &c, const MathsType type) |
Add, subract image from another. | |
void | maths (const float val, const MathsType type) |
Add, subract, multiply value to image. | |
unsigned int | items () const |
virtual void | dot (const DataContainer &a_x, void *ptr) const |
calculates the dot product of this container with another one | |
virtual void | axpby (const void *ptr_a, const DataContainer &a_x, const void *ptr_b, const DataContainer &a_y) |
*this = the linear combination of x and y | |
virtual void | xapyb (const DataContainer &a_x, const void *ptr_a, const DataContainer &a_y, const void *ptr_b) |
alternative interface to the above | |
virtual void | xapyb (const DataContainer &a_x, const DataContainer &a_a, const DataContainer &a_y, const DataContainer &a_b) |
*this = elementwise sum of two elementwise products x*a and y*b | |
virtual float | norm () const |
returns the norm of this container viewed as a vector | |
virtual void | multiply (const DataContainer &a_x, const DataContainer &a_y) |
*this = the elementwise product x*y | |
virtual void | divide (const DataContainer &a_x, const DataContainer &a_y) |
*this = the elementwise ratio x/y | |
virtual void | maximum (const DataContainer &x, const DataContainer &y) |
*this = the elementwise max(x, y) | |
virtual void | minimum (const DataContainer &x, const DataContainer &y) |
*this = the elementwise min(x, y) | |
virtual Dimensions | dimensions () const |
![]() | |
void | set_geom_info (const std::shared_ptr< VoxelisedGeometricalInfo3D > geom_info_sptr) |
Set geom info. | |
![]() | |
virtual void | conjugate_impl () |
we assume data to be real, complex data containers must override this | |
Additional Inherited Members | |
![]() | |
typedef ImageData::Iterator | BaseIter |
typedef ImageData::Iterator_const | BaseIter_const |
![]() | |
static std::shared_ptr< nifti_image > | create_from_geom_info (const VoxelisedGeometricalInfo3D &geom, const bool is_tensor=false, const NREG_TRANS_TYPE tensor_type=NREG_TRANS_TYPE::DEF_FIELD) |
Create NiftiImageData from geometrical info. | |
static void | construct_NiftiImageData_from_complex_im_real_component (std::shared_ptr< NiftiImageData > &out_sptr, const std::shared_ptr< const ImageData > in_sptr) |
Construct NiftiImageData from the real component of a complex SIRF ImageData. | |
static void | construct_NiftiImageData_from_complex_im_imag_component (std::shared_ptr< NiftiImageData > &out_sptr, const std::shared_ptr< const ImageData > in_sptr) |
Construct NiftiImageData from the imaginary component of a complex SIRF ImageData. | |
static void | construct_NiftiImageData_from_complex_im (std::shared_ptr< NiftiImageData > &out_real_sptr, std::shared_ptr< NiftiImageData > &out_imag_sptr, const std::shared_ptr< const ImageData > in_sptr) |
Construct two NiftiImageData from a complex SIRF ImageData. | |
static void | print_headers (const std::vector< const NiftiImageData *> &ims) |
Print multiple header info. More... | |
static bool | are_equal_to_given_accuracy (const NiftiImageData &im1, const NiftiImageData &im2, const float required_accuracy_compared_to_max) |
Check if the norms of two images are equal to a given accuracy. | |
static bool | do_nifti_image_metadata_match (const NiftiImageData &im1, const NiftiImageData &im2, bool verbose) |
Do nifti image metadatas match? | |
static void | dump_headers (const std::vector< const NiftiImageData *> &ims) |
Dump info of multiple nifti images. | |
template<typename T > | |
static void | dump_nifti_element (const std::vector< const NiftiImageData *> &ims, const std::string &name, const T &call_back) |
Dump nifti element. | |
template<typename T > | |
static void | dump_nifti_element (const std::vector< const NiftiImageData *> &ims, const std::string &name, const T &call_back, const unsigned num_elems) |
Dump nifti element. | |
static std::string | get_headers (const std::vector< const NiftiImageData< dataType > *> &ims) |
template<typename T > | |
static std::string | get_nifti_element (const std::vector< const NiftiImageData *> &ims, const std::string &name, const T &call_back) |
template<typename T > | |
static std::string | get_nifti_element (const std::vector< const NiftiImageData *> &ims, const std::string &name, const T &call_back, const unsigned num_elems) |
![]() | |
static bool | can_reorient (const VoxelisedGeometricalInfo3D &geom_1, const VoxelisedGeometricalInfo3D &geom_2, const bool throw_error) |
Can reorient? (check dimensions and spacing) | |
![]() | |
enum | NiftiImageDataType { _general, _3D, _3DTensor, _3DDisp, _3DDef } |
enum | MathsType { add, sub, mul, div } |
![]() | |
static void | open_nifti_image (std::shared_ptr< nifti_image > &image, const std::string &filename) |
Open nifti image. | |
static void | copy_nifti_image (std::shared_ptr< nifti_image > &output_image_sptr, const std::shared_ptr< nifti_image > &image_to_copy_sptr) |
Copy nifti image. | |
![]() | |
std::shared_ptr< nifti_image > | _nifti_image |
Image data as a nifti object. | |
float * | _data = NULL |
Data. | |
int | _original_datatype = -1 |
Original datatype. | |
std::shared_ptr< Iterator > | _begin |
std::shared_ptr< Iterator > | _end |
std::shared_ptr< Iterator_const > | _begin_const |
std::shared_ptr< Iterator_const > | _end_const |
Forward declarations.
3D Nifti image.
Here, we require that the number of dimensions == 3.