module #include "diplib.h"
Image The dip::Image
class and types that provide a view into it.
Classes
-
class dip::
ExternalInterface abstract - Support for external interfaces.
-
class dip::
AlignedAllocInterface dip::ExternalInterface
that allocates aligned data.-
class dip::
CoordinatesComputer - Computes pixel coordinates based on an index or offset.
-
class dip::
Image - Represents an image with all associated information.
-
class dip::
Tensor - Describes the shape of a tensor, but doesn’t actually contain tensor data.
Aliases
-
using dip::
DataSegment = std::shared_ptr<void> - A
dip::Image
holds a shared pointer to the data segment using this type. -
using dip::
ImageArray = std::vector<Image> - An array of images
-
using dip::
ImageRefArray = std::vector<std::reference_wrapper<Image>> - An array of image references
-
using dip::
ImageConstRefArray = std::vector<std::reference_wrapper<const Image>> - An array of const image references
Functions
-
auto dip::
NonOwnedRefToDataSegment(void* ptr) -> dip::DataSegment - This function converts a pointer to a
dip::DataSegment
that does not own the data pointed to. -
auto dip::
NonOwnedRefToDataSegment(void const* ptr) -> dip::DataSegment - This function converts a pointer to a
dip::DataSegment
that does not own the data pointed to. -
auto dip::
Alias(dip::Image const& img1, dip::Image const& img2) -> bool - Calls
img1.Aliases( img2 )
. Seedip::Image::Aliases
. -
void dip::
DefineROI(dip::Image const& src, dip::Image& dest, dip::UnsignedArray origin = {}, dip::UnsignedArray sizes = {}, dip::UnsignedArray spacing = {}) - Makes a new image object pointing to same pixel data as
src
, but with different origin, strides and size. -
void dip::
Copy(dip::Image const& src, dip::Image& dest) - Copies samples over from
src
todest
, identical to thedip::Image::Copy
method. -
void dip::
Copy(dip::Image::View const& src, dip::Image& dest) - Copies samples over from
src
todest
, identical to thedip::Image::Copy
method. -
void dip::
Copy(dip::Image const& src, dip::Image::View& dest) - Copies samples over from
src
todest
, identical to thedip::Image::View::Copy
method. -
void dip::
Copy(dip::Image::View const& src, dip::Image::View& dest) - Copies samples over from
src
todest
, identical to thedip::Image::View::Copy
method. -
void dip::
CopyFrom(dip::Image const& src, dip::Image& dest, dip::Image const& srcMask) - Copies the pixels selected by
srcMask
insrc
over todest
.dest
will be a 1D image. -
void dip::
CopyFrom(dip::Image const& src, dip::Image& dest, dip::IntegerArray const& srcOffsets) - Copies the pixels selected by
srcOffsets
over fromsrc
todest
.dest
will be a 1D image. -
void dip::
CopyTo(dip::Image const& src, dip::Image& dest, dip::Image const& destMask) - Copies all pixels from
src
over to the pixels selected bydestMask
indest
.dest
must be forged. -
void dip::
CopyTo(dip::Image const& src, dip::Image& dest, dip::IntegerArray const& destOffsets) - Copies all pixels from
src
over to the pixels selected bydestOffsets
indest
.dest
must be forged. -
void dip::
ExpandTensor(dip::Image const& src, dip::Image& dest) - Copies samples over from
src
todest
, expanding the tensor so it’s a standard, column-major matrix. -
void dip::
Convert(dip::Image const& src, dip::Image& dest, dip::DataType dt) - Copies samples over from
src
todest
, with data type conversion. -
auto dip::
CreateImageRefArray(dip::ImageArray& imar) -> dip::ImageRefArray - Creates a
dip::ImageRefArray
from adip::ImageArray
. -
auto dip::
CreateImageConstRefArray(dip::ImageArray const& imar) -> dip::ImageConstRefArray - Creates a
dip::ImageConstRefArray
from adip::ImageArray
.
Operators
-
auto dip::
operator<<(std::ostream& os, dip::Image const& img) -> std::ostream& - You can output a
dip::Image
tostd::cout
or any other stream. Some information about the image is printed. -
auto dip::
operator<<(std::ostream& os, dip::Image::Sample const& sample) -> std::ostream& - You can output a
dip::Image::Sample
tostd::cout
or any other stream. It is printed like any numeric value of the same type. -
auto dip::
operator+(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Arithmetic operator, element-wise.
-
auto dip::
operator-(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Arithmetic operator, element-wise.
-
auto dip::
operator*(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Arithmetic operator, tensor multiplication.
-
auto dip::
operator/(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Arithmetic operator, element-wise.
-
auto dip::
operator%(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Arithmetic operator, element-wise.
-
auto dip::
operator&(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Bit-wise operator, element-wise.
-
auto dip::
operator|(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Bit-wise operator, element-wise.
-
auto dip::
operator^(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> dip::Image::Pixel - Bit-wise operator, element-wise.
-
auto dip::
operator-(dip::Image::Pixel const& in) -> dip::Image::Pixel - Unary operator, element-wise.
-
auto dip::
operator~(dip::Image::Pixel const& in) -> dip::Image::Pixel - Bit-wise unary operator operator.
-
auto dip::
operator!(dip::Image::Pixel const& in) -> dip::Image::Pixel - Boolean unary operator, element-wise.
-
auto dip::
operator==(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> bool - Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
-
template<typename T, typename <SFINAE>>auto dip::
operator!=(dip::Image::Pixel const& lhs, T const& rhs) -> bool - Comparison operator, equivalent to
!(lhs==rhs)
. -
auto dip::
operator<(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> bool - Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
-
auto dip::
operator>(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> bool - Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
-
auto dip::
operator<=(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> bool - Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
-
auto dip::
operator>=(dip::Image::Pixel const& lhs, dip::Image::Pixel const& rhs) -> bool - Comparison operator, can only be true if the two pixels have compatible number of tensor elements.
-
auto dip::
operator<<(std::ostream& os, dip::Image::Pixel const& pixel) -> std::ostream& - You can output a
dip::Image::Pixel
tostd::cout
or any other stream. It is printed as a sequence of values, prepended with “Pixel with values:”. -
auto dip::
operator<<(std::ostream& os, dip::Tensor const& tensor) -> std::ostream& - Prints information about the tensor.
Class documentation
class dip:: CoordinatesComputer
Computes pixel coordinates based on an index or offset.
Objects of this class are returned by dip::Image::OffsetToCoordinatesComputer
and dip::Image::IndexToCoordinatesComputer
, and act as functors.
Call it with an offset or index (depending on which function created the
functor), and it will return the coordinates:
auto coordComp = img.OffsetToCoordinatesComputer(); auto coords1 = coordComp( offset1 ); auto coords2 = coordComp( offset2 ); auto coords3 = coordComp( offset3 );
Note that the coordinates must be inside the image domain, if the offset given does not correspond to one of the image’s pixels, the result is meaningless.