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