3 #include <itkVectorImage.h> 6 #include <vtkPolyData.h> 7 #include <vtkSmartPointer.h> 8 #include <itkLinearInterpolateImageFunction.h> 9 #include <itkProcessObject.h> 11 #include <itkProgressReporter.h> 13 #include "AnimaTractographyExport.h" 57 virtual void SetInputImage(ModelImageType *input) {m_InputImage = input;}
63 void SetCutMask(MaskImageType *mask) {m_CutMaskImage = mask;}
73 void Update() ITK_OVERRIDE;
76 void createVTKOutput(std::vector < std::vector <PointType> > &filteredFibers);
83 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreadTracker(
void *arg);
84 void ThreadTrack(
unsigned int numThread, std::vector <FiberType> &resultFibers);
85 void ThreadedTrackComputer(
unsigned int numThread, std::vector <FiberType> &resultFibers,
86 unsigned int startSeedIndex,
unsigned int endSeedIndex);
88 FiberProcessVectorType ComputeFiber(FiberType &fiber, FiberProgressType ways, itk::ThreadIdType threadId);
90 virtual void PrepareTractography();
91 std::vector < FiberType > FilterOutputFibers(std::vector < FiberType > &fibers);
93 virtual bool CheckModelCompatibility(VectorType &modelValue, itk::ThreadIdType threadId) = 0;
96 bool CheckIndexInImageBounds(IndexType &index, ImageBaseType *testImage);
97 virtual bool CheckIndexInImageBounds(ContinuousIndexType &index) = 0;
100 virtual void GetModelValue(ContinuousIndexType &index, VectorType &modelValue) = 0;
102 virtual PointType GetModelPrincipalDirection(VectorType &modelValue,
bool is2d, itk::ThreadIdType threadId) = 0;
103 virtual PointType GetNextDirection(PointType &previousDirection, VectorType &modelValue,
bool is2d, itk::ThreadIdType threadId) = 0;
106 bool isZero(VectorType &value);
111 unsigned int m_NumberOfFibersPerPixel;
113 double m_StepProgression;
114 double m_MaxFiberAngle;
116 double m_MinLengthFiber;
117 double m_MaxLengthFiber;
119 ModelImagePointer m_InputImage;
120 MaskImagePointer m_SeedingImage, m_FilteringImage, m_ForbiddenMaskImage, m_CutMaskImage;
122 FiberProcessVectorType m_PointsToProcess;
123 std::vector <unsigned int> m_FilteringValues;
125 bool m_ComputeLocalColors;
126 vtkSmartPointer<vtkPolyData> m_Output;
128 std::mutex m_LockHighestProcessedSeed;
129 int m_HighestProcessedSeed;
130 itk::ProgressReporter *m_ProgressReport;
void SetCutMask(MaskImageType *mask)
void SetComputeLocalColors(bool flag)
ModelImageType::RegionType RegionType
itk::ImageBase< ModelImageType::ImageDimension > ImageBaseType
itk::SmartPointer< Self > Pointer
virtual void ComputeAdditionalScalarMaps()
void SetNumberOfFibersPerPixel(unsigned int num)
void SetSeedingMask(MaskImageType *mask)
void SetMinLengthFiber(double num)
ModelImageType::Pointer ModelImagePointer
BaseTractographyImageFilter * trackerPtr
virtual void SetInputImage(ModelImageType *input)
void SetMaxLengthFiber(double num)
std::vector< std::pair< FiberProgressType, FiberType > > FiberProcessVectorType
MaskImageType::Pointer MaskImagePointer
void SetMaxFiberAngle(double num)
itk::Image< unsigned short, 3 > MaskImageType
vtkPolyData * GetOutput()
itk::ProcessObject Superclass
MaskImageType::PointType PointType
std::vector< PointType > FiberType
itk::ContinuousIndex< double, 3 > ContinuousIndexType
void SetForbiddenMask(MaskImageType *mask)
ModelImageType::PixelType VectorType
void SetFilteringMask(MaskImageType *mask)
itk::SmartPointer< const Self > ConstPointer
ModelImageType * GetInputImage()
std::vector< std::vector< FiberType > > resultFibersFromThreads
void SetStepProgression(double num)
itk::VectorImage< double, 3 > ModelImageType
MaskImageType::IndexType IndexType
BaseTractographyImageFilter Self