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 | Private Attributes | List of all members
DICe::cine::Cine_Reader Class Reference

A helper class the reads in cine files from disk and provides some methods such as getting a particular frame from the cine file. More...

#include <DICe_Cine.h>

Public Member Functions

 Cine_Reader (const std::string &file_name, std::ostream *out_stream=NULL)
 default constructor More...
 
virtual ~Cine_Reader ()
 default destructor
 
void get_frame (const int_t offset_x, const int_t offset_y, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right, const int_t frame_index)
 generic frame fetch More...
 
void get_average_frame (const int_t frame_start, const int_t frame_end, const int_t offset_x, const int_t offset_y, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right)
 generic frame fetch with averaging across frames More...
 
void get_frame_8_bit (const int_t offset_x, const int_t offset_y, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right, const int_t frame_index)
 8 bit frame fetch More...
 
void get_frame_10_bit (const int_t offset_x, const int_t offset_y, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right, const int_t frame_index)
 10 bit frame fetch More...
 
void get_frame_16_bit (const int_t offset_x, const int_t offset_y, const int_t width, const int_t height, intensity_t *intensities, const bool is_layout_right, const int_t frame_index)
 16 bit frame fetch More...
 
void initialize_filter (const bool filter_failed_pixels, const bool convert_to_8_bit, const int_t frame_index=0, const bool reinit=false)
 set up the filtering of failed pixels More...
 
int_t num_frames () const
 returns the number of images in the cine file
 
int_t frame_rate () const
 returns the number of images in the cine file
 
int_t width () const
 returns the image width
 
int_t height () const
 return the image height
 
int_t first_image_number () const
 return the offset to the first indexed image (can be negative)
 

Private Attributes

Teuchos::RCP< Cine_Headercine_header_
 pointer to the cine file header information
 
std::ostream * out_stream_
 pointer to the output stream
 
bool bit_12_warning_
 flag to prevent warnings from appearing multiple times for each frame
 
long long int header_offset_
 file offset
 
intensity_t filter_threshold_
 maximum value of intensity above which the values are filtered (the value is set to the next highest intensity value)
 
intensity_t conversion_factor_
 conversion factor for converting to 8 bit depth
 
bool filter_initialized_
 true if the filter has already been initialized
 

Detailed Description

A helper class the reads in cine files from disk and provides some methods such as getting a particular frame from the cine file.

Constructor & Destructor Documentation

◆ Cine_Reader()

DICe::cine::Cine_Reader::Cine_Reader ( const std::string &  file_name,
std::ostream *  out_stream = NULL 
)

default constructor

Parameters
file_namethe name of the cine file
out_stream(optional) output stream
filter_failed_pixelstrue if failed pixels should be filtered out by taking the next highest value
convert_to_8_bittrue if the values should be scaled to 8 bit

Member Function Documentation

◆ get_average_frame()

void DICe::cine::Cine_Reader::get_average_frame ( const int_t  frame_start,
const int_t  frame_end,
const int_t  offset_x,
const int_t  offset_y,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right 
)

generic frame fetch with averaging across frames

Parameters
frame_startthe initial frame to start averaging with
frame_endthe end of the section of frames to average
offset_xoffset to first pixel in x
offset_yoffset to first pixel in y
widththe width of the image or subimage
heightthe height of the image or subimage (intensities must be pre-allocated as a widthxheight array)
intensitiesthe intensity array
is_layout_rightcolum or row oriented storage flag (not used yet for cine)

◆ get_frame()

void DICe::cine::Cine_Reader::get_frame ( const int_t  offset_x,
const int_t  offset_y,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right,
const int_t  frame_index 
)

generic frame fetch

Parameters
offset_xoffset to first pixel in x
offset_yoffset to first pixel in y
widththe width of the image or subimage
heightthe height of the image or subimage (intensities must be pre-allocated as a widthxheight array)
intensitiesthe intensity array
is_layout_rightcolum or row oriented storage flag (not used yet for cine)
frame_indexthe frame to gather

◆ get_frame_10_bit()

void DICe::cine::Cine_Reader::get_frame_10_bit ( const int_t  offset_x,
const int_t  offset_y,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right,
const int_t  frame_index 
)

10 bit frame fetch

Parameters
offset_xoffset to first pixel in x
offset_yoffset to first pixel in y
widththe width of the image or subimage
heightthe height of the image or subimage (intensities must be pre-allocated as a widthxheight array)
intensitiesthe intensity array
is_layout_rightcolum or row oriented storage flag (not used yet for cine)
frame_indexthe frame to gather

◆ get_frame_16_bit()

void DICe::cine::Cine_Reader::get_frame_16_bit ( const int_t  offset_x,
const int_t  offset_y,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right,
const int_t  frame_index 
)

16 bit frame fetch

Parameters
offset_xoffset to first pixel in x
offset_yoffset to first pixel in y
widththe width of the image or subimage
heightthe height of the image or subimage (intensities must be pre-allocated as a widthxheight array)
intensitiesthe intensity array
is_layout_rightcolum or row oriented storage flag (not used yet for cine)
frame_indexthe frame to gather

◆ get_frame_8_bit()

void DICe::cine::Cine_Reader::get_frame_8_bit ( const int_t  offset_x,
const int_t  offset_y,
const int_t  width,
const int_t  height,
intensity_t intensities,
const bool  is_layout_right,
const int_t  frame_index 
)

8 bit frame fetch

Parameters
offset_xoffset to first pixel in x
offset_yoffset to first pixel in y
widththe width of the image or subimage
heightthe height of the image or subimage (intensities must be pre-allocated as a widthxheight array)
intensitiesthe intensity array
is_layout_rightcolum or row oriented storage flag (not used yet for cine)
frame_indexthe frame to gather

◆ initialize_filter()

void DICe::cine::Cine_Reader::initialize_filter ( const bool  filter_failed_pixels,
const bool  convert_to_8_bit,
const int_t  frame_index = 0,
const bool  reinit = false 
)

set up the filtering of failed pixels

Parameters
filter_failed_pixelstrue if failed pixels should be filtered out by taking the next highest value
convert_to_8_bittrue if the values should be scaled to 8 bit
frameindex to use to set up the filtering