ITK  6.0.0
Insight Toolkit
itkMultiScaleHessianBasedMeasureImageFilter.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 itkMultiScaleHessianBasedMeasureImageFilter_h
19 #define itkMultiScaleHessianBasedMeasureImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "ITKImageFeatureExport.h"
24 
25 namespace itk
26 {
32 {
33 public:
39  enum class SigmaStepMethod : uint8_t
40  {
43  };
44 };
45 // Define how to print enumeration
46 extern ITKImageFeature_EXPORT std::ostream &
48 
86 template <typename TInputImage, typename THessianImage, typename TOutputImage = TInputImage>
88  : public ImageToImageFilter<TInputImage, TOutputImage>
89 {
90 public:
91  ITK_DISALLOW_COPY_AND_MOVE(MultiScaleHessianBasedMeasureImageFilter);
92 
96 
99 
100  using InputImageType = TInputImage;
101  using OutputImageType = TOutputImage;
102  using HessianImageType = THessianImage;
103 
105 
106  using InputPixelType = typename TInputImage::PixelType;
107  using OutputPixelType = typename TOutputImage::PixelType;
109 
111  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
112 
114  using ScalesPixelType = float;
116 
119 
125 
126  using typename Superclass::DataObjectPointer;
127 
129  itkNewMacro(Self);
130 
132  itkOverrideGetNameOfClassMacro(MultiScaleHessianBasedMeasureImageFilter);
133 
135  itkSetMacro(SigmaMinimum, double);
136  itkGetConstMacro(SigmaMinimum, double);
140  itkSetMacro(SigmaMaximum, double);
141  itkGetConstMacro(SigmaMaximum, double);
145  itkSetMacro(NumberOfSigmaSteps, unsigned int);
146  itkGetConstMacro(NumberOfSigmaSteps, unsigned int);
152  itkSetObjectMacro(HessianToMeasureFilter, HessianToMeasureFilterType);
153  itkGetModifiableObjectMacro(HessianToMeasureFilter, HessianToMeasureFilterType);
162  itkSetMacro(NonNegativeHessianBasedMeasure, bool);
163  itkGetConstMacro(NonNegativeHessianBasedMeasure, bool);
164  itkBooleanMacro(NonNegativeHessianBasedMeasure);
168 #if !defined(ITK_LEGACY_REMOVE)
169 
170  static constexpr SigmaStepMethodEnum EquispacedSigmaSteps = SigmaStepMethodEnum::EquispacedSigmaSteps;
171  static constexpr SigmaStepMethodEnum LogarithmicSigmaSteps = SigmaStepMethodEnum::LogarithmicSigmaSteps;
172 #endif
173 
176  itkSetEnumMacro(SigmaStepMethod, SigmaStepMethodEnum);
177  itkGetConstMacro(SigmaStepMethod, SigmaStepMethodEnum);
181  void
182  SetSigmaStepMethodToEquispaced();
183 
185  void
186  SetSigmaStepMethodToLogarithmic();
187 
190  const HessianImageType *
191  GetHessianOutput() const;
192 
195  const ScalesImageType *
196  GetScalesOutput() const;
197 
200  itkSetMacro(GenerateScalesOutput, bool);
201  itkGetConstMacro(GenerateScalesOutput, bool);
202  itkBooleanMacro(GenerateScalesOutput);
207  itkSetMacro(GenerateHessianOutput, bool);
208  itkGetConstMacro(GenerateHessianOutput, bool);
209  itkBooleanMacro(GenerateHessianOutput);
214 
215 protected:
217  ~MultiScaleHessianBasedMeasureImageFilter() override = default;
218  void
219  PrintSelf(std::ostream & os, Indent indent) const override;
220 
222  void
223  GenerateData() override;
224 
225  void
226  EnlargeOutputRequestedRegion(DataObject *) override;
227 
228  using Superclass::MakeOutput;
230  MakeOutput(DataObjectPointerArraySizeType idx) override;
231 
232 private:
233  void
234  UpdateMaximumResponse(double sigma);
235 
236  double
237  ComputeSigmaValue(int scaleLevel);
238 
239  void
240  AllocateUpdateBuffer();
241 
242  bool m_NonNegativeHessianBasedMeasure{};
243 
244  double m_SigmaMinimum{};
245  double m_SigmaMaximum{};
246 
247  unsigned int m_NumberOfSigmaSteps{};
248  SigmaStepMethodEnum m_SigmaStepMethod{};
249 
250  typename HessianToMeasureFilterType::Pointer m_HessianToMeasureFilter{};
251 
252  typename HessianFilterType::Pointer m_HessianFilter{};
253 
254  typename UpdateBufferType::Pointer m_UpdateBuffer{};
255 
256  bool m_GenerateScalesOutput{};
257  bool m_GenerateHessianOutput{};
258 };
259 } // end namespace itk
260 
261 #ifndef ITK_MANUAL_INSTANTIATION
262 # include "itkMultiScaleHessianBasedMeasureImageFilter.hxx"
263 #endif
264 
265 #endif
itk::MultiScaleHessianBasedMeasureImageFilterEnums::SigmaStepMethod::EquispacedSigmaSteps
itk::MultiScaleHessianBasedMeasureImageFilterEnums
This class contains all enum classes used by MultiScaleHessianBasedMeasureImageFilter class.
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:31
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
itk::MultiScaleHessianBasedMeasureImageFilter::OutputRegionType
typename TOutputImage::RegionType OutputRegionType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:108
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkHessianRecursiveGaussianImageFilter.h
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::MultiScaleHessianBasedMeasureImageFilter::HessianImageType
THessianImage HessianImageType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:102
itk::Image::ValueType
TPixel ValueType
Definition: itkImage.h:111
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::MultiScaleHessianBasedMeasureImageFilter::ScalesPixelType
float ScalesPixelType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:114
itk::MultiScaleHessianBasedMeasureImageFilterEnums::SigmaStepMethod
SigmaStepMethod
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:39
itk::MultiScaleHessianBasedMeasureImageFilter
A filter to enhance structures using Hessian eigensystem-based measures in a multiscale framework.
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:87
itk::MultiScaleHessianBasedMeasureImageFilterEnums::SigmaStepMethod::LogarithmicSigmaSteps
itk::MultiScaleHessianBasedMeasureImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:106
itk::MultiScaleHessianBasedMeasureImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:107
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::HessianRecursiveGaussianImageFilter
Computes the Hessian matrix of an image by convolution with the Second and Cross derivatives of a Gau...
Definition: itkHessianRecursiveGaussianImageFilter.h:47
itk::ImageSource::DataObjectPointerArraySizeType
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: itkImageSource.h:84
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
SigmaStepMethod
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::MultiScaleHessianBasedMeasureImageFilter::BufferValueType
typename UpdateBufferType::ValueType BufferValueType
Definition: itkMultiScaleHessianBasedMeasureImageFilter.h:124
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293