ITK  5.4.0
Insight Toolkit
itkTensorFractionalAnisotropyImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkTensorFractionalAnisotropyImageFilter_h
19#define itkTensorFractionalAnisotropyImageFilter_h
20
22#include "itkImage.h"
23
24namespace itk
25{
26// This functor class invokes the computation of fractional anisotropy from
27// every pixel.
28namespace Functor
29{
30template <typename TInput>
32{
33public:
34 using RealValueType = typename TInput::RealValueType;
35 bool
37 {
38 return true;
39 }
40
42
43 inline RealValueType
44 operator()(const TInput & x) const
45 {
46 return x.GetFractionalAnisotropy();
47 }
48};
49} // end namespace Functor
50
66template <typename TInputImage,
67 typename TOutputImage =
68 Image<typename NumericTraits<typename TInputImage::PixelType::ValueType>::RealType, TInputImage::Dimension>>
70 : public UnaryFunctorImageFilter<TInputImage,
71 TOutputImage,
72 Functor::TensorFractionalAnisotropyFunction<typename TInputImage::PixelType>>
73{
74public:
75 ITK_DISALLOW_COPY_AND_MOVE(TensorFractionalAnisotropyImageFilter);
76
79 using Superclass =
80 UnaryFunctorImageFilter<TInputImage,
81 TOutputImage,
83
86
87 using typename Superclass::OutputImageType;
88 using OutputPixelType = typename TOutputImage::PixelType;
89 using InputPixelType = typename TInputImage::PixelType;
90 using InputValueType = typename InputPixelType::ValueType;
91
93 itkOverrideGetNameOfClassMacro(TensorFractionalAnisotropyImageFilter);
94
96 itkNewMacro(Self);
97
99 void
100 PrintSelf(std::ostream & os, Indent indent) const override
101 {
102 this->Superclass::PrintSelf(os, indent);
103 }
104
105#ifdef ITK_USE_CONCEPT_CHECKING
106 // Begin concept checking
107 itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputValueType>));
108 // End concept checking
109#endif
110
111protected:
114};
115} // end namespace itk
116
117#endif
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(TensorFractionalAnisotropyFunction)
bool operator==(const TensorFractionalAnisotropyFunction &) const
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Computes the Fractional Anisotropy for every pixel of a input tensor image.
void PrintSelf(std::ostream &os, Indent indent) const override
~TensorFractionalAnisotropyImageFilter() override=default
Implements pixel-wise generic operation on one image.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....