dsrscogr.h

00001 /*
00002  *
00003  *  Copyright (C) 2000-2005, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module: dcmsr
00019  *
00020  *  Author: Joerg Riesmeier
00021  *
00022  *  Purpose:
00023  *    classes: DSRGraphicDataItem, DSRGraphicDataList
00024  *
00025  *  Last Update:      $Author: meichel $
00026  *  Update Date:      $Date: 2005/12/08 16:05:15 $
00027  *  CVS/RCS Revision: $Revision: 1.11 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 
00035 #ifndef DSRSCOGR_H
00036 #define DSRSCOGR_H
00037 
00038 #include "dcmtk/config/osconfig.h"   /* make sure OS specific configuration is included first */
00039 
00040 #include "dcmtk/dcmsr/dsrtypes.h"
00041 #include "dcmtk/dcmsr/dsrtlist.h"
00042 
00043 
00044 /*---------------------*
00045  *  class declaration  *
00046  *---------------------*/
00047 
00050 class DSRGraphicDataItem
00051 {
00052   public:
00053 
00058     DSRGraphicDataItem(const Float32 column = 0,
00059                        const Float32 row = 0)
00060       : Column(column),
00061         Row(row)
00062     {
00063     }
00064 
00069     inline OFBool operator==(const DSRGraphicDataItem &item) const
00070     {
00071         return (item.Column == Column) && (item.Row == Row);
00072     }
00073 
00078     inline OFBool operator!=(const DSRGraphicDataItem &item) const
00079     {
00080         return (item.Column != Column) || (item.Row != Row);
00081     }
00082 
00087     inline OFBool operator<(const DSRGraphicDataItem &item) const
00088     {
00089         return (Row < item.Row) || ((Row == item.Row) && (Column < item.Column));
00090     }
00091 
00096     inline OFBool operator>(const DSRGraphicDataItem &item) const
00097     {
00098         return (Row > item.Row) || ((Row == item.Row) && (Column > item.Column));
00099     }
00100 
00101     /* copy constructor and assignment operator are defined implicitly */
00102 
00104     Float32 Column;
00106     Float32 Row;
00107 };
00108 
00109 
00112 class DSRGraphicDataList
00113   : public DSRListOfItems<DSRGraphicDataItem>
00114 {
00115 
00116   public:
00117 
00120     DSRGraphicDataList();
00121 
00125     DSRGraphicDataList(const DSRGraphicDataList &lst);
00126 
00129     virtual ~DSRGraphicDataList();
00130 
00135     DSRGraphicDataList &operator=(const DSRGraphicDataList &lst);
00136 
00145     OFCondition print(ostream &stream,
00146                       const size_t flags = 0,
00147                       const char pairSeparator = '/',
00148                       const char itemSeparator = ',') const;
00149 
00155     OFCondition read(DcmItem &dataset,
00156                      OFConsole *logStream);
00157 
00163     OFCondition write(DcmItem &dataset,
00164                       OFConsole *logStream) const;
00165 
00170     const DSRGraphicDataItem &getItem(const size_t idx) const;
00171 
00178     OFCondition getItem(const size_t idx,
00179                         Float32 &column,
00180                         Float32 &row) const;
00181 
00186     void addItem(const Float32 column,
00187                  const Float32 row);
00188 
00195     OFCondition putString(const char *stringValue);
00196 };
00197 
00198 
00199 #endif
00200 
00201 
00202 /*
00203  *  CVS/RCS Log:
00204  *  $Log: dsrscogr.h,v $
00205  *  Revision 1.11  2005/12/08 16:05:15  meichel
00206  *  Changed include path schema for all DCMTK header files
00207  *
00208  *  Revision 1.10  2003/08/07 12:45:38  joergr
00209  *  Added new putString() method.
00210  *
00211  *  Revision 1.9  2003/06/04 12:33:13  meichel
00212  *  Added comparison operators, needed by MSVC5 with STL
00213  *
00214  *  Revision 1.8  2003/06/03 10:16:44  meichel
00215  *  Renamed local variables to avoid name clashes with STL
00216  *
00217  *  Revision 1.7  2001/09/26 13:04:10  meichel
00218  *  Adapted dcmsr to class OFCondition
00219  *
00220  *  Revision 1.6  2001/05/07 16:13:24  joergr
00221  *  Updated CVS header.
00222  *
00223  *  Revision 1.5  2001/01/25 11:48:44  joergr
00224  *  Corrected typos / enhanced comments.
00225  *
00226  *  Revision 1.4  2000/11/06 11:31:04  joergr
00227  *  Added parameter to print() method specifying the item separator character.
00228  *
00229  *  Revision 1.3  2000/11/01 16:21:16  joergr
00230  *  Updated comments/formatting.
00231  *
00232  *  Revision 1.2  2000/10/18 17:06:51  joergr
00233  *  Added doc++ comments.
00234  *
00235  *  Revision 1.1  2000/10/13 07:49:31  joergr
00236  *  Added new module 'dcmsr' providing access to DICOM structured reporting
00237  *  documents (supplement 23).  Doc++ documentation not yet completed.
00238  *
00239  *
00240  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5