ImageDev

PasteImage3d

Pastes a three-dimensional image into another at a given location.

Access to parameter description

PasteImage3d pastes an area contained in an input image $I$ at a user-defined location of an output image $O$.
If the input image does not entirely fit into the output image at the given location, only the intersecting area is pasted, and no exception occurs.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > pasteImage3d( std::shared_ptr< iolink::ImageView > inputSource, std::shared_ptr< iolink::ImageView > inputDestination, iolink::Vector3i32 originSource, iolink::Vector3i32 originDestination, iolink::Vector3u32 areaSize, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
paste_image_3d(input_source: idt.ImageType,
               input_destination: idt.ImageType,
               origin_source: Iterable[int] = [0, 0, 0],
               origin_destination: Iterable[int] = [0, 0, 0],
               area_size: Iterable[int] = [0, 0, 0],
               output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
PasteImage3d( IOLink.ImageView inputSource,
              IOLink.ImageView inputDestination,
              int[] originSource = null,
              int[] originDestination = null,
              uint[] areaSize = null,
              IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputSource
The input source image to be pasted in the destination image. Image Binary, Label, Grayscale or Multispectral nullptr
input
inputDestination
The input destination image. Image Binary, Label, Grayscale or Multispectral nullptr
input
originSource
The origin of the region to select in the source image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. Vector3i32 Any value {0, 0, 0}
input
originDestination
The origin of the region to paste in the destination image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. Vector3i32 Any value {0, 0, 0}
input
areaSize
The size of the region to select, in voxels.
If this value is set to (0, 0, 0), the full size of the source image is used. Only source voxels lying in the overlap between both input images (after translation of the source) are pasted in the destination.
Vector3u32 Any value {0, 0, 0}
output
outputImage
The output image where the input image is pasted. Its dimensions and type are forced to the same values as the destination input image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_source
The input source image to be pasted in the destination image. image Binary, Label, Grayscale or Multispectral None
input
input_destination
The input destination image. image Binary, Label, Grayscale or Multispectral None
input
origin_source
The origin of the region to select in the source image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. vector3i32 Any value [0, 0, 0]
input
origin_destination
The origin of the region to paste in the destination image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. vector3i32 Any value [0, 0, 0]
input
area_size
The size of the region to select, in voxels.
If this value is set to (0, 0, 0), the full size of the source image is used. Only source voxels lying in the overlap between both input images (after translation of the source) are pasted in the destination.
vector3u32 Any value [0, 0, 0]
output
output_image
The output image where the input image is pasted. Its dimensions and type are forced to the same values as the destination input image. image None
Parameter Name Description Type Supported Values Default Value
input
inputSource
The input source image to be pasted in the destination image. Image Binary, Label, Grayscale or Multispectral null
input
inputDestination
The input destination image. Image Binary, Label, Grayscale or Multispectral null
input
originSource
The origin of the region to select in the source image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. Vector3i32 Any value {0, 0, 0}
input
originDestination
The origin of the region to paste in the destination image, expressed in voxel coordinates. If the value is set outside the image, nothing is done. Vector3i32 Any value {0, 0, 0}
input
areaSize
The size of the region to select, in voxels.
If this value is set to (0, 0, 0), the full size of the source image is used. Only source voxels lying in the overlap between both input images (after translation of the source) are pasted in the destination.
Vector3u32 Any value {0, 0, 0}
output
outputImage
The output image where the input image is pasted. Its dimensions and type are forced to the same values as the destination input image. Image null

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

PasteImage3d pasteImage3dAlgo;
pasteImage3dAlgo.setInputSource( foam );
pasteImage3dAlgo.setInputDestination( foam );
pasteImage3dAlgo.setOriginSource( {0, 0, 0} );
pasteImage3dAlgo.setOriginDestination( {10, 10, 10} );
pasteImage3dAlgo.setAreaSize( {100, 100, 100} );
pasteImage3dAlgo.execute();

std::cout << "outputImage:" << pasteImage3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

paste_image_3d_algo = imagedev.PasteImage3d()
paste_image_3d_algo.input_source = foam
paste_image_3d_algo.input_destination = foam
paste_image_3d_algo.origin_source = [0, 0, 0]
paste_image_3d_algo.origin_destination = [10, 10, 10]
paste_image_3d_algo.area_size = [100, 100, 100]
paste_image_3d_algo.execute()

print("output_image:", str(paste_image_3d_algo.output_image))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

PasteImage3d pasteImage3dAlgo = new PasteImage3d
{
    inputSource = foam,
    inputDestination = foam,
    originSource = new int[]{0, 0, 0},
    originDestination = new int[]{10, 10, 10},
    areaSize = new uint[]{100, 100, 100}
};
pasteImage3dAlgo.Execute();

Console.WriteLine( "outputImage:" + pasteImage3dAlgo.outputImage.ToString() );

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = pasteImage3d( foam, foam, {0, 0, 0}, {10, 10, 10}, {100, 100, 100} );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.paste_image_3d(foam, foam, [0, 0, 0], [10, 10, 10], [100, 100, 100])

print("output_image:", str(result))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.PasteImage3d( foam, foam, new int[]{0, 0, 0}, new int[]{10, 10, 10}, new uint[]{100, 100, 100} );

Console.WriteLine( "outputImage:" + result.ToString() );