25 #ifndef WFIBERCLUSTER_H
26 #define WFIBERCLUSTER_H
32 #include <boost/shared_ptr.hpp>
33 #include <boost/thread.hpp>
35 #include "../../common/WColor.h"
36 #include "../../common/WTransferable.h"
37 #include "../WDataSetFiberVector.h"
50 typedef boost::shared_ptr< WFiberCluster >
SPtr;
55 typedef boost::shared_ptr< const WFiberCluster >
ConstSPtr;
201 virtual const std::string
getName()
const;
234 WTransferable::operator=( other );
257 void setDataSetReference( boost::shared_ptr< const WDataSetFiberVector > fibs );
258 boost::shared_ptr< const WDataSetFiberVector > getDataSetReference()
const;
311 void unifyDirection( boost::shared_ptr< WDataSetFiberVector > fibs )
const;
336 boost::shared_ptr< const WDataSetFiberVector >
m_fibs;
415 return "FiberCluster";
420 return "A collection of indices for fibers representing a fiber cluster";
443 inline std::ostream& operator<<( std::ostream& os,
const WFiberCluster& c )
445 using string_utils::operator<<;
449 #endif // WFIBERCLUSTER_H
bool operator!=(const WFiberCluster &other) const
The opposite of the operator==.
virtual ~WFiberCluster()
Destructs.
Unit test the WFiberCluster class.
const IndexList & getIndices() const
Returns a const reference of all indices inside this cluster.
Represents a neural pathway.
boost::shared_ptr< WFiber > m_centerLine
Average fiber for this cluster representing the main direction and curvature of this cluster...
void elongateCenterLine() const
The centerline may be shortened due to the averaging of outliers.
Represents a cluster of indices of a WDataSetFiberVector.
void sort()
Sort the indices of fibers associated with this cluster in ascending order.
boost::shared_ptr< WFiber > getCenterLine() const
Returns the center line of this cluster.
std::list< size_t > IndexList
This is the list of indices of fibers.
boost::shared_mutex * m_centerLineCreationLock
Lock the modification in the m_centerLine mutable.
WColor getColor() const
Gets the color of which all fibers of this clusters should be painted with.
bool operator==(const WFiberCluster &other) const
WBoundingBox getBoundingBox() const
Recomputes on every call the axis aligned bounding box incorporating all tracts in this cluster...
WColor m_color
Color which is used to paint the members of this cluster.
osg::Vec3 m_mainDirection
The cluster's main direction.
void merge(WFiberCluster &other)
Merge the fibers of the other cluster with the fibers of this cluster.
bool empty() const
Returns true if there are no fibers in that cluster, false otherwise.
Class building the interface for classes that might be transferred using WModuleConnector.
IndexList m_memberIndices
All indices in this set are members of this cluster.
void setIndices(const IndexList &indices)
Reset the indices belonging to that cluster.
void unifyDirection(boost::shared_ptr< WDataSetFiberVector > fibs) const
Alings all fibers within the given dataset to be in one main direction.
void setMainDirection(osg::Vec3 mainDirection)
Sets the main direction of the cluster.
virtual const std::string getDescription() const
The description of this transferable.
void clear()
Make this cluster empty.
void generateCenterLine() const
Makes the hard work to compute the center line.
WFiberCluster & operator=(const WFiberCluster &other)
Copy assignment operator which does NOT copy the mutex's!!!
boost::shared_ptr< WFiberCluster > SPtr
Shared pointer abbreviation.
boost::shared_ptr< WFiber > m_longestLine
The longest fiber in the dataset.
boost::shared_ptr< const WFiberCluster > ConstSPtr
Const shared pointer abbreviation.
static boost::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
boost::shared_mutex * m_longestLineCreationLock
Lock the modification in the m_longestLine mutable.
void generateLongestLine() const
Makes the hard work to find the longest line.
static boost::shared_ptr< WPrototyped > m_prototype
Prototype for this dataset.
boost::shared_ptr< WFiber > getLongestLine() const
Returns the center line of this cluster.
boost::shared_ptr< const WDataSetFiberVector > m_fibs
Reference to the real fibers of the brain this cluster belongs to.
void setColor(WColor color)
Sets the color of which all fibers of this clusters should be painted with.
IndexList::const_iterator IndexListConstIterator
Const iterator on the index list.
virtual const std::string getName() const
The name of this transferable.
osg::Vec3 getMainDirection() const
Gets the main direction of the cluster ( if set )
WFiberCluster()
Constructs an empty cluster.