SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkSdbmVolumeReader.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_SDBM_VOLUME_READER_H
43 #define SVK_SDBM_VOLUME_READER_H
44 
45 
46 #include <vtkImageData.h>
47 #include <vtkInformation.h>
48 #include <vtkStringArray.h>
49 
50 #include <svkImageReader2.h>
51 #include <svkMRSIOD.h>
52 
53 #include <map>
54 #include <string>
55 
56 
57 namespace svk {
58 
59 
64 {
65 
66  public:
67 
68  static svkSdbmVolumeReader* New();
70 
71  // Description:
72  // A descriptive name for this format
73  virtual const char* GetDescriptiveName() {
74  return "GE sdbm File";
75  }
76 
78  {
80  }
81 
82  // Methods:
83  virtual int CanReadFile( const char* fname );
84 
85 
86  protected:
87 
90 
91  virtual int FillOutputPortInformation(int port, vtkInformation* info);
92  virtual void ExecuteInformation();
93  virtual void ExecuteDataWithInformation( vtkDataObject *output, vtkInformation* outInfo );
95 
96 
97  private:
98 
99  // Methods:
100  virtual void InitDcmHeader();
101  void InitPatientModule();
102  void InitGeneralStudyModule();
103  void InitGeneralSeriesModule();
104  void InitGeneralEquipmentModule();
105  void InitMultiFrameFunctionalGroupsModule();
106  void InitMultiFrameDimensionModule();
107  void InitAcquisitionContextModule();
108  void InitMRSpectroscopyPulseSequenceModule();
109  void InitSharedFunctionalGroupMacros();
110  void InitPerFrameFunctionalGroupMacros();
111  void InitPixelMeasuresMacro();
112  void InitFrameContentMacro();
113  void InitPlaneOrientationMacro();
114  void InitMRSpectroscopyFrameTypeMacro();
115  void InitMRTimingAndRelatedParametersMacro();
116  void InitMRSpectroscopyFOVGeometryMacro();
117  void InitMREchoMacro();
118  void InitMRModifierMacro();
119  void InitMRReceiveCoilMacro();
120  void InitMRTransmitCoilMacro();
121  void InitMRAveragesMacro();
122  void InitMRSpatialSaturationMacro();
123  void InitMRSpatialVelocityEncodingMacro();
124  void InitMRSpectroscopyModule();
125  void InitVolumeLocalizationSeq();
126  void InitMRSpectroscopyDataModule();
127  void ReadComplexFile( vtkImageData* data );
128  int GetNumVoxelsInVol();
129  int GetNumSlices();
130  void SetCellSpectrum( vtkImageData* data, int x, int y, int z, int channel = 0, int timepoint = 0 );
131  void ParseShf();
132  void ParseShfDim( string dimenNum );
133  string ReadLineSubstr(istringstream* iss, int start, int stop);
134  int ReadLineKeyValue(istringstream* iss, char delim, string* key, string* value);
135  string ReadLineIgnore(istringstream* iss, char delim);
136  void PrintKeyValuePairs();
137  int GetHeaderValueAsInt(map <string, string> hdrMap,
138  string keyString, int valueIndex = 0);
139  float GetHeaderValueAsFloat(map <string, string> hdrMap,
140  string keyString, int valueIndex = 0);
141  int GetNumPixelsInVol();
142  bool IsMultiCoil();
143 
144 
145 
146  // Members:
147  float* specData;
148  int numFrames;
149  int numSlices;
150  int numCoils;
151  static const string MFG_STRING;
152  double dcos[3][3];
154  ifstream* shfHdr;
155  map <string, string> shfMap;
156  vtkStringArray* tmpFileNames;
157  svkMRSIOD* iod;
158 
159 
160 };
161 
162 
163 } //svk
164 
165 #endif //SVK_SDBM_VOLUME_READER_H
166 
Definition: svkImageReader2.h:60
Definition: svkImageReader2.h:78
virtual int CanReadFile(const char *fname)
Definition: svkSdbmVolumeReader.cc:115
ReaderType
Definition: svkImageReader2.h:67
Definition: svkSdbmVolumeReader.h:63
virtual svkImageReader2::ReaderType GetReaderType()
Definition: svkSdbmVolumeReader.h:77
virtual void ExecuteInformation()
Definition: svkSdbmVolumeReader.cc:171
DcmPixelDataFormat
Definition: svkDcmHeader.h:92
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Definition: svkSdbmVolumeReader.cc:1676
~svkSdbmVolumeReader()
Definition: svkSdbmVolumeReader.cc:92
virtual const char * GetDescriptiveName()
Definition: svkSdbmVolumeReader.h:73
virtual svkDcmHeader::DcmPixelDataFormat GetFileType()
Definition: svkSdbmVolumeReader.cc:1665
DcmDataOrderingDirection
Definition: svkDcmHeader.h:108
Definition: svkMRSIOD.h:61
static svkSdbmVolumeReader * New()
svkSdbmVolumeReader()
Definition: svkSdbmVolumeReader.cc:68
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
Definition: svkSdbmVolumeReader.cc:210
vtkTypeMacro(svkSdbmVolumeReader, svkImageReader2)