#include <itkTrxStreamWriter.h>
Streaming TRX writer that ingests ITK streamlines and metadata.
This class wraps trx::TrxStream and enforces per-streamline synchronization of DPS/DPV fields when pushing streamlines.
Definition at line 47 of file itkTrxStreamWriter.h.
Inheritance diagram for itk::TrxStreamWriter:
Collaboration diagram for itk::TrxStreamWriter:Classes | |
| struct | FieldSpec |
Public Types | |
| using | ConstPointer = SmartPointer<const Self> |
| using | DimensionsType = FixedArray<uint16_t, 3> |
| using | MatrixType = Matrix<double, 4, 4> |
| using | Pointer = SmartPointer<Self> |
| using | PointType = itk::Point<double, 3> |
| using | Self = TrxStreamWriter |
| using | StreamlineType = std::vector<PointType> |
| 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 |
| void | Finalize () |
| const std::string & | GetFileName () const |
| virtual const char * | GetNameOfClass () const |
| virtual vcl_size_t | GetPositionsBufferMaxBytes () const |
| virtual bool | GetUseCompression () const |
| void | PushStreamline (const StreamlineType &points, const std::map< std::string, double > &dpsValues={}, const std::map< std::string, std::vector< double > > &dpvValues={}, const std::vector< std::string > &groupNames={}) |
| void | PushStreamline (const vnl_matrix< double > &points, const std::map< std::string, double > &dpsValues={}, const std::map< std::string, std::vector< double > > &dpvValues={}, const std::vector< std::string > &groupNames={}) |
| void | RegisterDpsField (const std::string &name, const std::string &dtype) |
| void | RegisterDpvField (const std::string &name, const std::string &dtype) |
| void | SetDimensions (const DimensionsType &dims) |
| void | SetFileName (const std::string &filename) |
| virtual void | SetPositionsBufferMaxBytes (vcl_size_t _arg) |
| virtual void | SetUseCompression (bool _arg) |
| void | SetVoxelToLpsMatrix (const MatrixType &matrix) |
| void | SetVoxelToRasMatrix (const MatrixType &matrix) |
| virtual void | UseCompressionOff () |
| virtual void | UseCompressionOn () |
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 | |
| TrxStreamWriter () | |
| ~TrxStreamWriter () override | |
Protected Member Functions inherited from itk::Object | |
| Object () | |
| bool | PrintObservers (std::ostream &os, Indent indent) const |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| 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 | EnsureStream () |
| std::vector< float > | FlattenPointsToRas (const StreamlineType &points) const |
| std::vector< float > | FlattenPointsToRas (const vnl_matrix< double > &points) const |
| void | ValidateDpsValues (const std::map< std::string, double > &dpsValues) const |
| void | ValidateDpvValues (const std::map< std::string, std::vector< double > > &dpvValues, vcl_size_t pointCount) const |
Private Attributes | |
| DimensionsType | m_Dimensions { { 0, 0, 0 } } |
| std::map< std::string, FieldSpec > | m_Dps |
| std::map< std::string, FieldSpec > | m_Dpv |
| std::string | m_FileName {} |
| bool | m_Finalized { false } |
| std::map< std::string, std::vector< uint32_t > > | m_Groups |
| bool | m_HasDimensions { false } |
| bool | m_HasVoxelToLps { false } |
| bool | m_HasVoxelToRas { false } |
| vcl_size_t | m_PositionsBufferMaxBytes { 0 } |
| std::unique_ptr< TrxStreamImpl > | m_Stream |
| vcl_size_t | m_StreamlineCount { 0 } |
| bool | m_UseCompression { false } |
| vcl_size_t | m_VertexCount { 0 } |
| MatrixType | m_VoxelToLpsMatrix {} |
| MatrixType | m_VoxelToRasMatrix {} |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| using itk::TrxStreamWriter::ConstPointer = SmartPointer<const Self> |
Definition at line 55 of file itkTrxStreamWriter.h.
| using itk::TrxStreamWriter::DimensionsType = FixedArray<uint16_t, 3> |
Definition at line 61 of file itkTrxStreamWriter.h.
| using itk::TrxStreamWriter::MatrixType = Matrix<double, 4, 4> |
Definition at line 60 of file itkTrxStreamWriter.h.
Definition at line 54 of file itkTrxStreamWriter.h.
| using itk::TrxStreamWriter::PointType = itk::Point<double, 3> |
Definition at line 62 of file itkTrxStreamWriter.h.
Definition at line 52 of file itkTrxStreamWriter.h.
| using itk::TrxStreamWriter::StreamlineType = std::vector<PointType> |
Definition at line 63 of file itkTrxStreamWriter.h.
Definition at line 53 of file itkTrxStreamWriter.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotected |
|
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.
|
private |
| void itk::TrxStreamWriter::Finalize | ( | ) |
Finalize and write TRX file.
|
private |
|
private |
| const std::string & itk::TrxStreamWriter::GetFileName | ( | ) | const |
|
virtual |
|
virtual |
|
virtual |
|
static |
| void itk::TrxStreamWriter::PushStreamline | ( | const StreamlineType & | points, |
| const std::map< std::string, double > & | dpsValues = {}, | ||
| const std::map< std::string, std::vector< double > > & | dpvValues = {}, | ||
| const std::vector< std::string > & | groupNames = {} ) |
Add a streamline with per-streamline and per-vertex values.
| void itk::TrxStreamWriter::PushStreamline | ( | const vnl_matrix< double > & | points, |
| const std::map< std::string, double > & | dpsValues = {}, | ||
| const std::map< std::string, std::vector< double > > & | dpvValues = {}, | ||
| const std::vector< std::string > & | groupNames = {} ) |
Add a streamline provided as an N-by-3 matrix of LPS coordinates.
| void itk::TrxStreamWriter::RegisterDpsField | ( | const std::string & | name, |
| const std::string & | dtype ) |
Register a per-streamline field (DPS).
| void itk::TrxStreamWriter::RegisterDpvField | ( | const std::string & | name, |
| const std::string & | dtype ) |
Register a per-vertex field (DPV).
| void itk::TrxStreamWriter::SetDimensions | ( | const DimensionsType & | dims | ) |
| void itk::TrxStreamWriter::SetFileName | ( | const std::string & | filename | ) |
|
virtual |
Optional buffer size (bytes) for streaming positions.
|
virtual |
| void itk::TrxStreamWriter::SetVoxelToLpsMatrix | ( | const MatrixType & | matrix | ) |
| void itk::TrxStreamWriter::SetVoxelToRasMatrix | ( | const MatrixType & | matrix | ) |
|
virtual |
|
virtual |
|
private |
|
private |
|
private |
Definition at line 150 of file itkTrxStreamWriter.h.
|
private |
Definition at line 158 of file itkTrxStreamWriter.h.
|
private |
Definition at line 159 of file itkTrxStreamWriter.h.
|
private |
Definition at line 141 of file itkTrxStreamWriter.h.
|
private |
Definition at line 156 of file itkTrxStreamWriter.h.
|
private |
Definition at line 160 of file itkTrxStreamWriter.h.
|
private |
Definition at line 147 of file itkTrxStreamWriter.h.
|
private |
Definition at line 146 of file itkTrxStreamWriter.h.
|
private |
Definition at line 145 of file itkTrxStreamWriter.h.
|
private |
Definition at line 143 of file itkTrxStreamWriter.h.
|
private |
Definition at line 153 of file itkTrxStreamWriter.h.
|
private |
Definition at line 154 of file itkTrxStreamWriter.h.
|
private |
Definition at line 142 of file itkTrxStreamWriter.h.
|
private |
Definition at line 155 of file itkTrxStreamWriter.h.
|
private |
Definition at line 149 of file itkTrxStreamWriter.h.
|
private |
Definition at line 148 of file itkTrxStreamWriter.h.