Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::ImageOp Namespace Reference

Functions

bool EqualImages (const std::string &file1, const std::string &file2)
 Loads and compares two images. classes. More...
 
template<class D , class D2 >
bool EqualImages (const Image< D > &img1, const Image< D2 > &img2)
 
template<class D >
Image< D > RemoveFrame (const Image< D > &img, const Vector< size_t > &low_coord, const Vector< size_t > &hgh_coord)
 Computes and returns image without the frame given by lower and higher coordinates. More...
 
template<class D >
Image< D > RemoveFrame (const Image< D > &img, size_t width)
 Computes and returns image without the frame. More...
 
template<class D >
Image< D > AddFrame (const Image< D > &img, const Vector< size_t > &base_coord, const Vector< size_t > &full_size)
 Computes and returns image with zero intensity pixels frame. base_coord gives the lower coordinates the img is inserted. full_size is the size of the framed image. More...
 
template<class D >
Image< D > AddFrame (const Image< D > &img, size_t width)
 Computes and returns image with zero value frame. Frame with given width is added to every extremity. More...
 
template<class D >
Image< D > SwapDims (const Image< D > &img, size_t dim_0, size_t dim_1, bool invert_dir_0=false, bool invert_dir_1=false)
 Computes the image resultant from swapping dim_0 with dim_1. More...
 
template<class D >
Image< D > Merge (Vector< Image< D > > &img_vector, float new_pixel_size=1.0)
 Static constructor of a 3D spatial image, from an vector of 2D images. Images may or may not have channels. More...
 
template<class D >
std::tuple< Vector< size_t >, Vector< size_t > > ROI (const Image< D > &img)
 Computes lower and higher coordinates of the region of interest (ROI). The ROI is the smallest box that contains all non-zero pixels. More...
 
template<class D >
Image< D > Resize (const Image< D > &mat, const Vector< size_t > &new_min, const Vector< size_t > &new_max)
 Returns a submatrix from this matrix. If this matrix has more dimensions than the input, than all elements of these Dimensions are included in the submatrix. More...
 
template<class D >
Image< D > Resize (const Image< D > &mat, const std::string &coordinates)
 Returns a submatrix from this matrix. The coordinates string must be given in a similar way as used by MatLab, or in some other variations. More...
 
