GDCM: gdcm::ImageRegionReader Class Reference

GDCM 3.0.25

Public Member Functions | Protected Member Functions | List of all members
gdcm::ImageRegionReader Class Reference

ImageRegionReader. More...

`#include <gdcmImageRegionReader.h>`

Inheritance diagram for gdcm::ImageRegionReader:
[legend]
Collaboration diagram for gdcm::ImageRegionReader:
[legend]

## Public Member Functions
| ImageRegionReader ()
| ~ImageRegionReader () override
size_t | ComputeBufferLength () const
Region const & | GetRegion () const
bool | ReadInformation ()
bool | ReadIntoBuffer (char *inreadbuffer, size_t buflen)
void | SetRegion (Region const &region)
| Set/Get Region to be read.
Public Member Functions inherited from gdcm::ImageReader
| ImageReader ()
| ~ImageReader () override
Image & | GetImage ()
const Image & | GetImage () const
| Return the read image.
Public Member Functions inherited from gdcm::PixmapReader
| PixmapReader ()
| ~PixmapReader () override
Pixmap & | GetPixmap ()
const Pixmap & | GetPixmap () const
| Return the read image (need to call Read() first)
bool | Read () override
Public Member Functions inherited from gdcm::Reader
| Reader ()
virtual | ~Reader ()
bool | CanRead () const
File & | GetFile ()
| Set/Get File.
const File & | GetFile () const
| Set/Get File.
size_t | GetStreamCurrentPosition () const
bool | ReadSelectedPrivateTags (std::set< PrivateTag > const &ptags, bool readvalues=true)
| Will only read the specified selected private tags.
bool | ReadSelectedTags (std::set< Tag > const &tags, bool readvalues=true)
| Will only read the specified selected tags.
bool | ReadUpToTag (const Tag &tag, std::set< Tag > const &skiptags=std::set< Tag >())
void | SetFile (File &file)
| Set/Get File.
void | SetFileName (const char *filename_native)
void | SetStream (std::istream &input_stream)
| Set the open-ed stream directly.

## Protected Member Functions
bool | Read () override
| To prevent user from calling super class Read() function.
Protected Member Functions inherited from gdcm::ImageReader
bool | ReadACRNEMAImage () override
bool | ReadImage (MediaStorage const &ms) override
Protected Member Functions inherited from gdcm::PixmapReader
bool | ReadImageInternal (MediaStorage const &ms, bool handlepixeldata=true)
Protected Member Functions inherited from gdcm::Reader
std::istream * | GetStreamPtr () const
bool | ReadDataSet ()
bool | ReadMetaInformation ()
bool | ReadPreamble ()

## Additional Inherited Members
Protected Attributes inherited from gdcm::PixmapReader
SmartPointer< Pixmap > | PixelData
Protected Attributes inherited from gdcm::Reader
SmartPointer< File > | F

## Detailed Description

ImageRegionReader.

This class is able to read a region from a DICOM file containing an image. This implementation requires that the information stored in the DICOM header are consistent with what is in the encapsulated Pixel Data. This is technically not required by DICOM standard, which makes this implementation illegal with regards to the famous JPEG note: http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html#para_4bcb841e-c6bf-4e26-82a5-3fad3c942da0

See also
  ImageReader

Examples
  ExtractImageRegion.cs, ExtractImageRegionWithLUT.cs, and TemplateEmptyImage.cxx.

## Constructor & Destructor Documentation

## ◆ ImageRegionReader()

gdcm::ImageRegionReader::ImageRegionReader | ( |  | ) |

## ◆ ~ImageRegionReader()

gdcm::ImageRegionReader::~ImageRegionReader | ( |  | ) |
| override

## Member Function Documentation

## ◆ ComputeBufferLength()

size_t gdcm::ImageRegionReader::ComputeBufferLength | ( |  | ) | const

Explicit call which will compute the minimal buffer length that can hold the whole uncompressed image as defined by Region `region`.

Returns
  0 upon error

## ◆ GetRegion()

Region const & gdcm::ImageRegionReader::GetRegion | ( |  | ) | const

## ◆ Read()

bool gdcm::ImageRegionReader::Read | ( |  | ) |
| overrideprotectedvirtual

To prevent user from calling super class Read() function.

Reimplemented from gdcm::ImageReader.

## ◆ ReadInformation()

bool gdcm::ImageRegionReader::ReadInformation | ( |  | ) |

Read meta information (not Pixel Data) from the DICOM file.

Returns
  false upon error

Examples
  ExtractImageRegion.cs, ExtractImageRegionWithLUT.cs, and TemplateEmptyImage.cxx.

## ◆ ReadIntoBuffer()

bool gdcm::ImageRegionReader::ReadIntoBuffer | ( | char * | inreadbuffer,
|  | size_t | buflen )

Read into buffer: For Python, the `buflen` param is deduced directly from the input bytearray passed as parameter (function only takes one param).

Returns
  false upon error

Examples
  ExtractImageRegion.cs, and ExtractImageRegionWithLUT.cs.

## ◆ SetRegion()

void gdcm::ImageRegionReader::SetRegion | ( | Region const & | region | ) |

Set/Get Region to be read.

Examples
  ExtractImageRegion.cs, and ExtractImageRegionWithLUT.cs.

The documentation for this class was generated from the following file:

- gdcmImageRegionReader.h