Toolkit for 3D volume processing
mkdir build && cd build
cmake ..
makeCMake options:
STK_BUILD_EXAMPLES: build example programsSTK_BUILD_TESTS: build testsSTK_USE_CUDA: build with CUDA supportSTK_WARNINGS_ARE_ERRORS: compilation will fail on warningsSTK_BUILD_WITH_DEBUG_INFO: include debug symbols in the binariesSTK_ENABLE_FAST_MATH: enable unsafe (non IEEE 754-compliant) optimisationsSTK_LOGGING_PREFIX_FILE: add the file name as prefix to each log message
When building with STK_USE_CUDA, in case the version of gcc selected by
CMake was not compatible with the one required by CUDA, it is possible to
specify a different executable with -DCMAKE_CUDA_FLAGS="-ccbin gcc-XX", where
gcc-XX is a version of gcc compatible with your CUDA version.
A minimalistic Python API is also provided.
python setup.py installimport stk
import numpy as np
# Create volume directly from numpy
vol = stk.Volume(np.zeros((5,5,5)).astype(np.float32), spacing=(2,2,2))
# or read volume from file
vol = stk.read_volume('test.nrrd')
# Modify data (numpy array points to the volume data)
data = np.array(vol, copy=False)
data[0:10] = 0.0
# Access meta data
vol.origin = (2, 2, 2)
vol.spacing = (3, 3, 3)
# Write volume
stk.write_volume('test-out.nrrd', vol)