ITK  5.0.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>
23 #include "ITKIOJPEG2000Export.h"
25 #include "memory"
26 
27 
28 namespace itk
29 {
30 
31 class JPEG2000ImageIOInternal;
32 
51 class ITKIOJPEG2000_EXPORT JPEG2000ImageIO:public StreamingImageIOBase
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(JPEG2000ImageIO);
55 
60 
62  itkNewMacro(Self);
63 
66 
67  /*-------- This part of the interfaces deals with reading data. ----- */
68 
71  bool CanReadFile(const char *) override;
72 
74  void ReadImageInformation() override;
75 
77  void Read(void *buffer) override;
78 
79  /*-------- This part of the interfaces deals with writing data. ----- */
80 
83  bool CanWriteFile(const char *) override;
84 
86  void WriteImageInformation() override;
87 
90  void Write(const void *buffer) override;
91 
97  GenerateStreamableReadRegionFromRequestedRegion(const ImageIORegion & requested) const override;
98 
100  SizeType GetHeaderSize() const override;
101 
103  void SetTileSize(int x, int y);
104 
110  bool CanStreamWrite() override;
111 
112 protected:
113  JPEG2000ImageIO();
114  ~JPEG2000ImageIO() override;
115 
116  void PrintSelf(std::ostream & os, Indent indent) const override;
117 
118 private:
119  std::unique_ptr< JPEG2000ImageIOInternal > m_Internal;
120 
123 
124  void ComputeRegionInTileBoundaries(unsigned int dimension,
125  SizeValueType tileSize, ImageIORegion & streamableRegion) const;
126 };
127 } // end namespace itk
128 
129 #endif // itkJPEG2000ImageIO_h
Light weight base class for most itk classes.
An ImageIORegion represents a structured region of data.
A base class for specific ImageIO file formats which support streaming.
::itk::IndexValueType IndexValueType
::itk::IndexValueType IndexValueType
::itk::SizeValueType SizeValueType
::itk::intmax_t SizeType
std::unique_ptr< JPEG2000ImageIOInternal > m_Internal
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Supports for the JPEG2000 file format based on openjpeg.
Base class for most ITK classes.
Definition: itkObject.h:60
::itk::SizeValueType SizeValueType