18 #ifndef _MITK_FiberBundle_H
19 #define _MITK_FiberBundle_H
23 #include <MitkFiberTrackingExports.h>
32 #include <vtkSmartPointer.h>
33 #include <vtkPolyData.h>
34 #include <vtkPoints.h>
35 #include <vtkDataSet.h>
36 #include <vtkTransform.h>
37 #include <vtkFloatArray.h>
53 virtual void UpdateOutputInformation()
override;
54 virtual void SetRequestedRegionToLargestPossibleRegion()
override;
55 virtual bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
56 virtual bool VerifyRequestedRegion()
override;
57 virtual void SetRequestedRegion(
const itk::DataObject*)
override;
60 itkFactorylessNewMacro(
Self)
65 void ColorFibersByCurvature(
bool minMaxNorm=true);
67 template <typename TPixel>
69 void ColorFibersByOrientation();
70 void SetFiberOpacity(vtkDoubleArray *FAValArray);
71 void ResetFiberOpacity();
72 void SetFiberColors(vtkSmartPointer<vtkUnsignedCharArray> fiberColors);
73 void SetFiberColors(
float r,
float g,
float b,
float alpha=255);
74 vtkSmartPointer<vtkUnsignedCharArray> GetFiberColors()
const {
return m_FiberColors; }
77 void Compress(
float error = 0.0);
80 void ResampleSpline(
float pointDistance=1);
81 void ResampleSpline(
float pointDistance,
double tension,
double continuity,
double bias );
83 bool RemoveShortFibers(
float lengthInMM);
84 bool RemoveLongFibers(
float lengthInMM);
85 bool ApplyCurvatureThreshold(
float minRadius,
bool deleteFibers);
86 void MirrorFibers(
unsigned int axis);
87 void RotateAroundAxis(
double x,
double y,
double z);
88 void TranslateFibers(
double x,
double y,
double z);
89 void ScaleFibers(
double x,
double y,
double z,
bool subtractCenter=
true);
90 void TransformFibers(
double rx,
double ry,
double rz,
double tx,
double ty,
double tz);
91 void RemoveDir(vnl_vector_fixed<double,3> dir,
double threshold);
92 itk::Point<float, 3> TransformPoint(vnl_vector_fixed< double, 3 > point,
double rx,
double ry,
double rz,
double tx,
double ty,
double tz);
93 itk::Matrix< double, 3, 3 > TransformMatrix(itk::Matrix< double, 3, 3 > m,
double rx,
double ry,
double rz);
102 FiberBundle::Pointer ExtractFiberSubset(ItkUcharImgType* mask,
bool anyPoint,
bool invert=
false,
bool bothEnds=
true);
105 vtkSmartPointer<vtkPolyData> GeneratePolyDataByIds( std::vector<long> );
106 void GenerateFiberIds();
110 float GetFiberWeight(
unsigned int fiber);
111 void SetFiberWeights(
float newWeight);
112 void SetFiberWeight(
unsigned int fiber,
float weight);
113 void SetFiberWeights(vtkSmartPointer<vtkFloatArray> weights);
114 void SetFiberPolyData(vtkSmartPointer<vtkPolyData>,
bool updateGeometry =
true);
115 vtkSmartPointer<vtkPolyData> GetFiberPolyData()
const;
116 itkGetMacro( NumFibers,
int)
118 int GetNumFibers()
const {
return m_NumFibers;}
119 itkGetMacro( MinFiberLength,
float )
120 itkGetMacro( MaxFiberLength,
float )
121 itkGetMacro( MeanFiberLength,
float )
122 itkGetMacro( MedianFiberLength,
float )
123 itkGetMacro( LengthStDev,
float )
124 itkGetMacro( UpdateTime2D,
itk::TimeStamp )
125 itkGetMacro( UpdateTime3D,
itk::TimeStamp )
126 void RequestUpdate2D(){ m_UpdateTime2D.Modified(); }
128 void RequestUpdate(){ m_UpdateTime2D.Modified(); m_UpdateTime3D.Modified(); }
130 unsigned long GetNumberOfPoints();
143 FiberBundle( vtkPolyData* fiberPolyData =
nullptr );
146 itk::
Point<
float, 3> GetItkPoint(
double point[3]);
149 void UpdateFiberGeometry();
154 vtkSmartPointer<vtkPolyData> m_FiberPolyData;
157 vtkSmartPointer<vtkDataSet> m_FiberIdDataSet;
161 vtkSmartPointer<vtkUnsignedCharArray> m_FiberColors;
162 vtkSmartPointer<vtkFloatArray> m_FiberWeights;
163 std::vector<
float > m_FiberLengths;
164 float m_MinFiberLength;
165 float m_MaxFiberLength;
166 float m_MeanFiberLength;
167 float m_MedianFiberLength;
170 itk::TimeStamp m_UpdateTime2D;
171 itk::TimeStamp m_UpdateTime3D;
Data management class that handles 'was created by' relations.
static const char * FIBER_ID_ARRAY
#define mitkNewMacro1Param(classname, type)
Base of all data objects.
DataCollection - Class to facilitate loading/accessing structured data.
itk::Image< unsigned char, 3 > ItkUcharImgType
vtkSmartPointer< vtkFloatArray > GetFiberWeights() const
#define mitkClassMacro(className, SuperClassName)
Image class for storing images.
Base Class for Fiber Bundles;.
MITKCORE_EXPORT const ScalarType eps
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
Class for defining the data type of pixels.