ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDisplacementFieldJacobianDeterminantFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkDisplacementFieldJacobianDeterminantFilter_h
19 #define itkDisplacementFieldJacobianDeterminantFilter_h
20 
22 #include "itkImageToImageFilter.h"
23 #include "itkVector.h"
24 #include "vnl/vnl_matrix.h"
25 #include "vnl/vnl_det.h"
26 
27 namespace itk
28 {
111 template< typename TInputImage,
112  typename TRealType = float,
113  typename TOutputImage = Image< TRealType,
114  TInputImage::ImageDimension >
115  >
117  public ImageToImageFilter< TInputImage, TOutputImage >
118 {
119 public:
120  ITK_DISALLOW_COPY_AND_ASSIGN(DisplacementFieldJacobianDeterminantFilter);
121 
127 
129  itkNewMacro(Self);
130 
133 
136  using OutputPixelType = typename TOutputImage::PixelType;
137  using InputPixelType = typename TInputImage::PixelType;
138 
140  using InputImageType = TInputImage;
141  using OutputImageType = TOutputImage;
142  using InputImagePointer = typename InputImageType::Pointer;
143  using OutputImagePointer = typename OutputImageType::Pointer;
144 
146  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
147 
149  static constexpr unsigned int VectorDimension = InputPixelType::Dimension;
150 
152  using RealType = TRealType;
153  using RealVectorType =
155  using RealVectorImageType =
157 
162 
164  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
165 
174  void GenerateInputRequestedRegion() override;
175 
181  { this->SetUseImageSpacing(true); }
182 
187  { this->SetUseImageSpacing(false); }
188 
191  void SetUseImageSpacing(bool);
192 
193  itkGetConstMacro(UseImageSpacing, bool);
194 
196 
199  void SetDerivativeWeights(const WeightsType &);
200  itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
202 
203 protected:
205  ~DisplacementFieldJacobianDeterminantFilter() override = default;
206 
210  void BeforeThreadedGenerateData() override;
211 
224  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
225 
226 
227  void PrintSelf(std::ostream & os, Indent indent) const override;
228 
229  using ImageBaseType = typename InputImageType::Superclass;
230 
232  itkGetConstObjectMacro(RealValuedInputImage, ImageBaseType);
233 
235  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
236  itkSetMacro(NeighborhoodRadius, RadiusType);
238 
239  virtual TRealType EvaluateAtNeighborhood(const ConstNeighborhoodIteratorType & it) const;
240 
243 
247 
248 private:
250 
252 
253  typename ImageBaseType::ConstPointer m_RealValuedInputImage;
254 
256 };
257 } // end namespace itk
258 
259 #ifndef ITK_MANUAL_INSTANTIATION
260 #include "itkDisplacementFieldJacobianDeterminantFilter.hxx"
261 #endif
262 
263 #endif
typename OutputImageType::Pointer OutputImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename InputImageType::Pointer InputImagePointer
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
unsigned int ThreadIdType
Definition: itkIntTypes.h:99
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::RadiusType RadiusType
Templated n-dimensional image class.
Definition: itkImage.h:75
Computes a scalar image from a vector image (e.g., deformation field) input, where each output scalar...