5#include "tpcclibConfig.h"
21typedef struct DCM_VR {
41static DCM_VR dcm_vr[]={
42 {
DCM_VR_AE,
"AE", 0, 0, 16,
"application entity"},
44 {
DCM_VR_AT,
"AT", 0, 0, 4,
"attribute tag"},
45 {
DCM_VR_CS,
"CS", 0, 0, 16,
"code string"},
47 {
DCM_VR_DS,
"DS", 0, 0, 16,
"decimal string"},
48 {
DCM_VR_DT,
"DT", 0, 0, 26,
"date and time"},
49 {
DCM_VR_FL,
"FL", 0, 1, 4,
"floating point single precision"},
50 {
DCM_VR_FD,
"FD", 0, 1, 8,
"floating point double precision"},
51 {
DCM_VR_IS,
"IS", 0, 0, 12,
"integer string"},
52 {
DCM_VR_LO,
"LO", 0, 0, 64,
"long string"},
53 {
DCM_VR_LT,
"LT", 0, 0, 10240,
"long text"},
54 {
DCM_VR_OB,
"OB", 2, 0, 0,
"other byte (8-bit) stream"},
55 {
DCM_VR_OD,
"OD", 2, 1, 0,
"other double (64-bit) stream"},
56 {
DCM_VR_OF,
"OF", 2, 1, 0,
"other float (32-bit) stream"},
57 {
DCM_VR_OL,
"OL", 2, 1, 0,
"other long (32-bit) stream"},
58 {
DCM_VR_OW,
"OW", 2, 1, 0,
"other word (16-bit) stream"},
59 {
DCM_VR_PN,
"PN", 0, 0, 64,
"person name"},
60 {
DCM_VR_SH,
"SH", 0, 0, 16,
"short string"},
61 {
DCM_VR_SL,
"SL", 0, 1, 4,
"signed long (32-bit integer)"},
62 {
DCM_VR_SQ,
"SQ", 2, 0, 0,
"sequence of elements (used for nested data)"},
63 {
DCM_VR_SS,
"SS", 0, 1, 2,
"signed short (16-bit integer)"},
64 {
DCM_VR_ST,
"ST", 0, 0, 1024,
"short text"},
66 {
DCM_VR_UC,
"UC", 2, 0, 0,
"unlimited characters"},
68 {
DCM_VR_UL,
"UL", 0, 1, 4,
"unsigned long (32-bit integer)"},
69 {
DCM_VR_UN,
"UN", 2, 0, 0,
"unknown, any valid length of another VR"},
70 {
DCM_VR_UR,
"UR", 2, 0, 64,
"URI or URL string"},
71 {
DCM_VR_US,
"US", 0, 1, 2,
"unsigned short (16-bit integer)"},
72 {
DCM_VR_UT,
"UT", 2, 0, 0,
"unlimited text"},
74 {
DCM_VR_INVALID,
"INVALID", 0, 0, 0,
"invalid value representation"}
89 unsigned short int i=0;
91 if(
id==dcm_vr[i].vr)
return(dcm_vr[i].res);
109 char buf[3]; buf[0]=s[0]; buf[1]=s[1]; buf[2]=(char)0;
112 unsigned short int i=0;
114 if(strncmp(dcm_vr[i].name, buf, 2)==0)
return(dcm_vr[i].vr);
130 unsigned short int i=0;
132 if(
id==dcm_vr[i].vr)
return(dcm_vr[i].name);
148 unsigned short int i=0;
150 if(
id==dcm_vr[i].vr)
return(dcm_vr[i].s);
166 unsigned short int i=0;
168 if(
id==dcm_vr[i].vr)
return(dcm_vr[i].descr);
186 if(orig==NULL || intl==NULL)
return(NULL);
187 if(
strnlen(orig, 10)<8)
return(NULL);
188 if(isdigit(orig[4])) {
189 sprintf(intl,
"%4.4s-%2.2s-%2.2s", orig, orig+4, orig+6);
191 sprintf(intl,
"%4.4s-%2.2s-%2.2s", orig, orig+5, orig+8);
209 if(orig==NULL || intl==NULL)
return(NULL);
210 if(
strnlen(orig, 14)<6)
return(NULL);
211 if(isdigit(orig[2])) {
212 sprintf(intl,
"%2.2s:%2.2s:%2.2s", orig, orig+2, orig+4);
214 sprintf(intl,
"%2.2s:%2.2s:%2.2s", orig, orig+3, orig+6);
233 if(orig==NULL || intl==NULL)
return(NULL);
234 if(
strnlen(orig, 26)<14)
return(NULL);
235 sprintf(intl,
"%4.4s-%2.2s-%2.2s %2.2s:%2.2s:%2.2s",
236 orig, orig+4, orig+6, orig+8, orig+10, orig+12);
int strDateValid(const char *str)
int strTimeValid(const char *str)
int strDateTimeValid(const char *str, char *intdate)
unsigned char dcmVRReserved(dcmvr id)
size_t dcmVRVLength(dcmvr id)
dcmvr dcmVRId(const char *s)
char * dcmDT2intl(const char *orig, char *intl)
char * dcmDA2intl(const char *orig, char *intl)
char * dcmTM2intl(const char *orig, char *intl)
char * dcmVRName(dcmvr id)
char * dcmVRDescr(dcmvr id)
size_t strnlen(const char *s, size_t n)
Header file for libtpcdcm.
@ DCM_VR_INVALID
Invalid DICOM value representation.
@ DCM_VR_DT
DICOM date time, max 26 bytes.
@ DCM_VR_UI
DICOM unique identifier (UID), max 64 bytes.
@ DCM_VR_FD
DICOM floating point double precision, 8 bytes fixed.
@ DCM_VR_UC
DICOM unlimited characters.
@ DCM_VR_PN
DICOM person name, max 64 chars per component group.
@ DCM_VR_CS
DICOM code (control) string, max 16 bytes.
@ DCM_VR_SS
DICOM signed short (16-bit integer), 2 bytes fixed.
@ DCM_VR_SH
DICOM short string, max 16 chars.
@ DCM_VR_OF
DICOM other float (32-bit) stream, endian sensitive.
@ DCM_VR_UT
DICOM unlimited text, character string.
@ DCM_VR_US
DICOM unsigned short (16-bit) integer, 2 bytes fixed.
@ DCM_VR_TM
DICOM time HHMMSS.FFFFFF, max 14 bytes.
@ DCM_VR_OB
DICOM other byte string, even bytes, endian insensitive.
@ DCM_VR_AS
DICOM age string, 4 bytes fixed.
@ DCM_VR_ST
DICOM short text, max 1024 chars.
@ DCM_VR_AT
DICOM attribute tag, 4 bytes fixed.
@ DCM_VR_LT
DICOM long text, max 10240 chars.
@ DCM_VR_DA
DICOM date in format YYYYMMDD, 8 bytes fixed.
@ DCM_VR_UL
DICOM unsigned long (32-bit) integer, 4 bytes fixed.
@ DCM_VR_UN
DICOM unknown, any valid length of another VR.
@ DCM_VR_DS
DICOM decimal string, max 16 bytes.
@ DCM_VR_OW
DICOM other word (16-bit) stream, even bytes, endian sensitive.
@ DCM_VR_IS
DICOM integer string, max 12 bytes.
@ DCM_VR_AE
DICOM application entity, max 16 bytes.
@ DCM_VR_UR
DICOM URI or URL, string of characters.
@ DCM_VR_LO
DICOM long string, max 64 chars.
@ DCM_VR_SQ
DICOM sequence of zero or more elements (used for nested data).
@ DCM_VR_FL
DICOM floating point single precision, 4 bytes fixed.
@ DCM_VR_SL
DICOM signed long (32-bit integer), 4 bytes fixed.
@ DCM_VR_OL
DICOM other long (32-bit) stream, endian sensitive.
@ DCM_VR_OD
DICOM other double (64-bit) stream, endian sensitive.
Header file for library libtpcextensions.