4 #include <itkImageRegionConstIterator.h> 5 #include <itkImageRegionConstIteratorWithIndex.h> 6 #include <itkImageRegionIterator.h> 10 template <
typename TInputPixelType>
15 typedef itk::ImageRegionConstIteratorWithIndex <TInputImage> InputIteratorType;
16 typedef itk::ImageRegionIterator <TOutputImage> OutputIteratorType;
18 InputIteratorType inputIt(this->GetInput(),outputRegionForThread);
19 OutputIteratorType outIt(this->GetOutput(),outputRegionForThread);
21 unsigned int vdim = this->GetInput()->GetNumberOfComponentsPerPixel();
24 while(!inputIt.IsAtEnd())
26 tmpCoefs = inputIt.Get();
36 double sumSquares = 0;
37 for (
unsigned int i = 0;i < vdim;++i)
38 sumSquares += tmpCoefs[i]*tmpCoefs[i];
40 outIt.Set(sqrt(1 - tmpCoefs[0]*tmpCoefs[0]/sumSquares));
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) ITK_OVERRIDE
Superclass::OutputImageRegionType OutputImageRegionType
TInputImage::PixelType InputImagePixel