|
DCMTK Version 3.7.0
OFFIS DICOM Toolkit
|
input stream that reads from standard input More...
Public Member Functions | |
| DcmJSONReader () | |
| constructor | |
| virtual | ~DcmJSONReader () |
| destructor | |
| virtual void | clear () |
| delete all internal buffers, but keep policy settings | |
| virtual OFCondition | readJSONFile (const char *ifname) |
| read a JSON file and store the content in this object | |
| virtual OFCondition | readJSONFromStdin () |
| read a JSON dataset from stdin and store the content in this object | |
| virtual void | setIgnoreBulkdataURIPolicy (OFBool value) |
| set the "ignore bulk data URI" policy | |
| virtual void | setStopOnErrorPolicy (OFBool value) |
| set the "stop on error" policy | |
| virtual void | setIgnoreMetaInfoPolicy (OFBool value) |
| set the "ignore meta info" policy | |
| virtual void | setArrayHandlingPolicy (signed long value) |
| set the array handling policy | |
| virtual void | setTransferSyntax (E_TransferSyntax value) |
| set the transfer syntax for the dataset | |
| virtual E_TransferSyntax | getTransferSyntax () const |
| set the transfer syntax for the dataset | |
| virtual OFCondition | readAndConvertJSONFile (DcmFileFormat &fileformat, const char *ifname) |
| parse the JSON file with the given filename | |
| virtual OFCondition | dumpJSONTokenArray () |
| dump the token array produced by the JSMN parser to stderr | |
| virtual OFBool | isFileURI (const OFString &uri) const |
| check if the given URI is a file URI | |
| virtual OFBool | isHttpURI (const OFString &uri) const |
| check if the given URI is a http: or https: URI | |
| virtual OFCondition | urlDecode (OFString &uri) const |
| URL decode the given URI, i.e. | |
| virtual OFCondition | fileURItoPath (const OFString &uri, OFString &filepath, size_t &offset, size_t &length) const |
| convert a file URI to a file path in the local filesystem | |
| virtual OFCondition | normalizePath (const OFString &filepath_in, OFString &filepath_out) const |
| normalize a file path into an absolute path without symbolic links. | |
| virtual OFCondition | addPermittedBulkdataPath (const OFString &dirpath) |
| add a path from which bulk data files may be read if referenced by a file BulkdataURI. | |
| virtual OFBool | bulkdataPathPermitted (const OFString &filepath) const |
| check if the given normalized path (which may include a filename) is in the list of permitted bulk data paths as defined by calls to addPermittedBulkdataPath(). | |
| virtual OFCondition | loadBulkdataFile (DcmElement &element, const OFString &filepath, size_t offset, size_t length) |
| load bulk data from file and insert it into the given element | |
Private Member Functions | |
| OFCondition | reserveTokens () |
| calculate the required number of tokens for the JSON dataset and allocate the token array accordingly | |
| virtual OFCondition | parseJSON () |
| parse the JSON dataset that has be read into the buffer | |
| DcmJSONReader (const DcmJSONReader &) | |
| private unimplemented copy constructor | |
| DcmJSONReader & | operator= (const DcmJSONReader &) |
| private unimplemented copy assignment operator | |
| void | getTokenContent (OFString &value, OFJsmnTokenPtr t) |
| helper function to retrieve the content of the token. | |
| virtual OFCondition | createElement (DcmElement *&newElem, DcmTag &dcmTag, const OFString &vr) |
| create DICOM element using the given tag and VR | |
| virtual OFCondition | extractTag (OFJsmnTokenPtr keyToken, DcmTagKey &tagkey) |
| extract DICOM tag from the given string | |
| virtual OFCondition | processJSONEscapeCharacters (OFString &value) |
| helper function processing escaped characters in JSON strings | |
| virtual OFCondition | parseDataSet (DcmItem *dataset, DcmItem *metaheader, OFJsmnTokenPtr ¤t) |
| parse the dataset part of an XML file containing a DICOM file or a DICOM dataset. | |
| virtual OFCondition | parseSequence (DcmSequenceOfItems &sequence, OFJsmnTokenPtr ¤t) |
| parse a DICOM sequence | |
| virtual OFCondition | parseElement (DcmItem *dataset, DcmItem *metaheader, OFJsmnTokenPtr ¤t) |
| parse a DICOM element that is not a sequence | |
| virtual OFCondition | parseElementValueArray (DcmElement *&newElem, OFJsmnTokenPtr ¤t) |
| parse a value array from JSON to DICOM | |
| virtual OFCondition | parsePersonName (OFString &value, OFJsmnTokenPtr ¤t) |
| parse a person name (PN value) | |
| virtual OFCondition | storeInlineBinaryValue (DcmElement &element, Uint8 *data, size_t length) |
| store decoded inline binary value in a DICOM element | |
| virtual OFCondition | storeBulkValue (DcmElement &element, Uint8 *data, size_t length) |
| store loaded bulk data value in a DICOM element | |
Private Attributes | |
| char * | jsonDataset_ |
| null terminated character string containing the entire JSON dataset | |
| size_t | jsonDatasetLen_ |
| size of jsonDataset_ in bytes, not including the terminating null byte | |
| OFJsmnTokenPtr | tokenArray_ |
| array of parsed JSON tokens | |
| int | tokenNumber_ |
| number of tokens in tokenArray_ | |
| OFBool | ignoreBulkdataURIPolicy_ |
| policy for handling bulk data URIs (true = ignore) | |
| OFBool | stopOnErrorPolicy_ |
| policy for error handling (false = ignore) | |
| OFBool | ignoreMetaInfoPolicy_ |
| policy for handling meta info elements in the JSON dataset (true = ignore) | |
| signed long | arrayHandlingPolicy_ |
| policy for handling arrays of multiple datasets. | |
| E_TransferSyntax | xferSyntax_ |
| transfer syntax of the dataset, default: LittleEndianExplicit | |
| OFList< OFString > | permittedBulkdataDirs_ |
| list of directories to which file URIs may point | |
input stream that reads from standard input
|
virtual |
add a path from which bulk data files may be read if referenced by a file BulkdataURI.
The path will be normalized before being stored. All subdirectories of the given directory will also be accepted a valid paths.
| dirpath | the directory path that is acceptable for bulk data |
|
virtual |
check if the given normalized path (which may include a filename) is in the list of permitted bulk data paths as defined by calls to addPermittedBulkdataPath().
| filepath | the file path to be checked |
|
privatevirtual |
create DICOM element using the given tag and VR
| newElem | pointer to newly created DICOM element returned in this parameter |
| dcmTag | attribute tag |
| vr | the string representation of the VR (if present) |
|
privatevirtual |
extract DICOM tag from the given string
| keyToken | token containing the string representation of the tag in form of "ggggeeee" |
| tagkey | stores the extracted DICOM tag |
|
virtual |
convert a file URI to a file path in the local filesystem
| uri | the file URI to convert |
| filepath | the file path is returned in this parameter |
| offset | the byte offset within the file is returned in this parameter |
| length | the number of bytes to read from the file is returned in this parameter, 0 means 'unlimited' |
|
private |
helper function to retrieve the content of the token.
There is no check on boundaries!
| value | the result string |
| t | token pointer |
|
inlinevirtual |
|
virtual |
check if the given URI is a file URI
| uri | URI to check |
|
virtual |
check if the given URI is a http: or https: URI
| uri | URI to check |
|
virtual |
load bulk data from file and insert it into the given element
| element | element into which the value will be inserted |
| filepath | path to the bulk data file |
| offset | offset in bytes within the file from where to start reading |
| length | number of bytes to read from file, 0 for the entire file from the given offset |
|
virtual |
normalize a file path into an absolute path without symbolic links.
On Windows, the long version of directory and file names will be generated and converted to uppercase, since the Win32 file API uses case insensitive filenames
| filepath_in | the file path to be normalized |
| filepath_out | the normalized file path is returned in this parameter. This parameter must not reference the same string as filepath_in. |
|
privatevirtual |
parse the dataset part of an XML file containing a DICOM file or a DICOM dataset.
| dataset | dataset stored in this parameter |
| metaheader | metaheader stored in this parameter |
| current | pointer to current JSMN Token |
|
privatevirtual |
parse a DICOM element that is not a sequence
| dataset | dataset stored in this parameter |
| metaheader | metaheader stored in this parameter |
| current | pointer to current JSMN Token |
|
privatevirtual |
parse a value array from JSON to DICOM
| newElem | Pointer to element where the value should be stored |
| current | pointer to current token in the tokenArray |
|
privatevirtual |
parse the JSON dataset that has be read into the buffer
|
privatevirtual |
parse a person name (PN value)
| value | string containing the PN DICOM value |
| current | pointer to current token in the tokenArray |
|
privatevirtual |
parse a DICOM sequence
| sequence | DICOM Sequence |
| current | pointer to current token in the tokenArray |
|
privatevirtual |
helper function processing escaped characters in JSON strings
| value | containing the string. The string will be changed |
|
virtual |
parse the JSON file with the given filename
| fileformat | DcmFileFormat instance to be populated with the parsed JSON content |
| ifname | name of the JSON file to be read |
|
virtual |
read a JSON file and store the content in this object
| ifname | name of the JSON file to be read |
|
virtual |
read a JSON dataset from stdin and store the content in this object
|
inlinevirtual |
set the array handling policy
| value | new policy
|
References arrayHandlingPolicy_.
|
inlinevirtual |
set the "ignore bulk data URI" policy
| value | new policy, true = ignore bulk data URIs |
References ignoreBulkdataURIPolicy_.
|
inlinevirtual |
set the "ignore meta info" policy
| value | new policy, true = ignore meta info elements in JSON dataset |
References ignoreMetaInfoPolicy_.
|
inlinevirtual |
set the "stop on error" policy
| value | new policy, true = stop when encountering a parse error |
References stopOnErrorPolicy_.
|
inlinevirtual |
|
privatevirtual |
store loaded bulk data value in a DICOM element
| element | element into which the value will be inserted |
| data | buffer containing the bulk data |
| length | of the buffer |
|
privatevirtual |
store decoded inline binary value in a DICOM element
| element | element into which the value will be inserted |
| data | buffer containing the inline binary data |
| length | of the buffer |
|
virtual |
URL decode the given URI, i.e.
replace all instances of 'xx' with the hex number xx by the corresponding byte.
| uri | URI string, will be modified by this method. |
|
private |
policy for handling arrays of multiple datasets.
Referenced by setArrayHandlingPolicy().