gdcmStreamImageReader.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef GDCMSTREAMIMAGEREADER_H
#define GDCMSTREAMIMAGEREADER_H
#include "gdcmReader.h"
namespace gdcm
{
class MediaStorage;
class GDCM_EXPORT StreamImageReader
{
public:
StreamImageReader();
virtual ~StreamImageReader();
void SetFileName(const char* inFileName);
void SetStream(std::istream& inStream);
std::vector<unsigned int> GetDimensionsValueForResolution( unsigned int );
void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax,
uint16_t inYMin, uint16_t inYMax, uint16_t inZMin = 0, uint16_t inZMax = 1);
uint32_t DefineProperBufferLength() const;
bool Read(char* inReadBuffer, const std::size_t& inBufferLength);
bool CanReadImage() const;
virtual bool ReadImageInformation();
File const & GetFile() const;
protected:
private:
//contains a reader for being able to ReadUpToTag
//however, we don't want the user to be able to call Read
//either directly or via a parent class call, so we hide the reader in here.
Reader mReader;
std::streamoff mFileOffset; //the file offset for getting header information
#if 0
std::streamoff mFileOffset1;
#endif
DataSet mHeaderInformation; //all the non-pixel information
//for thread safety, these should not be stored here, but should be used
//for every read subregion operation.
uint16_t mXMin, mYMin, mXMax, mYMax, mZMin, mZMax;
bool ReadImageSubregionRAW(char* inReadBuffer, const std::size_t& inBufferLength);
bool ReadImageSubregionJpegLS(char* inReadBuffer, const std::size_t& inBufferLength);
};
} // end namespace gdcm
#endif //GDCMSTREAMIMAGEREADER_H
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