#include <itkTrxGroup.h>
Represents a named group of streamlines within a TRX file.
A TRX file can contain named groups (e.g., "CST_left", "AF_right"), each of which is a subset of the total streamline set. TrxGroup stores the group's name, its streamline indices, any per-group scalar fields (DPG), and GUI display properties (color and visibility).
Groups are obtained through TrxStreamlineData, not constructed directly:
If the TRX file contains a DPG (data-per-group) field named "color" with at least 3 float values for this group, those values are used as the initial RGB color in [0, 1]. Otherwise a color is auto-assigned from a 10-entry perceptually distinct palette, cycling by group index.
TrxGroup inherits from itk::Object, so ITK's observer mechanism works:
Definition at line 99 of file itkTrxGroup.h.
Inheritance diagram for itk::TrxGroup:
Collaboration diagram for itk::TrxGroup:Public Types | |
| using | ColorType = FixedArray<float, 3> |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = TrxGroup |
| using | Superclass = Object |
Public Types inherited from itk::Object | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = Object |
| using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = LightObject |
Public Member Functions | |
| virtual::itk::LightObject::Pointer | CreateAnother () const |
| virtual ColorType | GetColor () const |
| std::vector< float > | GetDpgField (const std::string &name) const |
| std::vector< std::string > | GetDpgFieldNames () const |
| virtual const std::string & | GetName () const |
| virtual const char * | GetNameOfClass () const |
| virtual const std::vector< uint32_t > & | GetStreamlineIndices () const |
| SmartPointer< TrxStreamlineData > | GetStreamlines (SmartPointer< const TrxStreamlineData > parent) const |
| virtual bool | GetVisible () const |
| bool | HasDpgField (const std::string &name) const |
| virtual void | SetColor (ColorType _arg) |
| virtual void | SetVisible (bool _arg) |
| virtual void | VisibleOff () |
| virtual void | VisibleOn () |
Public Member Functions inherited from itk::Object | |
| unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
| unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
| virtual void | DebugOff () const |
| virtual void | DebugOn () const |
| Command * | GetCommand (unsigned long tag) |
| bool | GetDebug () const |
| MetaDataDictionary & | GetMetaDataDictionary () |
| const MetaDataDictionary & | GetMetaDataDictionary () const |
| virtual ModifiedTimeType | GetMTime () const |
| virtual const TimeStamp & | GetTimeStamp () const |
| bool | HasObserver (const EventObject &event) const |
| void | InvokeEvent (const EventObject &) |
| void | InvokeEvent (const EventObject &) const |
| virtual void | Modified () const |
| void | Register () const override |
| void | RemoveAllObservers () |
| void | RemoveObserver (unsigned long tag) const |
| void | SetDebug (bool debugFlag) const |
| void | SetReferenceCount (int) override |
| void | UnRegister () const noexcept override |
| void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
| void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
| virtual void | SetObjectName (std::string _arg) |
| virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
| Pointer | Clone () const |
| virtual void | Delete () |
| virtual int | GetReferenceCount () const |
| void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
| static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
| static bool | GetGlobalWarningDisplay () |
| static void | GlobalWarningDisplayOff () |
| static void | GlobalWarningDisplayOn () |
| static Pointer | New () |
| static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
| static void | BreakOnError () |
| static Pointer | New () |
Protected Member Functions | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| TrxGroup ()=default | |
| ~TrxGroup () override=default | |
Protected Member Functions inherited from itk::Object | |
| Object () | |
| bool | PrintObservers (std::ostream &os, Indent indent) const |
| virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
| ~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
| virtual LightObject::Pointer | InternalClone () const |
| LightObject () | |
| virtual void | PrintHeader (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
| virtual | ~LightObject () |
Private Member Functions | |
| void | SetDpgFields (std::map< std::string, std::vector< float > > dpgFields) |
| void | SetName (const std::string &name) |
| void | SetStreamlineIndices (std::vector< uint32_t > indices) |
Private Attributes | |
| ColorType | m_Color { { 1.0f, 1.0f, 1.0f } } |
| std::map< std::string, std::vector< float > > | m_DpgFields |
| std::string | m_Name |
| std::vector< uint32_t > | m_StreamlineIndices |
| bool | m_Visible { true } |
Friends | |
| class | TrxStreamlineData |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| using itk::TrxGroup::ColorType = FixedArray<float, 3> |
RGB color in [0, 1].
Definition at line 110 of file itkTrxGroup.h.
| using itk::TrxGroup::ConstPointer = SmartPointer<const Self> |
Definition at line 107 of file itkTrxGroup.h.
| using itk::TrxGroup::Pointer = SmartPointer<Self> |
Definition at line 106 of file itkTrxGroup.h.
| using itk::TrxGroup::Self = TrxGroup |
Definition at line 104 of file itkTrxGroup.h.
| using itk::TrxGroup::Superclass = Object |
Definition at line 105 of file itkTrxGroup.h.
|
protecteddefault |
Referenced by GetNameOfClass().
|
overrideprotecteddefault |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
virtual |
| std::vector< float > itk::TrxGroup::GetDpgField | ( | const std::string & | name | ) | const |
Values of a DPG field, widened to float regardless of on-disk dtype. For a scalar field this is a single-element vector. For a matrix field the values are returned flat in row-major order. Returns empty if the field does not exist.
| std::vector< std::string > itk::TrxGroup::GetDpgFieldNames | ( | ) | const |
Names of all data-per-group (DPG) fields stored for this group.
|
virtual |
Name of this group as stored in the TRX file.
|
virtual |
|
virtual |
Indices into the parent TrxStreamlineData identifying which streamlines belong to this group. Indices are in the range [0, N) where N is the total number of streamlines in the parent object.
| SmartPointer< TrxStreamlineData > itk::TrxGroup::GetStreamlines | ( | SmartPointer< const TrxStreamlineData > | parent | ) | const |
Return a TrxStreamlineData containing only the streamlines in this group. The subset is created lazily (no position data is copied; the backing TRX handle is remapped). Pass the parent TrxStreamlineData that this group was obtained from.
Callers must #include "itkTrxStreamlineData.h" to use this method.
|
virtual |
| bool itk::TrxGroup::HasDpgField | ( | const std::string & | name | ) | const |
True if a DPG field with the given name exists.
|
static |
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
|
virtual |
RGB color in [0, 1] for rendering this group. Initialized from the DPG "color" field if present, otherwise auto-assigned from a palette. Changing fires Modified().
|
private |
Set DPG field map — called once at construction by TrxStreamlineData.
|
private |
Set group name — called once at construction by TrxStreamlineData.
|
private |
Set streamline index list — called once at construction by TrxStreamlineData.
|
virtual |
Whether this group should be rendered. Changing fires Modified().
|
virtual |
|
virtual |
|
friend |
Definition at line 190 of file itkTrxGroup.h.
References TrxStreamlineData.
Referenced by TrxStreamlineData.
|
private |
Definition at line 207 of file itkTrxGroup.h.
|
private |
Definition at line 206 of file itkTrxGroup.h.
|
private |
Definition at line 204 of file itkTrxGroup.h.
|
private |
Definition at line 205 of file itkTrxGroup.h.
|
private |
Definition at line 208 of file itkTrxGroup.h.