LogicalOperationWithValue
Performs a pointwise logical operation between an image and a value.
Access to parameter description
The logical operators to apply between the input images I and the constant value C can be selected from:
See also
Access to parameter description
The logical operators to apply between the input images I and the constant value C can be selected from:
- The logical conjunction AND.
- The logical disconjunction OR.
- The negation of conjunction and disjunction NAND and NOR.
- The exclusive disjunction NOR and its negation NXOR.
- A logical difference operator.
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > logicalOperationWithValue( std::shared_ptr< iolink::ImageView > inputImage, uint32_t value, LogicalOperationWithValue::LogicalOperator logicalOperator, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input image, must be integer, including grayscale, binary, label, and color. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||||||||||||
![]() |
value |
The value to apply, cast to the type of the input image. | UInt32 | Any value | 0 | ||||||||||||||
![]() |
logicalOperator |
The logical operator to apply. Default is AND.
|
Enumeration | AND | |||||||||||||||
![]() |
outputImage |
The output image, size and type are forced to the same values as the input. | Image | nullptr |
Object Examples
auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); LogicalOperationWithValue logicalOperationWithValueAlgo; logicalOperationWithValueAlgo.setInputImage( polystyrene ); logicalOperationWithValueAlgo.setValue( 10 ); logicalOperationWithValueAlgo.setLogicalOperator( LogicalOperationWithValue::LogicalOperator::AND ); logicalOperationWithValueAlgo.execute(); std::cout << "outputImage:" << logicalOperationWithValueAlgo.outputImage()->toString();
Function Examples
auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = logicalOperationWithValue( polystyrene, 10, LogicalOperationWithValue::LogicalOperator::AND ); std::cout << "outputImage:" << result->toString();