dvpsda.h

00001 /*
00002  *
00003  *  Copyright (C) 1998-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: dcmpstat
00019  *
00020  *  Author: Marco Eichelberg
00021  *
00022  *  Purpose:
00023  *    classes: DVPSDisplayedArea
00024  *
00025  *  Last Update:      $Author: meichel $
00026  *  Update Date:      $Date: 2005/12/08 16:03:39 $
00027  *  CVS/RCS Revision: $Revision: 1.7 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef __DVPSDA_H__
00035 #define __DVPSDA_H__
00036 
00037 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00038 #include "dcmtk/dcmdata/dctk.h"
00039 #include "dcmtk/dcmpstat/dvpsril.h"     /* for DVPSReferencedImage_PList */
00040 #include "dcmtk/dcmpstat/dvpstyp.h"     /* for enum types */
00041 
00042 class DVPSReferencedSeries_PList;
00043 
00047 class DVPSDisplayedArea
00048 {
00049 public:
00051   DVPSDisplayedArea();
00052   
00054   DVPSDisplayedArea(const DVPSDisplayedArea& copy);
00055 
00060   DVPSDisplayedArea *clone() { return new DVPSDisplayedArea(*this); }
00061 
00063   virtual ~DVPSDisplayedArea();
00064 
00074   OFCondition read(DcmItem &dset);
00075   
00082   OFCondition write(DcmItem &dset);
00083 
00089   OFBool isApplicable(const char *instanceUID, unsigned long frame);
00090 
00097   OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability);
00098 
00102   DVPSPresentationSizeMode getPresentationSizeMode();
00103   
00109   double getPresentationPixelAspectRatio();
00110   
00118   void getDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY);
00119 
00125   OFCondition getPresentationPixelSpacing(double& x, double& y);
00126   
00131   OFCondition getPresentationPixelMagnificationRatio(double& magnification);
00132 
00143   OFCondition addImageReference(
00144     const char *sopclassUID,
00145     const char *instanceUID, 
00146     unsigned long frame,
00147     DVPSObjectApplicability applicability);
00148 
00161   void removeImageReference(
00162     DVPSReferencedSeries_PList& allReferences,
00163     const char *instanceUID,
00164     unsigned long frame, 
00165     unsigned long numberOfFrames, 
00166     DVPSObjectApplicability applicability);
00167 
00170   void clearImageReferences() { referencedImageList.clear(); }
00171   
00175   OFBool imageReferencesEmpty() { if (referencedImageList.size()==0) return OFTrue; else return OFFalse; }
00176     
00181   OFBool canUseTrueSize();
00182   
00189   OFCondition setDisplayedAreaPixelSpacing(double spacingX, double spacingY);
00190 
00196   OFCondition setDisplayedAreaPixelSpacing(const char *spacing);
00197   
00205   OFCondition setDisplayedAreaPixelAspectRatio(double ratio);
00206 
00212   OFCondition setDisplayedAreaPixelAspectRatio(const char *ratio);
00213  
00224   OFCondition setDisplayedArea(
00225     DVPSPresentationSizeMode sizeMode,
00226     Sint32 tlhcX, Sint32 tlhcY, 
00227     Sint32 brhcX, Sint32 brhcY,
00228     double magnification=1.0);
00229 
00235   void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode);
00236 
00244   void rotateAndFlip(
00245     DVPSRotationType rotationFrom, 
00246     OFBool isFlippedFrom,
00247     DVPSRotationType rotationTo, 
00248     OFBool isFlippedTo);
00249 
00250 private:
00253   DVPSDisplayedArea& operator=(const DVPSDisplayedArea& source);
00254 
00256   void switchHorizontalCorners();
00257 
00259   void switchVerticalCorners();
00260 
00267   void rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped);
00268 
00270   DVPSReferencedImage_PList referencedImageList;
00272   DcmSignedLong            displayedAreaTopLeftHandCorner;
00274   DcmSignedLong            displayedAreaBottomRightHandCorner;
00276   DcmCodeString            presentationSizeMode;
00278   DcmDecimalString         presentationPixelSpacing;
00280   DcmIntegerString         presentationPixelAspectRatio;
00282   DcmFloatingPointSingle   presentationPixelMagnificationRatio;
00283 
00286   OFConsole *logstream;
00287 
00290   OFBool verboseMode;
00291    
00294   OFBool debugMode;
00295 
00296 };
00297 
00298 #endif
00299 
00300 /*
00301  *  $Log: dvpsda.h,v $
00302  *  Revision 1.7  2005/12/08 16:03:39  meichel
00303  *  Changed include path schema for all DCMTK header files
00304  *
00305  *  Revision 1.6  2003/09/05 14:30:06  meichel
00306  *  Introduced new API methods that allow Displayed Areas to be queried
00307  *    and set either relative to the image (ignoring rotation and flip) or
00308  *    in absolute values as defined in the standard.  Rotate and flip methods
00309  *    now adjust displayed areas in the presentation state.
00310  *
00311  *  Revision 1.5  2001/09/26 15:36:09  meichel
00312  *  Adapted dcmpstat to class OFCondition
00313  *
00314  *  Revision 1.4  2001/06/01 15:50:14  meichel
00315  *  Updated copyright header
00316  *
00317  *  Revision 1.3  2000/06/02 16:00:44  meichel
00318  *  Adapted all dcmpstat classes to use OFConsole for log and error output
00319  *
00320  *  Revision 1.2  2000/03/08 16:28:50  meichel
00321  *  Updated copyright header.
00322  *
00323  *  Revision 1.1  1999/07/22 16:39:05  meichel
00324  *  Adapted dcmpstat data structures and API to supplement 33 letter ballot text.
00325  *
00326  *
00327  */


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