40 #ifndef THE_GRID_TRANSFORM_HXX_
41 #define THE_GRID_TRANSFORM_HXX_
44 #include <Core/ITKCommon/common.hxx>
74 bool xy_intersect(
const vertex_t * v_arr,
80 bool uv_intersect(
const vertex_t * v_arr,
85 unsigned int vertex_[3];
110 unsigned int xy_cell(
const pnt2d_t & xy)
const;
114 unsigned int xy_triangle(
const pnt2d_t & xy, pnt2d_t & uv)
const;
117 unsigned int uv_cell(
const pnt2d_t & uv)
const;
121 unsigned int uv_triangle(
const pnt2d_t & uv, pnt2d_t & xy)
const;
124 void update(
const vec2d_t * xy_shift);
125 void shift(
const vec2d_t & xy_shift);
128 void resize(
unsigned int rows,
136 void update_grid(
unsigned int t_idx);
140 std::vector<std::list<unsigned int> > xy_;
141 std::vector<std::list<unsigned int> > uv_;
150 std::vector<vertex_t> mesh_;
151 std::vector<triangle_t> tri_;
162 bool transform(
const pnt2d_t & xy, pnt2d_t & uv)
const;
165 bool transform_inv(
const pnt2d_t & uv, pnt2d_t & xy)
const;
169 bool jacobian(
const pnt2d_t & xy,
unsigned int * idx,
double * jac)
const;
190 bool is_ready()
const;
193 inline const vertex_t & vertex(
size_t row,
size_t col)
const
194 {
return grid_.mesh_[row * (cols_ + 1) + col]; }
196 inline vertex_t & vertex(
size_t row,
size_t col)
197 {
return grid_.mesh_[row * (cols_ + 1) + col]; }
200 bool transform_inv(
const pnt2d_t & uv, pnt2d_t & xy)
const;
203 void setup(
unsigned int rows,
205 const pnt2d_t & tile_min,
206 const pnt2d_t & tile_max,
207 const std::vector<pnt2d_t> & xy);
228 bool is_ready()
const;
231 bool setup(
const pnt2d_t & tile_min,
232 const pnt2d_t & tile_max,
233 const std::vector<pnt2d_t> & uv,
234 const std::vector<pnt2d_t> & xy,
235 unsigned int accel_grid_rows = 16,
236 unsigned int accel_grid_cols = 16);
240 bool insert_point(
const pnt2d_t & uv,
242 const bool delay_setup =
false);
246 bool insert_point(
const pnt2d_t & uv);
254 #endif // THE_GRID_TRANSFORM_HXX_
Definition: itkDiscontinuousTransform.h:106
Definition: itkDiscontinuousTransform.h:69
Definition: itkDiscontinuousTransform.h:56