📄 dicom_objects.h
字号:
/* Copyright (C) 1993, 1994, RSNA and Washington University The software and supporting documentation for the Radiological Society of North America (RSNA) 1993, 1994 Digital Imaging and Communications in Medicine (DICOM) Demonstration were developed at the Electronic Radiology Laboratory Mallinckrodt Institute of Radiology Washington University School of Medicine 510 S. Kingshighway Blvd. St. Louis, MO 63110 as part of the 1993, 1994 DICOM Central Test Node project for, and under contract with, the Radiological Society of North America. THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH THE USER. Copyright of the software and supporting documentation is jointly owned by RSNA and Washington University, and free access is hereby granted as a license to use this software, copy this software and prepare derivative works based upon this software. However, any distribution of this software source code or supporting documentation or derivative works (source code and supporting documentation) must include the three paragraphs of the copyright notice.*//* Copyright marker. Copyright will be inserted above. Do not remove *//*** DICOM 93** Electronic Radiology Laboratory** Mallinckrodt Institute of Radiology** Washington University School of Medicine**** Module Name(s):** Author, Date: Stephen M. Moore, 22-Apr-93** Intent: This file contains definitions and function prototypes** for the OBJECT facility which allows the user to** manipulate DICOM Objects.** Last Update: $Author: smm $, $Date: 2001/02/16 16:27:39 $** Source File: $RCSfile: dicom_objects.h,v $** Revision: $Revision: 1.94 $** Status: $State: Exp $*/#ifndef DCM_OBJECTS_IS_IN#define DCM_OBJECTS_IS_IN 1#ifdef __cplusplusextern "C" {#endiftypedef void *DCM_OBJECT;typedef enum { DCM_AE, /* Application Entity */ DCM_AS, /* Age string */ DCM_AT, /* Attribute tag */ DCM_CS, /* Control string */ DCM_DA, /* Date */ DCM_DD, /* Data set */ DCM_DS, /* Decimal string */ DCM_FD, /* Floating double */ DCM_FL, /* Float */ DCM_IS, /* Integer string */ DCM_LO, /* Long string */ DCM_LT, /* Long text */ DCM_OT, /* Other binary value */ DCM_SH, /* Short string */ DCM_SL, /* Signed long */ DCM_SQ, /* Sequence of items */ DCM_SS, /* Signed short */ DCM_ST, /* Short text */ DCM_TM, /* Time */ DCM_UI, /* Unique identifier (UID) */ DCM_UL, /* Unsigned long */ DCM_UN, /* Unknown (DICOM Unknown) */ DCM_US, /* Unsigned short */ DCM_UNKNOWN, /* Unknown/unspecified (non-standard) */ DCM_RET, /* Retired */ DCM_CTX, /* Context sensitive (non-standard) */ DCM_PN, /* Person Name */ DCM_OB, /* Other, byte */ DCM_OW, /* Other, word */ DCM_DT, /* Date/Time */ DCM_DLM, /* Delimiter (non-standard) */ DCM_UT /* Unlimited text */} DCM_VALUEREPRESENTATION;typedef enum { DCM_OBJECTUNKNOWN, DCM_OBJECTCOMMAND, DCM_OBJECTIMAGE, DCM_OBJECTELEMENTLIST} DCM_OBJECTTYPE;#if LONGSIZE == 64typedef unsigned int DCM_TAG;#define DCM_MAKETAG(g, e) (((((unsigned int)(g)) << 16) & 0xffff0000) \| ((unsigned int)(e) & 0xffff))#elsetypedef unsigned long DCM_TAG;#define DCM_MAKETAG(g, e) (((((unsigned long)(g)) << 16) & 0xffff0000) \| ((unsigned long)(e) & 0xffff))#endif#define DCM_TAG_GROUP(t) (unsigned short) ((t) >> 16)#define DCM_TAG_ELEMENT(t) (unsigned short) ((t) & 0xffff)typedef struct { DCM_TAG tag; DCM_VALUEREPRESENTATION representation; char description[48]; unsigned long multiplicity; U32 length; union { char *string; char **stringArray; short *ss; S32 *sl; unsigned short *us; U32 *ul; void *ot; unsigned short *ow; unsigned char *ob; LST_HEAD *sq; DCM_TAG *at; } d;} DCM_ELEMENT;typedef struct { void *reserved[2]; DCM_ELEMENT e;} DCM_ELEMENT_NODE;typedef struct { void *reserved[2]; DCM_TAG tag;} DCM_TAG_NODE;typedef struct { DCM_ELEMENT e; long flag; long *flagAddress;} DCM_FLAGGED_ELEMENT;typedef struct { void *reserved[2]; DCM_OBJECT *object;} DCM_SEQUENCE_ITEM;#define DCM_PREAMBLELENGTH 128#define DCM_FILEMETA_IMPLEMENTATIONVERSIONNAME (1 << 0)#define DCM_FILEMETA_SOURCEAPPLICATIONENTITYTITLE (1 << 1)#define DCM_FILEMETA_PRIVATEINFORMATIONCREATORUID (1 << 2)#define DCM_FILEMETA_PRIVATEINFORMATION (1 << 3)typedef struct { long flag; unsigned char preamble[DCM_PREAMBLELENGTH]; unsigned char fileMetaInformationVersion[2]; char mediaStorageSOPClassUID[DICOM_UI_LENGTH + 1]; char mediaStorageSOPInstanceUID[DICOM_UI_LENGTH + 1]; char transferSyntaxUID[DICOM_UI_LENGTH + 1]; char implementationClassUID[DICOM_UI_LENGTH + 1]; char implementationVersionName[DICOM_SH_LENGTH + 1]; char sourceApplicationEntityTitle[DICOM_AE_LENGTH + 1]; char privateInformationCreatorUID[DICOM_UI_LENGTH + 1]; unsigned char *privateInformation; unsigned long privateInformationLength;} DCM_FILE_META;#define DCM_ORDERMASK 0x7f#define DCM_ORDERNATIVE 0x01#define DCM_ORDERLITTLEENDIAN 0x02#define DCM_ORDERBIGENDIAN 0x03#define DCM_EXPLICITLITTLEENDIAN 0x04#define DCM_EXPLICITBIGENDIAN 0x05#define DCM_FILEFORMATMASK 0x80#define DCM_PART10FILE 0x80#define DCM_CONVERTMASK 0x100#define DCM_FORMATCONVERSION 0x100#define DCM_DELETEMASK 0x200#define DCM_DELETEONCLOSE 0x200#define DCM_GROUPLENGTHMASK 0x400#define DCM_NOGROUPLENGTH 0x400#define DCM_SEQUENCELENGTHMASK 0x800#define DCM_UNSPECIFIEDLENGTHFLAG 0x800#define DCM_LENGTHTOENDMASK 0x1000#define DCM_USELENGTHTOEND 0x1000/* These bits allow us to modify the file name during the open** to map from upper to lower case and \ to / to allow compatibility** between Unix filenames and Win filenames.*/#define DCM_FILENAMEMASK 0x2000#define DCM_TRYFILENAMECHANGE 0x2000/* These bits allow us to accept objects with explicit VR with improper** VRs (according to our dictionary). Examples are people who send** a VR of US when we expect SS.*/#define DCM_VRMASK 0x4000#define DCM_ACCEPTVRMISMATCH 0x4000#define DCM_SPECIALFORMATMASK 0x8000#define DCM_EFILM 0x8000/* Define prototypes for functions provided by this facility.*/CONDITION DCM_OpenFile(const char *name, unsigned long opt, DCM_OBJECT ** object);CONDITION DCM_CreateObject(DCM_OBJECT ** obj, unsigned long opt);CONDITION DCM_CopyObject(DCM_OBJECT ** src, DCM_OBJECT** dst);CONDITION DCM_MergeObject(DCM_OBJECT ** src, DCM_OBJECT** dst);CONDITION DCM_AddElement(DCM_OBJECT ** obj, DCM_ELEMENT * ele);CONDITION DCM_AddSequenceElement(DCM_OBJECT ** obj, DCM_ELEMENT * ele);CONDITION DCM_RemoveElement(DCM_OBJECT ** obj, DCM_TAG tag);CONDITION DCM_RemoveGroup(DCM_OBJECT ** callerObject, unsigned short group);CONDITIONDCM_ImportStream(unsigned char *buf, unsigned long length, unsigned long opt, DCM_OBJECT ** rntObj);CONDITIONDCM_ReadStream(DCM_OBJECT ** obj, unsigned long opt, long size, void *ctx, CONDITION(*rd) (void *ctx, void *buf, int toRead, int *bytesRead),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -