00001 /* 00002 * 00003 * Copyright (C) 1994-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: dcmdata 00015 * 00016 * Author: Gerd Ehlers, Andreas Barth 00017 * 00018 * Purpose: Interface of class DcmDecimalString 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-11-05 09:34:11 $ 00022 * CVS/RCS Revision: $Revision: 1.27 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DCVRDS_H 00031 #define DCVRDS_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 00035 #include "dcmtk/ofstd/ofvector.h" 00036 #include "dcmtk/dcmdata/dcbytstr.h" 00037 00038 00041 class DcmDecimalString 00042 : public DcmByteString 00043 { 00044 00045 public: 00046 00052 DcmDecimalString(const DcmTag &tag, 00053 const Uint32 len = 0); 00054 00058 DcmDecimalString(const DcmDecimalString &old); 00059 00062 virtual ~DcmDecimalString(); 00063 00068 DcmDecimalString &operator=(const DcmDecimalString &obj); 00069 00073 virtual DcmObject *clone() const 00074 { 00075 return new DcmDecimalString(*this); 00076 } 00077 00090 virtual OFCondition copyFrom(const DcmObject& rhs); 00091 00095 virtual DcmEVR ident() const; 00096 00104 virtual OFCondition checkValue(const OFString &vm = "1-n", 00105 const OFBool oldFormat = OFFalse); 00106 00112 virtual OFCondition getFloat64(Float64 &doubleVal, 00113 const unsigned long pos = 0); 00114 00124 virtual OFCondition getFloat64Vector(OFVector<Float64> &doubleVals); 00125 00132 virtual OFCondition getOFString(OFString &stringVal, 00133 const unsigned long pos, 00134 OFBool normalize = OFTrue); 00135 00141 virtual OFCondition writeXML(STD_NAMESPACE ostream &out, 00142 const size_t flags = 0); 00143 00144 /* --- static helper functions --- */ 00145 00154 static OFCondition checkStringValue(const OFString &value, 00155 const OFString &vm = "1-n"); 00156 }; 00157 00158 00159 #endif // DCVRDS_H 00160 00161 00162 /* 00163 ** CVS/RCS Log: 00164 ** $Log: dcvrds.h,v $ 00165 ** Revision 1.27 2010-11-05 09:34:11 joergr 00166 ** Added support for checking the value multiplicity "9" (see Supplement 131). 00167 ** 00168 ** Revision 1.26 2010-10-27 09:18:27 joergr 00169 ** Added getFloat64Vector() method which allows for retrieving the stored 00170 ** floating point values more efficiently (especially when there are many 00171 ** values). 00172 ** 00173 ** Revision 1.25 2010-10-14 13:15:42 joergr 00174 ** Updated copyright header. Added reference to COPYRIGHT file. 00175 ** 00176 ** Revision 1.24 2010-04-23 15:26:13 joergr 00177 ** Specify an appropriate default value for the "vm" parameter of checkValue(). 00178 ** 00179 ** Revision 1.23 2010-04-23 14:25:27 joergr 00180 ** Added new method to all VR classes which checks whether the stored value 00181 ** conforms to the VR definition and to the specified VM. 00182 ** 00183 ** Revision 1.22 2010-04-22 09:31:30 joergr 00184 ** Revised misleading parameter documentation for the checkValue() method. 00185 ** 00186 ** Revision 1.21 2010-04-22 08:59:10 joergr 00187 ** Added support for further VM values ("1-8", "1-99", "16", "32") to be checked. 00188 ** 00189 ** Revision 1.20 2010-03-01 09:08:45 uli 00190 ** Removed some unnecessary include directives in the headers. 00191 ** 00192 ** Revision 1.19 2009-08-03 09:05:30 joergr 00193 ** Added methods that check whether a given string value conforms to the VR and 00194 ** VM definitions of the DICOM standards. 00195 ** 00196 ** Revision 1.18 2008-07-17 11:19:49 onken 00197 ** Updated copyFrom() documentation. 00198 ** 00199 ** Revision 1.17 2008-07-17 10:30:23 onken 00200 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 00201 ** permits setting an instance's value from an existing object. Implemented 00202 ** assignment operator where necessary. 00203 ** 00204 ** Revision 1.16 2006-10-13 10:12:28 joergr 00205 ** Enhanced performance of writeXML() for large multi-valued DS elements. 00206 ** 00207 ** Revision 1.15 2005/12/08 16:28:56 meichel 00208 ** Changed include path schema for all DCMTK header files 00209 ** 00210 ** Revision 1.14 2004/07/01 12:28:25 meichel 00211 ** Introduced virtual clone method for DcmObject and derived classes. 00212 ** 00213 ** Revision 1.13 2002/12/06 12:49:15 joergr 00214 ** Enhanced "print()" function by re-working the implementation and replacing 00215 ** the boolean "showFullData" parameter by a more general integer flag. 00216 ** Added doc++ documentation. 00217 ** Made source code formatting more consistent with other modules/files. 00218 ** 00219 ** Revision 1.12 2002/04/25 09:51:08 joergr 00220 ** Removed getOFStringArray() implementation. 00221 ** 00222 ** Revision 1.11 2001/09/25 17:19:30 meichel 00223 ** Adapted dcmdata to class OFCondition 00224 ** 00225 ** Revision 1.10 2001/06/01 15:48:49 meichel 00226 ** Updated copyright header 00227 ** 00228 ** Revision 1.9 2000/03/08 16:26:22 meichel 00229 ** Updated copyright header. 00230 ** 00231 ** Revision 1.8 1999/03/31 09:24:58 meichel 00232 ** Updated copyright header in module dcmdata 00233 ** 00234 ** Revision 1.7 1998/11/12 16:47:47 meichel 00235 ** Implemented operator= for all classes derived from DcmObject. 00236 ** 00237 ** Revision 1.6 1997/09/11 15:13:13 hewett 00238 ** Modified getOFString method arguments by removing a default value 00239 ** for the pos argument. By requiring the pos argument to be provided 00240 ** ensures that callers realise getOFString only gets one component of 00241 ** a multi-valued string. 00242 ** 00243 ** Revision 1.5 1997/08/29 08:32:41 andreas 00244 ** - Added methods getOFString and getOFStringArray for all 00245 ** string VRs. These methods are able to normalise the value, i. e. 00246 ** to remove leading and trailing spaces. This will be done only if 00247 ** it is described in the standard that these spaces are not relevant. 00248 ** These methods do not test the strings for conformance, this means 00249 ** especially that they do not delete spaces where they are not allowed! 00250 ** getOFStringArray returns the string with all its parts separated by \ 00251 ** and getOFString returns only one value of the string. 00252 ** CAUTION: Currently getString returns a string with trailing 00253 ** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and 00254 ** truncates the original string (since it is not copied!). If you rely on this 00255 ** behaviour please change your application now. 00256 ** Future changes will ensure that getString returns the original 00257 ** string from the DICOM object (NULL terminated) inclusive padding. 00258 ** Currently, if you call getOF... before calling getString without 00259 ** normalisation, you can get the original string read from the DICOM object. 00260 ** 00261 ** Revision 1.4 1997/05/12 07:37:44 andreas 00262 ** - new get-Methods for DcmDecimalString: getFloat64 and 00263 ** DcmIntegerString: getSint32 00264 ** 00265 ** Revision 1.3 1996/01/05 13:23:04 andreas 00266 ** - changed to support new streaming facilities 00267 ** - more cleanups 00268 ** - merged read / write methods for block and file transfer 00269 ** 00270 */