SMIL  1.0.4
Operations on image channels

Detailed Description

+ Collaboration diagram for Operations on image channels:

Functions

template<class MCT1 , class T2 >
RES_T copyChannel (const Image< MCT1 > &imIn, const UINT &chanNum, Image< T2 > &imOut)
 copyChannel() - Copy a channel of multichannel image into a single channel image More...
 
template<class T1 , class MCT2 >
RES_T copyToChannel (const Image< T1 > &imIn, const UINT &chanNum, Image< MCT2 > &imOut)
 copyToChannel() - Copy a single channel image into a channel of multichannel image More...
 
template<class MCT1 , class T2 >
RES_T splitChannels (const Image< MCT1 > &imIn, Image< T2 > &im3DOut)
 splitChannels() - Split channels of multichannel image to a 3D image with each channel on a Z slice More...
 
template<class T1 , class MCT2 >
RES_T mergeChannels (const Image< T1 > &imIn, Image< MCT2 > &imOut)
 mergeChannels() - Merge slices of a 3D image into a multichannel image More...
 

Function Documentation

◆ copyChannel()

RES_T smil::copyChannel ( const Image< MCT1 > &  imIn,
const UINT &  chanNum,
Image< T2 > &  imOut 
)

copyChannel() - Copy a channel of multichannel image into a single channel image

Parameters
[in]imIn: input image
[in]chanNum: channel in the input image to copy
[out]imOut: output image
Note
  • imIn et imOut are 2D images
  • imOut shall be a previosly allocated single channel image with the same size than imIn.
  • chanNum shall be a valid channel of imIn.

Example

from smilPython import *
# Load a RGB image
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/arearea.png")
im1.show()
# Copy the green channel into a UINT8 image
im2 = Image()
copyChannel(im1, 1, im2)
im2.show()
# Split RGB channels into a 3D UINT8 image with 3 slices (one for each channel)
im3 = Image()
splitChannels(im1, im3)
im3.show()
# Perform a 2D dilation on the slices
im4 = Image(im3)
dilate(im3, im4)
im4.show()
# And merge the result into a RGB image
im5 = Image(im1)
mergeChannels(im4, im5)
im5.show()
RES_T copyChannel(const Image< MCT1 > &imIn, const UINT &chanNum, Image< T2 > &imOut)
copyChannel() - Copy a channel of multichannel image into a single channel image
Definition: DImageArith.hpp:1827
RES_T splitChannels(const Image< MCT1 > &imIn, Image< T2 > &im3DOut)
splitChannels() - Split channels of multichannel image to a 3D image with each channel on a Z slice
Definition: DImageArith.hpp:1892
RES_T mergeChannels(const Image< T1 > &imIn, Image< MCT2 > &imOut)
mergeChannels() - Merge slices of a 3D image into a multichannel image
Definition: DImageArith.hpp:1925
RES_T dilate(const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE, const T borderVal=ImDtTypes< T >::min())
dilate() - Morphological grayscale dilation
Definition: DMorphoBase.hpp:65

◆ copyToChannel()

RES_T smil::copyToChannel ( const Image< T1 > &  imIn,
const UINT &  chanNum,
Image< MCT2 > &  imOut 
)

copyToChannel() - Copy a single channel image into a channel of multichannel image

Parameters
[in]imIn: input image
[in]chanNum: channel in the output image to copy
[out]imOut: output image
Note
  • imIn et imOut are 2D images
  • imOut shall be a previosly allocated multichannel image with the same size than imIn.
  • chanNum shall be a valid channel of imOut.

Example

from smilPython import *
# Load a RGB image
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/arearea.png")
im1.show()
# Copy the green channel into a UINT8 image
im2 = Image()
copyChannel(im1, 1, im2)
im2.show()
# Split RGB channels into a 3D UINT8 image with 3 slices (one for each channel)
im3 = Image()
splitChannels(im1, im3)
im3.show()
# Perform a 2D dilation on the slices
im4 = Image(im3)
dilate(im3, im4)
im4.show()
# And merge the result into a RGB image
im5 = Image(im1)
mergeChannels(im4, im5)
im5.show()

◆ splitChannels()

RES_T smil::splitChannels ( const Image< MCT1 > &  imIn,
Image< T2 > &  im3DOut 
)

splitChannels() - Split channels of multichannel image to a 3D image with each channel on a Z slice

Parameters
[in]imIn: input image
[out]im3DOut: output image
Note
  • imIn is a 2D image
  • im3DOut whall be a previously allocated image. Its size will be set to the same as imIn, but its depth will be set the the number of channels of imIn.

Example

from smilPython import *
# Load a RGB image
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/arearea.png")
im1.show()
# Copy the green channel into a UINT8 image
im2 = Image()
copyChannel(im1, 1, im2)
im2.show()
# Split RGB channels into a 3D UINT8 image with 3 slices (one for each channel)
im3 = Image()
splitChannels(im1, im3)
im3.show()
# Perform a 2D dilation on the slices
im4 = Image(im3)
dilate(im3, im4)
im4.show()
# And merge the result into a RGB image
im5 = Image(im1)
mergeChannels(im4, im5)
im5.show()

◆ mergeChannels()

RES_T smil::mergeChannels ( const Image< T1 > &  imIn,
Image< MCT2 > &  imOut 
)

mergeChannels() - Merge slices of a 3D image into a multichannel image

This function has the inverse behaviour of function splitChannels()

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

Example

from smilPython import *
# Load a RGB image
im1 = Image("https://smil.cmm.minesparis.psl.eu/images/arearea.png")
im1.show()
# Copy the green channel into a UINT8 image
im2 = Image()
copyChannel(im1, 1, im2)
im2.show()
# Split RGB channels into a 3D UINT8 image with 3 slices (one for each channel)
im3 = Image()
splitChannels(im1, im3)
im3.show()
# Perform a 2D dilation on the slices
im4 = Image(im3)
dilate(im3, im4)
im4.show()
# And merge the result into a RGB image
im5 = Image(im1)
mergeChannels(im4, im5)
im5.show()