Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Commit 3f841777 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Merge branch 'issue144' of /mnt/bigone/git/repositories/berge/campvis into development

parents d4322ecc 68238109
......@@ -42,6 +42,104 @@ MACRO(PARSE_HEADER_FOR_PIPELINE FileName)
ENDFOREACH()
ENDMACRO(PARSE_HEADER_FOR_PIPELINE)
MACRO(INCLUDE_MODULE ModuleDirectory ModuleListFile)
LIST(APPEND CampvisEnabledModules ${ModuleDirectory})
SET(ThisModDir ${ModulesDir}/${ModuleDirectory})
# load .cmake file
INCLUDE(${ModuleListFile})
# merge module settings into global settings
LIST(APPEND CampvisModulesDefinitions ${ThisModDefinitions})
LIST(APPEND CampvisModulesIncludeDirs ${ThisModIncludeDirs})
LIST(APPEND CampvisModulesExternalLibs ${ThisModExternalLibs})
LIST(APPEND CampvisModulesLinkDirectories ${ThisModLinkDirectories})
LIST(APPEND CampvisModulesSources ${ThisModSources})
LIST(APPEND CampvisModulesHeaders ${ThisModHeaders})
LIST(APPEND CampvisModulesCoreSources ${ThisModCoreSources})
LIST(APPEND CampvisModulesCoreHeaders ${ThisModCoreHeaders})
LIST(APPEND CampvisExternalDllsDebug ${ThisModExternalDllsDebug})
LIST(APPEND CampvisExternalDllsRelease ${ThisModExternalDllsRelease})
# save dependencies in a variable to resolve them later
SET(${ModuleDirectory}ModDependencies ${ThisModDependencies})
# add shader directory to deployment list
LIST(APPEND CampvisShaderDirectories ${ThisModShaderDirectories})
# add definition that this module is activated
LIST(APPEND CampvisGlobalDefinitions -DCAMPVIS_HAS_MODULE_${ModuleDirectoryUpper})
# parse all header files for pipeline classes to add them to the pipeline registration
FOREACH(HeaderFile ${ThisModHeaders})
PARSE_HEADER_FOR_PIPELINE("modules/${HeaderFile}")
ENDFOREACH()
# unset module settings to avoid duplicates if module cmake file misses sth.
UNSET(ThisModDefinitions)
UNSET(ThisModIncludeDirs)
UNSET(ThisModExternalLibs)
UNSET(ThisModLinkDirectories)
UNSET(ThisModSources)
UNSET(ThisModHeaders)
UNSET(ThisModCoreSources)
UNSET(ThisModCoreHeaders)
UNSET(ThisModExternalDllsDebug)
UNSET(ThisModExternalDllsRelease)
UNSET(ThisModShaderDirectories)
UNSET(ThisModDependencies)
ENDMACRO(INCLUDE_MODULE)
MACRO(RESOLVE_MODULE_DEPENDENCIES)
# Iterate over all enabled modules and their dependencies.
# A WHILE loop is used here because FOREACH doesn't see changes to the list it processes.
# As a result, transitive dependencies would require several CMake runs to be resolved.
WHILE(CampvisEnabledModules)
LIST(GET CampvisEnabledModules 0 Mod)
LIST(REMOVE_AT CampvisEnabledModules 0)
FOREACH(Dep ${${Mod}ModDependencies})
# Check if the dependency exists
LIST(FIND CampvisModules ${Dep} DepExists)
STRING(TOUPPER ${Dep} DepUpper)
IF(DepExists EQUAL -1)
MESSAGE(WARNING "Dependency '${Dep}' of module '${Mod}' not found!")
ELSEIF(NOT CAMPVIS_BUILD_MODULE_${DepUpper})
# Enable the dependency if required
MESSAGE(STATUS "Enabling module '${Dep}' (required by '${Mod}')")
SET(CAMPVIS_BUILD_MODULE_${DepUpper} ON CACHE BOOL "Build module ${Dep} (required by ${Mod})" FORCE)
SET(ModFile ${ModulesDir}/${Dep}/${Dep}.cmake)
INCLUDE_MODULE(${Dep} ${ModFile})
ENDIF(DepExists EQUAL -1)
ENDFOREACH(Dep ${${Mod}ModDependencies})
UNSET(${Mod}ModDependencies)
ENDWHILE(CampvisEnabledModules)
ENDMACRO(RESOLVE_MODULE_DEPENDENCIES)
MACRO(SET_DEFAULT_MODULES DefaultModules)
# Only enable default modules on the first CMake run
IF(NOT DEFAULT_CAMPVIS_MODULES_SET)
FOREACH(Mod ${DefaultModules})
# Check if the module exists
LIST(FIND CampvisModules ${Mod} ModExists)
STRING(TOUPPER ${Mod} ModUpper)
IF(ModExists EQUAL -1)
MESSAGE(WARNING "Default module '${Mod}' not found!")
ELSEIF(NOT CAMPVIS_BUILD_MODULE_${ModUpper})
# Enable the module if required
MESSAGE(STATUS "Enabling default module '${Mod}'")
SET(CAMPVIS_BUILD_MODULE_${ModUpper} ON CACHE BOOL "Build default module ${Mod}" FORCE)
SET(ModFile ${ModulesDir}/${Mod}/${Mod}.cmake)
INCLUDE_MODULE(${Mod} ${ModFile})
ENDIF(ModExists EQUAL -1)
ENDFOREACH(Mod ${DefaultModules})
ENDIF(NOT DEFAULT_CAMPVIS_MODULES_SET)
SET(DEFAULT_CAMPVIS_MODULES_SET 1 CACHE INTERNAL "")
ENDMACRO(SET_DEFAULT_MODULES DefaultModules)
# copy and pasted from Voreen...
......
......@@ -8,60 +8,22 @@ MESSAGE(STATUS "Detecting installed modules:")
SET(ModulesDir ${CampvisHome}/modules)
LIST_SUBDIRECTORIES(ModDirs ${ModulesDir} false)
# remove CMake and SVN realated directories from list
# remove CMake and SVN related directories from list
LIST(REMOVE_ITEM ModDirs CMakeFiles campvis-modules.dir .svn)
# go through each subdirectory
FOREACH(ModDir ${ModDirs})
# check whether module.cmake file exists
# check whether module.cmake file exists
SET(ModFile ${ModulesDir}/${ModDir}/${ModDir}.cmake)
IF(EXISTS ${ModFile})
STRING(TOLOWER ${ModDir} ModDirLower)
STRING(TOUPPER ${ModDir} ModDirUpper)
LIST(APPEND CampvisModules ${ModDir})
# check whether the option to build this very module exists and is checked
IF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
MESSAGE(STATUS "* Found Module '${ModDir}' : ENABLED")
SET(ThisModDir ${ModulesDir}/${ModDir})
# load .cmake file
INCLUDE(${ModFile})
# merge module settings into global settings
LIST(APPEND CampvisModulesDefinitions ${ThisModDefinitions})
LIST(APPEND CampvisModulesIncludeDirs ${ThisModIncludeDirs})
LIST(APPEND CampvisModulesExternalLibs ${ThisModExternalLibs})
LIST(APPEND CampvisModulesLinkDirectories ${ThisModLinkDirectories})
LIST(APPEND CampvisModulesSources ${ThisModSources})
LIST(APPEND CampvisModulesHeaders ${ThisModHeaders})
LIST(APPEND CampvisModulesCoreSources ${ThisModCoreSources})
LIST(APPEND CampvisModulesCoreHeaders ${ThisModCoreHeaders})
LIST(APPEND CampvisExternalDllsDebug ${ThisModExternalDllsDebug})
LIST(APPEND CampvisExternalDllsRelease ${ThisModExternalDllsRelease})
# add shader directory to deployment list
LIST(APPEND CampvisShaderDirectories ${ThisModShaderDirectories})
# add definition that this module is activated
LIST(APPEND CampvisGlobalDefinitions -DCAMPVIS_HAS_MODULE_${ModDirUpper})
# parse all header files for pipeline classes to add them to the pipeline registration
FOREACH(HeaderFile ${ThisModHeaders})
PARSE_HEADER_FOR_PIPELINE("modules/${HeaderFile}")
ENDFOREACH()
# unset module settings to avoid duplicates if module cmake file misses sth.
UNSET(ThisModDefinitions)
UNSET(ThisModIncludeDirs)
UNSET(ThisModExternalLibs)
UNSET(ThisModLinkDirectories)
UNSET(ThisModSources)
UNSET(ThisModHeaders)
UNSET(ThisModCoreSources)
UNSET(ThisModCoreHeaders)
UNSET(ThisModExternalDllsDebug)
UNSET(ThisModExternalDllsRelease)
UNSET(ThisModShaderDirectories)
INCLUDE_MODULE(${ModDir} ${ModFile})
ELSE()
MESSAGE(STATUS "* Found Module '${ModDir}'")
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
......
......@@ -3,6 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
#INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring Campvis Modules")
SET_DEFAULT_MODULES("vis")
RESOLVE_MODULE_DEPENDENCIES()
WRITE_PIPELINE_REGISTRATION("gen_pipelineregistration.h")
LIST(APPEND CampvisModulesHeaders
......
......@@ -39,15 +39,11 @@ namespace campvis {
SliceVis::SliceVis(DataContainer* dc)
: AutoEvaluationPipeline(dc)
, _imageReader()
, _gvg()
, _lhh()
, _sliceExtractor(&_canvasSize)
, _wheelHandler(&_sliceExtractor.p_zSliceNumber)
, _tfWindowingHandler(&_sliceExtractor.p_transferFunction)
{
addProcessor(&_imageReader);
// addProcessor(&_gvg);
// addProcessor(&_lhh);
addProcessor(&_sliceExtractor);
addEventListenerToBack(&_wheelHandler);
addEventListenerToBack(&_tfWindowingHandler);
......@@ -61,13 +57,9 @@ namespace campvis {
_imageReader.p_url.setValue("D:\\Medical Data\\Dentalscan\\dental.mhd");
_imageReader.p_targetImageID.setValue("reader.output");
_imageReader.p_targetImageID.addSharedProperty(&_gvg.p_sourceImageID);
_imageReader.p_targetImageID.addSharedProperty(&_lhh.p_intensitiesId);
_imageReader.p_targetImageID.addSharedProperty(&_sliceExtractor.p_sourceImageID);
_imageReader.s_validated.connect(this, &SliceVis::onProcessorValidated);
// _gvg._outputGradients.connect(&_lhh._inputGradients);
_sliceExtractor.p_xSliceNumber.setValue(0);
// TODO: replace this hardcoded domain by automatically determined from image min/max values
......
......@@ -36,8 +36,6 @@
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/io/processors/mhdimagereader.h"
#include "modules/vis/processors/sliceextractor.h"
#include "modules/preprocessing/processors/gradientvolumegenerator.h"
#include "modules/preprocessing/processors/lhhistogram.h"
namespace campvis {
class SliceVis : public AutoEvaluationPipeline {
......@@ -71,8 +69,6 @@ namespace campvis {
virtual void onProcessorValidated(AbstractProcessor* processor);
MhdImageReader _imageReader;
GradientVolumeGenerator _gvg;
LHHistogram _lhh;
SliceExtractor _sliceExtractor;
MWheelToNumericPropertyEventListener _wheelHandler;
......
......@@ -15,4 +15,4 @@ FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
)
SET(ThisModShaderDirectories "modules/vis/glsl")
SET(ThisModDependencies devil io)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment