Commit 8c7cfad7 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE] - merged in 1.2.5 release

parents 9eb39a75 c18c5764
......@@ -64,9 +64,9 @@ and get the URL to our mercurial repository.
Required Dependencies:
----------------------
* Qt4 (>= 4.3)
* Qt4 (>= 4.6)
* OpenSceneGraph (>= 2.8.0)
* Boost (>= 1.39.0)
* Boost (>= 1.42.0)
Compilation on Unix-like systems:
---------------------------------
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = OpenWalnut
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.1+
PROJECT_NUMBER = 1.2.5
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = OpenWalnut
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.1+
PROJECT_NUMBER = 1.2.5
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
......@@ -5,5 +5,5 @@
## and project files.
## recommendation list:
recommended = 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,Grid Renderer,Spatial Derivation,Scalar Operator,Vector Operator,Colormapper
recommended = 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,Fiber Display Simple,Read Spherical Harmonics,Navigation Slices,Deterministic Tract Clustering using Gaussian Processes,Deterministic Tract to Gaussian Process Converter,Cluster Param Display,Write Tracts,Fiber Resampling,Grid Renderer,Spatial Derivation,Scalar Operator,Vector Operator,Colormapper
......@@ -37,33 +37,6 @@
*/
namespace wlimits
{
/**
* Maximum sample size per axis for image
* data like MRI, CT, funcMRI and dwMRI.
*/
static const unsigned int MAX_IMAGE_DIMENSION = 256;
/**
* Maximum number of channels for a certain modality.
*/
static const unsigned int MAX_RECORDING_CHANNELS = 1024;
/**
* Maximum number of samples of a recording.
* (2^32)-1 this is often equal to UINT_MAX
*/
static const unsigned int MAX_RECORDING_SAMPLES = 4294967295U;
/**
* Maximum number of segments of a recording.
*/
static const unsigned int MAX_RECORDING_SEGMENTS = 128;
/**
* Maximum samplimg frequency of a recording.
*/
static const unsigned int MAX_RECORDING_SAMPLING_FREQUENCY = 20000;
static const double MAX_DOUBLE = std::numeric_limits< double >::max(); //!< Maximum double value
static const float MAX_FLOAT = std::numeric_limits< float >::max(); //!< Maximum float value
......@@ -105,12 +78,6 @@ namespace wlimits
* \return True if the value is infinity, false otherwise.
*/
template< typename T > bool isinf( T value );
//! The maximum texture dimension.
static std::size_t const MAX_TEXTURE_DIMENSION = 2048;
//! We support only 8 textures because some known hardware does not support more texture coordinates.
static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
}
template< typename T > bool wlimits::isnan( T value )
......
......@@ -213,7 +213,8 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture( T* source, int compone
for( unsigned int i = 0; i < nbVoxels; ++i )
{
data[ 2 * i ] = WDataTexture3DScalers::scaleInterval( source[i], min, max, scaler );
data[ ( 2 * i ) + 1] = source[i] != min;
// NOTE: this is done to avoid ugly black borders when interpolation is active.
data[ ( 2 * i ) + 1] = wge::GLType< T >::FullIntensity() * ( source[i] != min );
}
}
else if( components == 2)
......@@ -228,8 +229,8 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture( T* source, int compone
{
data[ ( 4 * i ) ] = WDataTexture3DScalers::scaleInterval( source[ ( 2 * i ) ], min, max, scaler );
data[ ( 4 * i ) + 1 ] = WDataTexture3DScalers::scaleInterval( source[ ( 2 * i ) + 1 ], min, max, scaler );
data[ ( 4 * i ) + 2 ] = 0.0;
data[ ( 4 * i ) + 3 ] = 1.0;
data[ ( 4 * i ) + 2 ] = 0;
data[ ( 4 * i ) + 3 ] = wge::GLType< T >::FullIntensity();
}
}
else if( components == 3)
......@@ -245,7 +246,7 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture( T* source, int compone
data[ ( 4 * i ) ] = WDataTexture3DScalers::scaleInterval( source[ ( 3 * i ) ], min, max, scaler );
data[ ( 4 * i ) + 1 ] = WDataTexture3DScalers::scaleInterval( source[ ( 3 * i ) + 1 ], min, max, scaler );
data[ ( 4 * i ) + 2 ] = WDataTexture3DScalers::scaleInterval( source[ ( 3 * i ) + 2 ], min, max, scaler );
data[ ( 4 * i ) + 3 ] = 1.0;
data[ ( 4 * i ) + 3 ] = wge::GLType< T >::FullIntensity();
}
}
else if( components == 4)
......
......@@ -25,7 +25,6 @@
#include <string>
#include "../common/WPrototyped.h"
#include "../common/WLimits.h"
#include "WEEG.h"
......@@ -37,15 +36,15 @@ WEEG::WEEG( const WEEGSegmentArray& data,
const WEEGChannelLabels& channelLabels )
: WRecording()
{
assert( data.size() <= wlimits::MAX_RECORDING_SEGMENTS );
assert( data.size() <= WRecording::MAX_RECORDING_SEGMENTS );
assert( data.size() > 0 ); // ensure that ther is really data
for( WEEGSegmentArray::const_iterator it1 = data.begin(); it1 != data.end(); ++it1 )
{
assert( it1->size() <= wlimits::MAX_RECORDING_CHANNELS );
assert( it1->size() <= WRecording::MAX_RECORDING_CHANNELS );
assert( it1->size() > 0 ); // ensure that ther is really data
for( WEEGSegment::const_iterator it2 = it1->begin(); it2 != it1->end(); ++it2 )
{
assert( it2->size() <= wlimits::MAX_RECORDING_SAMPLES );
assert( it2->size() <= WRecording::MAX_RECORDING_SAMPLES );
assert( it2->size() > 0 ); // ensure that ther is really data
}
}
......
......@@ -30,7 +30,6 @@
#include <boost/shared_ptr.hpp>
#include "../common/WLimits.h"
#include "../common/exceptions/WOutOfBounds.h"
#include "exceptions/WDHException.h"
#include "io/WPagerEEG.h"
......@@ -55,19 +54,19 @@ WEEG2::WEEG2( boost::shared_ptr< WPagerEEG > pager, boost::shared_ptr< WEEGPosit
}
std::size_t nbSegments = pager->getNumberOfSegments();
if( nbSegments <= 0 || wlimits::MAX_RECORDING_SEGMENTS < nbSegments )
if( nbSegments <= 0 || WRecording::MAX_RECORDING_SEGMENTS < nbSegments )
{
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of segments" ) );
}
std::size_t nbChannels = pager->getNumberOfChannels();
if( nbChannels <= 0 || wlimits::MAX_RECORDING_CHANNELS < nbChannels )
if( nbChannels <= 0 || WRecording::MAX_RECORDING_CHANNELS < nbChannels )
{
throw WDHException( std::string( "Couldn't construct new EEG: invalid number of channels" ) );
}
m_samplingRate = pager->getSamplingRate();
if( m_samplingRate <= 0.0 || wlimits::MAX_RECORDING_SAMPLING_FREQUENCY < m_samplingRate )
if( m_samplingRate <= 0.0 || WRecording::MAX_RECORDING_SAMPLING_FREQUENCY < m_samplingRate )
{
throw WDHException( std::string( "Couldn't construct new EEG: invalid sampling rate" ) );
}
......
......@@ -29,13 +29,12 @@
#include <boost/shared_ptr.hpp>
#include "../common/WLimits.h"
#include "../common/exceptions/WOutOfBounds.h"
#include "WEEG2Segment.h"
#include "WEEGValueMatrix.h"
#include "WRecording.h"
#include "exceptions/WDHException.h"
#include "io/WPagerEEG.h"
#include "WEEGValueMatrix.h"
#include "WEEG2Segment.h"
WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG > pager )
: m_segmentID( segmentID ),
......@@ -54,7 +53,7 @@ WEEG2Segment::WEEG2Segment( std::size_t segmentID, boost::shared_ptr< WPagerEEG
}
m_nbSamples = m_pager->getNumberOfSamples( m_segmentID );
if( m_nbSamples <= 0 || wlimits::MAX_RECORDING_SAMPLES < m_nbSamples )
if( m_nbSamples <= 0 || WRecording::MAX_RECORDING_SAMPLES < m_nbSamples )
{
throw WDHException( std::string( "Couldn't construct new EEG segment: invalid number of samples" ) );
}
......
......@@ -67,6 +67,27 @@ public:
*/
static boost::shared_ptr< WPrototyped > getPrototype();
/**
* Maximum number of channels for a certain modality.
*/
static const unsigned int MAX_RECORDING_CHANNELS = 1024;
/**
* Maximum number of samples of a recording.
* (2^32)-1 this is often equal to UINT_MAX
*/
static const unsigned int MAX_RECORDING_SAMPLES = 4294967295U;
/**
* Maximum number of segments of a recording.
*/
static const unsigned int MAX_RECORDING_SEGMENTS = 128;
/**
* Maximum samplimg frequency of a recording.
*/
static const unsigned int MAX_RECORDING_SAMPLING_FREQUENCY = 20000;
protected:
/**
......
......@@ -54,6 +54,12 @@ template < typename TextureType = osg::Texture >
class WGETexture: public TextureType
{
public:
//! We support only 8 textures because some known hardware does not support more texture coordinates.
static std::size_t const MAX_NUMBER_OF_TEXTURES = 8;
//! The maximum texture dimension.
static std::size_t const MAX_TEXTURE_DIMENSION = 2048;
/**
* Default constructor. Creates an empty instance of the texture.
*
......
......@@ -67,6 +67,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
/**
......@@ -85,6 +92,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
/**
......@@ -103,6 +117,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_BYTE;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 127; } // NOLINT
};
/**
......@@ -121,6 +142,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_UNSIGNED_BYTE;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 255; } // NOLINT
};
/**
......@@ -141,6 +169,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
/**
......@@ -161,6 +196,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
/**
......@@ -181,6 +223,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
/**
......@@ -201,6 +250,13 @@ namespace wge
* The enum type of OpenGL
*/
static const GLenum TypeEnum = GL_FLOAT;
/**
* The value for full intensity.
*
* \return the full intensity value
*/
static Type FullIntensity(){ return 1.0; } // NOLINT
};
}
......
......@@ -427,7 +427,7 @@ vec4 atlas( in float value )
* This method applies a colormap to the specified value an mixes it with the specified color. It uses the proper colormap and works on scaled
* values.
*
* \param color this color gets mixed using alpha value with the new colormap color
* \return this color gets mixed using alpha value with the new colormap color
* \param value the value to map, <b>scaled</b>
* \param minV the minimum of the original value
* \param scaleV the scaler used to downscale the original value to [0-1]
......@@ -436,13 +436,14 @@ vec4 atlas( in float value )
* \param alpha the alpha blending value
* \param colormap the colormap index to use
*/
vec4 colormap( in vec3 value, float minV, float scaleV, float thresholdV, bool thresholdEnabled, float alpha, int colormap, bool active )
vec4 colormap( in vec4 value, float minV, float scaleV, float thresholdV, bool thresholdEnabled, float alpha, int colormap, bool active )
{
// descale value
vec3 valueDescaled = vec3( minV ) + ( value * scaleV );
vec3 valueDescaled = vec3( minV ) + ( value.rgb * scaleV );
float isNotBorder = float( value.a >= 0.75 );
// this is the final color returned by the colormapping algorithm. This is the correct value for the gray colormap
vec4 cmapped = grayscale( value );
vec4 cmapped = grayscale( value.rgb );
float clip = clipZero( valueDescaled.r, minV );
// negative to positive shading in red-blue
......@@ -474,6 +475,7 @@ vec4 colormap( in vec3 value, float minV, float scaleV, float thresholdV, bool t
// build final color
return vec4( cmapped.rgb, cmapped.a * // did the colormap use a alpha value?
isNotBorder * // is this a border pixel?
alpha * // did the user specified an alpha?
clip * // value clip?
clipThreshold( valueDescaled, colormap, thresholdV, thresholdEnabled ) * // clip due to threshold?
......
......@@ -49,7 +49,7 @@ void colormap( inout vec4 color, in sampler3D sampler, in vec3 coord, float minV
int cmap, bool active )
{
// get the value and descale it
vec3 value = texture3D( sampler, coord ).rgb;
vec4 value = texture3D( sampler, coord ).rgba;
// let someone else apply the colormap
vec4 src = colormap( value, minV, scaleV, thresholdV, thresholdEnabled, alpha, cmap, active );
......
......@@ -72,9 +72,11 @@ void main()
#endif // CLIPPLANE_ENABLED
// The same accounds for the vertex. Transfer it to world-space.
v_vertex = gl_ModelViewMatrix * gl_Vertex;
v_vertex = gl_ModelViewMatrix * gl_Vertex;
// fill this varying with a dummy. Not always needed.
v_normal = vec3( 1.0, 0.0, 0.0 );
#if ( defined ILLUMINATION_ENABLED || defined TUBE_ENABLED )
// Grab the tangent. We have uploaded it normalized in gl_Normal per vertex
// We need to transfer it to the world-space ass all further operations are done there.
vec3 tangent = normalize( ( gl_ModelViewMatrix * vec4( gl_Normal, 0.0 ) ).xyz );
......@@ -118,7 +120,6 @@ void main()
// with the tangent and the view vector we got the offset vector. We can noch get the normal using the tangent and the offset.
v_normal = cross( offset, tangent );
v_normal *= sign( dot( v_normal, vec3( 0.0, 0.0, 1.0 ) ) );
#endif // ( defined ILLUMINATION_ENABLED || defined TUBE_ENABLED )
#ifdef COLORMAPPING_ENABLED
// Allow the colormapper to do some precalculations with the real vertex coordinate in ow-scene-space
......
......@@ -37,7 +37,6 @@
#include <QtGui/QListWidgetItem>
#include <QtGui/QApplication>
#include "core/common/WLimits.h"
#include "core/dataHandler/WDataSet.h"
#include "core/dataHandler/WDataHandler.h"
#include "core/dataHandler/exceptions/WDHNoSuchSubject.h"
......@@ -56,7 +55,7 @@ WQtColormapper::WQtColormapper( QWidget* parent )
m_textureListWidget = new QListWidget( this );
m_textureListWidget->setToolTip( "List of available colormaps. Only the upper <b>"
+ QString().setNum( wlimits::MAX_NUMBER_OF_TEXTURES )
+ QString().setNum( WGETexture3D::MAX_NUMBER_OF_TEXTURES )
+ "</b> textures will be applied." );
this->setAllowedAreas( Qt::AllDockWidgetAreas );
this->setFeatures( QDockWidget::AllDockWidgetFeatures );
......
......@@ -21,7 +21,7 @@ packaging OpenWalnut. Here is an overview:
ensure, that our listed requirements are sufficient, since the build-chroot
is a minimal system which only contains the needed packages.
3. owuberbuild - automates building and packaging for multiple distributions and
3. release - automates building and packaging for multiple distributions and
architectures using owpack and owbuildchroot. This basically calls
owbuildchroot for each defined architecture, distribution and supported
package-type. It creates complete logs of the build/package process and
......
......@@ -142,7 +142,7 @@ chroot_do()
echo "* Executing \"$*\"."
chroot $CHROOTDIR $*
if [ $? -ne 0 ]; then
echo " * Failed to chroot. Does the chroot envirnoment exist?"
echo " * Error occured in chroot. Does the chroot envirnoment exist? Problem with the executed command?"
chroot_umount
exit 1
fi
......
......@@ -32,13 +32,11 @@
export LC_ALL=C
# the source config file
CONFIG_FILE=owpack.config
CONFIG_FILE=owrelease.config
# where to find the source tree?
CHECKOUT_DIR="OpenWalnut-hg"
WORKING_DIR_PREFIX="owpack"
WORKING_DIR_POSTFIX=""
REPO="ssh://openwalnut.com//srv/hg/ow"
#############################################################################################################
# Functions
......@@ -53,17 +51,6 @@ CleanUp()
rm -rf $WORKING_DIR_PREFIX-*
}
#########################################################################################################
# Like clean, also removes config and checkout
Purge()
{
CleanUp
echo " * Removing source directories."
rm -rf $CHECKOUT_DIR
echo " * Removing configuration."
rm -rf $CONFIG_FILE
}
#########################################################################################################
# Creates a proper working directory with filtered source, prepared for src-tar and build-system
#
......@@ -137,7 +124,44 @@ Builder_TGZ()
{
# apply builder
echo "Not yet implemented!"
exit 1
exit 0
}
#########################################################################################################
# Create a simple source tgz
#
# Precondition: the same as CreateWorkingDir
# Postcondition: working directory is PWD
Builder_SRC()
{
source $CONFIG_FILE
# some paths
BUILDER_SRC_UPSTREAM_SRC_DIR=OpenWalnut-$VERSION
BUILDER_SRC_UPSTREAM_SRC_TAR=OpenWalnut_$VERSION.tar.gz
# create some place to work in
CreateWorkingDir "src" "$BUILDER_SRC_UPSTREAM_SRC_DIR" ""
if [ $? -ne 0 ]; then
echo " * Failed to create working diretory."
exit 1
fi
# simply tar the stuff
echo "* Create source tar \"$BUILDER_SRC_UPSTREAM_SRC_TAR\"."
tar cfz $BUILDER_SRC_UPSTREAM_SRC_TAR $BUILDER_SRC_UPSTREAM_SRC_DIR
if [ $? -ne 0 ]; then
echo " * Failed to create tar archive."
exit 1
fi
# copy archive to release dir
echo "* Copy files to release dir \"$RELEASE_DIR\"."
cp $BUILDER_SRC_UPSTREAM_SRC_TAR ../$RELEASE_DIR
if [ $? -ne 0 ]; then
echo " * Failed to copy to release dir."
exit 1
fi
}
#########################################################################################################
......@@ -154,7 +178,8 @@ Builder_DEB()
# this and have special requirements on them (like debuild)
BUILDER_DEB_UPSTREAM_SRC_DIR=OpenWalnut-$VERSION
# Debuild requires a different upstream tar name ...
BUILDER_DEB_UPSTREAM_SRC_TAR=openwalnut_$VERSION.orig.tar.gz
BUILDER_DEB_UPSTREAM_SRC_BASENAME=openwalnut_$VERSION
BUILDER_DEB_UPSTREAM_SRC_TAR=$BUILDER_DEB_UPSTREAM_SRC_BASENAME.orig.tar.gz
# create some place to work in
CreateWorkingDir "deb" "$BUILDER_DEB_UPSTREAM_SRC_DIR" "src/modules/data/ext/nifti src/modules/data/ext/biosig"
......@@ -165,7 +190,7 @@ Builder_DEB()
# debuild requires the debian config dir to be present in OpenWalnut src dir
echo "* Setup debian package config."
cp -r "$BUILDER_DEB_UPSTREAM_SRC_DIR/tools/packaging/debian" "$BUILDER_DEB_UPSTREAM_SRC_DIR"
cp -r "$BUILDER_DEB_UPSTREAM_SRC_DIR/tools/release/packaging/debian" "$BUILDER_DEB_UPSTREAM_SRC_DIR"
if [ $? -ne 0 ]; then
echo " * Failed to copy debian package config."
exit 1
......@@ -195,7 +220,16 @@ Builder_DEB()
# get back to working dir
cd ..
echo "* Created source and binary package in \"`pwd`\"."
# copy archive to release dir
echo "* Copy files to release dir \"$RELEASE_DIR\"."
cp $BUILDER_DEB_UPSTREAM_SRC_TAR *.changes *.dsc *.debian.tar.gz ../$RELEASE_DIR
if [ $? -ne 0 ]; then
echo " * Failed to copy to release dir."
exit 1
fi
# hint
echo "* Please do not forget to sign the package."
}
#########################################################################################################
......@@ -207,36 +241,6 @@ Builder_RPM()
exit 1
}
#########################################################################################################
# Checkout a fresh OW copy and create config file
#
# Param 1: base version (MAJOR.MINOR.PATCH)
Checkout()
{
echo "* Removing old checkout."
rm -rf "$CHECKOUT_DIR"
if [ $? -ne 0 ]; then
echo " * Remove failed."
exit 1
fi
# get code
echo "* Cloning OpenWalnut repository \"$REPO\"."
hg clone "$REPO" "$CHECKOUT_DIR"
if [ $? -ne 0 ]; then
echo " * cloning failed. Wrong repository?."
exit 1
fi
# write config file
echo "SRC_DIR=$CHECKOUT_DIR" > $CONFIG_FILE
# The version. You can use shell commands to evaluate this. The command is
# called inside the working dir of owpack script.
#TODO(ebaum): get this via command line.
VERSION_BASE=1.2.1
echo "VERSION=$VERSION_BASE+hg`cd $CHECKOUT_DIR;hg parents --template "{rev}"`" >> $CONFIG_FILE
}
#########################################################################################################
# Checks validitiy of owpack environment: checks existence of $CONFIG_FILE and whether source exists.
#
......@@ -246,7 +250,7 @@ EnsureConfigAndSource()
# search CONFIG_FILE
echo "* Search configuration file."
if [ ! -f $CONFIG_FILE ]; then
echo " * File \"$CONFIG_FILE\" not found! Try checkout command first."
echo " * File \"$CONFIG_FILE\" not found!"