Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
itkNormalizeImageFilterWithMask.h
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2016 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 // File : itkNormalizeImageFilterWithMask.h
30 // Author : Pavel A. Koshevoy
31 // Created : 2006/06/15 17:09
32 // Copyright : (C) 2004-2008 University of Utah
33 // Description : An enhanced version of the itk::NormalizeImageFilter
34 // adding support for a mask image.
35 
36 #ifndef __itkNormalizeImageFilterWithMask_h
37 #define __itkNormalizeImageFilterWithMask_h
38 
39 // ITK includes:
40 #include <itkImageToImageFilter.h>
41 #include <itkShiftScaleImageFilter.h>
42 #include <itkSpatialObject.h>
43 #include <itkEventObject.h>
44 
45 // local includes:
46 #include <Core/ITKCommon/Filtering/itkStatisticsImageFilterWithMask.h>
47 
48 namespace itk {
49 
62 template<class TInputImage,class TOutputImage>
63 class ITK_EXPORT NormalizeImageFilterWithMask :
64  public ImageToImageFilter<TInputImage, TOutputImage>
65 {
66 public:
69  typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
70  typedef SmartPointer<Self> Pointer;
71  typedef SmartPointer<const Self> ConstPointer;
72 
74  itkNewMacro(Self);
75 
77  itkTypeMacro(NormalizeImageFilterWithMask, ImageToImageFilter);
78 
80  typedef typename TInputImage::Pointer InputImagePointer;
81  typedef typename TOutputImage::Pointer OutputImagePointer;
82 
85  typedef SpatialObject<TInputImage::ImageDimension> ImageMaskType;
86  typedef typename ImageMaskType::Pointer ImageMaskPointer;
87 
89  itkSetObjectMacro( ImageMask, ImageMaskType );
90  itkGetConstObjectMacro( ImageMask, ImageMaskType );
91 
92 protected:
94 
96  void GenerateData ();
97 
98  // Override since the filter needs all the data for the algorithm
99  void GenerateInputRequestedRegion();
100 
101 private:
102  NormalizeImageFilterWithMask(const Self&); //purposely not implemented
103  void operator=(const Self&); //purposely not implemented
104 
105  typename StatisticsImageFilterWithMask<TInputImage>::Pointer m_StatisticsFilter;
106  typename ShiftScaleImageFilter<TInputImage,TOutputImage>::Pointer m_ShiftScaleFilter;
107 
108  mutable ImageMaskPointer m_ImageMask;
109 } ; // end of class
110 
111 } // end namespace itk
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkNormalizeImageFilterWithMask.txx"
115 #endif
116 
117 #endif
Definition: itkNormalizeImageFilterWithMask.h:48
Normalize an image by setting its mean to zero and variance to one.
Definition: itkNormalizeImageFilterWithMask.h:63
NormalizeImageFilterWithMask Self
Definition: itkNormalizeImageFilterWithMask.h:68
SpatialObject< TInputImage::ImageDimension > ImageMaskType
Definition: itkNormalizeImageFilterWithMask.h:85
TInputImage::Pointer InputImagePointer
Definition: itkNormalizeImageFilterWithMask.h:80