Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
itkPhotoacousticBModeImageFilter.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 itkPhotoacousticBModeImageFilter_h
30 #define itkPhotoacousticBModeImageFilter_h
31 
32 #include "itkComplexToModulusImageFilter.h"
33 #include "itkConstantPadImageFilter.h"
34 #include "itkImageToImageFilter.h"
35 #include "itkImage.h"
36 
37 #include "ITKUltrasound/itkRegionFromReferenceImageFilter.h"
38 #include "ITKUltrasound/itkAnalyticSignalImageFilter.h"
39 
40 namespace itk
41 {
42 
54 template < typename TInputImage, typename TOutputImage=TInputImage, typename TComplexImage=Image< std::complex< typename TInputImage::PixelType >, TInputImage::ImageDimension > >
56  public ImageToImageFilter< TInputImage, TOutputImage >
57 {
58 public:
61  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
64 
66  typedef TInputImage InputImageType;
67 
69  itkStaticConstMacro (ImageDimension, unsigned int,
70  TInputImage::ImageDimension);
71 
73  typedef typename InputImageType::PixelType InputPixelType;
74 
76  typedef TOutputImage OutputImageType;
77 
79  typedef typename OutputImageType::PixelType OutputPixelType;
80 
83  typedef TComplexImage ComplexImageType;
84 
86  typedef typename InputImageType::RegionType InputRegionType;
87  typedef typename InputImageType::SizeType InputSizeType;
88  typedef typename InputImageType::IndexType InputIndexType;
89 
91  itkTypeMacro( PhotoacousticBModeImageFilter, ImageToImageFilter );
92 
94  itkNewMacro( Self );
95 
97  virtual void SetDirection( unsigned int direction )
98  {
99  this->m_AnalyticFilter->SetDirection( direction );
100  this->Modified();
101  }
102 
104  virtual unsigned int GetDirection() const
105  {
106  return m_AnalyticFilter->GetDirection();
107  }
108 
109 protected:
112 
113  void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
114 
115  void GenerateData() ITK_OVERRIDE;
116 
117  // These behave like their analogs in FFT1DRealToComplexConjugateImageFilter.
118  void GenerateInputRequestedRegion() ITK_OVERRIDE;
119  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
120 
123  typedef ComplexToModulusImageFilter< typename AnalyticType::OutputImageType, OutputImageType > ComplexToModulusType;
124  typedef ConstantPadImageFilter< InputImageType, InputImageType > PadType;
126 
127 private:
128  PhotoacousticBModeImageFilter( const Self& ); // purposely not implemented
129  void operator=( const Self& ); // purposely not implemented
130 
131  typename AnalyticType::Pointer m_AnalyticFilter;
132  typename ComplexToModulusType::Pointer m_ComplexToModulusFilter;
133  typename PadType::Pointer m_PadFilter;
134  typename ROIType::Pointer m_ROIFilter;
135 };
136 
137 } // end namespace itk
138 
139 #ifndef ITK_MANUAL_INSTANTIATION
140 #include "itkPhotoacousticBModeImageFilter.hxx"
141 #endif
142 
143 #endif // itkPhotoacousticBModeImageFilter_h
ComplexToModulusImageFilter< typename AnalyticType::OutputImageType, OutputImageType > ComplexToModulusType
void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
virtual void SetDirection(unsigned int direction)
void GenerateInputRequestedRegion() ITK_OVERRIDE
Decrease the image size by cropping the image by an itk::Size at both the upper and lower bounds of t...
AnalyticSignalImageFilter< InputImageType, ComplexImageType > AnalyticType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
RegionFromReferenceImageFilter< OutputImageType, OutputImageType > ROIType
ConstantPadImageFilter< InputImageType, InputImageType > PadType
Create an Photoacoustic B-Mode (Brightness-Mode) image from raw "RF" data. The RF&#39;s envelope is calcu...
void GenerateData() ITK_OVERRIDE