Commit 9e4c5327 authored by schurade's avatar schurade
Browse files

[Merge] with 2ca6c62598cf5413808a53edfcd6dba8f8b9e4aa

parents 5885043b 74a4c77a
all:
pdflatex openWalnutDesign
pdflatex openWalnutDesign
bibtex openWalnutDesign
bibtex openWalnutDesign
pdflatex openWalnutDesign
pdflatex openWalnutDesign
cp openWalnutDesign.pdf openWalnutDesignDocument.pdf
clean:
rm openWalnutDesign.aux openWalnutDesign.log openWalnutDesign.out openWalnutDesign.toc openWalnutDesign.bbl openWalnutDesign.blg openWalnutDesign.pdf openWalnutDesignDocument.pdf
This diff is collapsed.
This diff is collapsed.
......@@ -30,7 +30,6 @@
\subject{Documentation}
\title{
% \includegraphics{Pictures/FAnToM-logo}\\[.2cm]
OpenWalnut Design
}
\author{ Alexander Wiebel }
......@@ -39,66 +38,92 @@
\tableofcontents
\chapter{Introduction}
\section{Class Diagrams}
We use UML type notation in diagrams describing relationships between classes. Some of the descriptions used throughout this
section stem from the following website:
\begin{itemize}
\item \verb|http://en.wikipedia.org/w/index.php?title=Class_diagram&oldid=314998859|
\end{itemize}
\begin{figure}[htb]
\includegraphics[width=\textwidth]{relationship_examples}
\caption{Examples for relationships used in class diagrams.}
\end{figure}
\begin{description}
\item[Aggregation] can occur when a class is a collection or container of other classes, but where the contained classes do not
have a strong life cycle dependency on the container -- essentially, if the container is destroyed, its contents are not.
\item[Composition] usually has a strong life cycle dependency between instances of the container class and instances of the
contained class(es): If the container is destroyed, normally every instance that it contains is destroyed as well.
\end{description}
\chapter{Math}
\begin{figure}[htb]
\includegraphics[width=\textwidth]{WValue_hierachy}
\caption{The class hierarchy describing high-level values in OpenWalnut.}
\end{figure}
\section{Literature}
For a general overview on visualization in medicine \cite{Preim:2007:VMT} can be recommended.
\chapter{GUI}
The GUI module is the only part where we allow gui-toolkit related code. For example, this means that the use of any QT class is prohibited outside the GUI module.
The GUI module is the only part where we allow gui-toolkit related code. For example, this means that the use of any QT class is
prohibited outside the GUI module.
\chapter{GE (Graphics Engine)}
\todo{This is still wrong}
The GraphicsEngine module is the only part where we allow OpenGL or shader code.
There are different kind of objects being treated in the GraphicsEngine:
Graphics primitives like triangles, lines, ...
Textures, at least 2D and 3D
3D textures often are the representation of data from a data set in the DataHandler that is needed for rendering.
The graphics engine is mainly realized by integrating OpenSceneGraph (OSG) so far.
\chapter{DataHandler}
The sections in this chapter are organized according to different
types od recording or imaging data.
\section{EEG}
\subsection{Note}
sread in BIOSIG C++ toolbox provides start and length parameters ... these should be used as EEG might not fit or at least is not intended to be completely in the main memory. This should also be reflected in the design of the data structure.
Is segment-wise loading a good solution?
\section{Taken from Wiki}
\todo{Has to be fixed as it was
This page describes the main ideas of the architecture of our /src/dataHandler.
WDataHandler is the main entry point to the module. It contains all
the data sets. Each of the data sets is encapsulated by a WDataSet
object.
WDataSet is the base class for a number of subclasses representing
different types of data sets, e.g.
This chapter describes the main ideas of the architecture of our module that implements the data handling. WDataHandler is the
main entry point to the module. It contains all subject's data present in OpenWalnut. The data set belonging to a subject are held by
an instance of WSubject. Each of the data sets of a subject is encapsulated by a WDataSet object.
\begin{figure}[htb]
\centering
\includegraphics[width=.4\textwidth]{dataHandler_classDiagram}
\caption{Class diagram describing the data handler's architecture.}
\end{figure}
WDataSet is the base class for a number of subclasses representing different types of data sets, e.g.
\begin{itemize}
\item WDataSetSingle - A simple single data set.
\item WDatSetTimeDependent - A data set that encapsulates a number of
data sets for different time steps.
\item WDataSetSingle - A simple single data set.
\item WDatSetTimeDependent - A data set that encapsulates a number of data sets for different time steps.
\end{itemize}
WDataSet has a WMetaInfo
\section{Data Sets}
The subsections in this section are organized according to different types of recording or imaging data.
\subsection{EEG}
\subsubsection{Note}
sread in BIOSIG C++ toolbox provides start and length parameters ... these should be used as EEG might not fit or at least is not
intended to be completely in the main memory. This should also be reflected in the design of the data structure. Is segment-wise
loading a good solution?
A WDataSetSingle is a WDataSet and has a WValueSet
and a WGrid
\subsection{Image Data}
A WDataSetTimeDependent is a WDataSet has more than one WValueSet and
at least one WGrid (at the moment, i.e. 2009-05-13 we expect only one
WGrid)
A WDataSetSingle is a WDataSet and has a WValueSet and a WGrid.
A WMetaInfo has a number of attribute describing a WDataSet, e.g.:
Name of data set
FileName: Name of the file the data was loaded from.
...
A WMetaInfoTimeDependent is a WMetaInfo and has a
a number of additional attributes.
A WDataSetTimeDependent is a WDataSet has more than one WValueSet and at least one WGrid (at the moment, i.e. 2009-05-13 we expect
only one WGrid)
A WValueSet has subclasses for different types of values.
A WValueSet has subclasses for different types of values.
A data set has a low level access for the GraphicsEngine? to ensure
performance. This access is realized by a function similar to
\section{Raw Access}
Certain types of data sets provide a low level access for the GraphicsEngine to ensure performance. This access is realized by a
function similar to
\begin{verbatim}
T* getValuesPointer< class T >()
\end{verbatim}
and code to get the access then look similar to
and code to get the access then looks similar to
\begin{verbatim}
float *myValuePointer;
myValuePointer = getValuesPointer<float *>()
\end{verbatim}
Data can not be manipulated!
\section{Enforced rules}
\begin{itemize}
\item Data can not be manipulated!
\end{itemize}
\bibliography{../../books}
\end{document}
This diff is collapsed.
This diff is collapsed.
......@@ -15,6 +15,8 @@ IF( CMAKE_HOST_SYSTEM MATCHES Linux )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib CACHE PATH "The libraries will be put into this directory." )
ELSEIF( CMAKE_HOST_SYSTEM MATCHES Windows )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH "The libraries will be put into this directory." )
ELSEIF( CMAKE_HOST_SYSTEM MATCHES Darwin )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib CACHE PATH "The libraries will be put into this directory." )
ELSE()
MESSAGE( FATAL_ERROR "Could not determine platform type! (expected Linux or Windows)!" )
ENDIF()
......@@ -54,10 +56,11 @@ FIND_PACKAGE( osg ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgUtil ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgDB ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgViewer ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgText ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( osgGA ${MIN_OSG_VERSION} REQUIRED )
FIND_PACKAGE( OpenThreads ${MIN_OSG_VERSION} REQUIRED )
SET( OPENSCENEGRAPH_LIBRARIES ${OSGDB_LIBRARY} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY} )
SET( OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OPENTHREADS_INCLUDE_DIR} )
SET( OPENSCENEGRAPH_LIBRARIES ${OSGDB_LIBRARY} ${OSGTEXT_LIBRARY} ${OSGGA_LIBRARY} ${OSGUTIL_LIBRARY} ${OSGVIEWER_LIBRARY} ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY} )
SET( OPENSCENEGRAPH_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSGDB_INCLUDE_DIR} ${OSGTEXT_INCLUDE_DIR} ${OSGGA_INCLUDE_DIR} ${OSGVIEWER_INCLUDE_DIR} ${OSGUTIL_INCLUDE_DIR} ${OPENTHREADS_INCLUDE_DIR} )
# When new cmake version available >=2.6.4 we may use this the line below instead the stuff above
# FIND_PACKAGE( OpenSceneGraph 2.8.0 REQUIRED osgDB osgUtil osgGA osgViewer OpenThreads )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
......@@ -104,7 +107,6 @@ ELSE( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
# Package dependencies:
FIND_PACKAGE( Qt4 REQUIRED )
FIND_PACKAGE( GLEW REQUIRED )
# Includes:
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
......@@ -118,7 +120,7 @@ ELSE( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
QT4_WRAP_CPP( GUI_QT4_MOC_SRCS ${GUI_QT4_MOC_HDRS} )
ADD_EXECUTABLE( walnut ${ALL_SRC} ${NIFTI_SRC} ${GUI_QT4_MOC_SRCS} )
TARGET_LINK_LIBRARIES( walnut ${Boost_LIBRARIES} ${OSG_LIBRARIES} ${QT_LINK_LIBRARIES} ${GLEW_LIBRARY} )
TARGET_LINK_LIBRARIES( walnut ${Boost_LIBRARIES} ${OSG_LIBRARIES} ${QT_LINK_LIBRARIES} )
ENDIF ( NOT CMAKE_BUILD_TYPE STREQUAL "Static" )
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/shaders)
......@@ -200,7 +202,7 @@ ADD_CUSTOM_TARGET( vtest
#-------------------------------------------------------------------------------------------------------------
# Removes all tests thus forcing them to be recompiled during the next "make"
ADD_CUSTOM_TARGET( cleantest
COMMAND rm -f ${PROJECT_BINARY_DIR}/*/*_test.cc
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/../tools/CMakeModules/RemoveGeneratedTests.cmake
COMMENT "Remove all tests to force them to be recompiled"
)
......@@ -217,6 +219,7 @@ ADD_CUSTOM_TARGET( cicheck
ADD_CUSTOM_TARGET( fixtures
ALL
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/test/fixtures ${PROJECT_BINARY_DIR}/dataHandler/
COMMAND cp -rf ${PROJECT_SOURCE_DIR}/dataHandler/io/test/fixtures ${PROJECT_BINARY_DIR}/dataHandler/io
COMMENT "Copy fixtures to the right place."
)
......
......@@ -22,23 +22,23 @@
//
//---------------------------------------------------------------------------
#include <iostream>
#include <string>
#include <vector>
#include "WDataHandler.h"
#include "WSubject.h"
#include "exceptions/WNoSuchDataSetException.h"
#include "exceptions/WDHNoSuchDataSet.h"
#include "WLoaderManager.h"
WDataHandler::WDataHandler()
{
}
boost::shared_ptr< WSubject > WDataHandler::getSubject( const unsigned int subjectId ) const
{
if( subjectId >= m_subjects.size() )
throw WNoSuchDataSetException( "Index too large." );
throw WDHNoSuchDataSet( "Index too large." );
return m_subjects.at( subjectId );
}
......@@ -64,7 +64,13 @@ void WDataHandler::loadDataSets( std::vector< std::string > fileNames )
WLoaderManager lm;
for ( size_t i = 0 ; i < fileNames.size() ; ++i)
{
// TODO(wiebel): need to associate the dataset to its subject
lm.load( fileNames[i], shared_from_this() );
try
{
lm.load( fileNames[i], shared_from_this() );
}
catch( WDHException e )
{
std::cerr << "Error :: DataHandler :: " << e.what() << std::endl;
}
}
}
......@@ -30,17 +30,17 @@
/**
* Base class for all data set types. This class has a number of subclasses
* specifying the different types of data sets. Two of dataset type reprent
* single and time-dependent datasets (compound of several time steps)
* respectively. This base class contains the pointer to the meta information.
* specifying the different types of data sets. Two of the dataset types
* represent single and time-dependent datasets (compound of several time
* steps) respectively.
* \ingroup dataHandler
*/
class WDataSet
{
public:
/**
* Since every DataSet should have a MetaInfo, we ensure hereby you never
* go without one.
* This constructor shoul be used if a dataSet does not stem from a file.
* It presets the its correpsonding fileName as empty string.
*/
WDataSet();
......@@ -66,7 +66,8 @@ protected:
private:
/**
* Name of the file this data set was loaded from. This information
* may allow hollowing data sets later.
* may allow hollowing data sets later. DataSets that were not loaded
* from a file should have the empty string stored here.
*/
std::string m_fileName;
};
......
......@@ -36,7 +36,6 @@ class WDataSetMultiple : public WDataSet
public:
/**
* Dummy constructor.
* TODO(wiebel): implement this
*/
explicit WDataSetMultiple()
: WDataSet()
......
......@@ -40,7 +40,6 @@ WDataSetSingle::WDataSetSingle( boost::shared_ptr<WValueSetBase> newValueSet,
WDataSetSingle::~WDataSetSingle()
{
// TODO(wiebel): Auto-generated destructor stub
}
boost::shared_ptr<WValueSetBase> WDataSetSingle::getValueSet() const
......
......@@ -35,23 +35,25 @@
///======================================
// TODO(wiebel): use this szuff or remove it
#include "../math/WPosition.h"
typedef double dummyType;
typedef double WDummyType;
class WEEGElectrodeObject
{
public:
protected:
private:
wmath::WPosition m_position;
// WColor color;
// TODO(wiebel): The following is suggested in the
// eemagine design document
// WColor color;
};
class WEEGSegementInfo
{
public:
protected:
private:
dummyType m_startSample;
dummyType m_endSample;
dummyType m_segmentStartDate;
WDummyType m_startSample;
WDummyType m_endSample;
WDummyType m_segmentStartDate;
};
//================================================
......@@ -114,6 +116,7 @@ public:
*/
std::string getChannelLabel( size_t channelId ) const
{
// TODO(wiebel): what is done with the second string of the label?
return m_channelLabels[channelId].first;
}
......
......@@ -24,10 +24,19 @@
#include <string>
#include <boost/filesystem.hpp>
#include "WLoader.h"
#include "exceptions/WDHIOFailure.h"
WLoader::WLoader( std::string fileName )
: m_fileName( fileName )
WLoader::WLoader( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler ) throw( WDHIOFailure )
: m_fileName( fileName ),
m_dataHandler( dataHandler )
{
boost::filesystem::path p( m_fileName );
if( !boost::filesystem::exists( p ) )
{
throw WDHIOFailure( "file '" + m_fileName + "' doesn't exists." );
}
}
......@@ -27,15 +27,25 @@
#include <string>
#include <boost/shared_ptr.hpp>
#include "exceptions/WDHIOFailure.h"
#include "WDataHandler.h"
/**
* Base class to all WLoaders which imports data from a given file and generate
* a WDataSet out of it.
* a WDataSet out of it. The WLoader subclasses will also have to determine
* the subject a new dataSet belongs to.
* \ingroup dataHandler
*/
class WLoader
{
public:
explicit WLoader( std::string fileName );
/**
* Constructs basic Loader with access to the DataHandler (for inserting
* new stuff) and a file name.
*/
explicit WLoader( std::string fileName, boost::shared_ptr< WDataHandler > dataHanlder ) throw( WDHIOFailure );
virtual ~WLoader()
{
......@@ -49,7 +59,15 @@ public:
virtual void operator()() = 0;
protected:
/**
* Name of file to load.
*/
std::string m_fileName;
/**
* Reference to DataHandler
*/
boost::shared_ptr< WDataHandler > m_dataHandler;
private:
};
......
......@@ -24,14 +24,16 @@
#include <iostream>
#include <string>
#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
#include "WLoaderManager.h"
#include "WDataSet.h"
#include "exceptions/WDHException.h"
#include "io/WLoaderNIfTI.h"
#include "io/WLoaderBiosig.h"
#include "io/WLoaderEEGASCII.h"
#include "io/WLoaderVTK.h"
std::string getSuffix( std::string name )
{
......@@ -39,7 +41,7 @@ std::string getSuffix( std::string name )
return p.extension();
}
void WLoaderManager::load( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler )
void WLoaderManager::load( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler ) throw( WDHException )
{
std::string suffix = getSuffix( fileName );
......@@ -72,10 +74,14 @@ void WLoaderManager::load( std::string fileName, boost::shared_ptr< WDataHandler
std::cout << "VTK not implemented yet" << std::endl;
assert( 0 );
}
else if( suffix == ".fib" )
{
WLoaderVTK vtkLoader( fileName, dataHandler );
boost::thread loaderThread( vtkLoader );
}
else
{
std::cout << "Unknown file type: \"" << suffix << "\"" << std::endl;
assert( 0 );
throw WDHException( "Unknown file type: '" + suffix + "'" );
}
}
......
......@@ -26,9 +26,11 @@
#define WLOADERMANAGER_H
#include <string>
#include <boost/shared_ptr.hpp>
class WDataSet;
#include "exceptions/WDHException.h"
class WDataHandler;
/**
......@@ -41,7 +43,7 @@ public:
/**
* Selects correct loader for fileName and creates loader thread.
*/
void load( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler );
void load( std::string fileName, boost::shared_ptr< WDataHandler > dataHandler ) throw( WDHException );
protected:
private:
};
......
......@@ -36,7 +36,7 @@ class WRecording : public WDataSet
{
public:
/**
* TODO(wiebel): Document this!
* Empty standard constructor for recordings
*/
explicit WRecording()
: WDataSet()
......
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