GDCM 3.2.1

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
23 namespace gdcm
24{
25
26 class MediaStorage;
38 class GDCM_EXPORT StreamImageReader
39{
40
41 public:
42 StreamImageReader();
43 virtual ~StreamImageReader();
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
95 protected:
96 private:
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
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::MediaStorage
MediaStorage.
Definition gdcmMediaStorage.h:44
gdcm::Reader
Reader ala DOM (Document Object Model)
Definition gdcmReader.h:54
gdcm::StreamImageReader::SetStream
void SetStream(std::istream &inStream)
gdcm::StreamImageReader::DefinePixelExtent
void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax, uint16_t inYMin, uint16_t inYMax, uint16_t inZMin=0, uint16_t inZMax=1)
gdcm::StreamImageReader::ReadImageInformation
virtual bool ReadImageInformation()
gdcm::StreamImageReader::Read
bool Read(char *inReadBuffer, const std::size_t &inBufferLength)
gdcm::StreamImageReader::CanReadImage
bool CanReadImage() const
gdcm::StreamImageReader::SetFileName
void SetFileName(const char *inFileName)
gdcm::StreamImageReader::~StreamImageReader
virtual ~StreamImageReader()
gdcm::StreamImageReader::GetDimensionsValueForResolution
std::vector< unsigned int > GetDimensionsValueForResolution(unsigned int)
gdcm::StreamImageReader::GetFile
File const & GetFile() const
gdcm::StreamImageReader::StreamImageReader
StreamImageReader()
gdcm::StreamImageReader::DefineProperBufferLength
uint32_t DefineProperBufferLength() const
gdcmReader.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21