Digital Image Correlation Engine  Version 1.0
A modular, high-performance, image correlation tool used to compute full-field displacements and strains from digital images
Public Member Functions | List of all members
DICe::Shape Class Reference

Generic class for defining regions in an image. More...

#include <DICe_Shape.h>

Inheritance diagram for DICe::Shape:
DICe::Circle DICe::Polygon DICe::Rectangle

Public Member Functions

virtual std::set< std::pair< int_t, int_t > > get_owned_pixels (Teuchos::RCP< Local_Shape_Function > shape_function=Teuchos::null, const int_t cx=0, const int_t cy=0, const scalar_t skin_factor=1.0) const
 Returns a set of the coordinates of all pixels interior to this shape. NOTE: The pair is (y,x) not (x,y) so that the ordering in the set will match with loops over y then x. More...
 
virtual void deactivate_pixels (const int_t size, bool *pixel_flags, int_t *x_coords, int_t *y_coords) const
 Method used to turn pixels off that fall inside the shape. Mostly called in the construction of a conformal subset to turn off interior regions to the subset. More...
 

Detailed Description

Generic class for defining regions in an image.

For conformal subsets, the boundary is defined by an arbitrarily complex shape built up of DICe::Shapes. Depending on the derived class implementation, a shape holds nothing more than geometry information such as the coordinates of the vertices (for a polygon). There are only a couple basic methods for a shape used to determine if a particular pixel is inside or outside a shape. These methods are used in the construction of a conformal subset.

Member Function Documentation

◆ deactivate_pixels()

virtual void DICe::Shape::deactivate_pixels ( const int_t  size,
bool *  pixel_flags,
int_t x_coords,
int_t y_coords 
) const
inlinevirtual

Method used to turn pixels off that fall inside the shape. Mostly called in the construction of a conformal subset to turn off interior regions to the subset.

Parameters
pixel_flags[out] An array of bools true means the pixel is still active false means that the pixel falls inside the shape and deactivated (should be of same size as x_coords and y_coords)
sizenumber of elements in the arrays (all arrays should be the same size)
pixel_flagspointer to the array of flags for each pixel
x_coordspointer to the array with the x coordinates of each pixel to test
y_coordspointer to the array with the y coordinates of each pixel to test

Reimplemented in DICe::Rectangle, DICe::Circle, and DICe::Polygon.

◆ get_owned_pixels()

virtual std::set<std::pair<int_t,int_t> > DICe::Shape::get_owned_pixels ( Teuchos::RCP< Local_Shape_Function shape_function = Teuchos::null,
const int_t  cx = 0,
const int_t  cy = 0,
const scalar_t  skin_factor = 1.0 
) const
inlinevirtual

Returns a set of the coordinates of all pixels interior to this shape. NOTE: The pair is (y,x) not (x,y) so that the ordering in the set will match with loops over y then x.

Parameters
shape_functionOptional mapping to the deformed shape, otherwise reference map is used
cxOptional x centroid of the map
cyOptional y centroid of the map
skin_factorOptional padding added to the outside of the shape to make it larger or smaller

Reimplemented in DICe::Rectangle, DICe::Circle, and DICe::Polygon.