18#ifndef itkTrxStreamlineData_h
19#define itkTrxStreamlineData_h
21#include "TractographyTRXExport.h"
31#include ITK_EIGEN(Core)
32#include "vnl/vnl_matrix.h"
97 const void *
xyz{
nullptr };
150 std::vector<PointType>
177 Save(
const std::string & filename,
bool useCompression)
const;
191 const std::vector<Eigen::half> *
194 const std::vector<float> *
197 const std::vector<double> *
200 std::vector<Eigen::half> *
206 std::vector<double> *
209 const std::vector<OffsetType> &
222 SubsetStreamlines(
const std::vector<uint32_t> & streamlineIds,
bool buildCacheForResult =
false)
const;
234 bool buildCacheForResult =
false)
const;
239 bool buildCacheForResult,
240 size_t maxStreamlines,
241 uint32_t rngSeed)
const;
243 const std::vector<AabbType> &
285 template <
typename TTransform>
289 template <
typename TTransform>
293 template <
typename TTransform>
299 template <
typename TTransform>
307 template <
typename TTransform>
311 vnl_matrix<double> & buffer)
const;
326 std::vector<std::string>
345 std::vector<std::string>
349 std::vector<std::string>
418 using PositionStorageType = std::variant<std::vector<Eigen::half>, std::vector<float>, std::vector<double>>;
452std::shared_ptr<TrxHandleBase>
457#ifndef ITK_MANUAL_INSTANTIATION
458# include "itkTrxStreamlineData.hxx"
Simulate a standard C array with copy semantics.
Control indentation during Print() invocation.
A templated class holding a M x N size Matrix.
A templated class holding a geometric point in n-Dimensional space.
Implements transparent reference counting.
SmartPointer< Self > Pointer
Streaming TRX writer that ingests ITK streamlines and metadata.
const TrxStreamlineData * m_Data
bool operator!=(const Iterator &other) const
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
bool operator==(const Iterator &other) const
PointType operator*() const
Iterator(const TrxStreamlineData *data, SizeValueType index)
const TrxStreamlineData * m_Data
StreamlinePointRange()=default
StreamlinePointRange(const TrxStreamlineData *data, SizeValueType start, SizeValueType end)
const std::vector< Eigen::half > * GetFloat16Positions() const
std::vector< PointType > StreamlineType
itk::SizeValueType SizeValueType
CoordinateType m_FileCoordinateType
std::array< double, 6 > AabbType
MatrixType m_VoxelToLpsMatrix
Pointer QueryAabb(const PointType &minCornerLps, const PointType &maxCornerLps, bool buildCacheForResult=false) const
SmartPointer< Self > Pointer
void SetVoxelToRasMatrix(const MatrixType &matrix)
SizeValueType GetNumberOfStreamlines() const
std::vector< float > * GetFloat32Positions()
bool HasVoxelToRasMatrix() const
TrxGroup::Pointer GetGroup(const std::string &name) const
void SetCoordinateSystem(CoordinateSystem system)
void TransformInPlace(const TTransform *transform)
bool HasVoxelToLpsMatrix() const
void EnsureOffsetsSentinel()
Pointer SubsetStreamlinesLazy(const std::vector< uint32_t > &streamlineIds, bool buildCacheForResult=false) const
bool HasFloat32Positions() const
bool GetStreamlineView(SizeValueType streamlineIndex, StreamlineView &view) const
std::vector< std::string > m_DpsFieldNames
std::vector< std::string > GetDpvFieldNames() const
void Save(const std::string &filename, bool useCompression) const
void SetDimensions(const DimensionsType &dims)
std::variant< std::vector< Eigen::half >, std::vector< float >, std::vector< double > > PositionStorageType
void TransformToWriterChunkedReuseBuffer(const TTransform *transform, class TrxStreamWriter *writer, StreamlineType &buffer, SizeValueType reservePoints=0) const
bool HasFloat64Positions() const
PointType GetPointLpsAtIndex(SizeValueType index) const
FixedArray< uint16_t, 3 > DimensionsType
std::vector< OffsetType > m_Offsets
void SetTrxHandle(const std::shared_ptr< TrxHandleBase > &trxHandle)
void ForEachStreamlineChunked(const std::function< void(SizeValueType, const void *, SizeValueType, CoordinateType, CoordinateSystem)> &fn, CoordinateSystem requestedSystem=CoordinateSystem::LPS) const
SizeValueType GetGroupStreamlineCount(const std::string &name) const
std::vector< std::string > GetGroupNames() const
void TransformToWriterChunkedReuseVnlBuffer(const TTransform *transform, class TrxStreamWriter *writer, vnl_matrix< double > &buffer) const
std::map< std::string, TrxGroup::Pointer > m_GroupCache
void SetVoxelToLpsMatrix(const MatrixType &matrix)
void TransformInPlaceChunked(const TTransform *transform, SizeValueType chunkPoints)
void TransformToWriterChunked(const TTransform *transform, class TrxStreamWriter *writer, SizeValueType reservePoints=0) const
std::vector< PointType > GetStreamline(SizeValueType streamlineIndex) const
Pointer SubsetStreamlines(const std::vector< uint32_t > &streamlineIds, bool buildCacheForResult=false) const
CoordinateType GetCoordinateType() const
bool HasTrxHandle() const
CoordinateSystem GetCoordinateSystem() const
std::vector< std::string > m_GroupNames
const MatrixType & GetVoxelToLpsMatrix() const
SizeValueType GetNumberOfVertices() const
std::vector< Eigen::half > * GetFloat16Positions()
SmartPointer< const Self > ConstPointer
std::vector< float > GetDpsField(const std::string &name) const
MatrixType m_VoxelToRasMatrix
bool HasFloat16Positions() const
void PrintSelf(std::ostream &os, Indent indent) const override
const MatrixType & GetVoxelToRasMatrix() const
std::shared_ptr< TrxHandleBase > m_TrxHandle
std::vector< std::string > m_DpvFieldNames
const std::vector< OffsetType > & GetOffsets() const
itk::Point< double, 3 > PointType
std::vector< float > GetDpvField(const std::string &name) const
std::vector< AabbType > m_AabbCache
void InvalidateAabbCache() const
CoordinateSystem m_CoordinateSystem
void Graft(const DataObject *data) override
void EnsurePositionsLoaded() const
SizeValueType m_NumberOfVertices
const std::vector< AabbType > & GetOrBuildStreamlineAabbs() const
std::vector< std::string > GetDpsFieldNames() const
void SetOffsets(std::vector< OffsetType > &&offsets)
std::vector< double > * GetFloat64Positions()
~TrxStreamlineData() override=default
GroupConnectivityResult ComputeGroupConnectivity(const std::string &dpsFieldName="") const
PositionStorageType m_Positions
Pointer QueryAabb(const PointType &minCornerLps, const PointType &maxCornerLps, bool buildCacheForResult, vcl_size_t maxStreamlines, uint32_t rngSeed) const
const DimensionsType & GetDimensions() const
bool HasDimensions() const
StreamlinePointRange GetStreamlineRange(SizeValueType streamlineIndex) const
DimensionsType m_Dimensions
const std::vector< double > * GetFloat64Positions() const
const std::vector< float > * GetFloat32Positions() const
TrxStreamlineData()=default
Matrix< double, 4, 4 > MatrixType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
std::shared_ptr< TrxHandleBase > LoadTrxHandle(const std::string &path)
vnl_matrix< double > matrix
vnl_matrix< double > streamlineCounts
std::vector< std::string > groupNames
CoordinateSystem coordinateSystem
CoordinateType coordinateType