SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkImageLinearPhase.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2009-2014 The Regents of the University of California.
3  * All Rights Reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * • Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * • Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12  * • None of the names of any campus of the University of California, the name
13  * "The Regents of the University of California," or the names of any of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
26  * OF SUCH DAMAGE.
27  */
28 /*
29  * $URL$
30  * $Rev$
31  * $Author$
32  * $Date$
33  *
34  * Authors:
35  * Jason C. Crane, Ph.D.
36  * Beck Olson
37  */
38 /*=========================================================================
39 
40  Program: Visualization Toolkit
41  Module: $RCSfile: vtkImageRFFT.h,v $
42 
43  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
44  All rights reserved.
45  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
46 
47  This software is distributed WITHOUT ANY WARRANTY; without even
48  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
49  PURPOSE. See the above copyright notice for more information.
50 
51 =========================================================================*/
52 // .NAME vtkImageRFFT - Reverse Fast Fourier Transform.
53 // .SECTION Description
54 // vtkImageRFFT implements the reverse fast Fourier transform. The input
55 // can have real or complex data in any components and data types, but
56 // the output is always complex doubles with real values in component0, and
57 // imaginary values in component1. The filter is fastest for images that
58 // have power of two sizes. The filter uses a butterfly fitlers for each
59 // prime factor of the dimension. This makes images with prime number dimensions
60 // (i.e. 17x17) much slower to compute. Multi dimensional (i.e volumes)
61 // FFT's are decomposed so that each axis executes in series.
62 // In most cases the RFFT will produce an image whose imaginary values are all
63 // zero's. In this case vtkImageExtractComponents can be used to remove
64 // this imaginary components leaving only the real image.
65 
66 // .SECTION See Also
67 // vtkImageExtractComponenents
68 
69 
70 
71 #ifndef SVK_IMAGE_LINEAR_PHASE_H
72 #define SVK_IMAGE_LINEAR_PHASE_H
73 
74 #include <vtkImageData.h>
75 #include <vtkMath.h>
76 #include <vtkImageRFFT.h>
77 #include <vtkInformation.h>
78 #include <vtkObjectFactory.h>
79 #include <vtkStreamingDemandDrivenPipeline.h>
80 #include <svkSpecUtils.h>
81 
82 #include <math.h>
83 
84 
85 #include "vtkImageFourierFilter.h"
86 
87 namespace svk {
88 
89 using namespace std;
90 
103 class svkImageLinearPhase : public vtkImageFourierFilter
104 {
105  public:
106  static svkImageLinearPhase *New();
107  vtkTypeMacro(svkImageLinearPhase,vtkImageFourierFilter);
108  void SetShiftWindow( double shiftWindow[3] );
109  void ExecuteLinearPhase( vtkImageComplex* in, vtkImageComplex* out, int N, vtkImageComplex* phaseArray );
110  void CreatePhaseArray( int N, vtkImageComplex* phaseArray );
111 
112  // This extent of the components changes to real and imaginary values.
113  int IterativeRequestInformation(vtkInformation* vtkNotUsed(input), vtkInformation* output);
114 
115  protected:
118 
119  private:
120 
121  void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
122  int outExt[6], int threadId);
123  double shiftWindow[3];
124  vtkImageComplex* phaseArray;
125  double pie;
126 };
127 
128 } // svk
129 
130 #endif //SVK_IMAGE_LINEAR_PHASE_H
Definition: svkImageLinearPhase.h:103