Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
US/USHardwareDiPhAS/ITKUltrasound/itkBModeImageFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 /*=========================================================================
13  *
14  * Copyright Insight Software Consortium
15  *
16  * Licensed under the Apache License, Version 2.0 (the "License");
17  * you may not use this file except in compliance with the License.
18  * You may obtain a copy of the License at
19  *
20  * http://www.apache.org/licenses/LICENSE-2.0.txt
21  *
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an "AS IS" BASIS,
24  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25  * See the License for the specific language governing permissions and
26  * limitations under the License.
27  *
28  *=========================================================================*/
29 #ifndef itkBModeImageFilter_h
30 #define itkBModeImageFilter_h
31 
32 #include "itkAddImageFilter.h"
33 #include "itkComplexToModulusImageFilter.h"
34 #include "itkConstantPadImageFilter.h"
36 #include "itkImageToImageFilter.h"
37 #include "itkImage.h"
38 #include "itkLog10ImageFilter.h"
39 
41 
42 namespace itk
43 {
44 
59 template < typename TInputImage, typename TOutputImage=TInputImage, typename TComplexImage=Image< std::complex< typename TInputImage::PixelType >, TInputImage::ImageDimension > >
60 class BModeImageFilter :
61  public ImageToImageFilter< TInputImage, TOutputImage >
62 {
63 public:
66  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
69 
71  typedef TInputImage InputImageType;
72 
74  itkStaticConstMacro (ImageDimension, unsigned int,
75  TInputImage::ImageDimension);
76 
78  typedef typename InputImageType::PixelType InputPixelType;
79 
81  typedef TOutputImage OutputImageType;
82 
84  typedef typename OutputImageType::PixelType OutputPixelType;
85 
88  typedef TComplexImage ComplexImageType;
89 
91  typedef typename InputImageType::RegionType InputRegionType;
92  typedef typename InputImageType::SizeType InputSizeType;
93  typedef typename InputImageType::IndexType InputIndexType;
94 
96  itkTypeMacro( BModeImageFilter, ImageToImageFilter );
97 
99  itkNewMacro( Self );
100 
102  virtual void SetDirection( unsigned int direction )
103  {
104  this->m_AnalyticFilter->SetDirection( direction );
105  this->Modified();
106  }
107 
109  virtual unsigned int GetDirection() const
110  {
111  return m_AnalyticFilter->GetDirection();
112  }
113 
114 protected:
117 
118  virtual void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
119 
120  virtual void GenerateData() ITK_OVERRIDE;
121 
122  // These behave like their analogs in FFT1DRealToComplexConjugateImageFilter.
123  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
124  virtual void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
125 
128  typedef ComplexToModulusImageFilter< typename AnalyticType::OutputImageType, OutputImageType > ComplexToModulusType;
129  typedef ConstantPadImageFilter< InputImageType, InputImageType > PadType;
130  typedef AddImageFilter< InputImageType, InputImageType > AddConstantType;
131  typedef Log10ImageFilter< InputImageType, OutputImageType > LogType;
133 
134 private:
135  BModeImageFilter( const Self& ); // purposely not implemented
136  void operator=( const Self& ); // purposely not implemented
137 
138  typename AnalyticType::Pointer m_AnalyticFilter;
139  typename ComplexToModulusType::Pointer m_ComplexToModulusFilter;
140  typename PadType::Pointer m_PadFilter;
141  typename AddConstantType::Pointer m_AddConstantFilter;
142  typename LogType::Pointer m_LogFilter;
143  typename ROIType::Pointer m_ROIFilter;
144 };
145 
146 } // end namespace itk
147 
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "itkBModeImageFilter.hxx"
150 #endif
151 
152 #endif // itkBModeImageFilter_h
RegionFromReferenceImageFilter< OutputImageType, OutputImageType > ROIType
void GenerateData() ITK_OVERRIDE
ImageToImageFilter< TInputImage, TOutputImage > Superclass
AnalyticSignalImageFilter< InputImageType, ComplexImageType > AnalyticType
void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
ComplexToModulusImageFilter< typename AnalyticType::OutputImageType, OutputImageType > ComplexToModulusType
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
void GenerateInputRequestedRegion() ITK_OVERRIDE
ConstantPadImageFilter< InputImageType, InputImageType > PadType
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
Decrease the image size by cropping the image by an itk::Size at both the upper and lower bounds of t...
Log10ImageFilter< InputImageType, OutputImageType > LogType
AddImageFilter< InputImageType, InputImageType > AddConstantType
Create an ultrasound B-Mode (Brightness-Mode) image from raw "RF" data. The RF&#39;s envelope is calculat...