Commit 05f16efc authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents f6fa3fa1 38efa4b1
......@@ -8,6 +8,9 @@
# default=HUD
#whiteList =Isosurface,Bounding Box, Direct Volume Rendering,Distance Map Isosurface,Gauss Filtering,HUD,Vector Plot,Write NIfTI # A list of modules that will be provided through the GUI. If the list is empty all available modules are provided.
## A list of modules that will be prevented from being present in the GUI.
blackList = Data Module
## Specify a ";" separated list of additional paths for modules. The order of appearance is the order of loading. The following additional rules apply here:
## 1. if the directory contains one or more libOWmodule_XYZ it/they get loaded
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
......
......@@ -11,6 +11,9 @@
## If the list is empty all available modules are provided.
whiteList = Arbitrary Plane,Coordinate System,Image Extractor,Paint Texture,Arbitrary Rois,Bounding Box,Distance Map Isosurface,Gauss Filtering,HUD,Isosurface,Isosurface Raytracer,LIC,Read Mesh,Voxelizer,Superquadric Glyphs,Triangle Mesh Renderer,Vector Plot,Write NIfTI,Fiber Display,Read Spherical Harmonics,Navigation Slices,Deterministic Tract Clustering using Gaussian Processes,Deterministic Tract to Gaussian Process Converter,Cluster Param Display,Write Tracts,Fiber Resampling,Teem Glyphs
## A list of modules that will be prevented from being present in the GUI.
blackList = Data Module
## Specify a ";" separated list of additional paths for modules. The order of appearance is the order of loading. The following additional rules apply here:
## 1. if the directory contains one or more libOWmodule_XYZ it/they get loaded
## 2. if the directory does not contain any libOWmodule_XYZ, the subdirectories get searched.
......
......@@ -7,6 +7,9 @@ IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
ENDIF()
IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
ADD_DEFINITIONS( -DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT )
ENDIF()
# append search path for FindModules:
#------------------------------------
......@@ -272,6 +275,7 @@ ADD_EXECUTABLE( walnut OpenWalnut.cpp version.h )
TARGET_LINK_LIBRARIES( walnut ${OWKernelName} ${OWDatahandlerName} ${OWguiName} ${OWguiqt4Name} ${OWCommonName} ${OWgeName} ${Boost_LIBRARIES} )
IF(MSVC_IDE)
ADD_DEFINITIONS( -DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT )
SET_TARGET_PROPERTIES( walnut PROPERTIES DEBUG_POSTFIX "d")
SET_TARGET_PROPERTIES( walnut PROPERTIES PREFIX "../")
ENDIF(MSVC_IDE)
......
......@@ -32,6 +32,9 @@
#include "WVector3D.h"
#include "../WDefines.h"
#define EIGEN_DONT_ALIGN_STATICALLY
#include "../../ext/Eigen/Core"
#include "../../ext/Eigen/LU"
......
......@@ -36,6 +36,9 @@
#include "../WStringUtils.h"
#include "../WDefines.h"
#define EIGEN_DONT_ALIGN_STATICALLY
#include "../../ext/Eigen/Core"
/**
......@@ -236,7 +239,7 @@ typedef WVector3D WPosition;
*
* \return the output stream
*/
OW_API_DEPRECATED std::ostream& operator<<( std::ostream& os, const WVector3D &rhs );
OW_API_DEPRECATED OWCOMMON_EXPORT std::ostream& operator<<( std::ostream& os, const WVector3D &rhs );
/**
......@@ -247,7 +250,7 @@ OW_API_DEPRECATED std::ostream& operator<<( std::ostream& os, const WVector3D &r
*
* \return the input stream
*/
OW_API_DEPRECATED std::istream& operator>>( std::istream& in, WVector3D &rhs );
OW_API_DEPRECATED OWCOMMON_EXPORT std::istream& operator>>( std::istream& in, WVector3D &rhs );
/**
* Multiplies a WVector3D with a scalar
......@@ -255,6 +258,6 @@ OW_API_DEPRECATED std::istream& operator>>( std::istream& in, WVector3D &rhs );
* \param lhs left hand side of product
* \param rhs right hand side of product
*/
OW_API_DEPRECATED WVector3D operator*( osg::Vec3d::value_type lhs, const WVector3D& rhs );
OW_API_DEPRECATED OWCOMMON_EXPORT WVector3D operator*( osg::Vec3d::value_type lhs, const WVector3D& rhs );
#endif // WVECTOR3D_H
......@@ -138,43 +138,43 @@ public:
/**
* Test complex SH coefficient conversion.
*/
void testComplex()
{
// calc a conversion matrix
std::vector< WVector3D > grad;
std::vector< unsigned int > edges;
tesselateIcosahedron( &grad, &edges, 3 );
edges.clear();
std::vector< WUnitSphereCoordinates > orientations;
for( std::size_t i = 0; i < grad.size(); ++i )
{
if( grad[ i ][ 0 ] > 0.0 )
{
orientations.push_back( WUnitSphereCoordinates( grad[ i ] ) );
}
}
grad.clear();
WVector_2 values( 15 );
for( std::size_t i = 0; i < 15; ++i )
{
values[ i ] = i / 15.0;
}
WSymmetricSphericalHarmonic sh( values );
WVectorComplex_2 values2 = sh.getCoefficientsComplex();
WMatrixComplex_2 complexBaseMatrix = WSymmetricSphericalHarmonic::calcComplexBaseMatrix( orientations, 4 );
WVectorComplex_2 res = complexBaseMatrix * values2;
for( std::size_t k = 0; k < orientations.size(); ++k )
{
TS_ASSERT_DELTA( res[ k ].imag(), 0.0, 1e-15 );
TS_ASSERT_DELTA( res[ k ].real(), sh.getValue( orientations[ k ] ), 1e-15 );
}
}
// void testComplex()
// {
// // calc a conversion matrix
// std::vector< WVector3D > grad;
// std::vector< unsigned int > edges;
// tesselateIcosahedron( &grad, &edges, 3 );
// edges.clear();
// std::vector< WUnitSphereCoordinates > orientations;
// for( std::size_t i = 0; i < grad.size(); ++i )
// {
// if( grad[ i ][ 0 ] > 0.0 )
// {
// orientations.push_back( WUnitSphereCoordinates( grad[ i ] ) );
// }
// }
// grad.clear();
// WVector_2 values( 15 );
// for( std::size_t i = 0; i < 15; ++i )
// {
// values[ i ] = i / 15.0;
// }
// WSymmetricSphericalHarmonic sh( values );
// WVectorComplex_2 values2 = sh.getCoefficientsComplex();
// WMatrixComplex_2 complexBaseMatrix = WSymmetricSphericalHarmonic::calcComplexBaseMatrix( orientations, 4 );
// WVectorComplex_2 res = complexBaseMatrix * values2;
// for( std::size_t k = 0; k < orientations.size(); ++k )
// {
// TS_ASSERT_DELTA( res[ k ].imag(), 0.0, 1e-15 );
// TS_ASSERT_DELTA( res[ k ].real(), sh.getValue( orientations[ k ] ), 1e-15 );
// }
// }
};
#endif // WSYMMETRICSPHERICALHARMONIC_TEST_H
......@@ -81,20 +81,54 @@ public:
/**
* Test if the loaded files are really loaded
*/
void testLoading( void )
void testLoading1( void )
{
WReaderNIfTI reader1( "../fixtures/scalar_signed_short.nii.gz" );
WReaderNIfTI reader2( "../fixtures/scalar_unsigned_char.nii.gz" );
WReaderNIfTI reader3( "../fixtures/scalar_float.nii.gz" );
WReaderNIfTI reader4( "../fixtures/vector_float.nii.gz" );
WReaderNIfTI reader5( "../fixtures/symmetric_2nd_order_tensor_float.nii.gz" );
WReaderNIfTI reader6( "../fixtures/vector_unsigned_char.nii.gz" );
TS_ASSERT( reader1.load() );
}
/**
* Test if the loaded files are really loaded
*/
void testLoading2( void )
{
WReaderNIfTI reader2( "../fixtures/scalar_unsigned_char.nii.gz" );
TS_ASSERT( reader2.load() );
}
/**
* Test if the loaded files are really loaded
*/
void testLoading3( void )
{
WReaderNIfTI reader3( "../fixtures/scalar_float.nii.gz" );
TS_ASSERT( reader3.load() );
}
/**
* Test if the loaded files are really loaded
*/
void testLoading4( void )
{
WReaderNIfTI reader4( "../fixtures/vector_float.nii.gz" );
TS_ASSERT( reader4.load() );
}
/**
* Test if the loaded files are really loaded
*/
void testLoading5( void )
{
WReaderNIfTI reader5( "../fixtures/symmetric_2nd_order_tensor_float.nii.gz" );
TS_ASSERT( reader5.load() );
}
/**
* Test if the loaded files are really loaded
*/
void testLoading6( void )
{
WReaderNIfTI reader6( "../fixtures/vector_unsigned_char.nii.gz" );
TS_ASSERT( reader6.load() );
}
......
......@@ -47,13 +47,19 @@ WQtCombinerActionList::WQtCombinerActionList( QWidget* parent, WIconManager* ico
WPreferences::getPreference( "modules.whiteList", &moduleWhiteListString );
std::vector< std::string > moduleWhiteList = string_utils::tokenize( moduleWhiteListString, "," );
// These modules will be forbidden to be shown.
std::string moduleBlackListString;
WPreferences::getPreference( "modules.blackList", &moduleBlackListString );
std::vector< std::string > moduleBlackList = string_utils::tokenize( moduleBlackListString, "," );
// create an action for each group:
for ( WCombinerTypes::WCompatiblesList::iterator groups = compatibles.begin(); groups != compatibles.end(); ++groups )
{
// check current prototype against whitelist
// check current prototype against whitelist and blacklist
if( !ignoreWhiteList && // ignore the whitelist?
moduleWhiteList.size() && // whitelist empty?
std::find( moduleWhiteList.begin(), moduleWhiteList.end(), groups->first->getName() ) == moduleWhiteList.end() )
std::find( moduleWhiteList.begin(), moduleWhiteList.end(), groups->first->getName() ) == moduleWhiteList.end()
|| std::find( moduleBlackList.begin(), moduleBlackList.end(), groups->first->getName() ) != moduleBlackList.end() )
{
continue;
}
......
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