SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkMetaboliteMap.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 
30 
31 /*
32  * $URL$
33  * $Rev$
34  * $Author$
35  * $Date$
36  *
37  * Authors:
38  * Jason C. Crane, Ph.D.
39  * Beck Olson
40  */
41 
42 
43 #ifndef SVK_METABOLITE_MAP_H
44 #define SVK_METABOLITE_MAP_H
45 
46 
47 #include <vtkObject.h>
48 #include <vtkObjectFactory.h>
49 #include <vtkInformation.h>
50 
51 #include <svkImageData.h>
52 #include <svkMriImageData.h>
53 #include <svkMrsImageData.h>
54 #include <svkImageAlgorithm.h>
55 #include <svkDcmHeader.h>
56 #include <svkEnhancedMRIIOD.h>
57 
58 
59 namespace svk {
60 
61 
62 using namespace std;
63 
64 
71 {
72 
73  public:
74 
75  static svkMetaboliteMap* New();
76  vtkTypeMacro( svkMetaboliteMap, svkImageAlgorithm);
77 
78  typedef enum {
79  INTEGRATE = 0,
80  PEAK_HT = 1,
81  MAG_PEAK_HT = 2,
82  LINE_WIDTH = 3,
83  MAG_LINE_WIDTH = 4,
84  MAG_INTEGRATE = 5
85  }algorithm;
86 
87 
88  void SetSeriesDescription(vtkstd::string newSeriesDescription);
89  void SetOutputDataType(svkDcmHeader::DcmPixelDataFormat dataType);
90  void SetZeroCopy(bool zeroCopy);
91  void SetPeakPosPPM( float peak_center_ppm );
92  void SetPeakWidthPPM( float peak_width_ppm );
93  void SetAlgorithmToIntegrate();
94  void SetAlgorithmToPeakHeight();
95  void SetAlgorithmToMagPeakHeight();
96  void SetAlgorithmToLineWidth();
97  void SetAlgorithmToMagLineWidth();
98  void SetAlgorithmToMagIntegrate();
99  void SetAlgorithm( vtkstd::string algo );
100  void SetVerbose( bool isVerbose );
101  void LimitToSelectedVolume(float fraction = 0.5001);
102  short* GetSelectedVolumeMask();
103 
104 
105  static double GetIntegral( float* specPtr, int startPt, int endPt);
106  static double GetMagIntegral( float* specPtr, int startPt, int endPt);
107  static double GetPeakHt( float* specPtr, int startPt, int endPt );
108  static double GetMagPeakHt( float* specPtr, int startPt, int endPt );
109 
110 
111  protected:
112 
114  ~svkMetaboliteMap();
115 
116  virtual int RequestInformation(
117  vtkInformation* request,
118  vtkInformationVector** inputVector,
119  vtkInformationVector* outputVector
120  );
121  virtual int RequestData(
122  vtkInformation* request,
123  vtkInformationVector** inputVector,
124  vtkInformationVector* outputVector
125  );
126  void ZeroData();
127 
128  virtual int FillInputPortInformation( int vtkNotUsed(port), vtkInformation* info );
129  virtual int FillOutputPortInformation( int vtkNotUsed(port), vtkInformation* info );
130 
131 
132  private:
133 
134  // Methods:
135  virtual void UpdateProvenance();
136  void RedimensionData();
137  void GetIntegrationPtRange(int& startPt, int& endPt);
138  void GenerateMap();
139  float GetWidthInHz( int startPt, int endPt);
140  double GetMagLineWidth( float* specPtr, int startPt, int endPt );
141  double GetLineWidth( float* specPtr, int startPt, int endPt );
142  double GetMapVoxelValue( float* specPtr, int startPt, int endPt);
143 
144 
145  // Members:
146  vtkstd::string newSeriesDescription;
147  float peakCenterPPM;
148  float peakWidthPPM;
149  svkMetaboliteMap::algorithm quantificationAlgorithm;
150  bool isVerbose;
151  float useSelectedVolumeFraction;
152  short* quantificationMask;
153 
154 
155 };
156 
157 
158 } //svk
159 
160 
161 #endif //SVK_METABOLITE_MAP_H
162 
Definition: svkMetaboliteMap.h:70
DcmPixelDataFormat
Definition: svkDcmHeader.h:92
Definition: svkImageAlgorithm.h:70
algorithm
Definition: svkMetaboliteMap.h:78