GDCM 3.0.24
gdcmStreamImageReader.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 GDCMSTREAMIMAGEREADER_H
19#define GDCMSTREAMIMAGEREADER_H
20
21#include "gdcmReader.h"
22
23namespace gdcm
24{
25
26class MediaStorage;
39{
40
41public:
44
48 void SetFileName(const char* inFileName);
49 void SetStream(std::istream& inStream);
50
51 std::vector<unsigned int> GetDimensionsValueForResolution( unsigned int );
52
60 void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax,
61 uint16_t inYMin, uint16_t inYMax, uint16_t inZMin = 0, uint16_t inZMax = 1);
62
67 uint32_t DefineProperBufferLength() const;
68
76 bool Read(char* inReadBuffer, const std::size_t& inBufferLength);
77
83 bool CanReadImage() const;
84
88 virtual bool ReadImageInformation();
89
93 File const & GetFile() const;
94
95protected:
96private:
97 //contains a reader for being able to ReadUpToTag
98 //however, we don't want the user to be able to call Read
99 //either directly or via a parent class call, so we hide the reader in here.
100 Reader mReader;
101
102 std::streamoff mFileOffset; //the file offset for getting header information
103#if 0
104 std::streamoff mFileOffset1;
105#endif
106 DataSet mHeaderInformation; //all the non-pixel information
107
108 //for thread safety, these should not be stored here, but should be used
109 //for every read subregion operation.
110 uint16_t mXMin, mYMin, mXMax, mYMax, mZMin, mZMax;
111
116 bool ReadImageSubregionRAW(char* inReadBuffer, const std::size_t& inBufferLength);
117
120 bool ReadImageSubregionJpegLS(char* inReadBuffer, const std::size_t& inBufferLength);
121};
122
123} // end namespace gdcm
124
125#endif //GDCMSTREAMIMAGEREADER_H
126
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
a DICOM File
Definition gdcmFile.h:34
Reader ala DOM (Document Object Model)
Definition gdcmReader.h:54
StreamImageReader.
Definition gdcmStreamImageReader.h:39
void SetStream(std::istream &inStream)
void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax, uint16_t inYMin, uint16_t inYMax, uint16_t inZMin=0, uint16_t inZMax=1)
virtual bool ReadImageInformation()
bool Read(char *inReadBuffer, const std::size_t &inBufferLength)
bool CanReadImage() const
void SetFileName(const char *inFileName)
std::vector< unsigned int > GetDimensionsValueForResolution(unsigned int)
File const & GetFile() const
uint32_t DefineProperBufferLength() const
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21