ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkJPEG2000ImageIO.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 __itkJPEG2000ImageIO_h
19 #define __itkJPEG2000ImageIO_h
20 
21 
22 #include <fstream>
24 #include "itkAutoPointer.h"
25 
26 namespace itk
27 {
28 
29 class JPEG2000ImageIOInternal;
30 
49 class ITK_EXPORT JPEG2000ImageIO:public StreamingImageIOBase
50 {
51 public:
56 
58  itkNewMacro(Self);
59 
62 
63  /*-------- This part of the interfaces deals with reading data. ----- */
64 
67  virtual bool CanReadFile(const char *);
68 
70  virtual void ReadImageInformation();
71 
73  virtual void Read(void *buffer);
74 
75  /*-------- This part of the interfaces deals with writing data. ----- */
76 
79  virtual bool CanWriteFile(const char *);
80 
82  virtual void WriteImageInformation();
83 
86  virtual void Write(const void *buffer);
87 
92  virtual ImageIORegion
93  GenerateStreamableReadRegionFromRequestedRegion(const ImageIORegion & requested) const;
94 
96  virtual SizeType GetHeaderSize(void) const;
97 
99  void SetTileSize(int x, int y);
100 
106  virtual bool CanStreamWrite( void );
107 
108 protected:
109  JPEG2000ImageIO();
110  ~JPEG2000ImageIO();
111 
112  void PrintSelf(std::ostream & os, Indent indent) const;
113 
114 private:
115  JPEG2000ImageIO(const Self &); //purposely not implemented
116  void operator=(const Self &); //purposely not implemented
117 
119 
122 
123  void ComputeRegionInTileBoundaries(unsigned int dimension,
124  SizeValueType tileSize, ImageIORegion & streamableRegion) const;
125 };
126 } // end namespace itk
127 
128 #endif // __itkJPEG2000ImageIO_h
129