ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkDICOMImageIO2.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkDICOMImageIO2_h
19 #define __itkDICOMImageIO2_h
20 
21 #include <fstream>
22 #include "itkImageIOBase.h"
23 
24 #include "DICOMParser.h"
25 #include "DICOMAppHelper.h"
26 
27 namespace itk
28 {
34 class ITK_EXPORT DICOMImageIO2:public ImageIOBase
35 {
36 public:
37 
42 
44  itkNewMacro(Self);
45 
47  itkTypeMacro(DICOMImageIO2, Superclass);
48 
49  /*-------- This part of the interfaces deals with reading data. ----- */
50 
53  virtual bool CanReadFile(const char *);
54 
56  virtual void ReadImageInformation();
57 
59  // virtual const std::type_info& GetPixelType() const;
60 
62  virtual void Read(void *buffer);
63 
67  // virtual unsigned int GetComponentSize() const;
68 
69  /*-------- This part of the interfaces deals with writing data. ----- */
70 
73  virtual bool CanWriteFile(const char *) { return false; }
74 
76  virtual void WriteImageInformation() {}
77 
80  virtual void Write(const void *) {}
81 
83  void GetPatientName(char *name);
84 
85  void GetPatientID(char *id);
86 
87  void GetPatientSex(char *sex);
88 
89  void GetPatientAge(char *age);
90 
91  void GetStudyID(char *id);
92 
93  void GetPatientDOB(char *dob);
94 
95  void GetStudyDescription(char *desc);
96 
97  void GetBodyPart(char *part);
98 
99  void GetNumberOfSeriesInStudy(char *series);
100 
101  void GetNumberOfStudyRelatedSeries(char *series);
102 
103  void GetStudyDate(char *date);
104 
105  void GetModality(char *modality);
106 
107  void GetManufacturer(char *manu);
108 
109  void GetInstitution(char *ins);
110 
111  void GetModel(char *model);
112 
113 protected:
114  DICOMImageIO2();
115  virtual ~DICOMImageIO2();
116  void PrintSelf(std::ostream & os, Indent indent) const;
117 
118  itkdicomparser::DICOMParser *m_Parser;
119  itkdicomparser::DICOMAppHelper *m_AppHelper;
120 
121  void ReadDataCallback(doublebyte group,
122  doublebyte element,
123  itkdicomparser::DICOMParser::VRTypes type,
124  unsigned char *val,
125  quadbyte len);
126 
127  unsigned char *m_ImageDataBuffer;
128 private:
129  DICOMImageIO2(const Self &); //purposely not implemented
130  void operator=(const Self &); //purposely not implemented
131 };
132 } // end namespace itk
133 
134 #endif // __itkDICOMImageIO2_h
135