ITK  4.3.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:
125 
127  itkNewMacro(Self);
128 
131 
134  typedef typename TOutputImage::PixelType OutputPixelType;
135  typedef typename TInputImage::PixelType InputPixelType;
136 
138  typedef TInputImage InputImageType;
139  typedef TOutputImage OutputImageType;
140  typedef typename InputImageType::Pointer InputImagePointer;
141  typedef typename OutputImageType::Pointer OutputImagePointer;
142 
144  itkStaticConstMacro(ImageDimension, unsigned int,
145  TOutputImage::ImageDimension);
146 
148  itkStaticConstMacro(VectorDimension, unsigned int,
149  InputPixelType::Dimension);
150 
152  typedef TRealType RealType;
157 
162 
164  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
165 
174  virtual void GenerateInputRequestedRegion()
176 
181  void SetUseImageSpacingOn()
182  { this->SetUseImageSpacing(true); }
183 
187  void SetUseImageSpacingOff()
188  { this->SetUseImageSpacing(false); }
189 
192  void SetUseImageSpacing(bool);
193 
194  itkGetConstMacro(UseImageSpacing, bool);
195 
197 
200  void SetDerivativeWeights(const WeightsType &);
201  itkGetConstReferenceMacro(DerivativeWeights, WeightsType);
203 
204 protected:
207 
211  void BeforeThreadedGenerateData();
212 
225  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
226  ThreadIdType threadId);
227 
228  void PrintSelf(std::ostream & os, Indent indent) const;
229 
230  typedef typename InputImageType::Superclass ImageBaseType;
231 
233  itkGetConstObjectMacro(RealValuedInputImage, ImageBaseType);
234 
236  itkGetConstReferenceMacro(NeighborhoodRadius, RadiusType);
237  itkSetMacro(NeighborhoodRadius, RadiusType);
239 
240  virtual TRealType EvaluateAtNeighborhood(const ConstNeighborhoodIteratorType & it) const;
241 
244 
248 
249 private:
251 
253 
254  typename ImageBaseType::ConstPointer m_RealValuedInputImage;
255 
256  DisplacementFieldJacobianDeterminantFilter(const Self &); //purposely not
257  // implemented
258  void operator=(const Self &); //purposely not
259 
260  // implemented
261 
263 };
264 } // end namespace itk
265 
266 #ifndef ITK_MANUAL_INSTANTIATION
267 #include "itkDisplacementFieldJacobianDeterminantFilter.hxx"
268 #endif
269 
270 #endif
271