template<class D >
Image< size_t > Coordinates (const Image< D > &mat, const std::string &coordinates)
 Returns vectors with minimum and maximum coordinates from this matrix. The coordinates string must be given in a similar fashion as used by MatLab, or in some other variations. Examples: img( "1, 1:2 )" = coordinates with column 1 and rows 1 and 2. img( "1:, :2 )" = coordinates with columns 1 to img.size( 0 ) and rows 0 to 2. img( "1:, : )" = coordinates with columns 1 to img.size( 0 ) and all rows. If this matrix has more dimensions than the input string, than all elements of these dimensions are included in the resulting vector. More...
 
template<class D >
Vector< Image< D > > Split (const Image< D > &img, size_t dimension)
 Create a vector of ( dim < N )-D images from an N-D image. More...
 

Function Documentation

template<class D >
Image< D > Bial::ImageOp::AddFrame ( const Image< D > &  img,
const Vector< size_t > &  base_coord,
const Vector< size_t > &  full_size 
)

Computes and returns image with zero intensity pixels frame. base_coord gives the lower coordinates the img is inserted. full_size is the size of the framed image.

Date
2014/Jan/07
Parameters
imgInput image.
base_coordLower coordinates of the image with the frame.
full_sizeFull size of the computed image.
Returns
Image with frame.
Warning
none.
template<class D >
Image< D > Bial::ImageOp::AddFrame ( const Image< D > &  img,
size_t  width 
)

Computes and returns image with zero value frame. Frame with given width is added to every extremity.

Date
2014/Jan/07
Parameters
imgInput image.
widthFrame width.
Returns
Image with frame.
Warning
none.
template<class D >
Image< size_t > Bial::ImageOp::Coordinates ( const Image< D > &  mat,
const std::string &  coordinates 
)

Returns vectors with minimum and maximum coordinates from this matrix. The coordinates string must be given in a similar fashion as used by MatLab, or in some other variations. Examples: img( "1, 1:2 )" = coordinates with column 1 and rows 1 and 2. img( "1:, :2 )" = coordinates with columns 1 to img.size( 0 ) and rows 0 to 2. img( "1:, : )" = coordinates with columns 1 to img.size( 0 ) and all rows. If this matrix has more dimensions than the input string, than all elements of these dimensions are included in the resulting vector.

Date
2012/Oct/03
Parameters
coordinatesCoordinates in this matrix to be used to generate the submatrix.
Returns
2D Image with converted coordinates from the input string. First dimension referes to source matrix coordinates and second dimension has lower and higher limits of each coordinate.
Warning
The input string can not have more coordinates than this matrix.
bool Bial::ImageOp::EqualImages ( const std::string &  file1,
const std::string &  file2 
)

Loads and compares two images. classes.

Date
2015/Aug/21
Parameters
file1First image path.
file2Second image path.
Returns
Returns true if images are accessible and equal both in size and contents.
Warning
none.
template<class D , class D2 >
bool Bial::ImageOp::EqualImages ( const Image< D > &  img1,
const Image< D2 > &  img2 
)
template<class D >
Image< D > Bial::ImageOp::Merge ( Vector< Image< D > > &  img_vector,
float  new_pixel_size = 1.0 
)

Static constructor of a 3D spatial image, from an vector of 2D images. Images may or may not have channels.

Date
2014/Apr/11
Parameters
img_vectorvector of images.
new_pixel_sizePixel dimension of the new space.
Returns
Resultant merged 3D spatial image.
Warning
Images in vector must have the same dimension sizes.
template<class D >
Image< D > Bial::ImageOp::RemoveFrame ( const Image< D > &  img,
const Vector< size_t > &  low_coord,
const Vector< size_t > &  hgh_coord 
)

Computes and returns image without the frame given by lower and higher coordinates.

Date
2014/Jan/07
Parameters
imgInput image.
low_coordLower coordinates of the frame.
hgh_coordHigher coordinates of the frame.
Returns
Image without the frame.
Warning
none.
template<class D >
Image< D > Bial::ImageOp::RemoveFrame ( const Image< D > &  img,
size_t  width 
)

Computes and returns image without the frame.

Date
2014/Jan/16
Parameters
imgInput image.
widthFrame width.
Returns
Image without the frame.
Warning
none.
template<class D >
Image< D > Bial::ImageOp::Resize ( const Image< D > &  mat,
const Vector< size_t > &  new_min,
const Vector< size_t > &  new_max 
)

Returns a submatrix from this matrix. If this matrix has more dimensions than the input, than all elements of these Dimensions are included in the submatrix.

Date
2013/Oct/22
Parameters
new_minVector containing the coord. of the begin of the sub_matrix dimensions
new_maxVector containing the coord. of the end of the sub_matrix dimensions
Returns
A submatrix with given coordinates.
Warning
The input vectors can not have more coordinates than this matrix.
template<class D >
Image< D > Bial::ImageOp::Resize ( const Image< D > &  mat,
const std::string &  coordinates 
)

Returns a submatrix from this matrix. The coordinates string must be given in a similar way as used by MatLab, or in some other variations.

Examples:
img( "1, 1:2 )" = Submatrix with column 1 and rows 1 and 2.
img( "1:, :2 )" = Submatrix with columns 1 to img.size( 0 ) and rows 0 to 2.
img( "1:, : )" = Submatrix with columns 1 to img.size( 0 ) and all rows.

If this matrix has more dimensions than the input string, than all elements of these dimensions are included in the submatrix.

Date
2013/Oct/03
Parameters
coordinatesCoordinates in this matrix to be used to generate the submatrix.
Returns
A submatrix with given coordinates.
Warning
The input string can not have more coordinates than this matrix.
template<class D >
std::tuple< Vector< size_t >, Vector< size_t > > Bial::ImageOp::ROI ( const Image< D > &  img)

Computes lower and higher coordinates of the region of interest (ROI). The ROI is the smallest box that contains all non-zero pixels.

Date
2014/Jan/07
Parameters
imgInput image.
Returns
Lower and higher coordinates of the region of interest (ROI).
Warning
none.
template<class D >
Vector< Image< D > > Bial::ImageOp::Split ( const Image< D > &  img,
size_t  dimension 
)

Create a vector of ( dim < N )-D images from an N-D image.

Date
2013/Oct/23
Parameters
imgA 3D or 4D input image.
dimensionDimension of the image to be split in vectors.
Returns
An image vector with split images.
Warning
.
template<class D >
Image< D > Bial::ImageOp::SwapDims ( const Image< D > &  img,
size_t  dim_0,
size_t  dim_1,
bool  invert_dir_0 = false,
bool  invert_dir_1 = false 
)

Computes the image resultant from swapping dim_0 with dim_1.

Date
2014/Jan/07
Parameters
imgInput image.
dim_0A valid dimension of the image.
dim_1Another valid dimension of the image.
invert_dir_0Wheather dim_0 should be inverted or not.
invert_dir_1Wheather dim_1 should be inverted or not.
Returns
Dimension inverted image
Warning
Works only to swap spatial dimensions.