35 #ifndef __TrackContainer_h
36 #define __TrackContainer_h
45 #include "boost/multi_index_container.hpp"
46 #include "boost/multi_index/member.hpp"
47 #include "boost/multi_index/hashed_index.hpp"
48 #include "boost/multi_index/ordered_index.hpp"
49 #include "boost/numeric/conversion/cast.hpp"
50 #include "boost/lexical_cast.hpp"
52 #include "vtkProperty.h"
53 #include "vtkPolyData.h"
55 #include "vtkMapper.h"
56 #include "vtkPointData.h"
57 #include "vtkDoubleArray.h"
60 #include "QGoGUILibConfigure.h"
63 #include "vtkMutableDirectedGraph.h"
215 typedef multi_index::multi_index_container<
217 boost::multi_index::indexed_by<
218 boost::multi_index::ordered_unique<
219 boost::multi_index::tag< TraceID >,
222 boost::multi_index::ordered_non_unique<
223 boost::multi_index::tag< CollectionID >,
224 BOOST_MULTI_INDEX_MEMBER(
TraceStructure,
unsigned int, CollectionID)
226 boost::multi_index::ordered_non_unique<
227 boost::multi_index::tag< Highlighted >,
230 boost::multi_index::ordered_non_unique<
231 boost::multi_index::tag< Visible >,
299 bool UpdateTrackStructurePolyData(
const TrackStructure& iTrackStructure);
316 template<
class TList >
319 typename TList::const_iterator it = iTrackList.begin();
320 unsigned int temp = 0;
322 while(it!=iTrackList.end())
324 temp =
static_cast< unsigned int >(*it);
329 emit NeedMeshesInfoForImportedTrack(temp);
339 void ImportTrackInCurrentElement(std::map< unsigned int, double*>& iMeshes);
363 TrackStructure* UpdatePointsForATrack(
const unsigned int& iTrackID,
364 std::list< double*>& iListCenterBoundingBoxes);
375 Qt::CheckState state;
376 Superclass::UpdateElementHighlightingWithTraceID(TraceId,
378 emit TracePicked(TraceId, state);
389 void UpdateCollectionHighlighting(
const unsigned int& iTraceId);
395 void GetRootIterator(
396 MultiIndexContainerTraceIDIterator& iMotherIterator);
406 Superclass::UpdateElementVisibilityWithTraceID(iTraceID, iState);
409 emit TraceVisibilityChanged(iTraceID, Qt::Checked );
412 emit TraceVisibilityChanged(iTraceID, Qt::Unchecked );
420 void MergeTrack(
const unsigned int& iId1,
const unsigned int& iId2);
427 void setTimeInterval(
const int& iTimeInterval);
434 int getTimeInterval();
450 double* GetBorderOfTheTrack(
const unsigned int& iTrackID,
451 const BorderType& iBorder);
459 void SetListOfDivisions(std::list<unsigned int>& iListOfDivisions);
470 void AddDivision(
const unsigned int& iMotherID,
471 const unsigned int& iDaughter1ID,
472 const unsigned int& iDaughter2ID,
473 const bool& iVisible =
true);
482 std::vector<vtkActor* > CreateDivisionActor(vtkPolyData* iPolyData,
483 const bool& iVisible =
true);
490 void CreateDivisionPolydata(
const unsigned int& iMother);
497 std::list<unsigned int> GetSubLineage(
const unsigned int& iTrackID);
504 void UpdateSubLineage(MultiIndexContainerTraceIDIterator it,
505 std::list<unsigned int>& iList);
522 void UpdateDivisionScalar(
523 MultiIndexContainerTraceIDIterator& iMotherIterator,
524 const unsigned int& iDepth);
534 void UpdateCollectionColors(
const unsigned int& iTrackID,
535 const double* color);
541 void UpdateDivisionColor(
542 MultiIndexContainerTraceIDIterator& iMotherIterator,
543 const double* iColor);
551 void UpdateCollectionColorsData(
const unsigned int& iTrackID,
552 const double* color);
558 void UpdateDivisionColorData(
559 MultiIndexContainerTraceIDIterator& iMotherIterator,
560 const double* iColor);
568 unsigned int GetCollectionMaxDepth(
const unsigned int& iTrackRootID);
576 void UpdateCollectionMaxDepth(MultiIndexContainerTraceIDIterator& it,
577 const unsigned int& iDivisionDepth,
578 unsigned int& iLineageDepth);
584 unsigned int GetCollectionMinDepth(
const unsigned int& iTrackRootID );
592 void UpdateCollectionMinDepth( MultiIndexContainerTraceIDIterator& it,
593 const unsigned int& iDivisionDepth,
594 unsigned int& iLineageDepth);
600 unsigned int GetCollectionNumberOfDivisions(
601 const unsigned int& iTrackRootID);
608 void UpdateCollectionNumberOfDivisions(
609 MultiIndexContainerTraceIDIterator& it,
610 unsigned int& iNumberOfDivisions);
616 unsigned int GetCollectionNumberOfLeaves(
const unsigned int& iTrackRootID);
623 void UpdateCollectionNumberOfLeaves(MultiIndexContainerTraceIDIterator& it,
624 unsigned int& iNumberOfLeaves);
631 vtkMutableDirectedGraph* ExportLineage(
const unsigned int& iTrackID);
638 void SetCollectionColorCode(
const std::string& iColumnName,
639 const std::map<
unsigned int,
640 std::string >& iValues);
647 void SetDivisionRandomColor(
const std::string & iColumnName,
648 const std::map< unsigned int, std::string >& iValues);
659 void UpdateDivisionScalarData(MultiIndexContainerTraceIDIterator& it,
660 const std::string& iColumnName,
661 const double& iValue,
670 void SetScalarRangeForAllDivisions(
const double& iMin,
const double& iMax);
676 void SetLookupTableForAllDivisionsColorCoding(
const vtkLookupTable *iLut);
682 void RenderAllDivisionsWithOriginalColors();
695 void UpdateLineage(MultiIndexContainerTraceIDIterator& it,
696 vtkMutableDirectedGraph* iGraph,
697 unsigned int iPedrigree,
700 vtkDoubleArray* iDepthArray,
701 vtkDoubleArray* iIDArray);
705 void TracePicked(
unsigned int, Qt::CheckState);
708 void TraceVisibilityChanged(
unsigned int, Qt::CheckState);
711 void NeedMeshesInfoForImportedTrack(
unsigned int);
716 void UpdateLineageHighlightingFromTrackRootID(
unsigned int);
725 virtual void UpdateElementHighlightingWithGivenTraceIDs(
726 const QStringList& iList,
const Qt::CheckState& iCheck);
733 virtual void UpdateElementVisibilityWithGivenTraceIDs(
734 const QStringList& iList,
const Qt::CheckState& iCheck);
739 void ChangeColorCode(
const QString& iColorCode);
744 void ChangeDivisionsColorCode(
const QString& iColorCode);
753 void UpdateTracksRepresentation(
const double& iRadius,
754 const double& iRadius2,
755 const double& iWidth);
762 void HighlightCollection(
const unsigned int& iRootTrackID,
763 const bool& iHighlighted);
769 void UpdateCollectionHighlighted(MultiIndexContainerTraceIDIterator& it,
770 const bool& iHighlighted);
777 int ModifyDivisionHighlight(MultiIndexContainerTraceIDIterator& it,
778 const bool& iHighlight);
785 void ShowCollection(
const unsigned int&,
const bool&);
791 void UpdateCollectionVisibility(MultiIndexContainerTraceIDIterator& it,
792 const bool& iVisibility);
797 void DeleteCollection(
unsigned int);
801 void UpdateCollectionDelete( MultiIndexContainerTraceIDIterator& it);
809 int ModifyDivisionVisibility(MultiIndexContainerTraceIDIterator& it,
810 const bool& iVisibility );
816 void DeleteADivision(
const unsigned int& iMotherID);
818 void AddVolume(
const unsigned int& iTrackID,
const double& iVolume);
829 void RecomputeMap(
TrackStructure* iStructure, std::list< double* >& iPoints);
835 double* setTrackNodeScalars(
const QString& iArrayName);
841 double* setDivisionNodeScalars(
const QString& iArrayName);
853 #endif // TrackCONTAINER_H
MultiIndexContainerType::value_type MultiIndexContainerElementType
virtual std::list< unsigned int > DeleteAllHighlightedElements()=0
Delete all highlighted elements.
Add an array to a division with an unary function. Useful for the color coding.
void UpdateTracksStrings(const TList &iTrackList)
Update the points strings of the tracks for each element of the list { 1 -Add trackID to current elem...
change_data_color_division(const double *iColor)
void operator()(TrackStructure &iStructure)
QString m_ActiveTrackScalars
bool UpdateCurrentElementFromExistingOne(unsigned int iTraceID, bool iErase=true)
put the information of the existing element into m_CurrentElement and remove the existing element fro...
Superclass::MultiIndexContainerType MultiIndexContainerType
TrackType::PointsMapIterator PointsMapIterator
change_highlighted_division(vtkProperty *iProperty, bool iHighlight)
MultiIndexContainerType::template index< TraceID >::type::iterator MultiIndexContainerTraceIDIterator
void ModifyDivisionHighlight(vtkProperty *iProperty, const bool &iHighlight)
void AddVolume(const double &iVolume)
void operator()(TrackStructure &iStructure)
boost::MultiIndexTrackContainer MultiIndexContainerType
void operator()(TrackStructure &iStructure)
change_actor_color_division(const double *iColor)
Create a polydata for a division with an unary function. Useful for the color coding.
void CreateDivisionNode(vtkPolyData *iNode)
Change the visibility of a division with an unary function.
void operator()(TrackStructure &iStructure)
TrackType::PointsMapType PointsMapType
class for the visualization of 3D Image represented by one vtkImageData*.
Change the highlight of a division with an unary function.
multi_index::multi_index_container< TrackStructure, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< TraceID >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< CollectionID >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< Highlighted >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< Visible >, > >> MultiIndexTrackContainer
Structure which represent a track, and used for interaction between Visualization and TableWidget...
Generic interface for trace container. More specific container should inherit from this class and get...
QString m_ActiveDivisionScalars
void ModifyDivisionColorData(const double *iColor)
virtual bool DeleteElement(const unsigned int &iId)=0
Remove the element which TraceId = iId.
add_volume(const double &iVolume)
create_node_division(vtkPolyData *iNode)
void ModifyDivisionVisibility(const bool &iVisibility)
TrackType::PointsMapConstIterator PointsMapConstIterator
TraceContainerBase< boost::MultiIndexTrackContainer > Superclass
Superclass::MultiIndexContainerElementType TrackType
void AddDivisionArray(vtkIntArray *iArray)
void operator()(TrackStructure &iStructure)
void operator()(TrackStructure &iStructure)
Wraps a boost multi index container of TrackStructure. This class intends to synchronize Track repres...
void UpdateElementHighlighting(const unsigned int &TraceId)
Update highlighting property of one element given one actor.
void ModifyDivisionColorActor(const double *iColor)
add_array_division(vtkIntArray *iArray)
change_visible_division(const bool &iVisible)
void UpdateElementVisibility(const unsigned int &iTraceID, const bool &iState)
Update highlighting property of one element given one actor.
void operator()(TrackStructure &iStructure)
Structure which represent a trace (contour, mesh, track, lineage), and used for interaction between V...