Helper functions useful for constructing CZI-metadata.
More...
#include <libCZI_Metadata.h>
|
static void | WriteImageSizeInformation (libCZI::ICziMetadataBuilder *builder, int width, int height) |
|
static void | WriteMIndexSizeInformation (libCZI::ICziMetadataBuilder *builder, int mSize) |
|
static void | WriteDimensionSize (libCZI::ICziMetadataBuilder *builder, libCZI::DimensionIndex dim, int size) |
|
static void | WriteFillWithSubBlockStatistics (libCZI::ICziMetadataBuilder *builder, const libCZI::SubBlockStatistics &statistics) |
|
static void | WriteDimInfoT_Interval (libCZI::ICziMetadataBuilder *builder, const libCZI::XmlDateTime *startTime, double startOffSet, double increment) |
|
static void | WriteDimInfoT_List (libCZI::ICziMetadataBuilder *builder, const libCZI::XmlDateTime *startTime, const std::function< double(int)> &funcGetOffsets) |
|
static void | WriteDimInfoZ_Interval (libCZI::ICziMetadataBuilder *builder, double startPos, double startOffSet, double increment) |
|
static void | WriteDimInfoZ_List (libCZI::ICziMetadataBuilder *builder, double startPos, const std::function< double(int)> &funcGetOffsets) |
|
static void | WriteGeneralDocumentInfo (libCZI::ICziMetadataBuilder *builder, const libCZI::GeneralDocumentInfo &info) |
|
static void | WriteScalingInfo (libCZI::ICziMetadataBuilder *builder, const libCZI::ScalingInfo &scalingInfo) |
|
static void | WriteScalingInfoEx (libCZI::ICziMetadataBuilder *builder, const libCZI::ScalingInfoEx &scalingInfo) |
|
static void | SetOrAddCustomKeyValuePair (libCZI::ICziMetadataBuilder *builder, const std::string &key, const libCZI::CustomValueVariant &value) |
|
static void | WriteDisplaySettings (libCZI::ICziMetadataBuilder *builder, const libCZI::IDisplaySettings *display_settings, const std::map< int, PixelType > *channel_pixel_type=nullptr) |
|
static void | WriteDisplaySettings (libCZI::ICziMetadataBuilder *builder, const libCZI::IDisplaySettings *display_settings, int channel_count, const std::map< int, PixelType > *channel_pixel_type=nullptr) |
|
static void | WriteDisplaySettings (libCZI::ICziMetadataBuilder *builder, const libCZI::IDisplaySettings *display_settings, int channel_count, const std::function< void(int, CoerceAdditionalInfoForChannelDisplaySettings &)> &coerce_additional_info_functor) |
|
Helper functions useful for constructing CZI-metadata.
◆ SetOrAddCustomKeyValuePair()
Helper function which is putting a set of key-value pairs into the XML-metadata at the position "Metadata/Information/CustomAttributes/KeyValue". An element with the specified "key"-name is created/overwritten in this node, and the value is put into this element as the value. Type of the written custom key-value pair is explicitly marked with attribute of the xml node, e.g. Type="String" if the type of value is string. Special case: If two custom key-value pairs have the same key name, the last pair would overwrite the xml node created by the previous pair.
- Parameters
-
[in] | builder | The metadata-builder object. |
| key | Key of the custom key-value pair. |
| value | Value of the custom key-value pair.
|
◆ WriteDimensionSize()
Writes the size-information for the specified dimension (to "Metadata/Information/Image/Size?").
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| dim | The dimension. |
| size | The size of the dimension. |
◆ WriteDimInfoT_Interval()
Writes the "dimension-T"-information ("Information/Dimensions/T") - this associates a timestamp with each T-coordinate. With this function we provide the timestamps for the equidistant case (= the difference between consecutive T-indices is constant). The difference is specified as "increment". It is possible to specify an offset for the first T-index, given as startOffset. An absolute time-point may be specified as startTime. Example: say, startOffSet is 1 and increment is 2. Then T=0 is associated with 1, T=1 with 1+2, T=2 with 1+2*2, T=3 with 1+2*3 and so on.
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| startTime | If non-null, the (absolute) start time. |
| startOffSet | The offset for the first timepoint (in units of seconds). If numeric_limits<double>::quiet_NaN() is specified, this parameter is ignored. |
| increment | The increment (in units of seconds). If numeric_limits<double>::quiet_NaN() is specified, this parameter is ignored. |
◆ WriteDimInfoT_List()
Writes the "dimension-T"-information ("Information/Dimensions/T") - this associates a timestamp with each T-coordinate. With this function we provide a list of timestamps.
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| startTime | If non-null, the (absolute) start time. |
| funcGetOffsets | A function which is called for providing the timestamp. The integer parameter is incremented with each call, starting with 0. The return value is the timestamp (in units of seconds). If numeric_limits<double>::quiet_NaN() is returned, the enumeration is ended. |
◆ WriteDimInfoZ_Interval()
static void libCZI::MetadataUtils::WriteDimInfoZ_Interval |
( |
libCZI::ICziMetadataBuilder * |
builder, |
|
|
double |
startPos, |
|
|
double |
startOffSet, |
|
|
double |
increment |
|
) |
| |
|
static |
Helper function in order to write the Dimension-Z information - as a an equal-distance sequence.
- Parameters
-
[in] | builder | The metadata-builder object. |
| startPos | The start position. |
| startOffSet | The offset of the first item in the sequence. |
| increment | The increment. |
◆ WriteDimInfoZ_List()
static void libCZI::MetadataUtils::WriteDimInfoZ_List |
( |
libCZI::ICziMetadataBuilder * |
builder, |
|
|
double |
startPos, |
|
|
const std::function< double(int)> & |
funcGetOffsets |
|
) |
| |
|
static |
Helper function in order to write the Dimension-Z information - as a an explicit list.
- Parameters
-
[in] | builder | The metadata-builder object. |
| startPos | The start position. |
| funcGetOffsets | The function which is called to retrieve the offset. The argument is incremented with each call (starting with 0); a return value of infinity or NaN will end the enumeration. |
◆ WriteDisplaySettings() [1/3]
Helper function which writes the specified display-settings into the specified metadata-builder. The display-settings XML-metadata-node will have as many channel-items as the highest channel-number found in the display-settings object. If there are nodes with name "Channel" existing (prior to calling this function) under the node "Metadata/DisplaySetting/Channels", they are removed (before adding new content). The argument 'channel_pixel_type' is optional. If it is specified, the pixel-type of the channel is written into the display-settings XML-metadata-node. This is not a mandatory piece of information, but was found to be useful in some cases.
- Parameters
-
[in] | builder | The metadata-builder object. |
| display_settings | The display settings. |
| channel_pixel_type | The map of the channel and its corresponding pixel type. |
◆ WriteDisplaySettings() [2/3]
Helper function which writes the specified display-settings into the specified metadata-builder. The display-settings XML-metadata-node will have as many channel-items as specified with the argument 'channel_count'. If there are nodes with name "Channel" existing (prior to calling this function) under the node "Metadata/DisplaySetting/Channels", they are removed (before adding new content). This function allows to coerce and control some additional information that is written to the XML-metadata-node.
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| display_settings | The display settings. |
| channel_count | The number of channels (which are constructed in the display-settings XML-metadata). |
| coerce_additional_info_functor | A functor which allows to mutate and/or control what additional information is written to the XML-metadata-node. |
◆ WriteDisplaySettings() [3/3]
Helper function which writes the specified display-settings into the specified metadata-builder. The display-settings XML-metadata-node will have as many channel-items as specified with the argument 'channel_count'. If there are nodes with name "Channel" existing (prior to calling this function) under the node "Metadata/DisplaySetting/Channels", they are removed (before adding new content). The argument 'channel_pixel_type' is optional. If it is specified, the pixel-type of the channel is written into the display-settings XML-metadata-node. This is not a mandatory piece of information, but was found to be useful in some cases.
- Parameters
-
[in] | builder | The metadata-builder object. |
| display_settings | The display settings. |
| channel_count | The number of channels (which are constructed in the display-settings XML-metadata). |
| channel_pixel_type | The map of the channel and its corresponding pixel type. |
◆ WriteFillWithSubBlockStatistics()
Uses the specified statistics-data in order to write the "size"-information-
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| statistics | The subblock-statistics. |
◆ WriteGeneralDocumentInfo()
Helper function which writes the information from the specified "GeneralDocumentInfo" into the metadata-builder object.
- Parameters
-
[in] | builder | The metadata-builder object. |
| info | The general-document-information to be written into the metadata-builder object. |
◆ WriteImageSizeInformation()
Writes the nodes ""Metadata/Information/Image/SizeX" and ""Metadata/Information/Image/SizeY".
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| width | The width (=SizeX). |
| height | The height (=SizeY). |
◆ WriteMIndexSizeInformation()
Writes the node ""Metadata/Information/Image/SizeM".
- Parameters
-
[in,out] | builder | The metadata-builder object. |
| mSize | The M-size. |
◆ WriteScalingInfo()
Helper function in order to write scaling-information into the metadata-builder object.
- Parameters
-
[in] | builder | The metadata-builder object. |
| scalingInfo | The scaling to be written into the metadata-builder object. |
◆ WriteScalingInfoEx()
Helper function in order to write scaling-information into the metadata-builder object.
- Parameters
-
[in] | builder | The metadata-builder object. |
| scalingInfo | The scaling to be written into the metadata-builder object. |
The documentation for this class was generated from the following file: