dml namespace
The dml namespace contains the interface between MATLAB and DIPlib.
The functions and classes defined in this namespace are meant to be used in MATLAB MEX-files.
Classes
- class MatlabInterface
- This class is the
dip::ExternalInterfacefor the MATLAB interface. more... - class streambuf
- An output stream buffer for MEX-files. more...
Enums
- enum class ArrayConversionMode: dip::uint8
dml::GetImagecan optionally turn an input numeric array to a tensor image. If the numeric array is a short vector (up to 5 elements) or a small matrix (up to 5x5 elements) it will be seen as a 0D tensor image. more...- enum class GetImageMode: dip::uint8
dml::GetImagecan optionally create a shared copy of the inputmxArray, which extends its lifetime. This is useful if the MEX-file needs to keep a reference to the object. more...
Functions
- auto CreateDouble2Vector(dip::dfloat v0, dip::dfloat v1) -> mxArray*
- Create a two-element mxArray and write the two values in it.
- auto GetArray(bool in) -> mxArray*
- Convert an boolean from
booltomxArrayby copy. - auto GetArray(dip::uint in) -> mxArray*
- Convert an unsigned integer from
dip::uinttomxArrayby copy. - auto GetArray(dip::sint in) -> mxArray*
- Convert a signed integer from
dip::sinttomxArrayby copy. - auto GetArray(dip::dfloat in) -> mxArray*
- Convert a floating-point number from
dip::dfloattomxArrayby copy. - auto GetArray(dip::dcomplex in) -> mxArray*
- Convert a complex floating-point number from
dip::dcomplextomxArrayby copy. -
template<typename T, typename <SFINAE>>auto GetArray(dip::DimensionArray const& in) -> mxArray*
- Convert a numeric array from
dip::DimensionArraytomxArrayby copy. Works fordip::UnsignedArray,dip::IntegerArrayanddip::FloatArray. - auto GetArray(dip::CoordinateArray const& in) -> mxArray*
- Convert a coordinates array from
mxArraytodip::CoordinateArrayby copy. more... - auto GetArray(dip::String const& in) -> mxArray*
- Convert a string from
dip::StringtomxArrayby copy. - auto GetArray(dip::StringArray const& in) -> mxArray*
- Convert a string array from
dip::StringArraytomxArrayby copy. - auto GetArray(dip::Image::Sample const& in) -> mxArray*
- Convert a sample from
dip::Image::SampletomxArrayby copy. - auto GetArray(dip::Image::Pixel const& in) -> mxArray*
- Convert a set of samples from
dip::Image::PixeltomxArrayby copy. - auto GetArray(dip::PixelSize const& pixelSize) -> mxArray*
- Convert a pixel size object
dip::PixelSizetomxArrayby copy. - auto GetArray(dip::FileInformation const& fileInformation) -> mxArray*
- Convert a
dip::FileInformationstructure tomxArrayby copy. - auto GetArray(dip::Distribution const& in) -> mxArray*
- Convert a
dip::Distributionobject tomxArrayby copy. - auto GetArray(dip::Image const& img, bool doNotSetToTrue = false) -> mxArray*
- Find the
mxArraythat holds the data for thedip::Imageimg, and create a MATLABdip_imageobject around it. - auto GetArrayAsArray(dip::Image const& img, bool doNotSetToTrue = false) -> mxArray*
- Find the
mxArraythat holds the data for thedip::Imageimg. - auto GetArrayUnicode(dip::String const& in) -> mxArray*
- Convert a UTF-8 encoded string from
dip::StringtomxArrayby copy. - auto GetBoolean(mxArray const* mx) -> bool
- Convert a boolean (logical) from
mxArraytoboolby copy. Accepts"yes"and"no"as well. - auto GetBooleanArray(mxArray const* mx) -> dip::BooleanArray
- Convert a boolean (logical) array from
mxArraytodip::BooleanArrayby copy. - auto GetComplex(mxArray const* mx) -> dip::dcomplex
- Convert a complex floating-point number from
mxArraytodip::dcomplexby copy. - auto GetCoordinateArray(mxArray const* mx) -> dip::CoordinateArray
- Convert a coordinates array from
mxArraytodip::CoordinateArrayby copy. more... - auto GetFloat(mxArray const* mx) -> dip::dfloat
- Convert a floating-point number from
mxArraytodip::dfloatby copy. - auto GetFloatArray(mxArray const* mx) -> dip::FloatArray
- Convert a floating-point array from
mxArraytodip::FloatArrayby copy. - auto GetFloatCoordinateArray(mxArray const* mx) -> dip::FloatCoordinateArray
- Convert a coordinates array from
mxArraytodip::FloatCoordinateArrayby copy. more... - auto GetHistogramConfiguration(mxArray const* mx) -> dip::Histogram::Configuration
- Reads a histogram
Configurationstruct from a cellmxArraywith key-value pairs. - auto GetImage(mxArray const* mx, dml::GetImageMode mode = GetImageMode::REFERENCE, dml::ArrayConversionMode conversion = ArrayConversionMode::STANDARD) -> dip::Image
- Passing an
mxArrayto DIPlib, keeping ownership of the data. more... - auto GetImageArray(mxArray const* mx) -> dip::ImageArray
- Convert a cell array of images from
mxArraytodip::ImageArray, usingdml::GetImagefor each element of the cell array. - auto GetInteger(mxArray const* mx) -> dip::sint
- Convert a signed integer from
mxArraytodip::sintby copy. - auto GetIntegerArray(mxArray const* mx) -> dip::IntegerArray
- Convert a signed integer array from
mxArraytodip::IntegerArrayby copy. -
template<typename K>auto GetKernel(int nrhs, mxArray const*[] prhs, int& index, dip::uint nDims) -> K
- Gets a structuring element or kernel from the input argument(s) at
index, andindex+1.indexis updated to point to the next unused input argument. - auto GetPixel(mxArray const* mx) -> dip::Image::Pixel
- Convert a numeric array from
mxArraytodip::Image::Pixelby copy. -
template<typename T>auto GetPreference(dip::String const& preference) -> T
- Get the value of a property, equivalent to calling
dipgetprefin MATLAB. more... - auto GetProcessArray(mxArray const* mx, dip::uint nDims) -> dip::BooleanArray
- Convert an unsigned integer
mxArrayto adip::BooleanArray, where elements of the input are indices where the output array is set. The output array hasnDimselements. In MATLAB, dimensions start with 1. Ifmxis empty, all dimensions are to be processed. - auto GetRange(mxArray const* mx) -> dip::Range
- Convert an integer array from
mxArraytodip::Rangeby copy. more... - auto GetRangeArray(mxArray const* mx) -> dip::RangeArray
- Convert a cell array of integer array from
mxArraytodip::RangeArrayby copy. -
template<typename T>auto GetStdVector(mxArray const* mx) -> std::vector<T>
- Convert a 1D real-valued numeric array from
mxArraytostd::vector< T >by copy. Data is cast as usual from doubles to the target type (seedip::clamp_cast). - auto GetStdVectorOfFloats(mxArray const* mx) -> std::vector<dip::dfloat> deprecated
- Convert a floating-point array from
mxArraytostd::vector<dip::dfloat>by copy. - auto GetString(mxArray const* mx) -> dip::String
- Convert a string from
mxArraytodip::Stringby copy. - auto GetStringArray(mxArray const* mx) -> dip::StringArray
- Convert a cell array of strings from
mxArraytodip::StringArrayby copy. - auto GetStringSet(mxArray const* mx) -> dip::StringSet
- Convert a cell array of string from
mxArraytodip::StringSetby copy. - auto GetStringUnicode(mxArray const* mx) -> dip::String
- Convert a string from
mxArrayto a UTF-8 encodeddip::Stringby copy. - auto GetUnsigned(mxArray const* mx) -> dip::uint
- Convert an unsigned integer from
mxArraytodip::uintby copy. - auto GetUnsignedArray(mxArray const* mx) -> dip::UnsignedArray
- Convert an unsigned integer array from
mxArraytodip::UnsignedArrayby copy. - auto HandleNewStyleString(mxArray const* mx) -> mxArray const*
- If
mxis a “string” class object, return a char vector or a cell array of char vectors. - auto IsScalar(mxArray const* mx) -> bool
- True if array is scalar (has single value)
- auto IsString(mxArray const* mx) -> bool
- True if
mxis a string (char vector or string class) - auto IsVector(mxArray const* mx) -> bool
- True if empty or a one-dimensional array