SMIL  0.11.3-dev

Detailed Description

+ Collaboration diagram for Cut and paste:

Functions

template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
 copy() - Copy image (or a zone) into an output image More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, size_t startX, size_t startY, size_t sizeX, size_t sizeY, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
 copy() - Copy Image More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, size_t startX, size_t startY, size_t startZ, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
 copy() - Copy Image More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, size_t startX, size_t startY, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
 copy() - Copy Image (2D overload) More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, Image< T2 > &imOut, size_t outStartX, size_t outStartY, size_t outStartZ=0)
 copy() - Copy Image More...
 
template<class T1 , class T2 >
RES_T copy (const Image< T1 > &imIn, Image< T2 > &imOut)
 copy() - Copy / cast two images, convert their types. More...
 
template<class T >
RES_T copy (const Image< T > &imIn, Image< T > &imOut)
 copy() - Copy Image More...
 
template<class T >
RES_T clone (const Image< T > &imIn, Image< T > &imOut)
 clone() - Clone an image More...
 
template<class T >
RES_T crop (const Image< T > &imIn, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ, Image< T > &imOut)
 crop() - Crop image More...
 
template<class T >
RES_T crop (Image< T > &imInOut, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ)
 crop() - Crop image More...
 
template<class T >
RES_T crop (const Image< T > &imIn, size_t startX, size_t startY, size_t sizeX, size_t sizeY, Image< T > &imOut)
 crop() - 2D Crop image More...
 
template<class T >
RES_T crop (Image< T > &imInOut, size_t startX, size_t startY, size_t sizeX, size_t sizeY)
 crop() - 2D Crop image More...
 
template<class T >
RES_T addBorder (const Image< T > &imIn, const size_t &bSize, Image< T > &imOut, const T &borderValue=ImDtTypes< T >::max())
 addBorder() - Add a border of size bSize around the original image More...
 

Function Documentation

◆ copy() [1/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
size_t  startX,
size_t  startY,
size_t  startZ,
size_t  sizeX,
size_t  sizeY,
size_t  sizeZ,
Image< T2 > &  imOut,
size_t  outStartX = 0,
size_t  outStartY = 0,
size_t  outStartZ = 0 
)

copy() - Copy image (or a zone) into an output image

This is the most complete version of smil::copy().

It copies a region of imIn defined by its start point (startX, startY, startZ) and size (sizeX, sizeY, sizeZ) into a region on imOut beginning at position (outStartX, outStartY, outStartZ).

Parameters
[in]imIn: input image
[in]startX,startY,[startZ]: (optional) start position of the zone in the input image
[in]sizeX,sizeY,[sizeZ]: (optional) size of the zone in the input image
[out]imOut: output image
[in]outStartX,outStartY,[outStartZ]: (optional) position to copy the selected zone in the output image (default is the origin (0,0,0))

Example

from smilPython import *
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/barbara.png")
im2 = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
im3 = Image(im1)
im1.show()
im2.show()
im3.show()
# Crop the content of im1 from (256, 0) to im3 (which will be resized)
crop(im1, 256, 0, 256, 256, im3)
# Copy the content of im2 and put it at position (0, 256) in im1
copy(im2, im1, 0, 256)
# Copy the window starting at (256, 0) and with dimensions 128x128 and put it at (128, 128) in im2
copy(im1, 256, 0, 128, 128, im2, 128, 128)
# Same as previous (simple way)
copy(im1, 256, 0, im2, 128, 128)
# Create a 3D image and copy slices inside
im3D = Image(im2.getWidth(), im2.getHeight(), 3)
im3D << 0
copy(im1, 0, 256, im3D)
copy(im3, im3D, 0, 0, 2)
close(im3D, im3D, cbSE())
im3D.show()

◆ copy() [2/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
size_t  startX,
size_t  startY,
size_t  sizeX,
size_t  sizeY,
Image< T2 > &  imOut,
size_t  outStartX = 0,
size_t  outStartY = 0,
size_t  outStartZ = 0 
)

copy() - Copy Image

2D version of the general smil::copy function.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ copy() [3/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
size_t  startX,
size_t  startY,
size_t  startZ,
Image< T2 > &  imOut,
size_t  outStartX = 0,
size_t  outStartY = 0,
size_t  outStartZ = 0 
)

copy() - Copy Image

Copies the entire content of imIn beginning at (startX, startY, startZ) into imOut beginning at (outStartX, outStartY, outStartZ).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ copy() [4/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
size_t  startX,
size_t  startY,
Image< T2 > &  imOut,
size_t  outStartX = 0,
size_t  outStartY = 0,
size_t  outStartZ = 0 
)

copy() - Copy Image (2D overload)

Copies the entire content of imIn beginning at (startX, startY) into imOut beginning at (outStartX, outStartY).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ copy() [5/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
Image< T2 > &  imOut,
size_t  outStartX,
size_t  outStartY,
size_t  outStartZ = 0 
)

copy() - Copy Image

Copies the entire content of imIn into imOut beginning at (outStartX, outStartY, outStartZ)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ copy() [6/7]

