gdcm::FileStreamer Class Reference

FileStreamer. More...

`#include <gdcmFileStreamer.h>`

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

## Public Member Functions

| FileStreamer ()
| ~FileStreamer () override
bool | AppendToDataElement (const Tag &t, const char *array, size_t len)
| Append to previously started Tag t.
bool | AppendToGroupDataElement (const PrivateTag &pt, const char *array, size_t len)
| Append to previously started private creator.
bool | CheckDataElement (const Tag &t)
void | CheckTemplateFileName (bool check)
bool | ReserveDataElement (size_t len)
bool | ReserveGroupDataElement (unsigned short ndataelement)
void | SetOutputFileName (const char *filename_native)
| Set output filename (target file).
void | SetTemplateFileName (const char *filename_native)
| Set input DICOM template filename.
bool | StartDataElement (const Tag &t)
bool | StartGroupDataElement (const PrivateTag &pt, size_t maxsizede=0, uint8_t startoffset=0)
bool | StopDataElement (const Tag &t)
| Stop appending to tag t. This will compute the proper attribute length.
bool | StopGroupDataElement (const PrivateTag &pt)
| Stop appending to private creator.
Public Member Functions inherited from gdcm::Subject
| Subject ()
| ~Subject () override
unsigned long | AddObserver (const Event &event, Command *)
unsigned long | AddObserver (const Event &event, Command *) const
Command * | GetCommand (unsigned long tag)
bool | HasObserver (const Event &event) const
void | InvokeEvent (const Event &)
void | InvokeEvent (const Event &) const
void | RemoveAllObservers ()
void | RemoveObserver (unsigned long tag)
Public Member Functions inherited from gdcm::Object
| Object ()
| Object (const Object &)
| Special requirement for copy/cstor, assignment operator.
virtual | ~Object ()
void | operator= (const Object &)
virtual void | Print (std::ostream &) const

## Static Public Member Functions

static SmartPointer< FileStreamer > | New ()
| for wrapped language: instantiate a reference counted object

## Additional Inherited Members

Protected Member Functions inherited from gdcm::Object
void | Register ()
void | UnRegister ()

## Detailed Description

FileStreamer.

This class let a user create a massive DICOM DataSet from a template DICOM file, by appending chunks of data.

This class support two mode of operation:

1. Creating a single DataElement by appending chunk after chunk of data.
2. Creating a set of DataElement within the same group, using a private creator for start. New DataElement are added any time the user defined maximum size for data element is reached.

Warning
  any existing DataElement is removed, pick carefully which DataElement to add.

Examples
  FileStreaming.cs.

## Constructor & Destructor Documentation

## FileStreamer()

gdcm::FileStreamer::FileStreamer | ( |  | ) |

Referenced by New().

## ~FileStreamer()

gdcm::FileStreamer::~FileStreamer | ( |  | ) |

override

## Member Function Documentation

## AppendToDataElement()

bool gdcm::FileStreamer::AppendToDataElement | ( | const Tag & | t,
|  | const char * | array,
|  | size_t | len )

Append to previously started Tag t.

## AppendToGroupDataElement()

bool gdcm::FileStreamer::AppendToGroupDataElement | ( | const PrivateTag & | pt,
|  | const char * | array,
|  | size_t | len )

Append to previously started private creator.

Examples
  FileStreaming.cs.

## CheckDataElement()

bool gdcm::FileStreamer::CheckDataElement | ( | const Tag & | t | ) |

Decide to check the Data Element to be written (default: off) The implementation has default strategy for checking validity of DataElement. Currently it only support checking for the following tags:

- (7fe0,0010) Pixel Data

## CheckTemplateFileName()

void gdcm::FileStreamer::CheckTemplateFileName | ( | bool | check | ) |

Instead of simply blindly copying the input DICOM Template file, GDCM will be used to check the input file, and correct any issues recognized within the file. Only use if you do not have control over the input template file.

## New()

SmartPointer< FileStreamer > gdcm::FileStreamer::New | ( |  | ) |

inline static

for wrapped language: instantiate a reference counted object

References FileStreamer().

## ReserveDataElement()

bool gdcm::FileStreamer::ReserveDataElement | ( | size_t | len | ) |

Add a hint on the final size of the dataelement. When optimally chosen, this reduce the number of file in-place copying. Should be called before StartDataElement

## ReserveGroupDataElement()

bool gdcm::FileStreamer::ReserveGroupDataElement | ( | unsigned short | ndataelement | ) |

Optimisation: pre-allocate the number of dataelement within the private group (ndataelement <= 256). Should be called before StartGroupDataElement

## SetOutputFileName()

void gdcm::FileStreamer::SetOutputFileName | ( | const char * | filename_native | ) |

Set output filename (target file).

Examples
  FileStreaming.cs.

## SetTemplateFileName()

void gdcm::FileStreamer::SetTemplateFileName | ( | const char * | filename_native | ) |

Set input DICOM template filename.

Examples
  FileStreaming.cs.

## StartDataElement()

bool gdcm::FileStreamer::StartDataElement | ( | const Tag & | t | ) |

Start Single Data Element Operation This will delete any existing Tag t. Need to call it only once.

## StartGroupDataElement()

bool gdcm::FileStreamer::StartGroupDataElement | ( | const PrivateTag & | pt,
|  | size_t | maxsizede = 0,
|  | uint8_t | startoffset = 0 )

Start Private Group (multiple DataElement) Operation. Each newly added DataElement will have a length lower than

Parameters

  maxsizede | . When not specified, maxsizede is set to maximum size allowed by DICOM (= 2^32). startoffset can be used to specify the very first element you want to start with (instead of the first possible). Value should be in [0x0, 0xff] This will find the first available private creator.

Bug
  maxsizede should be a value lower than the actual total size of the buffer to be copied

Examples
  FileStreaming.cs.

## StopDataElement()

bool gdcm::FileStreamer::StopDataElement | ( | const Tag & | t | ) |

Stop appending to tag t. This will compute the proper attribute length.

## StopGroupDataElement()

bool gdcm::FileStreamer::StopGroupDataElement | ( | const PrivateTag & | pt | ) |

Stop appending to private creator.

Examples
  FileStreaming.cs.

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

- gdcmFileStreamer.h