SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkDcmVolumeReader.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_DCM_VOLUME_READER_H
44 #define SVK_DCM_VOLUME_READER_H
45 
46 
47 #include <svkImageReader2.h>
48 #include <vector>
49 #include <algorithm>
50 
51 
52 namespace svk {
53 
54 
60 {
61 
62  public:
63 
65 
66  static float GetFloatValAttribute7( vector< string > vec );
67  static int GetIntValAttribute8( vector< string > vec );
68  static void GetVOILUTScaledPixels( float* floatPixels, unsigned short* shortPixels, float center, float window, int numberOfPixels );
69 
70 
71 
72  protected:
73 
76 
77  typedef enum {
82 
83 
84  virtual void ExecuteInformation();
85  virtual void ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo);
87  void InitFileNames();
88  void OnlyReadInputFile();
90  vector< vector< string> >& dcmSeriesAttributes,
91  bool ascending
92  );
94  vector< vector< string> >& dcmSeriesAttributes,
95  int numSlicesPerVol,
96  bool ascending
97  );
98 
99  int numFrames;
101  virtual void InitDcmHeader();
102  void InitSliceOrder();
103  void InitSliceOrder(string hfileStart, string fileEnd);
104  virtual bool CheckForMultiVolume();
106  float GetSliceSpacing();
107  virtual void CleanAttributes( set < string >* uniqueSlices){ return; };
108 
109 
110  private:
111 
112  virtual void LoadData(svkImageData* data) = 0;
113  virtual void InitPrivateHeader() = 0;
114  vtkStringArray* tmpFileNames;
115  float sliceSpacing;
116  void SetSliceSpacing(
117  svkDcmHeader* hdr,
118  int numSlices,
119  vector< vector< string> >& dcmSeriesAttributes
120  );
121 
122 
123 
124 
125 };
126 
127 
128 } //svk
129 
130 
131 #endif //SVK_DCM_VOLUME_READER_H
132 
void InitSliceOrder()
Definition: svkDcmVolumeReader.cc:188
virtual void CleanAttributes(set< string > *uniqueSlices)
Definition: svkDcmVolumeReader.h:107
virtual void ExecuteInformation()
Definition: svkDcmVolumeReader.cc:131
Definition: svkDcmHeader.h:66
void SortFilesByImagePositionPatient(vector< vector< string > > &dcmSeriesAttributes, bool ascending)
Definition: svkDcmVolumeReader.cc:775
float GetSliceSpacing()
Definition: svkDcmVolumeReader.cc:635
Definition: svkImageReader2.h:60
virtual void InitDcmHeader()
Definition: svkDcmVolumeReader.cc:840
Definition: svkDcmVolumeReader.h:59
void SortFilesByInstanceNumber(vector< vector< string > > &dcmSeriesAttributes, int numSlicesPerVol, bool ascending)
Definition: svkDcmVolumeReader.cc:795
vtkTypeMacro(svkDcmVolumeReader, svkImageReader2)
ProprietarySOP ContainsProprietaryContent(svkImageData *data)
Definition: svkDcmVolumeReader.cc:90
static void GetVOILUTScaledPixels(float *floatPixels, unsigned short *shortPixels, float center, float window, int numberOfPixels)
Definition: svkDcmVolumeReader.cc:646
ProprietarySOP
Definition: svkDcmVolumeReader.h:77
Definition: svkDcmVolumeReader.h:78
int numVolumes
Definition: svkDcmVolumeReader.h:105
svkDcmHeader::DcmDataOrderingDirection dataSliceOrder
Definition: svkDcmVolumeReader.h:100
static float GetFloatValAttribute7(vector< string > vec)
Definition: svkDcmVolumeReader.cc:709
void InitFileNames()
Definition: svkDcmVolumeReader.cc:321
virtual bool CheckForMultiVolume()
Definition: svkDcmVolumeReader.cc:684
static int GetIntValAttribute8(vector< string > vec)
Definition: svkDcmVolumeReader.cc:729
void OnlyReadInputFile()
Definition: svkDcmVolumeReader.cc:692
int numFrames
Definition: svkDcmVolumeReader.h:99
Definition: svkImageData.h:107
svkDcmVolumeReader()
Definition: svkDcmVolumeReader.cc:66
DcmDataOrderingDirection
Definition: svkDcmHeader.h:108
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
Definition: svkDcmVolumeReader.cc:280
Definition: svkDcmVolumeReader.h:79
Definition: svkDcmVolumeReader.h:80
~svkDcmVolumeReader()
Definition: svkDcmVolumeReader.cc:81