SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkGESigna5XReader.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  * Don C. Bigler, Ph.D.
39  */
40 
41 
42 #ifndef SVK_GE_SIGNA_5X_READER_H
43 #define SVK_GE_SIGNA_5X_READER_H
44 
45 
46 #include <vtkStringArray.h>
47 
48 #include <svkImageReader2.h>
49 #include <svkGEImageHeader.h>
50 #include <svkEnhancedMRIIOD.h>
51 #include <algorithm>
52 
53 namespace svk {
54 
55 
69 {
70 
71  public:
72 
73  static svkGESigna5XReader* New();
75 
76  // Methods:
77  virtual int CanReadFile(const char* fname);
78 
79  // Description:
80  // Valid extentsions
81  virtual const char* GetFileExtensions() {
82  return ".MR";
83  }
84 
85  // Description:
86  // A descriptive name for this format
87  virtual const char* GetDescriptiveName() {
88  return "GE Genesis Signa 5X File";
89  }
90 
92  {
94  }
95 
96 
97  protected:
98 
101 
102  virtual void ExecuteInformation();
103  virtual void ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo);
104  virtual int FillOutputPortInformation(int port, vtkInformation* info);
106 
109  virtual GESignaHeader* ReadHeader(const char *FileNameToRead);
111  double tlhc[3], double row[3], double column[3], double normal[3]);
113  vtkStringArray* fileNames, bool ascending);
114  bool CopyGenesisImage(FILE *infp, int width, int height, int compress,
115  short *map_left, short *map_wide, unsigned short *output);
116  bool LoadData(const char *filename, unsigned short *outPtr,
117  int *outExt, vtkIdType *);
118  void statTimeAndDateToAscii (void *clock, char *time, char *date);
119 
120 
121  // Methods for initializing the DICOM header.
122  void InitDcmHeader();
124  void InitPatientModule();
125  void InitGeneralStudyModule();
133  void InitPixelMeasuresMacro();
139  void InitMRFOVGeometryMacro();
140  void InitMREchoMacro();
141  void InitMRModifierMacro();
143  void InitMRReceiveCoilMacro();
145  void InitMRAveragesMacro();
148 
149 
150 
151 };
152 
153 
154 } //svk
155 
156 
157 #endif //SVK_GE_SIGNA_5X_READER_H
158 
virtual int CanReadFile(const char *fname)
Definition: svkGESigna5XReader.cc:101
virtual const char * GetDescriptiveName()
Definition: svkGESigna5XReader.h:87
bool LoadData(const char *filename, unsigned short *outPtr, int *outExt, vtkIdType *)
Definition: svkGESigna5XReader.cc:1161
void InitPixelValueTransformationMacro()
Definition: svkGESigna5XReader.cc:2137
Definition: svkImageReader2.h:60
void InitMRPulseSequenceModule()
Definition: svkGESigna5XReader.cc:3047
ReaderType
Definition: svkImageReader2.h:67
svkEnhancedMRIIOD * iod
Definition: svkGESigna5XReader.h:147
bool CalculateTopLeftHandCornerAndRowColumnAndNormalVectors(GESignaHeader *hdr, double tlhc[3], double row[3], double column[3], double normal[3])
Definition: svkGESigna5XReader.cc:1352
int numFrames
Definition: svkGESigna5XReader.h:107
virtual const char * GetFileExtensions()
Definition: svkGESigna5XReader.h:81
void InitGeneralStudyModule()
Definition: svkGESigna5XReader.cc:1798
void InitPerFrameFunctionalGroupMacros()
Definition: svkGESigna5XReader.cc:2922
DcmPixelDataFormat
Definition: svkDcmHeader.h:92
void InitMRTimingAndRelatedParametersMacro()
Definition: svkGESigna5XReader.cc:2420
void InitMRImageAndSpectroscopyInstanceMacro()
Definition: svkGESigna5XReader.cc:2976
void InitMRImagingModifierMacro()
Definition: svkGESigna5XReader.cc:2796
static svkGESigna5XReader * New()
void InitMRImageFrameTypeMacro()
Definition: svkGESigna5XReader.cc:2178
void InitMRModifierMacro()
Definition: svkGESigna5XReader.cc:2657
GESignaHeader * imageHeader
Definition: svkGESigna5XReader.h:146
void InitSharedFunctionalGroupMacros()
Definition: svkGESigna5XReader.cc:2037
void InitMRFOVGeometryMacro()
Definition: svkGESigna5XReader.cc:2520
Definition: svkImageReader2.h:81
void InitEnhancedMRImageModule()
Definition: svkGESigna5XReader.cc:1715
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
Definition: svkGESigna5XReader.cc:1316
virtual svkDcmHeader::DcmPixelDataFormat GetFileType()
Definition: svkGESigna5XReader.cc:3264
svkGESigna5XReader()
Definition: svkGESigna5XReader.cc:73
void InitGeneralSeriesModule()
Definition: svkGESigna5XReader.cc:1873
void statTimeAndDateToAscii(void *clock, char *time, char *date)
Definition: svkGESigna5XReader.cc:983
Definition: svkEnhancedMRIIOD.h:61
void InitPixelMeasuresMacro()
Definition: svkGESigna5XReader.cc:2056
svkDcmHeader::DcmDataOrderingDirection dataSliceOrder
Definition: svkGESigna5XReader.h:108
Definition: svkGEImageHeader.h:91
virtual void ExecuteInformation()
Definition: svkGESigna5XReader.cc:1015
void InitPatientModule()
Definition: svkGESigna5XReader.cc:1737
void InitMRReceiveCoilMacro()
Definition: svkGESigna5XReader.cc:2818
vtkTypeMacro(svkGESigna5XReader, svkImageReader2)
void InitPlaneOrientationMacro()
Definition: svkGESigna5XReader.cc:2100
DcmDataOrderingDirection
Definition: svkDcmHeader.h:108
void InitMREchoMacro()
Definition: svkGESigna5XReader.cc:2643
virtual GESignaHeader * ReadHeader(const char *FileNameToRead)
Definition: svkGESigna5XReader.cc:128
void InitEnhancedGeneralEquipmentModule()
Definition: svkGESigna5XReader.cc:1973
void InitDcmHeader()
Definition: svkGESigna5XReader.cc:1602
bool SortFilesByImagePositionPatient(GESignaHeader *selectedFile, vtkStringArray *fileNames, bool ascending)
Definition: svkGESigna5XReader.cc:1544
Definition: svkGESigna5XReader.h:68
bool CopyGenesisImage(FILE *infp, int width, int height, int compress, short *map_left, short *map_wide, unsigned short *output)
Definition: svkGESigna5XReader.cc:1078
~svkGESigna5XReader()
Definition: svkGESigna5XReader.cc:91
void InitMRTransmitCoilMacro()
Definition: svkGESigna5XReader.cc:2875
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Definition: svkGESigna5XReader.cc:3273
void InitGeneralEquipmentModule()
Definition: svkGESigna5XReader.cc:1946
virtual svkImageReader2::ReaderType GetReaderType()
Definition: svkGESigna5XReader.h:91
void InitMultiFrameFunctionalGroupsModule()
Definition: svkGESigna5XReader.cc:1999
void InitMRAveragesMacro()
Definition: svkGESigna5XReader.cc:2893