SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkGEPFileMapper.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 #ifndef SVK_GE_PFILE_MAPPER_H
43 #define SVK_GE_PFILE_MAPPER_H
44 
45 
46 #include <vtkImageData.h>
47 #include <vtkCallbackCommand.h>
48 
49 #include <svkDcmHeader.h>
50 #include <svkImageReader2.h>
51 #include <svkMRSIOD.h>
52 
53 #include <map>
54 #include <vector>
55 #include <string>
56 #include <vtkStringArray.h>
57 
58 
59 namespace svk {
60 
61 
65 class svkGEPFileMapper : public vtkObject
66 {
67 
68  public:
69 
70  vtkTypeMacro( svkGEPFileMapper, vtkObject );
71  static svkGEPFileMapper* New();
72 
77  UNDEFINED = 0,
78  // load the entire data set as is, no averaging or data extraction.
80  // if suppressed and unsuppressed data, load only the unsuppressed acquisitions
82  // if suppressed and unsuppressed data, load only the suppressed acquisitions
84  // if suppressed and unsuppressed data, load only the average of the unsuppressed acquisitions
86  // if suppressed and unsuppressed data, load only the average of the suppressed acquisitions
88  // if EPSI data not handled intrinsically by the reader needs to be handled through command
89  // line args:
91  };
92 
93  virtual void InitializeDcmHeader(
94  map <string, vector< string > > pfMap,
95  svkDcmHeader* header,
96  float pfileVersion,
97  int swapBytes,
98  map < string, void* > inputArgs
99  );
100  virtual void ReadData( vtkStringArray* pFileNames, svkImageData* data );
101  string GetProgressText( );
102  void SetProgressText( string progressText );
103  static string ConvertGEDateToDICOM( string geDate );
104 
105  void SetPfileName( string pfileName );
106 
107  protected:
108 
111 
112 
113  void InitPatientModule();
114  void InitGeneralStudyModule();
120  virtual void InitAcquisitionContextModule();
122  virtual void InitSharedFunctionalGroupMacros();
123  virtual void InitPerFrameFunctionalGroupMacros();
124  virtual void InitPixelMeasuresMacro();
125  virtual void InitPlaneOrientationMacro();
126  virtual void InitMRSpectroscopyFrameTypeMacro();
128  virtual void InitMRSpectroscopyFOVGeometryMacro();
129  virtual void InitMREchoMacro();
130  virtual void InitMRModifierMacro();
131  virtual void InitMRReceiveCoilMacro();
132  virtual void InitMRTransmitCoilMacro();
133  virtual void InitMRAveragesMacro();
134  virtual void InitMRSpatialSaturationMacro();
135  virtual void InitSatBand( float satRAS[3], float translation);
136  virtual void InitMRSpectroscopyModule();
137  virtual string GetVolumeLocalizationTechnique();
138  virtual void InitVolumeLocalizationSeq();
139  virtual void InitMRSpectroscopyDataModule();
140  virtual void InitK0Sampled( svkDcmHeader* hdr );
141  virtual void InitSatBandsFromXML();
142 
143  virtual void GetCenterFromRawFile( double* center );
144  virtual float GetFrequencyOffset();
145  int GetNumVoxelsInVol();
146  virtual void GetNumVoxels( int numVoxels[3] );
147  virtual int GetNumKSpacePoints();
148  virtual void GetVoxelSpacing( double voxelSpacing[3] );
149  void GetFOV( float fov[3] );
150  int GetNumCoils();
151  int GetNumFrames();
152  virtual int GetNumTimePoints();
153  virtual int GetNumDummyScans();
154  virtual int GetNumEPSIAcquisitions();
155  bool AddDummy( int offset, int coilNum, int timePt );
156  void GetDcos( double dcos[3][3] );
157  virtual float GetPPMRef();
158  bool IsSwapOn();
159  bool Is2D();
160  virtual bool IsChopOn();
161  virtual void GetXYZIndices(int dataIndex, int* x, int* y, int* z);
162  void UpdateProgress(double amount);
163  virtual void ModifyBehavior( svkImageData* data );
165  virtual int GetNumberUnsuppressedAcquisitions();
166  virtual int GetNumberSuppressedAcquisitions();
167  virtual void GetSelBoxCenter( double selBoxCenter[3] );
168  virtual void GetSelBoxSize( double selBoxSize[3] );
169 
170 
171  void SetCellSpectrum(
172  vtkImageData* data,
173  bool wasSampled,
174  int offset,
175  int index,
176  int x, int y, int z,
177  int timePoint = 0,
178  int channel = 0
179  );
180 
181  virtual void InitSpecTuple( int numFreqPts, int freqPt, float* tuple, vtkDataArray* dataArray );
182 
183 
184  int GetHeaderValueAsInt(string key);
185  long long int GetHeaderValueAsLongInt(string key);
186  float GetHeaderValueAsFloat(string key);
187  string GetHeaderValueAsString(string key);
188  virtual bool WasIndexSampled(int xIndex, int yIndex, int zIndex);
189 
190 
191  string progressText;
192  map <string, vector< string > > pfMap;
193 
196  int* specData;
198  int chopVal;
199  map < string, void* > inputArgs;
202  double progress;
203 
204  bool isInputArgSet(string argName);
205  bool GetInputArgStringValue(string argName, string* argValue);
206  bool GetInputArgBoolValue(string argName, bool* argValue);
207 
208  virtual void ReorderEPSI( svkMrsImageData* data );
209  string GetNucleus();
210  void ModifyForPatientEntry( double dcos[3][3] );
211 
212  string pfileName;
213 
214 };
215 
216 
217 } //svk
218 
219 #endif //SVK_GE_PFILE_MAPPER_H
220 
virtual void GetNumVoxels(int numVoxels[3])
Definition: svkGEPFileMapper.cc:673
virtual void InitPerFrameFunctionalGroupMacros()
Definition: svkGEPFileMapper.cc:442
Definition: svkGEPFileMapper.h:90
virtual float GetPPMRef()
Definition: svkGEPFileMapper.cc:1845
virtual int GetNumTimePoints()
Definition: svkGEPFileMapper.cc:2140
virtual void GetVoxelSpacing(double voxelSpacing[3])
Definition: svkGEPFileMapper.cc:568
svkDcmHeader * dcmHeader
Definition: svkGEPFileMapper.h:194
Definition: svkDcmHeader.h:66
svkGEPFileMapper()
Definition: svkGEPFileMapper.cc:63
Definition: svkMrsImageData.h:66
virtual void InitMREchoMacro()
Definition: svkGEPFileMapper.cc:1305
void RedimensionModifiedSVData(svkImageData *data)
Definition: svkGEPFileMapper.cc:2863
void InitEnhancedGeneralEquipmentModule()
Definition: svkGEPFileMapper.cc:377
int swapBytes
Definition: svkGEPFileMapper.h:200
virtual bool WasIndexSampled(int xIndex, int yIndex, int zIndex)
Definition: svkGEPFileMapper.cc:2326
virtual void InitPlaneOrientationMacro()
Definition: svkGEPFileMapper.cc:869
void SetPfileName(string pfileName)
Definition: svkGEPFileMapper.cc:3043
Definition: svkGEPFileMapper.h:83
virtual int GetNumDummyScans()
Definition: svkGEPFileMapper.cc:2233
virtual void InitK0Sampled(svkDcmHeader *hdr)
Definition: svkGEPFileMapper.cc:1988
virtual void InitializeDcmHeader(map< string, vector< string > > pfMap, svkDcmHeader *header, float pfileVersion, int swapBytes, map< string, void * > inputArgs)
Definition: svkGEPFileMapper.cc:92
float pfileVersion
Definition: svkGEPFileMapper.h:195
void UpdateProgress(double amount)
Definition: svkGEPFileMapper.cc:3037
float GetHeaderValueAsFloat(string key)
Definition: svkGEPFileMapper.cc:2081
virtual void InitMRSpectroscopyModule()
Definition: svkGEPFileMapper.cc:1638
string GetProgressText()
Definition: svkGEPFileMapper.cc:3031
virtual void InitMRTransmitCoilMacro()
Definition: svkGEPFileMapper.cc:1426
map< string, vector< string > > pfMap
Definition: svkGEPFileMapper.h:192
virtual void InitMRSpatialSaturationMacro()
Definition: svkGEPFileMapper.cc:1472
virtual void InitMRAveragesMacro()
Definition: svkGEPFileMapper.cc:1441
virtual int GetNumberSuppressedAcquisitions()
Definition: svkGEPFileMapper.cc:2945
virtual void InitSatBandsFromXML()
Definition: svkGEPFileMapper.cc:1528
void SetCellSpectrum(vtkImageData *data, bool wasSampled, int offset, int index, int x, int y, int z, int timePoint=0, int channel=0)
Definition: svkGEPFileMapper.cc:2507
virtual float GetFrequencyOffset()
Definition: svkGEPFileMapper.cc:1830
svkMRSIOD * iod
Definition: svkGEPFileMapper.h:201
virtual void InitSharedFunctionalGroupMacros()
Definition: svkGEPFileMapper.cc:423
virtual void InitSpecTuple(int numFreqPts, int freqPt, float *tuple, vtkDataArray *dataArray)
Definition: svkGEPFileMapper.cc:2562
void GetDcos(double dcos[3][3])
Definition: svkGEPFileMapper.cc:697
Definition: svkGEPFileMapper.h:85
bool AddDummy(int offset, int coilNum, int timePt)
Definition: svkGEPFileMapper.cc:2188
virtual void InitMRSpectroscopyFOVGeometryMacro()
Definition: svkGEPFileMapper.cc:998
svkDcmHeader::DcmDataOrderingDirection dataSliceOrder
Definition: svkGEPFileMapper.h:197
virtual void InitSatBand(float satRAS[3], float translation)
Definition: svkGEPFileMapper.cc:1541
virtual void ReadData(vtkStringArray *pFileNames, svkImageData *data)
Definition: svkGEPFileMapper.cc:2338
virtual void InitMRReceiveCoilMacro()
Definition: svkGEPFileMapper.cc:1328
void InitGeneralSeriesModule()
Definition: svkGEPFileMapper.cc:304
void ModifyForPatientEntry(double dcos[3][3])
Definition: svkGEPFileMapper.cc:750
void InitFrameOfReferenceModule()
Definition: svkGEPFileMapper.cc:338
int GetNumFrames()
Definition: svkGEPFileMapper.cc:2270
virtual void ReorderEPSI(svkMrsImageData *data)
Definition: svkGEPFileMapper.cc:2709
virtual void InitMRSpectroscopyPulseSequenceModule()
Definition: svkGEPFileMapper.cc:1886
Definition: svkGEPFileMapper.h:79
static svkGEPFileMapper * New()
virtual string GetVolumeLocalizationTechnique()
Definition: svkGEPFileMapper.cc:1810
virtual void InitVolumeLocalizationSeq()
Definition: svkGEPFileMapper.cc:125
string GetNucleus()
Definition: svkGEPFileMapper.cc:1786
virtual void InitMRTimingAndRelatedParametersMacro()
Definition: svkGEPFileMapper.cc:985
void SetProgressText(string progressText)
Definition: svkGEPFileMapper.cc:3022
virtual void InitPixelMeasuresMacro()
Definition: svkGEPFileMapper.cc:489
static string ConvertGEDateToDICOM(string geDate)
Definition: svkGEPFileMapper.cc:542
virtual void ModifyBehavior(svkImageData *data)
Definition: svkGEPFileMapper.cc:2572
bool GetInputArgStringValue(string argName, string *argValue)
Definition: svkGEPFileMapper.cc:2976
bool Is2D()
Definition: svkGEPFileMapper.cc:819
Definition: svkGEPFileMapper.h:87
Definition: svkGEPFileMapper.h:77
virtual bool IsChopOn()
Definition: svkGEPFileMapper.cc:848
virtual void InitMRModifierMacro()
Definition: svkGEPFileMapper.cc:1316
bool GetInputArgBoolValue(string argName, bool *argValue)
Definition: svkGEPFileMapper.cc:2999
string GetHeaderValueAsString(string key)
Definition: svkGEPFileMapper.cc:2097
virtual void InitMultiFrameFunctionalGroupsModule()
Definition: svkGEPFileMapper.cc:400
int GetNumCoils()
Definition: svkGEPFileMapper.cc:2106
bool IsSwapOn()
Definition: svkGEPFileMapper.cc:804
int GetHeaderValueAsInt(string key)
Definition: svkGEPFileMapper.cc:2048
int GetNumVoxelsInVol()
Definition: svkGEPFileMapper.cc:2288
Definition: svkGEPFileMapper.h:81
bool isInputArgSet(string argName)
Definition: svkGEPFileMapper.cc:2957
void GetFOV(float fov[3])
Definition: svkGEPFileMapper.cc:599
int * specData
Definition: svkGEPFileMapper.h:196
vtkTypeMacro(svkGEPFileMapper, vtkObject)
string pfileName
Definition: svkGEPFileMapper.h:212
~svkGEPFileMapper()
Definition: svkGEPFileMapper.cc:81
map< string, void * > inputArgs
Definition: svkGEPFileMapper.h:199
virtual void InitMRSpectroscopyFrameTypeMacro()
Definition: svkGEPFileMapper.cc:926
virtual void InitMRSpectroscopyDataModule()
Definition: svkGEPFileMapper.cc:1933
virtual int GetNumKSpacePoints()
Definition: svkGEPFileMapper.cc:2306
virtual void GetSelBoxCenter(double selBoxCenter[3])
Definition: svkGEPFileMapper.cc:194
MapperBehavior
Definition: svkGEPFileMapper.h:76
virtual int GetNumberUnsuppressedAcquisitions()
Definition: svkGEPFileMapper.cc:2933
Definition: svkImageData.h:107
DcmDataOrderingDirection
Definition: svkDcmHeader.h:108
Definition: svkGEPFileMapper.h:65
Definition: svkMRSIOD.h:61
virtual int GetNumEPSIAcquisitions()
Definition: svkGEPFileMapper.cc:2159
void InitGeneralEquipmentModule()
Definition: svkGEPFileMapper.cc:355
string progressText
Definition: svkGEPFileMapper.h:191
virtual void GetSelBoxSize(double selBoxSize[3])
Definition: svkGEPFileMapper.cc:211
void InitPatientModule()
Definition: svkGEPFileMapper.cc:260
virtual void GetCenterFromRawFile(double *center)
Definition: svkGEPFileMapper.cc:2031
virtual void GetXYZIndices(int dataIndex, int *x, int *y, int *z)
Definition: svkGEPFileMapper.cc:2481
void InitGeneralStudyModule()
Definition: svkGEPFileMapper.cc:284
int chopVal
Definition: svkGEPFileMapper.h:198
long long int GetHeaderValueAsLongInt(string key)
Definition: svkGEPFileMapper.cc:2065
double progress
Definition: svkGEPFileMapper.h:202
virtual void InitAcquisitionContextModule()
Definition: svkGEPFileMapper.cc:1630