3 #include <itkImageToImageFilter.h> 5 #include <itkVariableLengthVector.h> 14 template <
typename TInputImage,
typename TOutputImage>
16 public itk::ImageToImageFilter < TInputImage, TOutputImage >
21 typedef itk::ImageToImageFilter <TInputImage, TOutputImage>
Superclass;
24 typedef typename itk::ImageSource<TOutputImage>::ThreadStruct
ThreadStruct;
35 itkSetMacro(NumberOfPointsToProcess,
unsigned int)
37 itkSetMacro(ComputationRegion, OutputImageRegionType)
38 itkGetMacro(ComputationRegion, OutputImageRegionType)
43 m_NumberOfProcessedPoints = 0;
44 m_ComputationRegion.SetSize(0,0);
45 m_HighestProcessedSlice = 0;
46 m_ProcessedDimension = 0;
64 template <
typename ScalarRealType>
68 unsigned int vectorSize = image->GetVectorLength();
69 zeroPixel = itk::VariableLengthVector <ScalarRealType> (vectorSize);
74 template <
typename PixelType>
78 zeroPixel = itk::NumericTraits <PixelType>::ZeroValue();
84 std::mutex m_LockThreadIdNumber;
85 std::vector <unsigned int> m_ThreadIdsVector;
87 std::mutex m_LockProcessedPoints;
88 unsigned int m_NumberOfProcessedPoints;
89 unsigned int m_NumberOfPointsToProcess;
91 std::mutex m_LockHighestProcessedSlice;
92 int m_HighestProcessedSlice;
93 unsigned int m_ProcessedDimension;
96 OutputImageRegionType m_ComputationRegion;
virtual void BeforeThreadedGenerateData() ITK_OVERRIDE
itk::SmartPointer< const Self > ConstPointer
Implements a class to handle thread number in a dynamic way for multithreaded methods needing thread ...
NumberedThreadImageToImageFilter()
Superclass::OutputImageRegionType OutputImageRegionType
unsigned int GetSafeThreadId()
virtual void GenerateData() ITK_OVERRIDE
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderMultiSplitCallback(void *arg)
void InitializeZeroPixel(TOutputImage *, PixelType &zeroPixel)
Utility function to initialize output images pixel to zero for all images except vector images...
void InitializeZeroPixel(TOutputImage *image, itk::VariableLengthVector< ScalarRealType > &zeroPixel)
Utility function to initialize output images pixel to zero for vector images.
itk::ImageSource< TOutputImage >::ThreadStruct ThreadStruct
void SafeReleaseThreadId(unsigned int threadId)
virtual void ThreadProcessSlices()
static constexpr unsigned int OutputImageDimension
virtual ~NumberedThreadImageToImageFilter()
void IncrementNumberOfProcessedPoints()
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
NumberedThreadImageToImageFilter Self
itk::SmartPointer< Self > Pointer