Documentation/Nightly/Extensions/BlendVectorVolumes

From Slicer Wiki
Jump to: navigation, search
Home < Documentation < Nightly < Extensions < BlendVectorVolumes

For the stable Slicer documentation, visit the 4.10 page.

Introduction and Acknowledgements

Extension: OpenCVExample
Acknowledgments: This work was supported by a supplement to the Quantitative Image Informatics project via the NIH-National Cancer Institute Grant U24 CA180918-03 as well as U24 CA180924 Tools to Analyze Morphology and Spatially Mapped Molecular Data with Stony Brook University.
Author: Nicole Aucoin (SPL)
Contact: Nicole Aucoin, <email>nicole@bwh.harvard.edu</email>

Quantitative Image Informatics for Cancer Research  
Surgical Planning Laboratory (SPL)  

Module Description

This is a CLI module that depends on the SlicerOpenCV extension, providing a way to blend two vector volumes together. It uses the OpenCV function addWeighted.

Use Cases

When loading in RGB files, they are loaded as vector volumes in Slicer. Use this module to blend them together if they have the same dimensions.

Tutorials

Panels and their use

Blend Vector Volumes GUI

IO:

  • Alpha: A double value between 0.0 and 1.0 that gives the weight of the first input image in the resulting blend.
  • Gamma: A double value that is added to the weighted blend, used to increase or decrease intensity.
  • First Input Volume: First input vector volume
  • Second Input Volume: Second input vector volume, must have the same dimensions as the first input volume.
  • Output Volume: Output vector volume, holding the blending of the two input volumes, Can be a newly created vector volume.

Similar Modules

References

Information for Developers


To depend on the OpenCV provided by the SlicerOpenCV extension, in the CLI's CMakeLists.txt file define OpenCV_DIR by finding the package that SlicerOpenCV provided:

 find_package(OpenCV 3.1 REQUIRED)
  • The header include path is defined as:
 get_filename_component(OpenCV_INCLUDE_DIR ${OpenCV_DIR}/../../include ABSOLUTE)
  • Add ${OpenCV_INCLUDE_DIR} to the MODULE_INCLUDE_DIRECTORIES list
  • Link against the OpenCV libraries by adding ${OpenCV_LIBS} to the MODULE_TARGET_LIBRARIES

OpenCVExample provides some more information about writing an extension that includes modules that depend on OpenCV

The images are read in using the opencv imread method. The blending is done by the opencv addWeighted function, and the output is written using imwrite.