RES_T smil::copy ( const Image< T1 > &  imIn,
Image< T2 > &  imOut 
)

copy() - Copy / cast two images, convert their types.

If imIn and imOut types may be different, the contents of imIn beginning at (0,0,0) will copied to imOut, at the same place but the range of imOut won't be adjusted.

Parameters
[in]imIn: input image
[out]imOut: output image

◆ copy() [7/7]

RES_T smil::copy ( const Image< T > &  imIn,
Image< T > &  imOut 
)

copy() - Copy Image

Copy one image to the other. imOut shall be of the same kind of imIn. Its size will be set to the same of imIn

Parameters
[in]imIn: input image
[out]imOut: output image

◆ clone()

RES_T smil::clone ( const Image< T > &  imIn,
Image< T > &  imOut 
)

clone() - Clone an image

Make imOut a clone imIn, with the same size and content.

Parameters
[in]imIn: input image
[out]imOut: output image
Note
imOut must be previously declared as an image with the same data type of imIn. Its initial size doesn't matter. It will be set to the same size of imIn.

◆ crop() [1/4]

RES_T smil::crop ( const Image< T > &  imIn,
size_t  startX,
size_t  startY,
size_t  startZ,
size_t  sizeX,
size_t  sizeY,
size_t  sizeZ,
Image< T > &  imOut 
)

crop() - Crop image

Crop an image into an output image

Parameters
[in]imIn: input image
[in]startX,startY,startZ: start position of the zone in the input image
[in]sizeX,sizeY,sizeZ: size of the zone in the input image
[out]imOut: output image
See also
Use copy() if you want to place the cropped image into a particular place of the output image

Example

from smilPython import *
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/barbara.png")
im2 = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
im3 = Image(im1)
im1.show()
im2.show()
im3.show()
# Crop the content of im1 from (256, 0) to im3 (which will be resized)
crop(im1, 256, 0, 256, 256, im3)
# Copy the content of im2 and put it at position (0, 256) in im1
copy(im2, im1, 0, 256)
# Copy the window starting at (256, 0) and with dimensions 128x128 and put it at (128, 128) in im2
copy(im1, 256, 0, 128, 128, im2, 128, 128)
# Same as previous (simple way)
copy(im1, 256, 0, im2, 128, 128)
# Create a 3D image and copy slices inside
im3D = Image(im2.getWidth(), im2.getHeight(), 3)
im3D << 0
copy(im1, 0, 256, im3D)
copy(im3, im3D, 0, 0, 2)
close(im3D, im3D, cbSE())
im3D.show()

◆ crop() [2/4]

RES_T smil::crop ( Image< T > &  imInOut,
size_t  startX,
size_t  startY,
size_t  startZ,
size_t  sizeX,
size_t  sizeY,
size_t  sizeZ 
)

crop() - Crop image

Crop an image in the same image.

Parameters
[in,out]imInOut: input image
[in]startX,startY,startZ: start position of the zone in the input image
[in]sizeX,sizeY,sizeZ: size of the zone in the input image

◆ crop() [3/4]

RES_T smil::crop ( const Image< T > &  imIn,
size_t  startX,
size_t  startY,
size_t  sizeX,
size_t  sizeY,
Image< T > &  imOut 
)

crop() - 2D Crop image

Crop an image (this is just an overload)

Parameters
[in]imIn: input image
[in]startX,startY: start position of the zone in the input image
[in]sizeX,sizeY: size of the zone in the input image
[out]imOut: output image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ crop() [4/4]

RES_T smil::crop ( Image< T > &  imInOut,
size_t  startX,
size_t  startY,
size_t  sizeX,
size_t  sizeY 
)

crop() - 2D Crop image

Crop an image in itself (this is just an overload)

Parameters
[in,out]imInOut: input image
[in]startX,startY: start position of the zone in the input image
[in]sizeX,sizeY: size of the zone in the input image

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ addBorder()

RES_T smil::addBorder ( const Image< T > &  imIn,
const size_t &  bSize,
Image< T > &  imOut,
const T &  borderValue = ImDtTypes<T>::max() 
)

addBorder() - Add a border of size bSize around the original image

Parameters
[in]imIn: input image
[in]bSize: border size
[out]imOut: output image
[in]borderValue: value to assign to each pixel in the border
Note
Image size is increased by 2 * bSize pixels in each direction
smil::copy
RES_T copy(const Image< T1 > &imIn, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ, Image< T2 > &imOut, size_t outStartX=0, size_t outStartY=0, size_t outStartZ=0)
copy() - Copy image (or a zone) into an output image
Definition: DImageTransform.hpp:84
smil::crop
RES_T crop(const Image< T > &imIn, size_t startX, size_t startY, size_t startZ, size_t sizeX, size_t sizeY, size_t sizeZ, Image< T > &imOut)
crop() - Crop image
Definition: DImageTransform.hpp:298
smil::close
RES_T close(const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
close() - Morphological grayscale closing
Definition: DMorphoFilter.hpp:70