plastimatch
Loading...
Searching...
No Matches
bspline_xform.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _bspline_xform_h_
5#define _bspline_xform_h_
6
7#include "plmbase_config.h"
8#include "bspline_header.h"
9#include "direction_cosines.h"
10#include "smart_pointer.h"
11#include "plm_int.h"
12
13class Volume;
14class Volume_header;
15
23 : public Bspline_header
24{
25public:
27public:
30public:
31 enum Lut_type {
34 LUT_1D_UNALIGNED
35 };
36public:
38 float* coeff;
39
42
43 /* Aligned grid (3D) LUTs */
44 plm_long* cidx_lut; /* Lookup volume for region number */
45 plm_long* c_lut; /* Lookup table for control point indices */
46 plm_long* qidx_lut; /* Lookup volume for region offset */
47 float* q_lut; /* Lookup table for influence multipliers */
48
49 /* Aligned grid (1D) LUTs */
50 float *bx_lut; /* LUT for influence multiplier in x dir */
51 float *by_lut; /* LUT for influence multiplier in y dir */
52 float *bz_lut; /* LUT for influence multiplier in z dir */
53
54 /* Unaligned grid (1D) LUTs */
55 float *ux_lut; /* LUT for influence multiplier in x dir */
56 float *uy_lut; /* LUT for influence multiplier in y dir */
57 float *uz_lut; /* LUT for influence multiplier in z dir */
58
59public:
63 void initialize (
64 float img_origin[3], /* Image origin (in mm) */
65 float img_spacing[3], /* Image spacing (in mm) */
66 plm_long img_dim[3], /* Image size (in vox) */
67 plm_long roi_offset[3], /* Position of first vox in ROI (in vox) */
68 plm_long roi_dim[3], /* Dimension of ROI (in vox) */
69 plm_long vox_per_rgn[3], /* Knot spacing (in vox) */
70 float direction_cosines[9] /* Direction cosines */
71 );
78 void initialize (
79 const Plm_image_header *pih,
80 const float grid_spac[3]
81 );
82 void save (const char* filename);
83 void fill_coefficients (float val);
88 void jitter_if_zero ();
90 Plm_image_header get_plm_image_header ();
91 void log_header ();
92protected:
95 void allocate ();
96};
97
98PLMBASE_C_API Bspline_xform* bspline_xform_load (const char* filename);
99
100/* Debugging routines */
101PLMBASE_C_API void bspline_xform_dump_coeff (Bspline_xform* bxf, const char* fn);
103
104
105#endif
EXTERNC Bspline_xform * bspline_xform_load(const char *filename)
Definition bspline_xform.cxx:152
EXTERNC void bspline_xform_dump_coeff(Bspline_xform *bxf, const char *fn)
Definition bspline_xform.cxx:285
EXTERNC void bspline_xform_dump_luts(Bspline_xform *bxf)
Definition bspline_xform.cxx:296
The Bspline_header class encapsulates the B-spline grid geometry.
Definition bspline_header.h:21
void get_volume_header(Volume_header *vh)
The Bspline_xform class encapsulates the B-spline coefficients used by native registration and warpin...
Definition bspline_xform.h:24
float * uz_lut
Definition bspline_xform.h:57
SMART_POINTER_SUPPORT(Bspline_xform)
Lut_type
Definition bspline_xform.h:31
@ LUT_3D_ALIGNED
Definition bspline_xform.h:32
@ LUT_1D_ALIGNED
Definition bspline_xform.h:33
Lut_type lut_type
Definition bspline_xform.h:41
float * by_lut
Definition bspline_xform.h:51
float * bz_lut
Definition bspline_xform.h:52
plm_long * qidx_lut
Definition bspline_xform.h:46
float * bx_lut
Definition bspline_xform.h:50
float * ux_lut
Definition bspline_xform.h:55
plm_long * cidx_lut
Definition bspline_xform.h:44
float * uy_lut
Definition bspline_xform.h:56
float * coeff
Definition bspline_xform.h:38
plm_long * c_lut
Definition bspline_xform.h:45
float * q_lut
Definition bspline_xform.h:47
The Plm_image_header class defines the geometry of an image. It defines image origin,...
Definition plm_image_header.h:24
Definition volume_header.h:17
The Volume class represents a three-dimensional volume on a uniform grid. The volume can be located a...
Definition volume.h:38
#define PLMBASE_API
Definition plmbase_config.h:19
#define PLMBASE_C_API
Definition plmbase_config.h:18