|
TPCCLIB
|
Processing DICOM data structs. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpcextensions.h"#include "tpcdcm.h"Go to the source code of this file.
Functions | |
| void | dcmfileInit (DCMFILE *d) |
| void | dcmitemFree (DCMITEM *d) |
| void | dcmfileFree (DCMFILE *d) |
| unsigned short int | dcmitemMaxDepth (DCMITEM *d) |
| unsigned short int | dcmfileMaxDepth (DCMFILE *df) |
| unsigned short int | dcmitemParentNr (DCMITEM *d) |
| char * | dcmValueString (DCMITEM *d) |
| long int | dcmitemGetInt (DCMITEM *d) |
| double | dcmitemGetReal (DCMITEM *d) |
| DCMITEM * | dcmFindTag (DCMITEM *d, const short int omit, DCMTAG *tag, const int verbose) |
| DCMITEM * | dcmFindDownTag (DCMITEM *d, const short int omit, DCMTAG *tag, const int verbose) |
| void | dcmitemPrint (DCMITEM *d) |
| void | dcmTagSet (DCMTAG *tag, unsigned short int group, unsigned short int element) |
| int | dcmAddItem (DCMFILE *dcm, DCMITEM *d, short int aschild, DCMTAG tag, dcmvr vr, unsigned int vl, char *rd, const int verbose) |
| int | dcmTagIntRange (DCMITEM *d, DCMTAG *tag, int *mi, int *ma, const int verbose) |
Processing DICOM data structs.
Definition in file dcmdata.c.
| int dcmAddItem | ( | DCMFILE * | dcm, |
| DCMITEM * | d, | ||
| short int | aschild, | ||
| DCMTAG | tag, | ||
| dcmvr | vr, | ||
| unsigned int | vl, | ||
| char * | rd, | ||
| const int | verbose ) |
Add an item to DCMFILE data struct.
| dcm | Pointer to DCMFILE. |
| d | Pointer to a previous item in DCMFILE, into which to link this item; enter NULL to add as next item to the highest level. |
| aschild | Add as child; 1=yes, 0=no. |
| tag | Tag |
| vr | VR |
| vl | VL; enter 0xFFFFFFFF to use VR's default length. |
| rd | Pointer to the item value as byte array |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 501 of file dcmdata.c.
Referenced by imgWriteDICOM().
| void dcmfileFree | ( | DCMFILE * | d | ) |
Free memory allocated for DCMFILE data. All contents are destroyed.
| d | Pointer to DCMFILE. |
Definition at line 67 of file dcmdata.c.
Referenced by dcmFileList(), dcmFileRead(), dcmMListRead(), imgReadDICOM(), and imgWriteDICOM().
| void dcmfileInit | ( | DCMFILE * | d | ) |
Initiate the DCMFILE struct before any use.
| d | Pointer to DCMFILE. |
Definition at line 22 of file dcmdata.c.
Referenced by dcmfileFree(), dcmFileList(), dcmMListRead(), imgReadDICOM(), and imgWriteDICOM().
| unsigned short int dcmfileMaxDepth | ( | DCMFILE * | df | ) |
Get the maximum depth of DCMFILE items tree.
| df | Pointer to DCMFILE item. |
Definition at line 102 of file dcmdata.c.
Search for specified tag in DCMITEM data tree, but only downward.
| d | Pointer to current DICOM item. |
| omit | Omit this item from the search. |
| tag | Pointer to the DICOM tag that is searched for. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 428 of file dcmdata.c.
Referenced by dcmFindDownTag(), dcmFindTag(), dcmImgIsotope(), dcmImgPos(), dcmImgPxlsize(), dcmMListRead(), and imgReadDICOM().
Search for specified tag in DCMITEM data tree, from left to right, down and up.
| d | Pointer to current DICOM item. |
| omit | Omit this item from the search. |
| tag | Pointer to the DICOM tag that is searched for. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 375 of file dcmdata.c.
Referenced by dcmFileList(), dcmFindTag(), dcmImgDim(), dcmImgIsotope(), dcmImgOrient(), dcmImgPos(), dcmImgPxlsize(), dcmMListRead(), dcmSameImage(), dcmTagIntRange(), and imgReadDICOM().
| void dcmitemFree | ( | DCMITEM * | d | ) |
Recursively free memory allocated for DCMITEM items and their children items.
| d | Pointer to DCMITEM. |
Definition at line 39 of file dcmdata.c.
Referenced by dcmfileFree(), and dcmitemFree().
| long int dcmitemGetInt | ( | DCMITEM * | d | ) |
Read integer value from given DICOM item.
VR must be either UL, US, SL, SS, or IS; otherwise 0 is returned.
| d | Pointer to item. |
Definition at line 295 of file dcmdata.c.
Referenced by dcmImgDim(), dcmImgPos(), dcmMListRead(), dcmSameImage(), dcmTagIntRange(), and imgReadDICOM().
| double dcmitemGetReal | ( | DCMITEM * | d | ) |
Read floating point value from given DICOM item.
VR must be either FL, FD, DS, UL, US, SL, SS, or IS; otherwise 0 is returned.
| d | Pointer to item. |
Definition at line 331 of file dcmdata.c.
Referenced by dcmImgPxlsize(), dcmMListRead(), and imgReadDICOM().
| unsigned short int dcmitemMaxDepth | ( | DCMITEM * | d | ) |
Get the maximum depth of DCMITEM tree.
| d | Pointer to DCMITEM item. |
Definition at line 83 of file dcmdata.c.
Referenced by dcmfileMaxDepth(), and dcmitemMaxDepth().
| unsigned short int dcmitemParentNr | ( | DCMITEM * | d | ) |
Check how deep in DCMITEM tree this item is.
| d | Pointer to DCMITEM. |
Definition at line 122 of file dcmdata.c.
Referenced by dcmFileReadNextElement().
| void dcmitemPrint | ( | DCMITEM * | d | ) |
Print contents of given DICOM item into stdout.
| d | Pointer to item. |
Definition at line 467 of file dcmdata.c.
Referenced by dcmAddItem(), dcmFileWrite(), dcmMListRead(), and imgReadDICOM().
Search the range of integer values for specified tag in DCMITEM data tree.
| d | Pointer to top DICOM item. |
| tag | Pointer to the DICOM tag that is searched for. |
| mi | Pointer to int where min value is written; NULL if not needed. |
| ma | Pointer to int where max value is written; NULL if not needed. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 631 of file dcmdata.c.
Referenced by dcmImgDim(), and dcmMListRead().
| void dcmTagSet | ( | DCMTAG * | tag, |
| unsigned short int | group, | ||
| unsigned short int | element ) |
Set DICOM Tag group and element.
| tag | Pointer to Tag to set. |
| group | Tag Group |
| element | Tag Element |
Definition at line 483 of file dcmdata.c.
Referenced by dcmFileList(), dcmImgDim(), dcmImgIsotope(), dcmImgOrient(), dcmImgPos(), dcmImgPxlsize(), dcmSameImage(), imgReadDICOM(), and imgWriteDICOM().
| char * dcmValueString | ( | DCMITEM * | d | ) |
Pre-process the DICOM element value into format suitable for printing.
Attribute tag
Float
Double
Unsigned 32-bit int
Unsigned 16-bit int
Signed 32-bit int
Signed 16-bit int
| d | Pointer to item containing the value to print. |
Definition at line 141 of file dcmdata.c.
Referenced by dcmFileReadNextElement(), dcmImgIsotope(), dcmImgOrient(), dcmImgPos(), dcmImgPxlsize(), dcmitemPrint(), dcmMListRead(), and imgReadDICOM().