ITK  4.8.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 #if !defined( ITK_LEGACY_REMOVE )
21 
22 #include <fstream>
23 #include "itkImageIOBase.h"
24 
25 #include "DICOMParser.h"
26 #include "DICOMAppHelper.h"
27 
28 namespace itk
29 {
36 class DICOMImageIO2:public ImageIOBase
37 {
38 public:
39 
41  typedef DICOMImageIO2 Self;
42  typedef ImageIOBase Superclass;
43  typedef SmartPointer< Self > Pointer;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(DICOMImageIO2, Superclass);
50 
51  /*-------- This part of the interfaces deals with reading data. ----- */
52 
55  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
56 
58  virtual void ReadImageInformation() ITK_OVERRIDE;
59 
61  // virtual const std::type_info& GetPixelType() const;
62 
64  virtual void Read(void *buffer) ITK_OVERRIDE;
65 
69  // virtual unsigned int GetComponentSize() const;
70 
71  /*-------- This part of the interfaces deals with writing data. ----- */
72 
75  virtual bool CanWriteFile(const char *) ITK_OVERRIDE { return false; }
76 
78  virtual void WriteImageInformation() ITK_OVERRIDE {}
79 
82  virtual void Write(const void *) ITK_OVERRIDE {}
83 
85  void GetPatientName(char *name);
86 
87  void GetPatientID(char *id);
88 
89  void GetPatientSex(char *sex);
90 
91  void GetPatientAge(char *age);
92 
93  void GetStudyID(char *id);
94 
95  void GetPatientDOB(char *dob);
96 
97  void GetStudyDescription(char *desc);
98 
99  void GetBodyPart(char *part);
100 
101  void GetNumberOfSeriesInStudy(char *series);
102 
103  void GetNumberOfStudyRelatedSeries(char *series);
104 
105  void GetStudyDate(char *date);
106 
107  void GetModality(char *modality);
108 
109  void GetManufacturer(char *manu);
110 
111  void GetInstitution(char *ins);
112 
113  void GetModel(char *model);
114 
115 protected:
116  DICOMImageIO2();
117  virtual ~DICOMImageIO2();
118  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
119 
120  itkdicomparser::DICOMParser *m_Parser;
121  itkdicomparser::DICOMAppHelper *m_AppHelper;
122 
123  void ReadDataCallback(doublebyte group,
124  doublebyte element,
125  itkdicomparser::DICOMParser::VRTypes type,
126  unsigned char *val,
127  quadbyte len);
128 
129  unsigned char *m_ImageDataBuffer;
130 
131 private:
132  DICOMImageIO2(const Self &); //purposely not implemented
133  void operator=(const Self &); //purposely not implemented
134 };
135 } // end namespace itk
136 
137 #endif //#if !defined( ITK_LEGACY_REMOVE )
138 #endif // itkDICOMImageIO2_h
*brief Mask an image with the negative of a mask **This class is templated over the types of the *input image type