3D Volumes and Linking to C/C++
LibraryLink is extended to support 2D and 3D images being directly sent to/from external libraries.
Here is an example to negate pixel values of an Image or Image3D object. The color_negate function works with interleaved or planar images with any number of channels and any data type. See the complete example here.
The CCompilerDriver package lets you build executables, libraries, and object files from C/C++ source code utilizing compilers installed on your computer.
show complete Wolfram Language inputhide input
Create a dynamic link library from the code above.
Here, the library is loaded and the colorNegateCpp function call is linked to the color_negate C++ procedure.
Out[4]= | |
Import a volume.
Out[5]= | |
Segment the noisy background using region growing, starting from the eight corners.
Out[6]= | |
Apply colorNegateCpp from the C++ library to invert the background and create a foreground mask.
Out[7]= | |
Mask volume to remove noisy background.
Out[8]= | |