Developer documentation
Version 3.0.3-105-gd3941f44
MR::File::Dicom::Element Class Reference

#include "file/dicom/element.h"

Public Types

enum  _Type {
  INVALID , INT , UINT , FLOAT ,
  DATE , TIME , DATETIME , STRING ,
  SEQ , OTHER
}
 
typedef enum MR::File::Dicom::Element::_Type Type
 

Public Member Functions

void set (const std::string &filename, bool force_read=false, bool read_write=false)
 
bool read ()
 
bool is (uint16_t Group, uint16_t Element) const
 
std::string tag_name () const
 
uint32_t tag () const
 
size_t offset (uint8_t *address) const
 
bool is_big_endian () const
 
bool is_new_sequence () const
 
bool ignore_when_parsing () const
 
bool is_in_series_ref_sequence () const
 
Type type () const
 
vector< int32_t > get_int () const
 
vector< uint32_t > get_uint () const
 
vector< default_typeget_float () const
 
Date get_date () const
 
Time get_time () const
 
std::pair< Date, Timeget_datetime () const
 
vector< std::string > get_string () const
 
int32_t get_int (size_t idx, int32_t default_value=0) const
 
uint32_t get_uint (size_t idx, uint32_t default_value=0) const
 
double get_float (size_t idx, double default_value=0.0) const
 
std::string get_string (size_t idx, std::string default_value=std::string()) const
 
std::string as_string () const
 
size_t level () const
 
template<typename VectorType >
FORCE_INLINE void check_size (const VectorType v, size_t min_size=1)
 

Static Public Member Functions

static std::string print_header ()
 

Public Attributes

uint16_t group
 
uint16_t element
 
uint16_t VR
 
uint32_t size
 
uint8_t * data
 
vector< Sequenceparents
 
bool transfer_syntax_supported
 

Protected Member Functions

void set_explicit_encoding ()
 
bool read_GR_EL ()
 
uint16_t get_VR_from_tag_name (const std::string &name)
 
bool check_get (size_t idx, size_t size) const
 
void error_in_get (size_t idx) const
 
void error_in_check_size (size_t min_size, size_t actual_size) const
 
void report_unknown_tag_with_implicit_syntax () const
 

Static Protected Member Functions

static void init_dict ()
 

Protected Attributes

std::unique_ptr< File::MMapfmap
 
uint8_t * next
 
uint8_t * start
 
bool is_explicit
 
bool is_BE
 
bool is_transfer_syntax_BE
 
vector< uint8_t * > end_seq
 

Static Protected Attributes

static std::unordered_map< uint32_t, const char * > dict
 
static const char * type_as_str []
 

Friends

std::ostream & operator<< (std::ostream &stream, const Element &item)
 

Detailed Description

Definition at line 95 of file element.h.

Member Typedef Documentation

◆ Type

Member Enumeration Documentation

◆ _Type

Enumerator
INVALID 
INT 
UINT 
FLOAT 
DATE 
TIME 
DATETIME 
STRING 
SEQ 
OTHER 

Definition at line 97 of file element.h.

Member Function Documentation

◆ as_string()

std::string MR::File::Dicom::Element::as_string ( ) const

◆ check_get()

bool MR::File::Dicom::Element::check_get ( size_t  idx,
size_t  size 
) const
inlineprotected

Definition at line 211 of file element.h.

◆ check_size()

template<typename VectorType >
FORCE_INLINE void MR::File::Dicom::Element::check_size ( const VectorType  v,
size_t  min_size = 1 
)
inline

Definition at line 182 of file element.h.

◆ error_in_check_size()

void MR::File::Dicom::Element::error_in_check_size ( size_t  min_size,
size_t  actual_size 
) const
protected

◆ error_in_get()

void MR::File::Dicom::Element::error_in_get ( size_t  idx) const
protected

◆ get_date()

Date MR::File::Dicom::Element::get_date ( ) const

◆ get_datetime()

std::pair< Date, Time > MR::File::Dicom::Element::get_datetime ( ) const

◆ get_float() [1/2]

vector< default_type > MR::File::Dicom::Element::get_float ( ) const

◆ get_float() [2/2]

double MR::File::Dicom::Element::get_float ( size_t  idx,
double  default_value = 0.0 
) const
inline

Definition at line 167 of file element.h.

◆ get_int() [1/2]

vector< int32_t > MR::File::Dicom::Element::get_int ( ) const

◆ get_int() [2/2]

int32_t MR::File::Dicom::Element::get_int ( size_t  idx,
int32_t  default_value = 0 
) const
inline

Definition at line 165 of file element.h.

◆ get_string() [1/2]

vector< std::string > MR::File::Dicom::Element::get_string ( ) const

◆ get_string() [2/2]

