9#ifndef _aa2965aa_e891_4713_9c90_e8eacd2944ea
10#define _aa2965aa_e891_4713_9c90_e8eacd2944ea
57 std::string transfer_syntax,
bool keep_group_length=
false);
60 static void ignore(std::istream & stream, std::streamsize size);
67 std::istream & stream, std::string
const & transfer_syntax,
68 bool keep_group_length=
false);
72 std::function<
bool(
Tag const &)> halt_condition =
73 [](
Tag const &) {
return false;})
const;
87 Tag const & tag=
Tag(0xffff,0xffff),
88 std::shared_ptr<DataSet const> data_set=std::make_shared<DataSet>())
const;
91 static std::pair<std::shared_ptr<DataSet>, std::shared_ptr<DataSet>>
93 std::istream & stream,
94 bool keep_group_length=
false,
95 std::function<
bool(
Tag const &)> halt_condition = [](
Tag const &) {
return false;});
100 typedef void result_type;
102 std::istream & stream;
106 std::string transfer_syntax;
109 bool keep_group_length;
112 std::istream & stream,
VR vr, uint32_t vl,
114 bool explicit_vr,
bool keep_group_length);
125 std::shared_ptr<DataSet>
126 read_item(std::istream & specific_stream)
const;
128 std::istream & specific_stream)
const;
134#include "odil/Reader.txx"
Element of a DICOM data set.
Definition: Element.h:27
Read DICOM objects from a stream.
Definition: Reader.h:30
Reader(std::istream &stream, std::string const &transfer_syntax, bool keep_group_length=false)
Build a reader, derive byte ordering and explicit-ness of VR from transfer syntax.
bool keep_group_length
Flag to keep or discard group length tags.
Definition: Reader.h:45
std::shared_ptr< DataSet > read_data_set(std::function< bool(Tag const &)> halt_condition=[](Tag const &) { return false;}) const
Read a data set.
ByteOrdering byte_ordering
Endianness.
Definition: Reader.h:39
static Value::Binary read_encapsulated_pixel_data(std::istream &stream, ByteOrdering byte_ordering, std::string transfer_syntax, bool keep_group_length=false)
Read pixel data in encapsulated form.
std::string transfer_syntax
Transfer syntax used to read the file.
Definition: Reader.h:36
static void ignore(std::istream &stream, std::streamsize size)
Ignore data from a stream, ensure stream is still good.
bool explicit_vr
Explicit-ness of the Value Representations.
Definition: Reader.h:42
std::istream & stream
Input stream.
Definition: Reader.h:33
uint32_t read_length(VR vr) const
Read the length of an element.
static T read_binary(std::istream &stream, ByteOrdering ordering)
Read binary data from an stream encoded with the given endianness, ensure stream is still good.
Tag read_tag() const
Read a tag.
static std::pair< std::shared_ptr< DataSet >, std::shared_ptr< DataSet > > read_file(std::istream &stream, bool keep_group_length=false, std::function< bool(Tag const &)> halt_condition=[](Tag const &) { return false;})
Return the meta-data header and data set stored in the stream.
Element read_element(Tag const &tag=Tag(0xffff, 0xffff), std::shared_ptr< DataSet const > data_set=std::make_shared< DataSet >()) const
Read an element (VR and value), try to guess the VR from the tag, partially read data set,...
A DICOM element tag.
Definition: Tag.h:26
std::vector< String > Strings
String container.
Definition: Value.h:57
std::vector< Integer > Integers
Integer container.
Definition: Value.h:51
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:63
std::vector< Real > Reals
Real container.
Definition: Value.h:54
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition: Value.h:60
Definition: Association.h:25
ByteOrdering const byte_ordering
ByteOrdering
Definition: endian.h:30
VR
Value representations of DICOM.
Definition: VR.h:23
#define ODIL_API
Definition: odil.h:28