OFFIS DCMTK  Version 3.6.0
dsrscogr.h
1 /*
2  *
3  * Copyright (C) 2000-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmsr
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose:
19  * classes: DSRGraphicDataItem, DSRGraphicDataList
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:33 $
23  * CVS/RCS Revision: $Revision: 1.15 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 
31 #ifndef DSRSCOGR_H
32 #define DSRSCOGR_H
33 
34 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
35 
36 #include "dcmtk/dcmsr/dsrtypes.h"
37 #include "dcmtk/dcmsr/dsrtlist.h"
38 
39 
40 /*---------------------*
41  * class declaration *
42  *---------------------*/
43 
47 {
48  public:
49 
54  DSRGraphicDataItem(const Float32 column = 0,
55  const Float32 row = 0)
56  : Column(column),
57  Row(row)
58  {
59  }
60 
65  inline OFBool operator==(const DSRGraphicDataItem &item) const
66  {
67  return (item.Column == Column) && (item.Row == Row);
68  }
69 
74  inline OFBool operator!=(const DSRGraphicDataItem &item) const
75  {
76  return (item.Column != Column) || (item.Row != Row);
77  }
78 
83  inline OFBool operator<(const DSRGraphicDataItem &item) const
84  {
85  return (Row < item.Row) || ((Row == item.Row) && (Column < item.Column));
86  }
87 
92  inline OFBool operator>(const DSRGraphicDataItem &item) const
93  {
94  return (Row > item.Row) || ((Row == item.Row) && (Column > item.Column));
95  }
96 
97  /* copy constructor and assignment operator are defined implicitly */
98 
100  Float32 Column;
102  Float32 Row;
103 };
104 
105 
109  : public DSRListOfItems<DSRGraphicDataItem>
110 {
111 
112  public:
113 
117 
122 
125  virtual ~DSRGraphicDataList();
126 
132 
141  OFCondition print(STD_NAMESPACE ostream &stream,
142  const size_t flags = 0,
143  const char pairSeparator = '/',
144  const char itemSeparator = ',') const;
145 
150  OFCondition read(DcmItem &dataset);
151 
156  OFCondition write(DcmItem &dataset) const;
157 
162  const DSRGraphicDataItem &getItem(const size_t idx) const;
163 
170  OFCondition getItem(const size_t idx,
171  Float32 &column,
172  Float32 &row) const;
173 
178  void addItem(const Float32 column,
179  const Float32 row);
180 
187  OFCondition putString(const char *stringValue);
188 };
189 
190 
191 #endif
192 
193 
194 /*
195  * CVS/RCS Log:
196  * $Log: dsrscogr.h,v $
197  * Revision 1.15 2010-10-14 13:16:33 joergr
198  * Updated copyright header. Added reference to COPYRIGHT file.
199  *
200  * Revision 1.14 2009-10-13 14:57:50 uli
201  * Switched to logging mechanism provided by the "new" oflog module.
202  *
203  * Revision 1.13 2007-11-15 16:33:19 joergr
204  * Fixed coding style to be more consistent.
205  *
206  * Revision 1.12 2006/08/15 16:40:03 meichel
207  * Updated the code in module dcmsr to correctly compile when
208  * all standard C++ classes remain in namespace std.
209  *
210  * Revision 1.11 2005/12/08 16:05:15 meichel
211  * Changed include path schema for all DCMTK header files
212  *
213  * Revision 1.10 2003/08/07 12:45:38 joergr
214  * Added new putString() method.
215  *
216  * Revision 1.9 2003/06/04 12:33:13 meichel
217  * Added comparison operators, needed by MSVC5 with STL
218  *
219  * Revision 1.8 2003/06/03 10:16:44 meichel
220  * Renamed local variables to avoid name clashes with STL
221  *
222  * Revision 1.7 2001/09/26 13:04:10 meichel
223  * Adapted dcmsr to class OFCondition
224  *
225  * Revision 1.6 2001/05/07 16:13:24 joergr
226  * Updated CVS header.
227  *
228  * Revision 1.5 2001/01/25 11:48:44 joergr
229  * Corrected typos / enhanced comments.
230  *
231  * Revision 1.4 2000/11/06 11:31:04 joergr
232  * Added parameter to print() method specifying the item separator character.
233  *
234  * Revision 1.3 2000/11/01 16:21:16 joergr
235  * Updated comments/formatting.
236  *
237  * Revision 1.2 2000/10/18 17:06:51 joergr
238  * Added doc++ comments.
239  *
240  * Revision 1.1 2000/10/13 07:49:31 joergr
241  * Added new module 'dcmsr' providing access to DICOM structured reporting
242  * documents (supplement 23). Doc++ documentation not yet completed.
243  *
244  *
245  */
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
Template class to store and access items in a list structure.
Definition: dsrtlist.h:49
virtual ~DSRGraphicDataList()
destructor
void addItem(const Float32 column, const Float32 row)
add value pair to the list
OFBool operator==(const DSRGraphicDataItem &item) const
comparison operator
Definition: dsrscogr.h:65
OFCondition write(DcmItem &dataset) const
write list of graphic data
Class for graphic data lists.
Definition: dsrscogr.h:108
OFBool operator!=(const DSRGraphicDataItem &item) const
comparison operator
Definition: dsrscogr.h:74
OFCondition print(STD_NAMESPACE ostream &stream, const size_t flags=0, const char pairSeparator= '/', const char itemSeparator= ',') const
print list of graphic data.
Class for graphic data items.
Definition: dsrscogr.h:46
const DSRGraphicDataItem & getItem(const size_t idx) const
get reference to the specified item
OFBool operator>(const DSRGraphicDataItem &item) const
comparison operator
Definition: dsrscogr.h:92
OFBool operator<(const DSRGraphicDataItem &item) const
comparison operator
Definition: dsrscogr.h:83
DSRGraphicDataList()
default constructor
Float32 Column
column value (VR=FL)
Definition: dsrscogr.h:100
OFCondition putString(const char *stringValue)
put list of graphic data as a string.
OFCondition read(DcmItem &dataset)
read list of graphic data
DSRGraphicDataList & operator=(const DSRGraphicDataList &lst)
assignment operator
Float32 Row
row value (VR=FL)
Definition: dsrscogr.h:102
DSRGraphicDataItem(const Float32 column=0, const Float32 row=0)
(default) constructor
Definition: dsrscogr.h:54
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Dec 28 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.8