25 #ifndef WFIBERSELECTOR_H
26 #define WFIBERSELECTOR_H
32 #include "../common/WCondition.h"
33 #include "../dataHandler/WDataSetFibers.h"
35 #include "WSelectorBranch.h"
36 #include "WSelectorRoi.h"
47 typedef std::shared_ptr< WFiberSelector >
SPtr;
52 typedef std::shared_ptr< const WFiberSelector >
ConstSPtr;
58 explicit WFiberSelector( std::shared_ptr< const WDataSetFibers > fibers );
76 std::shared_ptr< std::vector< bool > >
getBitfield();
91 std::shared_ptr< std::vector< size_t > >
getStarts();
97 std::shared_ptr< std::vector< size_t > >
getLengths();
189 return m_fibers->getLineStartIndexes();
std::shared_ptr< WCondition > SPtr
Shared pointer type for WCondition.
Adaptor class between the roi manager and the fiber display.
std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > m_assocRoiSignal
Signal that can be used to update the selector.
std::shared_ptr< std::vector< bool > > m_outputBitfield
bit field of activated fibers
std::shared_ptr< std::vector< size_t > > getStarts()
getter for the line start index array
std::shared_ptr< std::vector< size_t > > getLengths()
getter for the line length array
WColor getFiberColor(size_t fidx) const
Get color for fiber with given index.
void slotRemoveBranch(std::shared_ptr< WRMBranch > branch)
listener function for removing rois
std::shared_ptr< boost::function< void() > > m_changeRoiSignal
Signal that can be used to update the selector.
std::list< std::shared_ptr< WSelectorBranch > > m_branches
list of branches int he roi structure
void slotAddRoi(osg::ref_ptr< WROI > roi)
listener function for inserting rois
WFiberSelector(std::shared_ptr< const WDataSetFibers > fibers)
constructor
void setDirty()
setter sets the dirty flag
std::shared_ptr< std::vector< bool > > getBitfield()
getter
WCondition::SPtr getDirtyCondition()
Condition that fires upon a recalculation of the fiber selection.
size_t m_size
number of fibers in the dataset
size_t size()
Return the number of fibers in the dataset.
void recalculate()
update the bitfield when there was a change in the roi structure
std::shared_ptr< const WDataSetFibers > m_fibers
Pointer to the fiber data set.
std::shared_ptr< boost::function< void(std::shared_ptr< WRMBranch >) > > m_removeBranchSignal
Signal for updating the selector.
std::shared_ptr< WKdTree > m_kdTree
Stores a pointer to the kdTree used for fiber selection.
bool getDirty()
Get the current dirty-state.
WCondition::SPtr m_dirtyCondition
Condition that fires on setDirty.
std::shared_ptr< const WFiberSelector > ConstSPtr
Const fiber selector pointer.
~WFiberSelector()
destructor
std::shared_ptr< std::vector< float > > m_outputColorMap
Map each fiber to a color.
void slotRemoveRoi(osg::ref_ptr< WROI > roi)
listener function for removing rois
std::shared_ptr< boost::function< void(osg::ref_ptr< WROI >) > > m_removeRoiSignal
Signal that can be used to update the selector.
std::shared_ptr< WFiberSelector > SPtr
Fiber selector pointer.
bool isNothingFiltered() const
Returns true if no fiber gets filtered out because there is no branch in the ROI tree.