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: DSRWaveformChannelItem, DSRWaveformChannelList 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:33 $ 00023 * CVS/RCS Revision: $Revision: 1.16 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 00031 #ifndef DSRWAVCH_H 00032 #define DSRWAVCH_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 DSRWaveformChannelItem 00047 { 00048 public: 00049 00054 DSRWaveformChannelItem(const Uint16 multiplexGroupNumber = 0, 00055 const Uint16 channelNumber = 0) 00056 : MultiplexGroupNumber(multiplexGroupNumber), 00057 ChannelNumber(channelNumber) 00058 { 00059 } 00060 00065 inline OFBool operator==(const DSRWaveformChannelItem &item) const 00066 { 00067 return (item.MultiplexGroupNumber == MultiplexGroupNumber) && (item.ChannelNumber == ChannelNumber); 00068 } 00069 00074 inline OFBool operator!=(const DSRWaveformChannelItem &item) const 00075 { 00076 return (item.MultiplexGroupNumber != MultiplexGroupNumber) || (item.ChannelNumber != ChannelNumber); 00077 } 00078 00083 inline OFBool operator<(const DSRWaveformChannelItem &item) const 00084 { 00085 return (ChannelNumber < item.ChannelNumber) || ((ChannelNumber == item.ChannelNumber) && (MultiplexGroupNumber < item.MultiplexGroupNumber)); 00086 } 00087 00092 inline OFBool operator>(const DSRWaveformChannelItem &item) const 00093 { 00094 return (ChannelNumber > item.ChannelNumber) || ((ChannelNumber == item.ChannelNumber) && (MultiplexGroupNumber > item.MultiplexGroupNumber)); 00095 } 00096 00097 /* copy constructor and assignment operator are defined implicitly */ 00098 00100 Uint16 MultiplexGroupNumber; 00102 Uint16 ChannelNumber; 00103 }; 00104 00105 00108 class DSRWaveformChannelList 00109 : public DSRListOfItems<DSRWaveformChannelItem> 00110 { 00111 00112 public: 00113 00116 DSRWaveformChannelList(); 00117 00121 DSRWaveformChannelList(const DSRWaveformChannelList &lst); 00122 00125 virtual ~DSRWaveformChannelList(); 00126 00131 DSRWaveformChannelList &operator=(const DSRWaveformChannelList &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 00163 OFBool isElement(const Uint16 multiplexGroupNumber, 00164 const Uint16 channelNumber) const; 00165 00172 OFCondition getItem(const size_t idx, 00173 Uint16 &multiplexGroupNumber, 00174 Uint16 &channelNumber) const; 00175 00180 void addItem(const Uint16 multiplexGroupNumber, 00181 const Uint16 channelNumber); 00182 00189 OFCondition putString(const char *stringValue); 00190 }; 00191 00192 00193 #endif 00194 00195 00196 /* 00197 * CVS/RCS Log: 00198 * $Log: dsrwavch.h,v $ 00199 * Revision 1.16 2010-10-14 13:16:33 joergr 00200 * Updated copyright header. Added reference to COPYRIGHT file. 00201 * 00202 * Revision 1.15 2009-10-13 14:57:50 uli 00203 * Switched to logging mechanism provided by the "new" oflog module. 00204 * 00205 * Revision 1.14 2007-11-15 16:33:19 joergr 00206 * Fixed coding style to be more consistent. 00207 * 00208 * Revision 1.13 2006/08/15 16:40:03 meichel 00209 * Updated the code in module dcmsr to correctly compile when 00210 * all standard C++ classes remain in namespace std. 00211 * 00212 * Revision 1.12 2005/12/08 16:05:32 meichel 00213 * Changed include path schema for all DCMTK header files 00214 * 00215 * Revision 1.11 2003/08/07 13:06:29 joergr 00216 * Added new putString() method. 00217 * 00218 * Revision 1.10 2003/06/04 12:33:13 meichel 00219 * Added comparison operators, needed by MSVC5 with STL 00220 * 00221 * Revision 1.9 2003/06/03 10:16:44 meichel 00222 * Renamed local variables to avoid name clashes with STL 00223 * 00224 * Revision 1.8 2001/09/26 13:04:15 meichel 00225 * Adapted dcmsr to class OFCondition 00226 * 00227 * Revision 1.7 2001/05/07 16:13:24 joergr 00228 * Updated CVS header. 00229 * 00230 * Revision 1.6 2001/01/25 11:48:44 joergr 00231 * Corrected typos / enhanced comments. 00232 * 00233 * Revision 1.5 2000/11/06 11:21:26 joergr 00234 * Added parameter to print() method specifying the item separator character. 00235 * 00236 * Revision 1.4 2000/11/01 16:22:57 joergr 00237 * Updated comments/formatting. 00238 * 00239 * Revision 1.3 2000/10/18 17:10:51 joergr 00240 * Added doc++ comments. 00241 * 00242 * Revision 1.2 2000/10/16 11:52:29 joergr 00243 * Added new method checking whether a waveform content item applies to a 00244 * certain channel. 00245 * 00246 * Revision 1.1 2000/10/13 07:49:36 joergr 00247 * Added new module 'dcmsr' providing access to DICOM structured reporting 00248 * documents (supplement 23). Doc++ documentation not yet completed. 00249 * 00250 * 00251 */