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 = NULL );
This function returns outputImage.
// Function prototype. logical_operation_with_value( input_image, value = 0, logical_operator = LogicalOperationWithValue.LogicalOperator.AND, output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView LogicalOperationWithValue( IOLink.ImageView inputImage, UInt32 value = 0, LogicalOperationWithValue.LogicalOperator logicalOperator = ImageDev.LogicalOperationWithValue.LogicalOperator.AND, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Class Name | LogicalOperationWithValue |
---|
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
std::shared_ptr< iolink::ImageView > 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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) logical_operation_with_value_algo = imagedev.LogicalOperationWithValue() logical_operation_with_value_algo.input_image = polystyrene logical_operation_with_value_algo.value = 10 logical_operation_with_value_algo.logical_operator = imagedev.LogicalOperationWithValue.AND logical_operation_with_value_algo.execute() print( "output_image:", str( logical_operation_with_value_algo.output_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); LogicalOperationWithValue logicalOperationWithValueAlgo = new LogicalOperationWithValue { inputImage = polystyrene, value = 10, logicalOperator = LogicalOperationWithValue.LogicalOperator.AND }; logicalOperationWithValueAlgo.Execute(); Console.WriteLine( "outputImage:" + logicalOperationWithValueAlgo.outputImage.ToString() );
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = logicalOperationWithValue( polystyrene, 10, LogicalOperationWithValue::LogicalOperator::AND ); std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) result = imagedev.logical_operation_with_value( polystyrene, 10, imagedev.LogicalOperationWithValue.AND ) print( "output_image:", str( result ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); IOLink.ImageView result = Processing.LogicalOperationWithValue( polystyrene, 10, LogicalOperationWithValue.LogicalOperator.AND ); Console.WriteLine( "outputImage:" + result.ToString() );