ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkNoiseBaseImageFilter.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 itkNoiseBaseImageFilter_h
19 #define itkNoiseBaseImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
22 #include <vcl_ctime.h>
23 
24 namespace itk
25 {
26 
37 template <class TInputImage, class TOutputImage=TInputImage>
39  public InPlaceImageFilter<TInputImage,TOutputImage >
40 {
41 public:
47 
49 
52 
54  itkGetConstMacro(Seed, uint32_t);
55  itkSetMacro(Seed, uint32_t);
57 
60  virtual void SetSeed();
61 
62 protected:
64 
65  virtual ~NoiseBaseImageFilter() = 0;
66 
67  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
68 
69  inline static uint32_t Hash(uint32_t a, uint32_t b)
70  {
71  // Knuth's Multiplicative Method for hashing
72  return (a+b)*2654435761u;
73  }
74 
75  // Clamp and round the input value to the output
76  static OutputImagePixelType ClampCast(const double &value);
77 
78 private:
79  NoiseBaseImageFilter(const Self&); //purposely not implemented
80  void operator=(const Self&); //purposely not implemented
81 
83 
84 };
85 
86 } // end namespace itk
87 
88 #ifndef ITK_MANUAL_INSTANTIATION
89 #include "itkNoiseBaseImageFilter.hxx"
90 #endif
91 
92 #endif // itkNoiseBaseImageFilter_h
SmartPointer< const Self > ConstPointer
Superclass::OutputImagePixelType OutputImagePixelType
virtual ~NoiseBaseImageFilter()=0
void operator=(const Self &)
static uint32_t Hash(uint32_t a, uint32_t b)
An Abstract Base class for Noise image filters.
static OutputImagePixelType ClampCast(const double &value)
Superclass::OutputImagePixelType OutputImagePixelType
typedef::itksysFundamentalType_UInt32 uint32_t
Definition: itkIntTypes.h:87
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for filters that take an image as input and overwrite that image as the output...
InPlaceImageFilter< TInputImage, TOutputImage > Superclass