ITK  5.3.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  * http://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 
24 namespace itk
25 {
26 // This functor class invokes the computation of fractional anisotropy from
27 // every pixel.
28 namespace Functor
29 {
30 template <typename TInput>
32 {
33 public:
34  using RealValueType = typename TInput::RealValueType;
37  bool
39  {
40  return true;
41  }
42 
44 
45  inline RealValueType
46  operator()(const TInput & x) const
47  {
48  return x.GetFractionalAnisotropy();
49  }
50 };
51 } // end namespace Functor
52 
68 template <typename TInputImage,
69  typename TOutputImage =
70  Image<typename NumericTraits<typename TInputImage::PixelType::ValueType>::RealType, TInputImage::Dimension>>
72  : public UnaryFunctorImageFilter<TInputImage,
73  TOutputImage,
74  Functor::TensorFractionalAnisotropyFunction<typename TInputImage::PixelType>>
75 {
76 public:
77  ITK_DISALLOW_COPY_AND_MOVE(TensorFractionalAnisotropyImageFilter);
78 
81  using Superclass =
82  UnaryFunctorImageFilter<TInputImage,
83  TOutputImage,
85 
88 
89  using typename Superclass::OutputImageType;
90  using OutputPixelType = typename TOutputImage::PixelType;
91  using InputPixelType = typename TInputImage::PixelType;
92  using InputValueType = typename InputPixelType::ValueType;
93 
96 
98  itkNewMacro(Self);
99 
101  void
102  PrintSelf(std::ostream & os, Indent indent) const override
103  {
104  this->Superclass::PrintSelf(os, indent);
105  }
106 
107 #ifdef ITK_USE_CONCEPT_CHECKING
108  // Begin concept checking
109  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputValueType>));
110  // End concept checking
111 #endif
112 
113 protected:
115  ~TensorFractionalAnisotropyImageFilter() override = default;
116 };
117 } // end namespace itk
118 
119 #endif
itkUnaryFunctorImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::TensorFractionalAnisotropyImageFilter
Computes the Fractional Anisotropy for every pixel of a input tensor image.
Definition: itkTensorFractionalAnisotropyImageFilter.h:71
itk::UnaryFunctorImageFilter
Implements pixel-wise generic operation on one image.
Definition: itkUnaryFunctorImageFilter.h:50
itkImage.h
itk::TensorFractionalAnisotropyImageFilter::InputValueType
typename InputPixelType::ValueType InputValueType
Definition: itkTensorFractionalAnisotropyImageFilter.h:92
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Functor::TensorFractionalAnisotropyFunction::operator==
bool operator==(const TensorFractionalAnisotropyFunction &) const
Definition: itkTensorFractionalAnisotropyImageFilter.h:38
itk::Functor::TensorFractionalAnisotropyFunction::operator()
RealValueType operator()(const TInput &x) const
Definition: itkTensorFractionalAnisotropyImageFilter.h:46
itk::Functor::TensorFractionalAnisotropyFunction::~TensorFractionalAnisotropyFunction
~TensorFractionalAnisotropyFunction()=default
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::TensorFractionalAnisotropyFunction::TensorFractionalAnisotropyFunction
TensorFractionalAnisotropyFunction()=default
itk::UnaryFunctorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: itkUnaryFunctorImageFilter.h:75
itk::InPlaceImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::TensorFractionalAnisotropyImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkTensorFractionalAnisotropyImageFilter.h:102
itk::TensorFractionalAnisotropyImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkTensorFractionalAnisotropyImageFilter.h:91
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::TensorFractionalAnisotropyImageFilter::~TensorFractionalAnisotropyImageFilter
~TensorFractionalAnisotropyImageFilter() override=default
itk::TensorFractionalAnisotropyImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkTensorFractionalAnisotropyImageFilter.h:90
itk::Functor::TensorFractionalAnisotropyFunction::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(TensorFractionalAnisotropyFunction)
itk::Functor::TensorFractionalAnisotropyFunction< TInputImage::PixelType >::RealValueType
typename TInputImage::PixelType ::RealValueType RealValueType
Definition: itkTensorFractionalAnisotropyImageFilter.h:34
itk::Functor::TensorFractionalAnisotropyFunction
Definition: itkTensorFractionalAnisotropyImageFilter.h:31
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::TensorFractionalAnisotropyImageFilter::TensorFractionalAnisotropyImageFilter
TensorFractionalAnisotropyImageFilter()=default