Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
03da07f4
Commit
03da07f4
authored
Sep 19, 2011
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] - cleaned up wlimits.
parent
40b314eb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
48 deletions
+38
-48
src/core/common/WLimits.h
src/core/common/WLimits.h
+0
-33
src/core/dataHandler/WEEG.cpp
src/core/dataHandler/WEEG.cpp
+3
-4
src/core/dataHandler/WEEG2.cpp
src/core/dataHandler/WEEG2.cpp
+3
-4
src/core/dataHandler/WEEG2Segment.cpp
src/core/dataHandler/WEEG2Segment.cpp
+4
-5
src/core/dataHandler/WRecording.h
src/core/dataHandler/WRecording.h
+21
-0
src/core/graphicsEngine/WGETexture.h
src/core/graphicsEngine/WGETexture.h
+6
-0
src/qt4gui/qt4/controlPanel/WQtColormapper.cpp
src/qt4gui/qt4/controlPanel/WQtColormapper.cpp
+1
-2
No files found.
src/core/common/WLimits.h
View file @
03da07f4
...
...
@@ -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
)
...
...
src/core/dataHandler/WEEG.cpp
View file @
03da07f4
...
...
@@ -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
}
}
...
...
src/core/dataHandler/WEEG2.cpp
View file @
03da07f4
...
...
@@ -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"
)
);
}
...
...
src/core/dataHandler/WEEG2Segment.cpp
View file @
03da07f4
...
...
@@ -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"
)
);
}
...
...
src/core/dataHandler/WRecording.h
View file @
03da07f4
...
...
@@ -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:
/**
...
...
src/core/graphicsEngine/WGETexture.h
View file @
03da07f4
...
...
@@ -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.
*
...
...
src/qt4gui/qt4/controlPanel/WQtColormapper.cpp
View file @
03da07f4
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment