plastimatch
Loading...
Searching...
No Matches
Bspline_xform Class Reference

The Bspline_xform class encapsulates the B-spline coefficients used by native registration and warping algorithms. Information describing the B-spline geometry is held in the base class: Bspline_header. More...

#include <bspline_xform.h>

Inheritance diagram for Bspline_xform:
Bspline_header

Public Types

enum  Lut_type { LUT_3D_ALIGNED , LUT_1D_ALIGNED , LUT_1D_UNALIGNED }
 

Public Member Functions

 SMART_POINTER_SUPPORT (Bspline_xform)
 
 Bspline_xform ()
 
 ~Bspline_xform ()
 
void initialize (float img_origin[3], float img_spacing[3], plm_long img_dim[3], plm_long roi_offset[3], plm_long roi_dim[3], plm_long vox_per_rgn[3], float direction_cosines[9])
 
void initialize (const Plm_image_header *pih, const float grid_spac[3])
 
void save (const char *filename)
 
void fill_coefficients (float val)
 
void jitter_if_zero ()
 This function jitters the coefficients if they are all zero. It is used to prevent local minima artifact when optimizing an MI cost function for images with the same geometry.
 
void get_volume_header (Volume_header *vh)
 
Plm_image_header get_plm_image_header ()
 
void log_header ()
 
- Public Member Functions inherited from Bspline_header
 Bspline_header ()
 
void set (const float img_origin[3], const float img_spacing[3], const plm_long img_dim[3], const plm_long roi_offset[3], const plm_long roi_dim[3], const plm_long vox_per_rgn[3], const float direction_cosines[9])
 
void set (const Plm_image_header *pih, const float grid_spac[3])
 
void set_unaligned (const float img_origin[3], const float img_spacing[3], const plm_long img_dim[3], const plm_long roi_offset[3], const plm_long roi_dim[3], const float grid_spac[3], const float direction_cosines[9])
 
void set_unaligned (const Plm_image_header *pih, const float grid_spac[3])
 
void get_volume_header (Volume_header *vh)
 

Public Attributes

float * coeff
 
Lut_type lut_type
 
plm_long * cidx_lut
 
plm_long * c_lut
 
plm_long * qidx_lut
 
float * q_lut
 
float * bx_lut
 
float * by_lut
 
float * bz_lut
 
float * ux_lut
 
float * uy_lut
 
float * uz_lut
 
- Public Attributes inherited from Bspline_header
float img_origin [3]
 
float img_spacing [3]
 
plm_long img_dim [3]
 
Direction_cosines dc
 
plm_long roi_offset [3]
 
plm_long roi_dim [3]
 
plm_long vox_per_rgn [3]
 
float grid_spac [3]
 
plm_long rdims [3]
 
plm_long cdims [3]
 
int num_knots
 
int num_coeff
 

Protected Member Functions

void allocate ()
 

Detailed Description

The Bspline_xform class encapsulates the B-spline coefficients used by native registration and warping algorithms. Information describing the B-spline geometry is held in the base class: Bspline_header.

Member Enumeration Documentation

◆ Lut_type

Enumerator
LUT_3D_ALIGNED 
LUT_1D_ALIGNED 
LUT_1D_UNALIGNED 

Constructor & Destructor Documentation

◆ Bspline_xform()

Bspline_xform::Bspline_xform ( )

◆ ~Bspline_xform()

Bspline_xform::~Bspline_xform ( )

Member Function Documentation

◆ allocate()

void Bspline_xform::allocate ( )
protected

Allocate and initialize coefficients and LUTs

◆ fill_coefficients()

void Bspline_xform::fill_coefficients ( float val)

◆ get_plm_image_header()

Plm_image_header Bspline_xform::get_plm_image_header ( )

◆ get_volume_header()

void Bspline_xform::get_volume_header ( Volume_header * vh)

◆ initialize() [1/2]

void Bspline_xform::initialize ( const Plm_image_header * pih,
const float grid_spac[3] )

Initialize B-spline geometry and allocate memory for coefficients. This version of the function gets used when creating a B-Spline with a specified grid spacing.

Parameters
pihThe image geometry associated with B-spline
grid_spacThe B-Spline grid spacing (in mm)

◆ initialize() [2/2]

void Bspline_xform::initialize ( float img_origin[3],
float img_spacing[3],
plm_long img_dim[3],
plm_long roi_offset[3],
plm_long roi_dim[3],
plm_long vox_per_rgn[3],
float direction_cosines[9] )

Initialize B-spline geometry and allocate memory for coefficients. This version of the function gets used when loading a B-Spline from file.

◆ jitter_if_zero()

void Bspline_xform::jitter_if_zero ( )

This function jitters the coefficients if they are all zero. It is used to prevent local minima artifact when optimizing an MI cost function for images with the same geometry.

◆ log_header()

void Bspline_xform::log_header ( )

◆ save()

void Bspline_xform::save ( const char * filename)

◆ SMART_POINTER_SUPPORT()

Bspline_xform::SMART_POINTER_SUPPORT ( Bspline_xform )

Member Data Documentation

◆ bx_lut

float* Bspline_xform::bx_lut

◆ by_lut

float* Bspline_xform::by_lut

◆ bz_lut

float* Bspline_xform::bz_lut

◆ c_lut

plm_long* Bspline_xform::c_lut

◆ cidx_lut

plm_long* Bspline_xform::cidx_lut

◆ coeff

float* Bspline_xform::coeff

Array of B-spline coefficients.

◆ lut_type

Lut_type Bspline_xform::lut_type

Choose which kind of LUT is used

◆ q_lut

float* Bspline_xform::q_lut

◆ qidx_lut

plm_long* Bspline_xform::qidx_lut

◆ ux_lut

float* Bspline_xform::ux_lut

◆ uy_lut

float* Bspline_xform::uy_lut

◆ uz_lut

float* Bspline_xform::uz_lut

The documentation for this class was generated from the following files: