ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkDCMTKImageIO.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 __itkDCMTKImageIO_h
19 #define __itkDCMTKImageIO_h
20 #include "ITKIODCMTKExport.h"
21 
22 
23 #include <fstream>
24 #include <stdio.h>
25 #include "itkImageIOBase.h"
26 
27 class DicomImage;
28 
29 namespace itk
30 {
39 class ITKIODCMTK_EXPORT DCMTKImageIO:public ImageIOBase
40 {
41 public:
43  typedef DCMTKImageIO Self;
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(DCMTKImageIO, ImageIOBase);
52 
57  enum LogLevel
58  {
59  TRACE_LOG_LEVEL = 0,
66  };
67 
69  void SetDicomImagePointer( DicomImage* UserProvided)
70  {
71  m_DImage = UserProvided;
72  m_DicomImageSetByUser = true;
73  }
74 
75  /*-------- This part of the interfaces deals with reading data. ----- */
76 
79  virtual bool CanReadFile(const char *);
80 
82  virtual void ReadImageInformation();
83 
85  virtual void Read(void *buffer);
86 
87  /*-------- This part of the interfaces deals with writing data. ----- */
88 
91  virtual bool CanWriteFile(const char *);
92 
94  virtual void WriteImageInformation();
95 
98  virtual void Write(const void *buffer);
99 
101  void SetLogLevel(LogLevel level);
102 
104  LogLevel GetLogLevel() const;
105 
106  DCMTKImageIO();
107  ~DCMTKImageIO();
108  void PrintSelf(std::ostream & os, Indent indent) const;
109 
110 private:
111  DCMTKImageIO(const Self &); //purposely not implemented
112  void operator=(const Self &); //purposely not implemented
113 
114  void OpenDicomImage();
115 
116  /*----- internal helpers --------------------------------------------*/
120 
121  DicomImage* m_DImage;
122 
124 
127  std::string m_LastFileName;
128 };
129 } // end namespace itk
130 
131 #endif // __itkDCMTKImageIO_h
DicomImage * m_DImage
Light weight base class for most itk classes.
std::string m_LastFileName
Abstract superclass defines image IO interface.
ImageIOBase Superclass
void SetDicomImagePointer(DicomImage *UserProvided)
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
DCMTKImageIO Self
Read DICOM image file format.