00001 /* 00002 * 00003 * Copyright (C) 1998-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: dcmpstat 00015 * 00016 * Author: Marco Eichelberg 00017 * 00018 * Purpose: 00019 * classes: DVPSDisplayedArea 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:36 $ 00023 * CVS/RCS Revision: $Revision: 1.10 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 #ifndef DVPSDA_H 00031 #define DVPSDA_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 #include "dcmtk/dcmdata/dctk.h" 00035 #include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */ 00036 #include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */ 00037 00038 class DVPSReferencedSeries_PList; 00039 00043 class DVPSDisplayedArea 00044 { 00045 public: 00047 DVPSDisplayedArea(); 00048 00050 DVPSDisplayedArea(const DVPSDisplayedArea& copy); 00051 00056 DVPSDisplayedArea *clone() { return new DVPSDisplayedArea(*this); } 00057 00059 virtual ~DVPSDisplayedArea(); 00060 00070 OFCondition read(DcmItem &dset); 00071 00078 OFCondition write(DcmItem &dset); 00079 00085 OFBool isApplicable(const char *instanceUID, unsigned long frame); 00086 00093 OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability); 00094 00098 DVPSPresentationSizeMode getPresentationSizeMode(); 00099 00105 double getPresentationPixelAspectRatio(); 00106 00114 void getDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY); 00115 00121 OFCondition getPresentationPixelSpacing(double& x, double& y); 00122 00127 OFCondition getPresentationPixelMagnificationRatio(double& magnification); 00128 00139 OFCondition addImageReference( 00140 const char *sopclassUID, 00141 const char *instanceUID, 00142 unsigned long frame, 00143 DVPSObjectApplicability applicability); 00144 00157 void removeImageReference( 00158 DVPSReferencedSeries_PList& allReferences, 00159 const char *instanceUID, 00160 unsigned long frame, 00161 unsigned long numberOfFrames, 00162 DVPSObjectApplicability applicability); 00163 00166 void clearImageReferences() { referencedImageList.clear(); } 00167 00171 OFBool imageReferencesEmpty() { if (referencedImageList.size()==0) return OFTrue; else return OFFalse; } 00172 00177 OFBool canUseTrueSize(); 00178 00185 OFCondition setDisplayedAreaPixelSpacing(double spacingX, double spacingY); 00186 00192 OFCondition setDisplayedAreaPixelSpacing(const char *spacing); 00193 00201 OFCondition setDisplayedAreaPixelAspectRatio(double ratio); 00202 00208 OFCondition setDisplayedAreaPixelAspectRatio(const char *ratio); 00209 00220 OFCondition setDisplayedArea( 00221 DVPSPresentationSizeMode sizeMode, 00222 Sint32 tlhcX, Sint32 tlhcY, 00223 Sint32 brhcX, Sint32 brhcY, 00224 double magnification=1.0); 00225 00233 void rotateAndFlip( 00234 DVPSRotationType rotationFrom, 00235 OFBool isFlippedFrom, 00236 DVPSRotationType rotationTo, 00237 OFBool isFlippedTo); 00238 00239 private: 00242 DVPSDisplayedArea& operator=(const DVPSDisplayedArea& source); 00243 00245 void switchHorizontalCorners(); 00246 00248 void switchVerticalCorners(); 00249 00256 void rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped); 00257 00259 DVPSReferencedImage_PList referencedImageList; 00261 DcmSignedLong displayedAreaTopLeftHandCorner; 00263 DcmSignedLong displayedAreaBottomRightHandCorner; 00265 DcmCodeString presentationSizeMode; 00267 DcmDecimalString presentationPixelSpacing; 00269 DcmIntegerString presentationPixelAspectRatio; 00271 DcmFloatingPointSingle presentationPixelMagnificationRatio; 00272 00273 }; 00274 00275 #endif 00276 00277 /* 00278 * $Log: dvpsda.h,v $ 00279 * Revision 1.10 2010-10-14 13:16:36 joergr 00280 * Updated copyright header. Added reference to COPYRIGHT file. 00281 * 00282 * Revision 1.9 2010-10-07 14:31:35 joergr 00283 * Removed leading underscore characters from preprocessor symbols (reserved). 00284 * 00285 * Revision 1.8 2009-11-24 14:12:57 uli 00286 * Switched to logging mechanism provided by the "new" oflog module. 00287 * 00288 * Revision 1.7 2005-12-08 16:03:39 meichel 00289 * Changed include path schema for all DCMTK header files 00290 * 00291 * Revision 1.6 2003/09/05 14:30:06 meichel 00292 * Introduced new API methods that allow Displayed Areas to be queried 00293 * and set either relative to the image (ignoring rotation and flip) or 00294 * in absolute values as defined in the standard. Rotate and flip methods 00295 * now adjust displayed areas in the presentation state. 00296 * 00297 * Revision 1.5 2001/09/26 15:36:09 meichel 00298 * Adapted dcmpstat to class OFCondition 00299 * 00300 * Revision 1.4 2001/06/01 15:50:14 meichel 00301 * Updated copyright header 00302 * 00303 * Revision 1.3 2000/06/02 16:00:44 meichel 00304 * Adapted all dcmpstat classes to use OFConsole for log and error output 00305 * 00306 * Revision 1.2 2000/03/08 16:28:50 meichel 00307 * Updated copyright header. 00308 * 00309 * Revision 1.1 1999/07/22 16:39:05 meichel 00310 * Adapted dcmpstat data structures and API to supplement 33 letter ballot text. 00311 * 00312 * 00313 */