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.

In[1]:=
Click for copyable input
X
show complete Wolfram Language input

Create a dynamic link library from the code above.

In[3]:=
Click for copyable input
X

Here, the library is loaded and the colorNegateCpp function call is linked to the color_negate C++ procedure.

In[4]:=
Click for copyable input
X
Out[4]=

Import a volume.

In[5]:=
Click for copyable input
X
Out[5]=

Segment the noisy background using region growing, starting from the eight corners.

In[6]:=
Click for copyable input
X
Out[6]=

Apply colorNegateCpp from the C++ library to invert the background and create a foreground mask.

In[7]:=
Click for copyable input
X
Out[7]=

Mask volume to remove noisy background.

In[8]:=
Click for copyable input
X
Out[8]=
de es ja pt-br zh