IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Greyscale inversion of 3d imageSee full documentation
imageinvert3dImg (inImg3d)

Detailed Description

algorithm allowing to invert 3d image intensity

Given an input image $InImg$, output image $OutImg$ as follow :

\[ OutImg[i] = K - InImg[i] \]

where $K = \min\{InImg\} + \max\{InImg\}$ is defined from input image extrema.

This transformation allows to preserve image range since :

During this transformation, image histogram is mirrored around mean input range $\frac{\min\{InImg\} + \max\{InImg\}}{2}$.

See Greyscale inversion of 2d image for an illustration of a greyscale inversion of 2d a image.

In this case algorithm is applied 3d bloc by 3d bloc (ie image extrema are computed and applied 3d bloc by 3d bloc), for a 2d version of this algorithm see Greyscale inversion of 2d image.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# greyscale inversion of input image
outImg = itrans.invert3dImg(inImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/Invert3dImg/Invert3dImg.h>

Code Example

// opening of input image
ImagePtr pInImg3d = loadTiffImageFile(inputGreyImgPath, eTiffDirectoryMode::eTDM_Volume);
// greyscale inversion of input image
ImagePtr pOutImg = invert3dImg(pInImg3d);