41 #ifndef THE_GRID_TRANSFORM_HXX_
42 #define THE_GRID_TRANSFORM_HXX_
46 #include <Core/ITKCommon/common.hxx>
76 bool xy_intersect(
const vertex_t * v_arr,
82 bool uv_intersect(
const vertex_t * v_arr,
87 unsigned int vertex_[3];
112 unsigned int xy_cell(
const pnt2d_t & xy)
const;
116 unsigned int xy_triangle(
const pnt2d_t & xy, pnt2d_t & uv)
const;
119 unsigned int uv_cell(
const pnt2d_t & uv)
const;
123 unsigned int uv_triangle(
const pnt2d_t & uv, pnt2d_t & xy)
const;
126 void update(
const vec2d_t * xy_shift);
127 void shift(
const vec2d_t & xy_shift);
130 void resize(
unsigned int rows,
138 void update_grid(
unsigned int t_idx);
142 std::vector<std::list<unsigned int> > xy_;
143 std::vector<std::list<unsigned int> > uv_;
152 std::vector<vertex_t> mesh_;
153 std::vector<triangle_t> tri_;
164 bool transform(
const pnt2d_t & xy, pnt2d_t & uv)
const;
167 bool transform_inv(
const pnt2d_t & uv, pnt2d_t & xy)
const;
171 bool jacobian(
const pnt2d_t & xy,
unsigned int * idx,
double * jac)
const;
192 bool is_ready()
const;
195 inline const vertex_t & vertex(
size_t row,
size_t col)
const
196 {
return grid_.mesh_[row * (cols_ + 1) + col]; }
198 inline vertex_t & vertex(
size_t row,
size_t col)
199 {
return grid_.mesh_[row * (cols_ + 1) + col]; }
202 bool transform_inv(
const pnt2d_t & uv, pnt2d_t & xy)
const;
205 void setup(
unsigned int rows,
207 const pnt2d_t & tile_min,
208 const pnt2d_t & tile_max,
209 const std::vector<pnt2d_t> & xy);
230 bool is_ready()
const;
233 bool setup(
const pnt2d_t & tile_min,
234 const pnt2d_t & tile_max,
235 const std::vector<pnt2d_t> & uv,
236 const std::vector<pnt2d_t> & xy,
237 unsigned int accel_grid_rows = 16,
238 unsigned int accel_grid_cols = 16);
242 bool insert_point(
const pnt2d_t & uv,
244 const bool delay_setup =
false);
248 bool insert_point(
const pnt2d_t & uv);
256 #endif // THE_GRID_TRANSFORM_HXX_
Definition: itkDiscontinuousTransform.h:106
Definition: itkDiscontinuousTransform.h:69
Definition: itkDiscontinuousTransform.h:56