std::string MR::File::Dicom::Element::get_string ( size_t  idx,
std::string  default_value = std::string() 
) const
inline

Definition at line 168 of file element.h.

◆ get_time()

Time MR::File::Dicom::Element::get_time ( ) const

◆ get_uint() [1/2]

vector< uint32_t > MR::File::Dicom::Element::get_uint ( ) const

◆ get_uint() [2/2]

uint32_t MR::File::Dicom::Element::get_uint ( size_t  idx,
uint32_t  default_value = 0 
) const
inline

Definition at line 166 of file element.h.

◆ get_VR_from_tag_name()

uint16_t MR::File::Dicom::Element::get_VR_from_tag_name ( const std::string &  name)
inlineprotected

Definition at line 200 of file element.h.

◆ ignore_when_parsing()

bool MR::File::Dicom::Element::ignore_when_parsing ( ) const

◆ init_dict()

static void MR::File::Dicom::Element::init_dict ( )
staticprotected

◆ is()

bool MR::File::Dicom::Element::is ( uint16_t  Group,
uint16_t  Element 
) const
inline

Definition at line 119 of file element.h.

◆ is_big_endian()

bool MR::File::Dicom::Element::is_big_endian ( ) const
inline

Definition at line 146 of file element.h.

◆ is_in_series_ref_sequence()

bool MR::File::Dicom::Element::is_in_series_ref_sequence ( ) const

◆ is_new_sequence()

bool MR::File::Dicom::Element::is_new_sequence ( ) const
inline

Definition at line 149 of file element.h.

◆ level()

size_t MR::File::Dicom::Element::level ( ) const
inline

Definition at line 172 of file element.h.

◆ offset()

size_t MR::File::Dicom::Element::offset ( uint8_t *  address) const
inline

Definition at line 143 of file element.h.

◆ print_header()

static std::string MR::File::Dicom::Element::print_header ( )
inlinestatic

Definition at line 175 of file element.h.

◆ read()

bool MR::File::Dicom::Element::read ( )

◆ read_GR_EL()

bool MR::File::Dicom::Element::read_GR_EL ( )
protected

◆ report_unknown_tag_with_implicit_syntax()

void MR::File::Dicom::Element::report_unknown_tag_with_implicit_syntax ( ) const
protected

◆ set()

void MR::File::Dicom::Element::set ( const std::string &  filename,
bool  force_read = false,
bool  read_write = false 
)

◆ set_explicit_encoding()

void MR::File::Dicom::Element::set_explicit_encoding ( )
protected

◆ tag()

uint32_t MR::File::Dicom::Element::tag ( ) const
inline

Definition at line 131 of file element.h.

◆ tag_name()

std::string MR::File::Dicom::Element::tag_name ( ) const
inline

Definition at line 125 of file element.h.

◆ type()

Type MR::File::Dicom::Element::type ( ) const

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
const Element item 
)
friend

Member Data Documentation

◆ data

uint8_t* MR::File::Dicom::Element::data

Definition at line 112 of file element.h.

◆ dict

std::unordered_map<uint32_t, const char*> MR::File::Dicom::Element::dict
staticprotected

Definition at line 208 of file element.h.

◆ element

uint16_t MR::File::Dicom::Element::element

Definition at line 110 of file element.h.

◆ end_seq

vector<uint8_t*> MR::File::Dicom::Element::end_seq
protected

Definition at line 197 of file element.h.

◆ fmap

std::unique_ptr<File::MMap> MR::File::Dicom::Element::fmap
protected

Definition at line 189 of file element.h.

◆ group

uint16_t MR::File::Dicom::Element::group

Definition at line 110 of file element.h.

◆ is_BE

bool MR::File::Dicom::Element::is_BE
protected

Definition at line 195 of file element.h.

◆ is_explicit

bool MR::File::Dicom::Element::is_explicit
protected

Definition at line 195 of file element.h.

◆ is_transfer_syntax_BE

bool MR::File::Dicom::Element::is_transfer_syntax_BE
protected

Definition at line 195 of file element.h.

◆ next

uint8_t* MR::File::Dicom::Element::next
protected

Definition at line 193 of file element.h.

◆ parents

vector<Sequence> MR::File::Dicom::Element::parents

Definition at line 113 of file element.h.

◆ size

uint32_t MR::File::Dicom::Element::size

Definition at line 111 of file element.h.

◆ start

uint8_t* MR::File::Dicom::Element::start
protected

Definition at line 194 of file element.h.

◆ transfer_syntax_supported

bool MR::File::Dicom::Element::transfer_syntax_supported

Definition at line 114 of file element.h.

◆ type_as_str

const char* MR::File::Dicom::Element::type_as_str[]
staticprotected

Definition at line 216 of file element.h.

◆ VR

uint16_t MR::File::Dicom::Element::VR

Definition at line 110 of file element.h.


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