Back to module list
Add labels
Description
Adds an overlay to the specified input image with each object represented by a text label. The label can include information such as measurements, associated object counts or ID numbers.
Parameters
- Colour mode
- Description: Method for determining colour of each object's corresponding overlay:
- "Child count" Overlay colour is determined by the number of children each object has. Colour range runs across the first half of the visible spectrum (i.e. red to cyan) and is maximised, so the object with the fewest children is shown in red and the object with the most, in cyan. Objects without any children are always shown in red. Child objects used for counting are selected with the "Child objects for colour" parameter.
- "ID" Overlay colour is quasi-randomly selected based on the ID number of the object. The colour used for a specific ID number will always be the same and is calculated using the equation hue = (ID * 1048576 % 255) / 255.
- "Measurement value" Overlay colour is determined by a measurement value. Colour range runs across the first half of the visible spectrum (i.e. red to cyan) and is maximised, so the object with the smallest measurement is shown in red and the object with the largest, in cyan. Objects missing the relevant measurement are always shown in red. The measurement value is selected with the "Measurement for colour" parameter.
- "Parent ID" Overlay colour is quasi-randomly selected based on the ID number of a parent of this object. The colour used for a specific ID number will always be the same and is calculated using the equation hue = (ID * 1048576 % 255) / 255. The parent object is selected with the "Parent object for colour" parameter.
- "Parent measurement value" Overlay colour is determined by a measurement value of a parent of this object. Colour range runs across the first half of the visible spectrum (i.e. red to cyan) and is maximised, so the object with the smallest measurement is shown in red and the object with the largest, in cyan. Objects either missing the relevant measurement or without the relevant parent are always shown in red. The parent object is selected with the "Parent object for colour" parameter and the measurement value is selected with the "Measurement for colour" parameter.
- "Partner count" Overlay colour is determined by the number of partners each object has. Colour range runs across the first half of the visible spectrum (i.e. red to cyan) and is maximised, so the object with the fewest partners is shown in red and the object with the most, in cyan. Objects without any partners are always shown in red. Partner objects used for counting are selected with the "Partner objects for colour" parameter.
- "Random colour" Overlay colour is randomly selected for each object. Unlike the "ID" option, the colours generated here will be different for each evaluation of the module.
- "Single colour" (default option) Overlay colour is fixed to one of a predetermined list of colours. All objects will be assigned the same overlay colour. The colour is chosen using the "Single colour" parameter.
- Type: ChoiceP
- Default value: Single colour
- Choices:
- Child count
- ID
- Measurement value
- Parent ID
- Parent measurement value
- Partner count
- Random colour
- Single colour
- Single colour
- Description: Colour for all object overlays to be rendered using. This parameter is used if "Colour mode" is set to "Single colour". Options are: White, Black, Red, Orange, Yellow, Green, Cyan, Blue, Violet, Magenta.
- Type: ChoiceP
- Default value: White
- Choices:
- White
- Black
- Red
- Orange
- Yellow
- Green
- Cyan
- Blue
- Violet
- Magenta
- Child objects for colour
- Description: Object collection used to determine the colour of the overlay based on number of children per object when "Colour mode" is set to "Child count". These objects will be children of the input objects.
- Type: ChildObjectsP
- Measurement for colour
- Description: Measurement used to determine the colour of the overlay when "Colour mode" is set to either "Measurement value" or "Parent measurement value".
- Type: ObjectMeasurementP
- Parent object for colour
- Description: Object collection used to determine the colour of the overlay based on either the ID or measurement value of a parent object when "Colour mode" is set to either "Parent ID" or "Parent measurement value". These objects will be parents of the input objects.
- Type: ParentObjectsP
- Partner objects for colour
- Description: Object collection used to determine the colour of the overlay based on number of partners per object when "Colour mode" is set to "Partner count". These objects will be partners of the input objects.
- Type: PartnerObjectsP
- Opacity (%)
- Description: Opacity of the overlay to be rendered. This is a value between 0 (totally transparent) and 100 (totally opaque).
- Type: DoubleP
- Default value: 100.0
- Input image
- Description: Image onto which overlay will be rendered. Input image will only be updated if "Apply to input image" is enabled, otherwise the image containing the overlay will be stored as a new image with name specified by "Output image".
- Type: InputImageP
- Input objects
- Description: Objects to represent as overlays.
- Type: InputObjectsP
- Apply to input image
- Description: Determines if the modifications made to the input image (added overlay elements) will be applied to that image or directed to a new image. When selected, the input image will be updated.
- Type: BooleanP
- Default value: false
- Add output image to workspace
- Description: If the modifications (overlay) aren't being applied directly to the input image, this control will determine if a separate image containing the overlay should be saved to the workspace.
- Type: BooleanP
- Default value: false
- Output image
- Description: The name of the new image to be saved to the workspace (if not applying the changes directly to the input image).
- Type: OutputImageP
- Label mode
- Description: Controls what information each label displays:
- "Child count" The number of children from a specific object collection for each object. The children to summarise are selected using the "Child objects for label" parameter.
- "ID" The ID number of the object.
- "Measurement value" A measurement associated with the object. The measurement is selected using the "Measurement for label" parameter.
- "Parent ID" The ID number of a parent of the object. The parent object is selected using the "Parent object for label" parameter.
- "Parent measurement value" A measurement associated with a parent of the object. The measurement is selected using the "Measurement for label" parameter and the parent object with the "Parent object for label" parameter.
- "Partner count" The number of partners from a specific object collection for each object. The partners to summarise are selected using the "Partner objects for label" parameter.
- Type: ChoiceP
- Default value: ID
- Choices:
- Child count
- ID
- Measurement value
- Parent ID
- Parent measurement value
- Partner count
- Decimal places
- Description: Number of decimal places to use when displaying numeric values.
- Type: IntegerP
- Default value: 0
- Use scientific notation
- Description: When enabled, numeric values will be displayed in the format 1.23E-3. Otherwise, the same value would appear as 0.00123.
- Type: BooleanP
- Default value: false
- Label size
- Description: Font size of the text label.
- Type: IntegerP
- Default value: 8
- X-offset
- Description: Offset the label by this number of pixels horizontally (along the x-axis). Increasingly positive numbers move the label right.
- Type: IntegerP
- Default value: 0
- Y-offset
- Description: Offset the label by this number of pixels vertically (along the y-axis). Increasingly positive numbers move the label down.
- Type: IntegerP
- Default value: 0
- Child objects for label
- Description: If "Label mode" is set to "Child count", these are the child objects which will be counted and displayed on the label. These objects will be children of the input objects.
- Type: ChildObjectsP
- Parent object for label
- Description: If "Label mode" is set to either "Parent ID" or "Parent measurement value", these are the parent objects which will be used. These objects will be parents of the input objects.
- Type: ParentObjectsP
- Partner objects for label
- Description: If "Label mode" is set to "Partner count", these are the partner objects which will be counted and displayed on the label. These objects will be partners of the input objects.
- Type: PartnerObjectsP
- Measurement for label
- Description: If "Label mode" is set to either "Measurement value" or "Parent measurement value", these are the measurements which will be used.
- Type: ObjectMeasurementP
- Label position
- Description: Determines the method used for placing the label overlay for each object:
- "Centre of object" Labels will be placed at the centroid (average coordinate location) of each object. This position won't necessarily coincide with a region corresponding to that object. For example, the centroid of a crescent shape won't lie on the crescent itself.
- "Inside largest part of object" Labels will be placed coinciden with the largest region of each object. This ensures the label is placed directly over the relevant object.
- Type: ChoiceP
- Default value: Centre of object
- Choices:
- Centre of object
- Inside largest part of object
- Render in all object slices
- Description: Display overlay elements in all slices corresponding to that object.
- Type: BooleanP
- Default value: false
- Render in all frames
- Description: Display overlay elements in all frames, irrespective of whether each object is present in that frame.
- Type: BooleanP
- Default value: false
- Enable multithreading
- Description: Process multiple overlay elements simultaneously. This can provide a speed improvement when working on a computer with a multi-core CPU.
- Type: BooleanP
- Default value: true