plastimatch
Loading...
Searching...
No Matches
itk_volume_header.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _itk_volume_header_h_
5#define _itk_volume_header_h_
6
7#include "plmbase_config.h"
8#include "itk_image_type.h"
9
10class Bspline_xform;
11
13public:
18
19public:
22 float origin[3], float spacing[3], plm_long dim[3])
23 {
24 this->set_from_gpuit (origin, spacing, dim, 0);
25 }
27 float origin[3], float spacing[3],
28 plm_long dim[3], float direction_cosines[9])
29 {
30 this->set_from_gpuit (origin, spacing, dim, direction_cosines);
31 }
32
33public:
34 int Size (int d) const { return m_region.GetSize()[d]; }
35
36public:
37 /* Return 1 if the two headers are the same */
38 static int compare (Itk_volume_header *pli1, Itk_volume_header *pli2);
39
40public:
41 void set_origin (float origin[3]);
42 void set_spacing (float spacing[3]);
43 void set_dim (plm_long dim[3]);
44 void
45 set_from_gpuit (float gpuit_origin[3],
46 float gpuit_spacing[3],
47 plm_long gpuit_dim[3],
48 float gpuit_direction_cosines[9]);
49 void
50 set_from_gpuit_bspline (Bspline_xform *bxf);
51 template<class T>
52 void set_from_itk_image (const T image) {
53 m_origin = image->GetOrigin ();
54 m_spacing = image->GetSpacing ();
55 m_region = image->GetLargestPossibleRegion ();
56 m_direction = image->GetDirection ();
57 }
58 static void clone (Itk_volume_header *dest, Itk_volume_header *src) {
59 dest->m_origin = src->m_origin;
60 dest->m_spacing = src->m_spacing;
61 dest->m_region = src->m_region;
62 dest->m_direction = src->m_direction;
63 }
64
65 void get_origin (float origin[3]);
66 void get_spacing (float spacing[3]);
67 void get_dim (plm_long dim[3]);
68 void get_direction_cosines (
69 float direction_cosines[9]);
70
71 void print (void) const;
72 void get_image_center (float center[3]);
73};
74
75/* -----------------------------------------------------------------------
76 Global functions
77 ----------------------------------------------------------------------- */
78void
80 float direction_cosines[9],
81 DirectionType* itk_direction
82);
83
84#endif
The Bspline_xform class encapsulates the B-spline coefficients used by native registration and warpin...
Definition bspline_xform.h:24
Definition itk_volume_header.h:12
RegionType m_region
Definition itk_volume_header.h:14
SpacingType m_spacing
Definition itk_volume_header.h:16
int Size(int d) const
Definition itk_volume_header.h:34
Itk_volume_header(float origin[3], float spacing[3], plm_long dim[3], float direction_cosines[9])
Definition itk_volume_header.h:26
OriginType m_origin
Definition itk_volume_header.h:15
static void clone(Itk_volume_header *dest, Itk_volume_header *src)
Definition itk_volume_header.h:58
Itk_volume_header()
Definition itk_volume_header.h:20
DirectionType m_direction
Definition itk_volume_header.h:17
void set_from_itk_image(const T image)
Definition itk_volume_header.h:52
Itk_volume_header(float origin[3], float spacing[3], plm_long dim[3])
Definition itk_volume_header.h:21
itk::Vector< double, 3 > SpacingType
Definition itk_image.h:21
itk::Point< double, 3 > OriginType
Definition itk_image.h:18
itk::ImageRegion< 3 > RegionType
Definition itk_image.h:19
void direction_cosines_from_itk(float direction_cosines[9], DirectionType *itk_direction)
#define PLMBASE_API
Definition plmbase_config.h:19
int compare(const void *a, const void *b)
Definition simplify_points.cxx:19