/home/oan/prosjekt/gotools/segmentation/gpl_distro/lsseg_1.0_gpl/include/simple_tools.h File Reference

Contains misc. utilities for working with Images. More...

#include "Image.h"
#include "LevelSetFunction.h"
#include "Mask.h"
#include "ParzenDistributionForce.h"
#include "simple_tools_templates.h"

Go to the source code of this file.

Namespaces

namespace  lsseg

Enumerations

enum  lsseg::SEG_REGION { lsseg::SEG_NEGATIVE = 0, lsseg::SEG_POSITIVE }

Functions

void lsseg::negate (Image< double > &img, double min=0, double max=255)
 make an Image<double> a negative of itself.
void lsseg::rescale (Image< double > &img, double cur_min, double cur_max, double to_min=0, double to_max=255)
 rescale the pixel range of an Image<double> so that its pixels spans a different range than before rescaling
void lsseg::rescale_channels (Image< double > &img, double to_min=0, double to_max=255)
 rescale the pixel ranges of each of an image's channels to a user-specified interval
void lsseg::clip (Image< double > &img, double min, double max)
 clip the pixel range of a image to a certain interval
template<typename T>
void lsseg::to_grayscale (Image< T > &img)
 convert a three-channel Image (RGB of double, int, etc.) to greyscale.
void lsseg::transpose (Image< double > &img)
 transpose the x and y dimensions of an Image<double>
void lsseg::transpose (const Image< double > &img, Image< double > &target)
 Generate an Image<double> that is the transpose of another Image<double>.
void lsseg::horizontal_sinusoidal_bands (LevelSetFunction &img, int num_bands, double phase=0)
 Initializes a LevelSetFunction with horizontal bands created by a sine function.
void lsseg::rectangle (LevelSetFunction &img, double xmin_ratio, double xmax_ratio, double ymin_ratio, double ymax_ratio, double zmin_ratio=0, double zmax_ratio=1)
 Initializes a LevelSetFunction to become 1 everywhere, except for an interior rectangular domain where the LevelSetFunction has the value -1.
void lsseg::sphere (LevelSetFunction &img, double relrad,double xrelpos,double yrelpos,double zrelpos=0)
 Initializes a LevelSetFunction to become the signed distance function from a point $P$ in its domain minus some fixed value, thus its zero-set becomes a circle around $P$.
void lsseg::set_from_parzen (LevelSetFunction &img, const ParzenDistributionForce pf, const Mask *m=0)
 Initializes a LevelSetFunction to become a function with two values, 1 and -1, corresponding to the domains in which the force defined by the pf argument is positive or negative.
void lsseg::init_voronoi_regions (LevelSetFunction *regs, const double *center_coords,int num_regions, bool three_d=false)
 Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a voronoi subdivision of the domain. The points defining the voronoi subdivision is given by the user.
void lsseg::random_scattered_voronoi (LevelSetFunction *regs, int num_regs, int num_fragments)
 Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a voronoi subdivision of the domain. The points defining the voronoi subdivision are randomly generated.
void lsseg::multiregion_bands (LevelSetFunction *regs, int num_regs, int pixel_bandwidth)
 Initializes a set of LevelSetFunctions defined on a common domain so that their closed regions together constitute a subdivision on the domain, and where each such region consists of a set of horizontal bands of a certain width along the y-direction.
void lsseg::make_border_mask (const LevelSetFunction &phi, Mask &target, int width=2, const Mask *geom_mask=0)
 Generate a Mask over a domain, where the active region of the Mask is specified as the region of a certain width (in pixels) around the zero-set of a LevelSetFunction defined on the same domain.
void lsseg::mask_from_segmentation (const LevelSetFunction &phi, Mask &target, SEG_REGION reg)
 Generate a Mask over a domain, where the active region of the Mask is specified as the region defined by the negative (or positive) region of a LevelSetFunction over the same domain.
void lsseg::read_image_sequence (std::istream &image_list, Image< double > &result, bool convert_to_grayscale=false)
 Read a set of 2D-image files and write the result into a 3D Image<double>, where the read images will be stacked along the z-coordinate direction.
template<typename ImgType>
void lsseg::resample_into (const ImgType &src, ImgType &target, bool linear=true)
 Resample an image, using nearest-pixel or linear interpolation.
template<typename ImgType>
void lsseg::downsample_series (const ImgType &input, std::vector< ImgType > &result, int min_num_pixels, bool downscale_z=false, double downscale_factor=2, bool to_grayscale=false, bool linear=true)
 Create a sequence of progressively smaller, resampled copies of a reference image.
unsigned long int lsseg::nonzeroes (const Image< int > &img)
 Count the number of nonzero pixels of an Image<int>.
double lsseg::nonzero_ratio (const Image< int > &img)
 Calculate the ratio of the number pixels with a nonzero value to the total number of pixels in an Image<int>.
unsigned long int lsseg::positives (const Image< double > &img)
 Count the number of pixels with a nonnegative value in an Image<int>.
double lsseg::positive_ratio (const Image< double > &img)
 Calculate the ratio of the number of pixels with a nonnegative value to the total number of pixels in an Image<double>.
unsigned long int lsseg::negatives (const Image< double > &img)
 Count the number of pixels with a negative value in an Image<int>.
double lsseg::negative_ratio (const Image< double > &img)
 Calculate the ratio of the number of pixels with a negative value to the total number of pixels in an Image<double>.


Detailed Description

Contains misc. utilities for working with Images.

Definition in file simple_tools.h.


Generated on Tue Nov 28 18:35:47 2006 for lsseg by  doxygen 1.4.7