Table: | For specifying the predefined CNN classifier context, dataset context, or CNN prediction result buffer |
Table: | For a predefined classifier context or a dataset context |
Table: | For a CNN prediction result buffer |
+ combination: | For modifying the drawing operation |
MIL_ID ContextGraId, | //in |
MIL_ID ContextOrResultClassId, | //in |
MIL_ID DstImageBufOrListGraId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT64 Index, | //in |
MIL_INT64 ControlFlag | //in |
This function draws specific features of a predefined CNN classifier context, an images dataset context, a features dataset context, or a CNN prediction result buffer. Drawing operations are typically performed in a destination image buffer. Note, you cannot draw from a tree ensemble classifier context or a tree ensemble prediction result buffer.
By default, this function performs the drawing operation for every class in the specified context or result. To draw for a specific class, specify its index (Index).
Specifies the identifier of the 2D graphics context to use when drawing. This parameter must be set to one of the following values:
For specifying the 2D graphics context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the default 2D graphics context of the current MIL application is used. Note that there is a different default 2D graphics context for each thread. (summarize)Specifies that the default 2D graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL 2D graphics context identifier |
Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the identifier of the predefined CNN classifier context, dataset context, or CNN prediction result buffer from which to draw.
For specifying the predefined CNN classifier context,
dataset context, or CNN prediction result buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
ContextClassifierCNNPredefinedId |
Specifies the identifier of the predefined CNN classifier context. This context is allocated using MclassAlloc() with M_CLASSIFIER_CNN_PREDEFINED. (summarize)Specifies the identifier of the predefined CNN classifier context. (more details...) |
||||||||||||||||||||||||||||||||||||||
ContextDatasetId |
Specifies the identifier of an images or features dataset context. These contexts must have been previously allocated on the required system using MclassAlloc() with M_DATASET_IMAGES or M_DATASET_FEATURES. (summarize)Specifies the identifier of an images or features dataset context. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultClassPredictId |
Specifies the identifier of the CNN prediction result buffer. This buffer is allocated using MclassAllocResult() with M_PREDICT_CNN_RESULT. (summarize)Specifies the identifier of the CNN prediction result buffer. (more details...) |
Specifies the identifier of the destination image buffer or LUT buffer in which to draw. You should typically specify an image, which can be any valid MIL image buffer allocated using MbufAlloc...(). By drawing into a display's overlay buffer, you can also annotate an image non-destructively. To specify a LUT, you must use the M_DRAW_CLASS_COLOR_LUT drawing operation.
When drawing from a CNN prediction result buffer, the expected size of the destination image buffer is, by default, the same as the target image. This assumes prediction results are from a typical image classification process.
Note, if your image classification results are from a coarse segmentation prediction, be aware that the classification map (the output of the network) is, by default, scaled by M_CLASSIFICATION_MAP_SCALE_X and M_CLASSIFICATION_MAP_SCALE_Y, and placed at M_CLASSIFICATION_MAP_OFFSET_X and M_CLASSIFICATION_MAP_OFFSET_Y (these scale and map values are retrievable using MclassGetResult()). If you add M_REPLICATE_BORDER to the drawing operation, MIL expands (copies) the edges of the classification map to reach the edges of the destination buffer.
You can modify the default scale and offset map behavior by adding M_CLASSIFICATION_MAP_SIZE to the drawing operation. This performs the drawing operation according to the exact classification map (output of the network) without scaling or expanding. In this case, the destination buffer size should be equal to the resulting X- and Y-size of the classification map; to retrieve these dimensions, call MclassGetResult() with M_CLASSIFICATION_MAP_SIZE_X and M_CLASSIFICATION_MAP_SIZE_Y.
Specifies the drawing operation to perform.
The following Operation parameter values can be set for a predefined CNN classifier context or a features dataset context.
For a predefined classifier context or a dataset
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DRAW_CLASS_COLOR_LUT |
Draws the color (LUT) associated to the class. This color is defined using MclassControl() with M_CLASS_DRAW_COLOR. When performing this operation, you must set the destination buffer (DstImageBufOrListGraId) to the identifier of a MIL LUT buffer. To inquire the width of this LUT, use M_NUMBER_OF_CLASSES. (summarize)Draws the color (LUT) associated to the class. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_CLASS_ICON |
Draws the icon image associated to the class. This image is defined using MclassControl() with M_CLASS_ICON_ID. When performing this operation, you must set the destination buffer (DstImageBufOrListGraId) to the identifier of a MIL image buffer. To inquire the format of this buffer (DstImageBufOrListGraId), such as the X- and Y-size, use M_CLASS_ICON_ID (the dimension of the destination image in which you draw should be the same as the class description's icon image). (summarize)Draws the icon image associated to the class. (more details...) |
The following Operation parameter values can be set for a CNN prediction result buffer. These operations require an image buffer as the destination in which to draw (DstImageBufOrListGraId).
For a CNN prediction result buffer
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DRAW_BEST_INDEX_CONTOUR_IMAGE + |
Draws the contours of the best classes. If you do not specify the M_PSEUDO_COLOR combination value, MIL uses the result type M_CLASS_MAP_INDEX_IMAGE_TYPE to determine the type of the image to use. If you specify M_PSEUDO_COLOR, the image type must be 3 bands, 8-bit unsigned. (summarize)Draws the contours of the best classes. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_BEST_INDEX_IMAGE + |
Draws an image using the index value of the best class at each point. If you do not specify the M_PSEUDO_COLOR combination value, MIL uses the result type M_CLASS_MAP_INDEX_IMAGE_TYPE to determine the type of the image to use. If you specify M_PSEUDO_COLOR, the image type must be 3 bands, 8-bit unsigned. (summarize)Draws an image using the index value of the best class at each point. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_BEST_SCORE_IMAGE + |
Draws an image using the best score at each point. If you do not specify the M_PSEUDO_COLOR combination value, the image type must be float or unsigned. If you specify M_PSEUDO_COLOR, the image type must be 3 bands, 8-bit unsigned. (summarize)Draws an image using the best score at each point. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_CLASSIFICATION_SCORE + |
Draws (fills) an image using the scores of a specific class. This drawing operation is not possible when drawing general results; you must set the Index parameter to a specific class. If you specify the M_CLASSIFICATION_MAP_SIZE combination value, the drawing is done with the classification map size (the ControlFlag parameter must be set to its default). If you do not specify the M_CLASSIFICATION_MAP_SIZE combination value, you can set the ControlFlag parameter to M_BILINEAR_INTERPOLATION or M_RECEPTIVE_FIELD_PATCH. You cannot use the M_PSEUDO_COLOR combination value with this drawing operation. In all cases, when using M_CLASSIFICATION_MAP_SIZE, the image type must be float or 8-bit unsigned. (summarize)Draws (fills) an image using the scores of a specific class. (more details...) |
You can add one or more of the following values to the above-mentioned values to specify a modification to the drawing operation.
For modifying the drawing operation
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description | ||||||||||||||||||||||||||||||||||||||
M_CLASSIFICATION_MAP_SIZE |
Draws according to the exact classification map size (output of the network) without scaling or expanding. In this case, the expected size of the destination buffer (DstImageBufOrListGraId) is the same as the X- and Y-size of M_CLASSIFICATION_MAP_SIZE. You cannot use M_CLASSIFICATION_MAP_SIZE with M_REPLICATE_BORDER. (summarize)Draws according to the exact classification map size (output of the network) without scaling or expanding. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_PSEUDO_COLOR |
Draws using the pseudo colors defined by calling MclassControl() with M_CLASS_DRAW_COLOR. For all drawing operations, if you specify M_PSEUDO_COLOR, the destination buffer (DstImageBufOrListGraId) image type must be 3 bands, 8-bit unsigned. Depending on the draw operation, you can use M_PSEUDO_COLOR with other combination values. (summarize)Draws using the pseudo colors defined by calling MclassControl() with M_CLASS_DRAW_COLOR. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_REPLICATE_BORDER |
Draws with borders expanded to the size of the destination buffer (DstImageBufOrListGraId). You cannot use M_REPLICATE_BORDER with M_CLASSIFICATION_MAP_SIZE. (summarize)Draws with borders expanded to the size of the destination buffer (DstImageBufOrListGraId). (more details...) |
Specifies what to use to perform the drawing operation.
Set this parameter to one of the following values:
For specifying what to use to perform the drawing
operation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_CONTEXT, if the ContextOrResultClassId parameter is a predefined CNN classifier context or an images dataset context; same as M_GENERAL, if the ContextOrResultClassId is a CNN prediction result buffer. |
||||||||||||||||||||||||||||||||||||||
Specifies that the drawing operation is for a specific class in the predefined CNN classifier context, dataset context, or CNN prediction result buffer (ContextOrResultClassId). (summarize)Specifies that the drawing operation is for a specific class in the predefined CNN classifier context, dataset context, or CNN prediction result buffer (ContextOrResultClassId). (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Set this parameter to the following: |
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
M_CONTEXT |
Specifies that the drawing operation is for every class in the predefined CNN classifier context or the dataset context (ContextOrResultClassId). |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Specifies that the drawing operation is for every class in the CNN prediction result buffer (ContextOrResultClassId). |
Specifies how to control the drawing operation.
For all drawing operations except M_DRAW_CLASSIFICATION_SCORE, set this parameter to M_DEFAULT. Typically, these drawing operations apply to prediction results from a coarse segmentation.
For specifying how to control the classification
score drawing
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Implements the default behavior. This is the only possible setting for all drawing operations except M_DRAW_CLASSIFICATION_SCORE. (summarize)Implements the default behavior. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_BILINEAR_INTERPOLATION |
Scales the classification map with a bilinear calculation, when using M_DRAW_CLASSIFICATION_SCORE. The scale is network property and established in receptive field calculations. The scaled image is placed at the offset of the receptive field. (summarize)Scales the classification map with a bilinear calculation, when using M_DRAW_CLASSIFICATION_SCORE. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RECEPTIVE_FIELD_PATCH |
Fills the corresponding receptive fields with calculated scores, when using M_DRAW_CLASSIFICATION_SCORE. Scores are drawn in order, from low to high. The best score is therefore drawn over lower scores. (summarize)Fills the corresponding receptive fields with calculated scores, when using M_DRAW_CLASSIFICATION_SCORE. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milclass.lib. |
DLL | Requires mil.dll; milclass.dll. |