#include <itkTrxParcellationLabeler.h>
Assigns streamlines to TRX groups based on brain parcellation images.
Reads one or more NIfTI-1 label images (parcellations), performs a single sequential pass over all streamline coordinates in LPS space, and records which streamlines intersect which region voxels. Results are written as named groups in a new TRX file that preserves all existing DPS and DPV fields from the input.
A streamline is assigned to a region group when any of its coordinates falls inside a voxel bearing that region's integer label. The check is whole-streamline (endpoints are not treated specially).
Groups are named {prefix}_{label_name}, e.g. Glasser_Left_V1. Pre-existing groups in the input TRX are preserved in the output.
All computation is performed in ITK's LPS physical coordinate system. NIfTI images are read via itk::ImageFileReader, which delivers images in LPS automatically. The TRX coordinate conversion is handled internally by TrxStreamlineData::ForEachStreamlineChunked. Callers need not be aware of the TRX-internal RAS representation.
Definition at line 79 of file itkTrxParcellationLabeler.h.
Inheritance diagram for itk::TrxParcellationLabeler:
Collaboration diagram for itk::TrxParcellationLabeler:Classes | |
| struct | ParcellationSpec |
Public Types | |
| using | ConstPointer = SmartPointer<const Self> |
| using | Pointer = SmartPointer<Self> |
| using | Self = TrxParcellationLabeler |
| 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 | |
| void | AddParcellation (const ParcellationSpec &spec) |
| virtual::itk::LightObject::Pointer | CreateAnother () const |
| virtual unsigned int | GetDilationRadius () const |
| vcl_size_t | GetFinalFileBytes () const |
| const std::string & | GetInputFileName () const |
| virtual vcl_size_t | GetMaxDpvBytes () const |
| virtual const char * | GetNameOfClass () const |
| const std::string & | GetOutputFileName () const |
| vcl_size_t | GetPreGroupFileBytes () const |
| virtual void | SetDilationRadius (unsigned int _arg) |
| void | SetInput (TrxStreamlineData::ConstPointer input) |
| void | SetInputFileName (const std::string &filename) |
| virtual void | SetMaxDpvBytes (vcl_size_t _arg) |
| void | SetOutputFileName (const std::string &filename) |
| void | Update () |
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 |
| TrxParcellationLabeler ()=default | |
| ~TrxParcellationLabeler () 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 Attributes | |
| unsigned int | m_DilationRadius { 0 } |
| vcl_size_t | m_FinalFileBytes { 0 } |
| TrxStreamlineData::ConstPointer | m_Input |
| std::string | m_InputFileName |
| vcl_size_t | m_MaxDpvBytes { 512ULL * 1024ULL * 1024ULL } |
| std::string | m_OutputFileName |
| std::vector< ParcellationSpec > | m_Parcellations |
| vcl_size_t | m_PreGroupFileBytes { 0 } |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| using itk::TrxParcellationLabeler::ConstPointer = SmartPointer<const Self> |
Definition at line 87 of file itkTrxParcellationLabeler.h.
Definition at line 86 of file itkTrxParcellationLabeler.h.
Definition at line 84 of file itkTrxParcellationLabeler.h.
Definition at line 85 of file itkTrxParcellationLabeler.h.
|
protecteddefault |
Referenced by GetNameOfClass().
|
overrideprotecteddefault |
| void itk::TrxParcellationLabeler::AddParcellation | ( | const ParcellationSpec & | spec | ) |
Add a parcellation atlas. May be called multiple times.
|
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 |
| vcl_size_t itk::TrxParcellationLabeler::GetFinalFileBytes | ( | ) | const |
Bytes in output artifact after group append (final output).
| const std::string & itk::TrxParcellationLabeler::GetInputFileName | ( | ) | const |
|
virtual |
|
virtual |
Reimplemented from itk::Object.
References TrxParcellationLabeler().
| const std::string & itk::TrxParcellationLabeler::GetOutputFileName | ( | ) | const |
| vcl_size_t itk::TrxParcellationLabeler::GetPreGroupFileBytes | ( | ) | const |
Bytes in output artifact immediately before group append.
|
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 |
Morphological dilation radius applied to each label image before lookup, measured in voxels. A ball-shaped structuring element is used. Set to 0 (default) to skip dilation. Dilation uses a grayscale max-value rule, which expands each label into adjacent background voxels; at region boundaries the higher label value wins.
| void itk::TrxParcellationLabeler::SetInput | ( | TrxStreamlineData::ConstPointer | input | ) |
Set the source streamline data.
| void itk::TrxParcellationLabeler::SetInputFileName | ( | const std::string & | filename | ) |
|
virtual |
Maximum bytes of DPV data to load per field. Fields whose total byte size exceeds this limit are skipped with a warning rather than copied. Default: 512 MiB.
| void itk::TrxParcellationLabeler::SetOutputFileName | ( | const std::string & | filename | ) |
Set the output TRX file path. A ".trx" extension produces a zip archive; any other extension (or no extension) produces an uncompressed directory.
| void itk::TrxParcellationLabeler::Update | ( | ) |
Run labeling and write the output TRX file.
|
private |
Definition at line 185 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 188 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 181 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 182 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 186 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 184 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 183 of file itkTrxParcellationLabeler.h.
|
private |
Definition at line 187 of file itkTrxParcellationLabeler.h.