DGtalTools
1.2.0
|
Functions | |
template<typename Calculus , DGtal::Dimension dim, DGtal::Duality duality> | |
DGtal::LinearOperator< Calculus, dim, duality, dim, duality > | diagonal (const DGtal::KForm< Calculus, dim, duality > &kform) |
template<typename Calculus , DGtal::Dimension dim, DGtal::Duality duality> | |
void | squares (DGtal::KForm< Calculus, dim, duality > &kform) |
template<typename Calculus , DGtal::Dimension dim, DGtal::Duality duality> | |
DGtal::LinearOperator< Calculus, dim, duality, dim, duality > | squaredDiagonal (const DGtal::KForm< Calculus, dim, duality > &kform) |
template<typename Image > | |
void | writePixel (Image &image, typename Image::Point pt, typename Image::Value val, int pixel_size=1) |
template<typename Image > | |
void | writePrimalLinel (Image &image, typename Image::Point pt, typename Image::Value val, int pixel_size=1) |
template<typename Image > | |
void | writeDualLinel (Image &image, typename Image::Point pt, typename Image::Value val, int pixel_size=1) |
template<typename Calculus , typename AnyForm2 , typename Image , typename Function > | |
void | form2ToImage (const Calculus &calculus, const AnyForm2 &u, Image &image, const Function &functor, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Form1 , typename Image , typename Function , typename Predicate > | |
void | form1ToImage (const Calculus &calculus, const Form1 &v, bool primal, Image &image, const Function &functor, const Predicate &predicate, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image , typename Function , typename Predicate > | |
void | dualForm1ToImage (const Calculus &calculus, const typename Calculus::DualForm1 &v, Image &image, const Function &functor, const Predicate &predicate, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image , typename Function , typename Predicate > | |
void | primalForm1ToImage (const Calculus &calculus, const typename Calculus::PrimalForm1 &v, Image &image, const Function &functor, const Predicate &predicate, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename AnyForm2 , typename Image , typename Function > | |
void | threeForms2ToImage (const Calculus &calculus, const AnyForm2 &u0, const AnyForm2 &u1, const AnyForm2 &u2, Image &image, const Function &functor, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename AnyForm2 , typename Image > | |
void | form2ToGreyLevelImage (const Calculus &calculus, const AnyForm2 &u, Image &image, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image > | |
void | primalForm1ToGreyLevelImage (const Calculus &calculus, const typename Calculus::PrimalForm1 &v, Image &image, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image > | |
void | dualForm1ToGreyLevelImage (const Calculus &calculus, const typename Calculus::DualForm1 &v, Image &image, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image > | |
void | primalForm1ToRGBColorImage (const Calculus &calculus, const typename Calculus::PrimalForm1 &v, Image &image, Color color, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename Image > | |
void | dualForm1ToRGBColorImage (const Calculus &calculus, const typename Calculus::DualForm1 &v, Image &image, Color color, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
template<typename Calculus , typename AnyForm2 , typename Image > | |
void | threeForms2ToRGBColorImage (const Calculus &calculus, const AnyForm2 &u0, const AnyForm2 &u1, const AnyForm2 &u2, Image &image, double cut_low=0.0, double cut_up=1.0, int pixel_size=1) |
DGtal::LinearOperator<Calculus, dim, duality, dim, duality> DGtal::functions::dec::diagonal | ( | const DGtal::KForm< Calculus, dim, duality > & | kform | ) |
Builds a diagonal linear operator from a k-form. These operators arise naturally when differentiating with respect to another variable (e.g. d/dx (vx)^t (vx) = diag(v^2) x).
[in] | kform | any kform w. |
Calculus | any discrete exterior calculus. |
dim | the dimension of the form. |
duality | either PRIMAL for a primal form or DUAL for a dual form. |
Definition at line 72 of file DECImageHelpers.h.
Referenced by squaredDiagonal().
void DGtal::functions::dec::dualForm1ToGreyLevelImage | ( | const Calculus & | calculus, |
const typename Calculus::DualForm1 & | v, | ||
Image & | image, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output a dual 1-form into a grey-level image.
Displays the dual 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. If this value is belows 0.25, it is written in the image as a "line" of size pixel_size x 1 or 1 x pixel_size, depending on position.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any dual 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Definition at line 577 of file DECImageHelpers.h.
References dualForm1ToImage().
void DGtal::functions::dec::dualForm1ToImage | ( | const Calculus & | calculus, |
const typename Calculus::DualForm1 & | v, | ||
Image & | image, | ||
const Function & | functor, | ||
const Predicate & | predicate, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Displays the dual 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to image values with the function functor. They are written in the image as "lines" of size pixel_size x 1 or 1 x pixel_size, depending on position and duality.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any dual 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
functor | the function transforming scalar values to image values. | |
predicate | the predicate telling for a value if it must be displayed (returns true in this case). | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Function | any function type (double) -> typename Image::Value to convert form value to Image value. |
Predicate | any function type (double) -> bool to select 1-forms to display. |
Definition at line 359 of file DECImageHelpers.h.
References form1ToImage().
Referenced by dualForm1ToGreyLevelImage(), and dualForm1ToRGBColorImage().
void DGtal::functions::dec::dualForm1ToRGBColorImage | ( | const Calculus & | calculus, |
const typename Calculus::DualForm1 & | v, | ||
Image & | image, | ||
Color | color, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output a dual 1-form into a color image.
Displays the dual 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. If this value is belows 0.25, it is written in the image as a "line" of size pixel_size x 1 or 1 x pixel_size, depending on position, and of color color.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any dual 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
color | the color for displaying 1-forms below 0.25. | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Definition at line 655 of file DECImageHelpers.h.
References dualForm1ToImage().
void DGtal::functions::dec::form1ToImage | ( | const Calculus & | calculus, |
const Form1 & | v, | ||
bool | primal, | ||
Image & | image, | ||
const Function & | functor, | ||
const Predicate & | predicate, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Displays the primal or dual 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to image values with the function functor. They are written in the image as "lines" of size pixel_size x 1 or 1 x pixel_size, depending on position and duality.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any primal 1-form defined in calculus if primal is true, otherwise a dual 1-form. | |
primal | tells if v is a primal 1-form (true), or a dual 1-form (false). | |
[in,out] | image | the image where v is written. |
functor | the function transforming scalar values to image values. | |
predicate | the predicate telling for a value if it must be displayed (returns true in this case). | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Form1 | either a primal 1-form if primal is true, or dual 1-form is primal is false. |
Image | any image type (see concepts::CImage). |
Function | any function type (double) -> typename Image::Value to convert form value to Image value. |
Predicate | any function type (double) -> bool to select 1-forms to display. |
Definition at line 297 of file DECImageHelpers.h.
References writeDualLinel(), and writePrimalLinel().
Referenced by dualForm1ToImage(), and primalForm1ToImage().
void DGtal::functions::dec::form2ToGreyLevelImage | ( | const Calculus & | calculus, |
const AnyForm2 & | u, | ||
Image & | image, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output a 2-form into a grey-level image.
Displays the 2-form u in the given image. Scalar values of u are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. They are written in the image as grey-level "pixels" of size pixel_size x pixel_size.
calculus | the discrete exterior calculus containing the 2-form u. | |
u | any primal or dual 2-form defined in calculus. | |
[in,out] | image | the image where u is written. |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 2-form is mapped into image as pixel_size x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
AnyForm2 | either a primal 2-form type or a dual 2-form type of the given Calculus. |
Image | any image type (see concepts::CImage). |
Definition at line 505 of file DECImageHelpers.h.
References form2ToImage().
void DGtal::functions::dec::form2ToImage | ( | const Calculus & | calculus, |
const AnyForm2 & | u, | ||
Image & | image, | ||
const Function & | functor, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Displays the 2-form u in the given image. Scalar values of u are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to image values with the function functor. They are written in the image as "pixels" of size pixel_size x pixel_size.
calculus | the discrete exterior calculus containing the 2-form u. | |
u | any primal or dual 2-form defined in calculus. | |
[in,out] | image | the image where u is written. |
functor | the function transforming scalar values to image values. | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 2-form is mapped into image as pixel_size x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
AnyForm2 | either a primal 2-form type or a dual 2-form type of the given Calculus. |
Image | any image type (see concepts::CImage). |
Function | any function type (double) -> typename Image::Value to convert form value to Image value. |
Definition at line 237 of file DECImageHelpers.h.
References writePixel().
Referenced by form2ToGreyLevelImage().
void DGtal::functions::dec::primalForm1ToGreyLevelImage | ( | const Calculus & | calculus, |
const typename Calculus::PrimalForm1 & | v, | ||
Image & | image, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output a primal 1-form into a grey-level image.
Displays the primal 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. If this value is belows 0.25, it is written in the image as a "line" of size pixel_size x 1 or 1 x pixel_size, depending on position.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any primal 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Definition at line 539 of file DECImageHelpers.h.
References primalForm1ToImage().
void DGtal::functions::dec::primalForm1ToImage | ( | const Calculus & | calculus, |
const typename Calculus::PrimalForm1 & | v, | ||
Image & | image, | ||
const Function & | functor, | ||
const Predicate & | predicate, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Displays the primal 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to image values with the function functor. They are written in the image as "lines" of size pixel_size x 1 or 1 x pixel_size, depending on position and duality.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any primal 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
functor | the function transforming scalar values to image values. | |
predicate | the predicate telling for a value if it must be displayed (returns true in this case). | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Function | any function type (double) -> typename Image::Value to convert form value to Image value. |
Predicate | any function type (double) -> bool to select 1-forms to display. |
Definition at line 396 of file DECImageHelpers.h.
References form1ToImage().
Referenced by primalForm1ToGreyLevelImage(), and primalForm1ToRGBColorImage().
void DGtal::functions::dec::primalForm1ToRGBColorImage | ( | const Calculus & | calculus, |
const typename Calculus::PrimalForm1 & | v, | ||
Image & | image, | ||
Color | color, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output a primal 1-form into a color image.
Displays the primal 1-form v in the given image. Scalar values of v are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. If this value is belows 0.25, it is written in the image as a "line" of size pixel_size x 1 or 1 x pixel_size, depending on position, and of color color.
calculus | the discrete exterior calculus containing the 1-form v. | |
v | any primal 1-form defined in calculus. | |
[in,out] | image | the image where v is written. |
color | the color for displaying 1-forms below 0.25. | |
cut_low | every value of u below is set to cut_low. | |
cut_up | every value of u above is set to cut_up. | |
pixel_size | every value of a 1-form is mapped into image as pixel_size x 1 pixels or 1 x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
Image | any image type (see concepts::CImage). |
Definition at line 616 of file DECImageHelpers.h.
References primalForm1ToImage().
DGtal::LinearOperator<Calculus, dim, duality, dim, duality> DGtal::functions::dec::squaredDiagonal | ( | const DGtal::KForm< Calculus, dim, duality > & | kform | ) |
Builds a diagonal linear operator from a k-form and squares it. These operators arise naturally when differentiating with respect to another variable (e.g. d/dx (vx)^t (vx) = diag(v^2) x).
[in] | kform | any kform v |
Calculus | any discrete exterior calculus. |
dim | the dimension of the form. |
duality | either PRIMAL for a primal form or DUAL for a dual form. |
Definition at line 118 of file DECImageHelpers.h.
References diagonal(), and squares().
void DGtal::functions::dec::squares | ( | DGtal::KForm< Calculus, dim, duality > & | kform | ) |
Squares the given k-form.
[in,out] | kform | any kform. |
Calculus | any discrete exterior calculus. |
dim | the dimension of the form. |
duality | either PRIMAL for a primal form or DUAL for a dual form. |
Definition at line 99 of file DECImageHelpers.h.
Referenced by squaredDiagonal().
void DGtal::functions::dec::threeForms2ToImage | ( | const Calculus & | calculus, |
const AnyForm2 & | u0, | ||
const AnyForm2 & | u1, | ||
const AnyForm2 & | u2, | ||
Image & | image, | ||
const Function & | functor, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Displays the three 2-forms u0, u1, u2 in the given image. Scalar values of u0, u1, u2 are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to image values with the function functor. They are written in the image as "pixels" of size pixel_size x pixel_size.
calculus | the discrete exterior calculus containing the 2-forms u0, u1, u2. | |
u0 | any primal or dual 2-form defined in calculus. | |
u1 | any primal or dual 2-form defined in calculus. | |
u2 | any primal or dual 2-form defined in calculus. | |
[in,out] | image | the image where u is written. |
functor | the function transforming three scalar values to image values. | |
cut_low | every value of u0, u1, u2 below is set to cut_low. | |
cut_up | every value of u0, u1, u2 above is set to cut_up. | |
pixel_size | every value of 2-forms is mapped into image as pixel_size x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
AnyForm2 | either a primal 2-form type or a dual 2-form type of the given Calculus. |
Image | any image type (see concepts::CImage). |
Function | any function type (double,double,double) -> typename Image::Value to convert form value to Image value. |
Definition at line 433 of file DECImageHelpers.h.
References writePixel().
Referenced by threeForms2ToRGBColorImage().
void DGtal::functions::dec::threeForms2ToRGBColorImage | ( | const Calculus & | calculus, |
const AnyForm2 & | u0, | ||
const AnyForm2 & | u1, | ||
const AnyForm2 & | u2, | ||
Image & | image, | ||
double | cut_low = 0.0 , |
||
double | cut_up = 1.0 , |
||
int | pixel_size = 1 |
||
) |
Standard method to output three 2-forms into a RGB Color image.
Displays the three 2-forms u0, u1, u2 in the given image as RGB colors. Scalar values of u0, u1, u2 are first cut up and low according to cut_low and cut_up, and then rescaled according to max and min value. Then these values are transformed to RGB color image values (u0 defines the intensity of the red channel, u1 the green channel, u2, the blue channel). They are written in the image as "pixels" of size pixel_size x pixel_size.
calculus | the discrete exterior calculus containing the 2-forms u0, u1, u2. | |
u0 | any primal or dual 2-form defined in calculus. | |
u1 | any primal or dual 2-form defined in calculus. | |
u2 | any primal or dual 2-form defined in calculus. | |
[in,out] | image | the image where u is written. |
cut_low | every value of u0, u1, u2 below is set to cut_low. | |
cut_up | every value of u0, u1, u2 above is set to cut_up. | |
pixel_size | every value of 2-forms is mapped into image as pixel_size x pixel_size pixels. |
Calculus | any discrete exterior calculus type. |
AnyForm2 | either a primal 2-form type or a dual 2-form type of the given Calculus. |
Image | any image type (see concepts::CImage). |
Definition at line 698 of file DECImageHelpers.h.
References threeForms2ToImage().
void DGtal::functions::dec::writeDualLinel | ( | Image & | image, |
typename Image::Point | pt, | ||
typename Image::Value | val, | ||
int | pixel_size = 1 |
||
) |
Considers an image image to have pixels of size pixel_size x pixel_size, and writes the value val at the specified linel position pt.
[in,out] | image | any image of sufficient size. |
pt | a linel Khalimsky coordinates. | |
val | the value to write in pixel_size x 1 pixels (if horizontal) or 1 x pixel_size pixels (if vertical). | |
pixel_size | the chosen pixel_size (when 1, this is the normal setValue of an image). |
Image | any image type (see concepts::CImage). |
Definition at line 197 of file DECImageHelpers.h.
Referenced by form1ToImage().
void DGtal::functions::dec::writePixel | ( | Image & | image, |
typename Image::Point | pt, | ||
typename Image::Value | val, | ||
int | pixel_size = 1 |
||
) |
Considers an image image to have pixels of size pixel_size x pixel_size, and writes the value val at the specified pixel position pt.
[in,out] | image | any image of sufficient size. |
pt | a pixel coordinate (which is multiplied by pixel_size within). | |
val | the value to write in pixel_size x pixel_size pixels. | |
pixel_size | the chosen pixel_size (when 1, this is the normal setValue of an image). |
Image | any image type (see concepts::CImage). |
Definition at line 138 of file DECImageHelpers.h.
Referenced by form2ToImage(), and threeForms2ToImage().
void DGtal::functions::dec::writePrimalLinel | ( | Image & | image, |
typename Image::Point | pt, | ||
typename Image::Value | val, | ||
int | pixel_size = 1 |
||
) |
Considers an image image to have pixels of size pixel_size x pixel_size, and writes the value val at the specified linel position pt.
[in,out] | image | any image of sufficient size. |
pt | a linel Khalimsky coordinates. | |
val | the value to write in pixel_size x 1 pixels (if horizontal) or 1 x pixel_size pixels (if vertical). | |
pixel_size | the chosen pixel_size (when 1, this is the normal setValue of an image). |
Image | any image type (see concepts::CImage). |
Definition at line 166 of file DECImageHelpers.h.
Referenced by form1ToImage().