Commit fa86b77c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[DELETE] removed imageSpaceTensorLIC. It is in the main openwalnut repo now.

parent 11eccbce
You are free to copy, modify and re-distribute these files as you like.
* This is an example of how to create your own module toolbox
for OpenWalnut (http://www.openwalnut.org).
* You should have a look at our WIKI for further details under
http://www.openwalnut.org/projects/openwalnut/wiki/Module_ExternalDevelopment
* It basically creates one library with two modules in it.
You can use this example as your basic development setup
and extend it as you need.
* Please contact us if you have trouble or if you have added
platform support to the OpenWalnut.cmake script. We
appreciate your help!
Happy coding!
- The OpenWalnut Team -
# OW Version File. This file specifies the version. The line VERSION=X.Y.Z is
# used and parsed. This file has to be here everytime. The VERSION needs to be
# set properly or CMake will fail.
#
# SYNTAX: The version string always is 1.2.3 with an optional postfix of "+hg1234".
# This is useful if building is done by scripts. If you want to automatically
# add the correct HG revision, use only +hgX without number.
#
# IMPORTANT: If you modify the file, cmake re-creates the version header. But
# it is not able to set all library version. Please re-run cmake if
# you change something here.
#
# NOTE: do not add a space after #. The current CMake script will fail.
# Examples:
#VERSION=1.2.0
#VERSION=1.2.0+hgX -> replaces the X with the current revision number
#VERSUIB=1.2.0+hg1234 -> here, revision number was set by the build scripts for example.
VERSION=0.1.0+hgX
This diff is collapsed.
<doxygenlayout version="1.0">
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title=""/>
<tab type="modules" visible="yes" title="Groups"/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespaces" visible="yes" title=""/>
<tab type="namespacemembers" visible="yes" title=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classes" visible="yes" title=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title=""/>
<tab type="classmembers" visible="yes" title=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="files" visible="yes" title=""/>
<tab type="globals" visible="yes" title=""/>
</tab>
<tab type="dirs" visible="yes" title=""/>
<tab type="examples" visible="yes" title=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<dirs visible="yes" title=""/>
<nestedgroups visible="yes" title=""/>
<files visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
#---------------------------------------------------------------------------
#
# Project: OpenWalnut ( http://www.openwalnut.org )
#
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
# For more information see http://www.openwalnut.org/copying
#
# This file is part of OpenWalnut.
#
# OpenWalnut is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenWalnut is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
#
#---------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# General CMake Setup
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT( ImageSpaceTensorLIC )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Include the OpenWalnut build system.
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# where to find our utils and cmake modules?
SET( OW_TOOLS_DIR ${PROJECT_SOURCE_DIR}/../tools )
# append search path for FindModules:
LIST( APPEND CMAKE_MODULE_PATH ${OW_TOOLS_DIR}/cmake )
# These scripts contains all the needed tools to setup the build:
# * Compiler Setup
# * Common OpenWalnut Options
# * Third-party Dependencies Setup
# * Unit Testing Setup if found
# * Doxygen Setup if found
INCLUDE( OpenWalnut )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Setup your additional dependencies and tools
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# IMPORTANT: NEVER add any commands bore the line INCLUDE( OpenWalnut ). This might cause problems!
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Setup all modules
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Here, you can add your own targets, call ADD_MODULE provided by OpenWalnut or a combination of it. When using ADD_MODULE or SETUP_MODULE, the
# OpenWalnut CMake scripts manages proper resource handling, test compilation and similar. You should use it whenever possible. More details on
# how to develop external modules, have a look at http://www.openwalnut.org. You can have a look at OpenWalnut.cmake if you want to modify
# the default behaviour.
# Please see the documentation of SETUP_MODULE as it shows how to add custom dependencies (third-party libs)
SETUP_MODULE(
${PROJECT_NAME} # use project name as module(-toolbox) name
"." # where to find the sources
"" # no additonal dependencies
"" # no sources to exclude
)
# Tell CMake that we want to use the WToolboxVersion header in our Modules. It gets created automatically if you keep this line.
SETUP_USE_VERSION_HEADER( ${PROJECT_NAME} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Additional Setup
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Add the files under ../resources/MyGlobalResources as additional, global resources
# The first parameter is the directory name, the second parameter is the component name. This is used during installation to identify to which
# install component this belongs. The name is arbitrary but must be unique.
#
# NOTE: The first parameter of SETUP_MODULE is not allowed as component name here because SETUP_MODULE already registers this component. Simply
# append some string.
# SETUP_GLOBAL_RESOURCES( "MyGlobalResources" ${PROJECT_NAME}_Global )
This diff is collapsed.
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WMIMAGESPACETENSORLIC_H
#define WMIMAGESPACETENSORLIC_H
#include <string>
#include <vector>
#include "core/dataHandler/WDataSetVector.h"
#include "core/graphicsEngine/WTriangleMesh.h"
#include "core/graphicsEngine/WGEManagedGroupNode.h"
#include "core/kernel/WModule.h"
#include "core/kernel/WModuleInputData.h"
/**
* This module takes a second order symmetric tensor dataset and uses it to apply an image space based (fast) fabric-like LIC to an arbitrary
* surface. The surface can be specified as tri mesh or, if not specified, slices.
*
* \ingroup modules
*/
class WMImageSpaceTensorLIC: public WModule
{
public:
/**
* Default constructor.
*/
WMImageSpaceTensorLIC();
/**
* Destructor.
*/
virtual ~WMImageSpaceTensorLIC();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual const std::string getName() const;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual const std::string getDescription() const;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual boost::shared_ptr< WModule > factory() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void moduleMain();
/**
* Initialize the connectors this module is using.
*/
virtual void connectors();
/**
* Initialize the properties for this module.
*/
virtual void properties();
private:
/**
* Initializes the needed geodes, transformations and vertex arrays. This needs to be done once for each new dataset.
*
* \param grid the grid to places the slices in
* \param mesh the mesh to use if not NULL and m_useSlices is false
*/
void initOSG( boost::shared_ptr< WGridRegular3D > grid, boost::shared_ptr< WTriangleMesh > mesh );
/**
* The input connector containing the DTI field whose derived field is used for LIC.
*/
boost::shared_ptr< WModuleInputData< WDataSetVector > > m_evec1In;
/**
* The input connector containing the DTI field whose derived field is used for LIC.
*/
boost::shared_ptr< WModuleInputData< WDataSetVector > > m_evec2In;
/**
* The input connector containing the DTI field whose derived field is used for LIC.
*/
boost::shared_ptr< WModuleInputData< WDataSetVector > > m_evalsIn;
/**
* The input containing the surface on which the LIC should be applied on
*/
boost::shared_ptr< WModuleInputData< WTriangleMesh > > m_meshIn;
/**
* A property allowing the user to select whether the slices or the mesh should be used
*/
WPropSelection m_geometrySelection;
/**
* A list of items that can be selected using m_geometrySelection.
*/
boost::shared_ptr< WItemSelection > m_geometrySelections;
/**
* A condition used to notify about changes in several properties.
*/
boost::shared_ptr< WCondition > m_propCondition;
/**
* The Geode containing all the slices and the mesh
*/
osg::ref_ptr< WGEGroupNode > m_output;
/**
* Scene root node.
*/
osg::ref_ptr< WGEManagedGroupNode > m_root;
WPropGroup m_sliceGroup; //!< the group contains several slice properties
WPropGroup m_geometryGroup; //!< the group contains several input geometry parameters
WPropGroup m_licGroup; //!< the group contains several LIC properties
WPropBool m_useSlices; //!< indicates whether the vector should be shown on slices or input geometry
WPropInt m_xPos; //!< x position of the slice
WPropInt m_yPos; //!< y position of the slice
WPropInt m_zPos; //!< z position of the slice
WPropBool m_showonX; //!< indicates whether the vector should be shown on slice X
WPropBool m_showonY; //!< indicates whether the vector should be shown on slice Y
WPropBool m_showonZ; //!< indicates whether the vector should be shown on slice Z
WPropBool m_showHUD; //!< indicates whether to show the texture HUD
WPropBool m_useEdges; //!< indicates whether to show the edges
WPropColor m_useEdgesColor; //!< indicated whether the edges (if enabled) should be black or white or green or red or ....
WPropDouble m_useEdgesStep; //!< define the steepness of the step function used to blend in the edge color.
WPropBool m_useLight; //!< indicates whether to use Phong
WPropDouble m_lightIntensity; //!< light intensity
WPropInt m_numIters; //!< the number of iterations done per frame
WPropDouble m_cmapRatio; //!< the ratio between colormap and LIC
WPropDouble m_projectionAngleThreshold; //!< the angle threshold between surface and vector before clipping the vector.
/**
* The group for more advanced LIC features
*/
WPropGroup m_advancedLicGroup;
/**
* The resolution scaling for the noise
*/
WPropDouble m_noiseRes;
/**
* Clipp according to FA.
*/
WPropDouble m_faClip;
};
#endif // WMIMAGESPACETENSORLIC_H
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
// This file's purpose is to provide a list of modules and additional extensions as entry point for OpenWalnut's module loader.
// Both functAdd your modules here. If you miss this step, OpenWalnut will not be able to load your modules/extensions.
#include <boost/shared_ptr.hpp>
#include <core/kernel/WModule.h>
#include "WMImageSpaceTensorLIC.h"
/**
* This function is called by OpenWalnut, when loading your library to learn about the modules you provide. The function is called with a given
* list reference, where you add all of your modules. Modules which are not registered this way, cannot be used in OpenWalnut. As this is called
* before loading any project file or running any module, it is ensured that you can rely on the modules provided here in your project files and
* other modules.
*
* \note this function is optional. You can remove it if you do not need it.
*
* \param m the list of modules. Add you module instances into this list.
*/
extern "C" void WLoadModule( WModuleList& m ) // NOLINT
{
// This line is needed by the module loader to actually find your module. You need to add this to your module too. Do NOT add a ";" here.
m.push_back( boost::shared_ptr< WModule >( new WMImageSpaceTensorLIC ) );
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV-Leipzig and CNCF-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <iostream>
#include <vector>
#include <boost/random.hpp>
#include <core/common/exceptions/WPreconditionNotMet.h>
#include "WTuringTextureCreator.h"
WTuringTextureCreator::WTuringTextureCreator( std::size_t numThreads )
: m_numIterations( 100 ),
m_spotIrregularity( 0.1 ),
m_spotSize( 0.1 )
{
WPrecond( numThreads > 0, "" );
for( std::size_t k = 0; k < numThreads; ++k )
{
m_threads.push_back( boost::shared_ptr< TextureThread >( new TextureThread( k, numThreads ) ) );
}
}
WTuringTextureCreator::~WTuringTextureCreator()
{
}
void WTuringTextureCreator::setNumIterations( std::size_t iter )
{
WPrecond( iter > 0, "Invalid number of iterations!" );
m_numIterations = iter;
}