00001 /* 00002 * 00003 * Copyright (C) 2000-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmsr 00015 * 00016 * Author: Joerg Riesmeier 00017 * 00018 * Purpose: 00019 * classes: DSRGraphicDataItem, DSRGraphicDataList 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:33 $ 00023 * CVS/RCS Revision: $Revision: 1.15 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 00031 #ifndef DSRSCOGR_H 00032 #define DSRSCOGR_H 00033 00034 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00035 00036 #include "dcmtk/dcmsr/dsrtypes.h" 00037 #include "dcmtk/dcmsr/dsrtlist.h" 00038 00039 00040 /*---------------------* 00041 * class declaration * 00042 *---------------------*/ 00043 00046 class DSRGraphicDataItem 00047 { 00048 public: 00049 00054 DSRGraphicDataItem(const Float32 column = 0, 00055 const Float32 row = 0) 00056 : Column(column), 00057 Row(row) 00058 { 00059 } 00060 00065 inline OFBool operator==(const DSRGraphicDataItem &item) const 00066 { 00067 return (item.Column == Column) && (item.Row == Row); 00068 } 00069 00074 inline OFBool operator!=(const DSRGraphicDataItem &item) const 00075 { 00076 return (item.Column != Column) || (item.Row != Row); 00077 } 00078 00083 inline OFBool operator<(const DSRGraphicDataItem &item) const 00084 { 00085 return (Row < item.Row) || ((Row == item.Row) && (Column < item.Column)); 00086 } 00087 00092 inline OFBool operator>(const DSRGraphicDataItem &item) const 00093 { 00094 return (Row > item.Row) || ((Row == item.Row) && (Column > item.Column)); 00095 } 00096 00097 /* copy constructor and assignment operator are defined implicitly */ 00098 00100 Float32 Column; 00102 Float32 Row; 00103 }; 00104 00105 00108 class DSRGraphicDataList 00109 : public DSRListOfItems<DSRGraphicDataItem> 00110 { 00111 00112 public: 00113 00116 DSRGraphicDataList(); 00117 00121 DSRGraphicDataList(const DSRGraphicDataList &lst); 00122 00125 virtual ~DSRGraphicDataList(); 00126 00131 DSRGraphicDataList &operator=(const DSRGraphicDataList &lst); 00132 00141 OFCondition print(STD_NAMESPACE ostream &stream, 00142 const size_t flags = 0, 00143 const char pairSeparator = '/', 00144 const char itemSeparator = ',') const; 00145 00150 OFCondition read(DcmItem &dataset); 00151 00156 OFCondition write(DcmItem &dataset) const; 00157 00162 const DSRGraphicDataItem &getItem(const size_t idx) const; 00163 00170 OFCondition getItem(const size_t idx, 00171 Float32 &column, 00172 Float32 &row) const; 00173 00178 void addItem(const Float32 column, 00179 const Float32 row); 00180 00187 OFCondition putString(const char *stringValue); 00188 }; 00189 00190 00191 #endif 00192 00193 00194 /* 00195 * CVS/RCS Log: 00196 * $Log: dsrscogr.h,v $ 00197 * Revision 1.15 2010-10-14 13:16:33 joergr 00198 * Updated copyright header. Added reference to COPYRIGHT file. 00199 * 00200 * Revision 1.14 2009-10-13 14:57:50 uli 00201 * Switched to logging mechanism provided by the "new" oflog module. 00202 * 00203 * Revision 1.13 2007-11-15 16:33:19 joergr 00204 * Fixed coding style to be more consistent. 00205 * 00206 * Revision 1.12 2006/08/15 16:40:03 meichel 00207 * Updated the code in module dcmsr to correctly compile when 00208 * all standard C++ classes remain in namespace std. 00209 * 00210 * Revision 1.11 2005/12/08 16:05:15 meichel 00211 * Changed include path schema for all DCMTK header files 00212 * 00213 * Revision 1.10 2003/08/07 12:45:38 joergr 00214 * Added new putString() method. 00215 * 00216 * Revision 1.9 2003/06/04 12:33:13 meichel 00217 * Added comparison operators, needed by MSVC5 with STL 00218 * 00219 * Revision 1.8 2003/06/03 10:16:44 meichel 00220 * Renamed local variables to avoid name clashes with STL 00221 * 00222 * Revision 1.7 2001/09/26 13:04:10 meichel 00223 * Adapted dcmsr to class OFCondition 00224 * 00225 * Revision 1.6 2001/05/07 16:13:24 joergr 00226 * Updated CVS header. 00227 * 00228 * Revision 1.5 2001/01/25 11:48:44 joergr 00229 * Corrected typos / enhanced comments. 00230 * 00231 * Revision 1.4 2000/11/06 11:31:04 joergr 00232 * Added parameter to print() method specifying the item separator character. 00233 * 00234 * Revision 1.3 2000/11/01 16:21:16 joergr 00235 * Updated comments/formatting. 00236 * 00237 * Revision 1.2 2000/10/18 17:06:51 joergr 00238 * Added doc++ comments. 00239 * 00240 * Revision 1.1 2000/10/13 07:49:31 joergr 00241 * Added new module 'dcmsr' providing access to DICOM structured reporting 00242 * documents (supplement 23). Doc++ documentation not yet completed. 00243 * 00244 * 00245 */