Commit 1a57d922 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[MERGE]

parents 3cb3a4d0 0a9fdd40
......@@ -2,22 +2,20 @@
INCLUDE_DIRECTORIES( io/libeep )
ADD_SUBDIRECTORY( io )
ADD_SUBDIRECTORY( datastructures )
FILE( GLOB DATAHANDLER_SRC "*.cpp" "*.h" )
FILE( GLOB DATAHANDLER_DATASTRUCTURES_SRC "datastructures/*.cpp" "datastructures/*.h" )
FILE( GLOB DATAHANDLER_EXCEPTIONS_SRC "exceptions/*.cpp" "exceptions/*.h" )
FILE( GLOB DATAHANDLER_IO_SRC "io/*.cpp" "io/*.h" ) # former WLoader
IF( CMAKE_HOST_SYSTEM MATCHES Windows )
FILE( GLOB DATAHANDLER_SRC "*.cpp" "*.h" )
FILE( GLOB DATAHANDLER_EXCEPTIONS_SRC "exceptions/*.cpp" "exceptions/*.h" )
FILE( GLOB DATAHANDLER_IO_SRC "io/*.cpp" "io/*.h" ) # former WLoader
FILE( GLOB EXCLUDE_biosig "io/*Biosig.cpp" "io/*Biosig.h" )
LIST( REMOVE_ITEM DATAHANDLER_IO_SRC ${EXCLUDE_biosig} )
ADD_LIBRARY( dataHandler ${DATAHANDLER_SRC} ${DATAHANDLER_EXCEPTIONS_SRC} ${DATAHANDLER_IO_SRC} )
ADD_LIBRARY( dataHandler ${DATAHANDLER_SRC} ${DATAHANDLER_EXCEPTIONS_SRC} ${DATAHANDLER_IO_SRC} ${DATAHANDLER_DATASTRUCTURES_SRC} )
TARGET_LINK_LIBRARIES( dataHandler common math ${Boost_LIBRARIES} niftiio libeep ${OPENSCENEGRAPH_LIBRARIES})
ELSE()
FILE( GLOB DATAHANDLER_SRC "*.cpp" "*.h" )
FILE( GLOB DATAHANDLER_EXCEPTIONS_SRC "exceptions/*.cpp" "exceptions/*.h" )
FILE( GLOB DATAHANDLER_IO_SRC "io/*.cpp" "io/*.h" ) # former WLoader
ADD_LIBRARY( dataHandler SHARED ${DATAHANDLER_SRC} ${DATAHANDLER_EXCEPTIONS_SRC} ${DATAHANDLER_IO_SRC} )
ADD_LIBRARY( dataHandler SHARED ${DATAHANDLER_SRC} ${DATAHANDLER_EXCEPTIONS_SRC} ${DATAHANDLER_IO_SRC} ${DATAHANDLER_DATASTRUCTURES_SRC} )
TARGET_LINK_LIBRARIES( dataHandler common math ${Boost_LIBRARIES} niftiio biosig libeep ${OPENSCENEGRAPH_LIBRARIES})
ENDIF()
# Unit tests
......
FILE( GLOB DATAHANDLER_DATASTRUCTURES_SRC "*.cpp" "*.h" )
# Unit tests
IF( OW_COMPILE_TESTS )
CXXTEST_ADD_TESTS_FROM_LIST( "${DATAHANDLER_DATASTRUCTURES_SRC}"
"dataHandler;common" # no libs for linking required
)
ENDIF( OW_COMPILE_TESTS )
......@@ -27,10 +27,9 @@
#include <boost/shared_ptr.hpp>
#include "../../dataHandler/WDataSetFiberVector.h"
#include "../../math/fiberSimilarity/WDLTMetric.h"
#include "../WLimits.h"
#include "../WTransferable.h"
#include "../../common/WLimits.h"
#include "../../common/WTransferable.h"
#include "../WDataSetFiberVector.h"
#include "WFiberCluster.h"
// TODO(math): The only reason why we store here a Reference to the fiber
......@@ -89,3 +88,19 @@ boost::shared_ptr< WPrototyped > WFiberCluster::getPrototype()
return m_prototype;
}
// \endcond
void WFiberCluster::generateCenterLine()
{
// make copies of the fibers
WDataSetFiberVector fibs;
std::list< size_t >::const_iterator cit = m_memberIndices.begin();
for( ; cit != m_memberIndices.end(); ++cit )
{
fibs.push_back( m_fibs->at( *cit ) );
}
}
boost::shared_ptr< wmath::WFiber > WFiberCluster::getCenterLine() const
{
return m_centerLine;
}
......@@ -31,9 +31,9 @@
#include <boost/shared_ptr.hpp>
#include "../../dataHandler/WDataSetFiberVector.h"
#include "../WColor.h"
#include "../WTransferable.h"
#include "../../common/WColor.h"
#include "../../common/WTransferable.h"
#include "../WDataSetFiberVector.h"
/**
* Represents a cluster of indices of a WDataSetFiberVector.
......@@ -138,23 +138,34 @@ public:
// dataset is, we need it in the WMVoxelizer module as well as the clustering
// information. Since we don't have the possibility of multiple
// InputConnectors we must agglomerate those into one object. Please remove this.
// DISABLE DOXYGEN HERE
// \cond
void setDataSetReference( boost::shared_ptr< const WDataSetFiberVector > fibs );
boost::shared_ptr< const WDataSetFiberVector > getDataSetReference() const;
static boost::shared_ptr< WPrototyped > getPrototype();
// \endcond
/**
* Returns the center line of this cluster
*
* \return Reference to the center line
*/
boost::shared_ptr< wmath::WFiber > getCenterLine() const;
protected:
// TODO(math): The only reason why we store here a Reference to the fiber
// dataset is, we need it in the WMVoxelizer module as well as the clustering
// information. Since we don't have the possibility of multiple
// InputConnectors we must agglomerate those into one object. Please remove this.
// \cond
static boost::shared_ptr< WPrototyped > m_prototype;
// \endcond
// ENDABLE DOXYGEN HERE
private:
/**
* Makes the hard work to compute the center line.
*/
void generateCenterLine();
private:
/**
* All indices in this set are members of this cluster
*/
......@@ -169,6 +180,8 @@ private:
* Color which is used to paint the members of this cluster.
*/
WColor m_color;
boost::shared_ptr< wmath::WFiber > m_centerLine; //!< Average fiber for this cluster representing the main direction and curvatur of this cluster
};
inline bool WFiberCluster::empty() const
......
......@@ -26,11 +26,11 @@
#include <set>
#include <vector>
#include "../common/datastructures/WUnionFind.h"
#include "../common/exceptions/WNotImplemented.h"
#include "../common/WStringUtils.h"
#include "../../common/WStringUtils.h"
#include "../../common/datastructures/WUnionFind.h"
#include "../../common/exceptions/WNotImplemented.h"
#include "../WValueSet.h"
#include "WJoinContourTree.h"
#include "WValueSet.h"
WJoinContourTree::WJoinContourTree( boost::shared_ptr< WDataSetSingle > dataset )
: m_elementIndices( dataset->getValueSet()->size() ),
......
......@@ -30,7 +30,7 @@
#include <boost/shared_ptr.hpp>
#include "WDataSetSingle.h"
#include "../WDataSetSingle.h"
/**
* Processes a dataset for join tree computation. This is a part of those famous contur trees.
......
......@@ -27,10 +27,15 @@
#include "WLine.h"
#include "WPosition.h"
//namespace wmath
//{
//WLine::WLine( const std::vector< WPosition > &points )
// : m_points( points )
//{
//}
//} // end of namespace
namespace wmath
{
WLine::WLine( const std::vector< WPosition > &points )
: WMixinVector< wmath::WPosition >( points )
{
}
WLine::WLine()
: WMixinVector< wmath::WPosition >()
{
}
} // end of namespace
......@@ -27,6 +27,7 @@
#include <algorithm>
#include <iostream>
#include <vector>
#include "../common/WMixinVector.h"
#include "WPosition.h"
......@@ -39,6 +40,21 @@ namespace wmath
/**
* A line is an ordered sequence of WPositions.
*/
typedef WMixinVector< WPosition > WLine;
// typedef WMixinVector< WPosition > WLine;
class WLine : public WMixinVector< WPosition >
{
public:
/**
* Generates a new line out of a sequence of points.
*
* \param points Point sequence
*/
explicit WLine( const std::vector< WPosition > &points );
/**
* Creates an empty line.
*/
WLine();
};
} // end of namespace
#endif // WLINE_H
......@@ -39,7 +39,7 @@
#include "../../common/WProgress.h"
#include "../../common/WStringUtils.h"
#include "../../common/datastructures/WDXtLookUpTable.h"
#include "../../common/datastructures/WFiberCluster.h"
#include "../../dataHandler/datastructures/WFiberCluster.h"
#include "../../dataHandler/WDataSetFiberVector.h"
#include "../../dataHandler/WSubject.h"
#include "../../dataHandler/io/WReaderLookUpTableVTK.h"
......
......@@ -33,7 +33,7 @@
#include <osg/Geode>
#include "../../common/datastructures/WDXtLookUpTable.h"
#include "../../common/datastructures/WFiberCluster.h"
#include "../../dataHandler/datastructures/WFiberCluster.h"
#include "../../dataHandler/WDataSetFiberVector.h"
#include "../../graphicsEngine/WGEGroupNode.h"
#include "../../kernel/WModule.h"
......
......@@ -30,7 +30,7 @@
#include <osg/Geode>
#include "../../common/datastructures/WFiberCluster.h"
#include "../../dataHandler/datastructures/WFiberCluster.h"
#include "../../dataHandler/WDataSetSingle.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
......
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