1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
|
/********************************************************************************/
/* */
/* Papyrus 3 library. */
/* This library constitutes a DICOM file system which helps reading and writing */
/* DICOM files and DICOMDIR files. */
/* */
/* Copyright (C) 2004 - Service of Medical Informatics - */
/* University Hospitals of Geneva (HUG), Geneva, Switzerland */
/* */
/* This library is a free software; you can redistribute it and/or modify it */
/* under the terms of the GNU Lesser General Public License as published by the */
/* Free Software Foundation; either version 2.1 of the License, or */
/* (at your option) any later version. */
/* */
/* This library is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/* See the GNU Lesser General Public License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with this library; if not, write to */
/* the Free Software Foundation, Inc., */
/* 59 Temple Place, Suite 330, */
/* Boston, MA 02111-1307 USA */
/* */
/* You can contact us for more information at osiris@sim.hcuge.ch */
/* or by writing to Papyrus, */
/* Unite d'Imagerie Numerique / Service d'Informatique Medicale / HUG, */
/* 24, Micheli-du-Crest street, 1211 Geneva 14, Switzerland. */
/* */
/* The University Hopitals of Geneva, hereby disclaims all copyright interest */
/* in the library `Papyrus' (a library for reading and writing DICOM files). */
/* */
/* Geneva, april 2004 */
/* Antoine Geissbuhler, head of the Service of Medical Informatics, */
/* University Hospitals of Geneva, Switzerland */
/* */
/********************************************************************************/
/********************************************************************************/
/* */
/* Project : P A P Y R U S Toolkit */
/* File : PapyTypeDef3.h */
/* Function : contains the declarations of the constants, the enumerated */
/* types, the structures and the type definition for the */
/* PAPYRUS toolkit. */
/* Authors : Christian Girard */
/* */
/* History : 03.1996 version 3.3 */
/* 01.1999 version 3.6 */
/* 04.2001 version 3.7 */
/* 09.2001 version 3.7 on CVS */
/* 10.2001 version 3.71 MAJ Dicom par CHG */
/* */
/********************************************************************************/
#ifndef PapyTypeDef3H
#define PapyTypeDef3H
#include <stdio.h>
/* BEWARE : Mac must be defined only if we are on a Mac architecture. */
#ifndef unix
#ifndef hpux
#ifndef __alpha
#ifndef _WINDOWS
#ifndef Mac
#define Mac
#endif
#endif
#endif
#endif
#endif
#ifdef DLL
#ifdef WIN32
#define EXPORT
#define EXPORT32 __declspec (dllexport )
#define CALLINGCONV
#else /* WIN32 not defined */
#define EXPORT _export _far _pascal
#define EXPORT32
#define CALLINGCONV _far _pascal
#endif /* WIN32 */
#else /* DLL not defined */
#define EXPORT
#define EXPORT32
#define CALLINGCONV
#endif /* DLL */
/* --- constants needed by the file managers --- */
#ifndef SEEK_END
#define SEEK_END 2
#endif
#ifndef SEEK_CUR
#define SEEK_CUR 1
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
#ifdef unix
#define NULLFILE NULL
#else
#define NULLFILE -1
#endif
/* --- boolean definitions --- */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/* --- Constant definitions --- */
#ifndef _WINDOWS
#define kMax_file_open 100
#else
#define kMax_file_open 20 /* Limitation on the PCs to 20 open files... */
#endif
#define kMax_tmp_file 10000
#define kLength_length 12
#define kMax_overlay 0x601E /* overlay groups are from 0x6000 to 0x601E (even) */
#define kMax_UIN_overlay 0x6FFF /* UINOverlays are from 0x6001 to 0x6FFF (odd) */
/* --- basic types definitions --- */
/* will ensure cross-plateform interoperability */
typedef unsigned char PapyUChar; /* 8 bits unsigned char */
typedef char PapyChar; /* 8 bits signed char */
typedef short PapyShort; /* 16 bits short int */
typedef unsigned short PapyUShort; /* 16 bits unsigned short int */
#ifdef __alpha
typedef int PapyLong; /* 32 bits long int */
typedef unsigned int PapyULong; /* 32 bits unsigned long int */
#else
typedef long PapyLong; /* 32 bits long int */
typedef unsigned long PapyULong; /* 32 bits unsigned long int */
#endif
typedef float PapyFloat; /* 32 bits float */
typedef double PapyFloatDouble; /* 64 bits float double */
#ifdef Mac
typedef PapyShort PAPY_FILE; /* the pointer to a PAPYRUS file */
#else
#ifdef _WINDOWS
typedef int PAPY_FILE; /* Windows file handle */
#else /* unix */
typedef FILE * PAPY_FILE; /* ANSI FILE pointer */
#endif /* _WINDOWS */
#endif /* Mac */
/* --- Enumerated types --- */
/* Definition of the DICOM transfert syntaxes */
enum ETransf_Syntax {LITTLE_ENDIAN_IMPL, LITTLE_ENDIAN_EXPL, BIG_ENDIAN_EXPL};
/* The type of the file */
enum EFile_Type {DICOM10, PAPYRUS3, DICOM_NOT10, DICOMDIR, PAPYRUS2, other};
/* Definition of the different compression used */
enum EPap_Compression {NONE, JPEG_LOSSLESS, JPEG_LOSSY, RLE, MAYO_WAVELET};
/* Definition of the photometric interpretation */
enum EPhoto_Interpret {MONOCHROME1, MONOCHROME2, PALETTE, RGB, HSV, ARGB, CMYK,
YBR_FULL, YBR_FULL_422, YBR_PARTIAL_422};
enum EDataSet_Image {DataSetID, ImageID};
/* enumeration of the different imaging modalities */
enum EModality {CR_IM, CT_IM, MR_IM, NM_IM, US_IM, US_MF_IM, SEC_CAPT_IM,
DX_IM, MG_IM, IO_IM, PX_IM, RF_IM, PET_IM, VLE_IM, VLM_IM,
VLS_IM, VLP_IM, MFSBSC_IM, MFGBSC_IM, MFGWSC_IM, MFTCSC_IM,
END_MODALITY};
/* is the module mandatory, conditional or user optional for a given modality ? */
enum EUsage {M, C, U};
/* the different value representation defined in DICOM */
enum EV_R_T {AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OW,
PN, SH, SL, SQ, SS, ST, TM, UI, UL, UN, USS, UT, RET};
/* the DICOM defined types for the elements */
enum EType_T {T1, T1C, T2, T2C, T3};
/* what kind of Object is it ? */
enum EKind_Obj {papItem, papModule, papGroup, papTmpFile, papRecord};
/* enum needed by UINOverlays */
enum E_ROI {RECTANGLE, ANNOTATION, GRAPHIC};
enum E_Font {TIMES, HELVETICA};
enum E_Style {NORMAL, BOLD, ITALIC, BOLDITALIC};
enum E_Color {WHITE, BLACK, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW};
/* Not used in the toolkit:
enum E_Editable {EDIT, FIXED};
enum E_Opacity {NONE, OPAQUE, TRANSPARENT};
enum E_Shape {MASK, RECT, ELLIPSE, POLY}; was FOR
*/
/* --- Structures and type definitions --- */
struct SPapy_List_;
typedef union UValue_T_
{
PapyShort ss; /* SS */
PapyUShort us; /* US, AT */
PapyUShort * ow; /* OW */
PapyLong sl; /* SL */
PapyULong ul; /* UL */
PapyFloat fl; /* FL */
PapyFloatDouble fd; /* FD */
char * a; /* AE, AS, CS, DA, DS, DT, IS, LO, LT, OB, PN, SH, ST, TM, UI, UN, UT */
struct SPapy_List_ *sq; /* SQ */
} UValue_T;
typedef struct SElement_ /* structure of an element */
{
PapyUShort group;
PapyUShort element;
PapyULong length;
enum EV_R_T vr; /* Value Representation */
char *vm; /* Value Multiplicity */
enum EType_T type_t; /* EType_T (mandatory, cond., optional) */
PapyULong nb_val;
UValue_T *value;
} SElement;
typedef struct SGroup_ /* assigns a number for each group */
{
PapyUShort number;
PapyULong size;
} SGroup;
typedef struct SShadowOwner_ /* keep the allowed elements of the shadow-groups */
{
char *str_value;
} SShadowOwner;
typedef struct SImageList_ /* keeps references to images */
{
PapyShort file; /* the reference to the file */
PapyShort image; /* the number of the image */
} SImageList;
/* --- types specific to PAPYRUS 3 --- */
typedef SElement Module; /* the Module is defined the same way as an SElement */
typedef SElement Record; /* the Record is defined the same way as an SElement */
typedef struct SObject_ /* the Object can be either a ... */
{
enum EKind_Obj whoAmI; /* what kind of object is it ? */
int objID; /* only way to identify a group or a module */
struct SPapy_List_ *item;
Module *module;
SElement *group;
Record *record;
PapyULong tmpFileLength; /* the length of the temporary file */
void *file; /* will store tmp file */
} Object;
struct SPapy_List_
{
Object *object;
struct SPapy_List_ *next;
};
typedef struct SPapy_List_ Papy_List;
typedef Papy_List Item;
typedef Papy_List Sequence;
typedef struct SData_Set_
{
int moduleName;
int usage; /*enum EUsage usage;*/
} Data_Set;
#endif /* PapyTypeDef3H */
|