OFFIS DCMTK  Version 3.6.0
dvpsda.h
1 /*
2  *
3  * Copyright (C) 1998-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: dcmpstat
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose:
19  * classes: DVPSDisplayedArea
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:36 $
23  * CVS/RCS Revision: $Revision: 1.10 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DVPSDA_H
31 #define DVPSDA_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 #include "dcmtk/dcmdata/dctk.h"
35 #include "dcmtk/dcmpstat/dvpsril.h" /* for DVPSReferencedImage_PList */
36 #include "dcmtk/dcmpstat/dvpstyp.h" /* for enum types */
37 
39 
44 {
45 public:
48 
51 
56  DVPSDisplayedArea *clone() { return new DVPSDisplayedArea(*this); }
57 
59  virtual ~DVPSDisplayedArea();
60 
70  OFCondition read(DcmItem &dset);
71 
78  OFCondition write(DcmItem &dset);
79 
85  OFBool isApplicable(const char *instanceUID, unsigned long frame);
86 
93  OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability);
94 
98  DVPSPresentationSizeMode getPresentationSizeMode();
99 
106 
114  void getDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY);
115 
121  OFCondition getPresentationPixelSpacing(double& x, double& y);
122 
128 
140  const char *sopclassUID,
141  const char *instanceUID,
142  unsigned long frame,
143  DVPSObjectApplicability applicability);
144 
158  DVPSReferencedSeries_PList& allReferences,
159  const char *instanceUID,
160  unsigned long frame,
161  unsigned long numberOfFrames,
162  DVPSObjectApplicability applicability);
163 
167 
171  OFBool imageReferencesEmpty() { if (referencedImageList.size()==0) return OFTrue; else return OFFalse; }
172 
177  OFBool canUseTrueSize();
178 
185  OFCondition setDisplayedAreaPixelSpacing(double spacingX, double spacingY);
186 
192  OFCondition setDisplayedAreaPixelSpacing(const char *spacing);
193 
202 
209 
221  DVPSPresentationSizeMode sizeMode,
222  Sint32 tlhcX, Sint32 tlhcY,
223  Sint32 brhcX, Sint32 brhcY,
224  double magnification=1.0);
225 
233  void rotateAndFlip(
234  DVPSRotationType rotationFrom,
235  OFBool isFlippedFrom,
236  DVPSRotationType rotationTo,
237  OFBool isFlippedTo);
238 
239 private:
243 
246 
248  void switchVerticalCorners();
249 
256  void rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped);
257 
272 
273 };
274 
275 #endif
276 
277 /*
278  * $Log: dvpsda.h,v $
279  * Revision 1.10 2010-10-14 13:16:36 joergr
280  * Updated copyright header. Added reference to COPYRIGHT file.
281  *
282  * Revision 1.9 2010-10-07 14:31:35 joergr
283  * Removed leading underscore characters from preprocessor symbols (reserved).
284  *
285  * Revision 1.8 2009-11-24 14:12:57 uli
286  * Switched to logging mechanism provided by the "new" oflog module.
287  *
288  * Revision 1.7 2005-12-08 16:03:39 meichel
289  * Changed include path schema for all DCMTK header files
290  *
291  * Revision 1.6 2003/09/05 14:30:06 meichel
292  * Introduced new API methods that allow Displayed Areas to be queried
293  * and set either relative to the image (ignoring rotation and flip) or
294  * in absolute values as defined in the standard. Rotate and flip methods
295  * now adjust displayed areas in the presentation state.
296  *
297  * Revision 1.5 2001/09/26 15:36:09 meichel
298  * Adapted dcmpstat to class OFCondition
299  *
300  * Revision 1.4 2001/06/01 15:50:14 meichel
301  * Updated copyright header
302  *
303  * Revision 1.3 2000/06/02 16:00:44 meichel
304  * Adapted all dcmpstat classes to use OFConsole for log and error output
305  *
306  * Revision 1.2 2000/03/08 16:28:50 meichel
307  * Updated copyright header.
308  *
309  * Revision 1.1 1999/07/22 16:39:05 meichel
310  * Adapted dcmpstat data structures and API to supplement 33 letter ballot text.
311  *
312  *
313  */
void clear()
reset the object to initial state.
a class representing the DICOM value representation 'Integer String' (IS)
Definition: dcvris.h:39
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
OFCondition setDisplayedAreaPixelAspectRatio(double ratio)
sets the displayed area pixel spacing and removes any pixel spacing setting.
virtual ~DVPSDisplayedArea()
destructor
DVPSDisplayedArea()
default constructor
a class representing the DICOM value representation 'Decimal String' (DS)
Definition: dcvrds.h:41
OFCondition setDisplayedArea(DVPSPresentationSizeMode sizeMode, Sint32 tlhcX, Sint32 tlhcY, Sint32 brhcX, Sint32 brhcY, double magnification=1.0)
sets the displayed area and size mode.
void rotateAndFlip(DVPSRotationType rotationFrom, OFBool isFlippedFrom, DVPSRotationType rotationTo, OFBool isFlippedTo)
adjusts the displayed area coordinates for the rotation and flipping status of the image...
OFBool isApplicable(const char *instanceUID, unsigned long frame)
checks if this displayed area is applicable to the given image and frame.
DcmFloatingPointSingle presentationPixelMagnificationRatio
VR=FL, VM=1, Type 1c (required if presentationSizeMode is "MAGNIFY")
Definition: dvpsda.h:271
void removeImageReference(DVPSReferencedSeries_PList &allReferences, const char *instanceUID, unsigned long frame, unsigned long numberOfFrames, DVPSObjectApplicability applicability)
removes a reference to an image or frame.
void clearImageReferences()
removes all image references for this displayed area.
Definition: dvpsda.h:166
double getPresentationPixelAspectRatio()
gets the presentation pixel aspect ratio for this displayed area selection.
size_t size() const
gets the number of image references in this list.
Definition: dvpsril.h:170
void rotateAndFlipFromOrTo(DVPSRotationType rotation, OFBool isFlipped)
adjusts the displayed area coordinates for rotation and flipping.
DcmIntegerString presentationPixelAspectRatio
VR=IS, VM=2, Type 1c (required if presentationPixelSpacing is absent)
Definition: dvpsda.h:269
OFBool canUseTrueSize()
checks if the TRUE SIZE mode is possible, i.e.
DcmCodeString presentationSizeMode
VR=CS, VM=1, Type 1.
Definition: dvpsda.h:265
OFCondition write(DcmItem &dset)
writes the displayed area selection managed by this object to a DICOM dataset.
OFCondition getPresentationPixelSpacing(double &x, double &y)
gets the presentation pixel spacing for this displayed area if present.
OFCondition setDisplayedAreaPixelSpacing(double spacingX, double spacingY)
sets the displayed area pixel spacing and removes any pixel aspect ratio setting. ...
a class representing the DICOM value representation 'Signed Long' (SL)
Definition: dcvrsl.h:40
void getDisplayedArea(Sint32 &tlhcX, Sint32 &tlhcY, Sint32 &brhcX, Sint32 &brhcY)
gets the displayed area top lefthand corner and bottom righthand corner.
DcmSignedLong displayedAreaBottomRightHandCorner
VR=SL, VM=2, Type 1.
Definition: dvpsda.h:263
a class representing the DICOM value representation 'Code String' (CS)
Definition: dcvrcs.h:40
OFBool imageReferencesEmpty()
checks if the list of image references for this displayed area is empty.
Definition: dvpsda.h:171
DVPSDisplayedArea & operator=(const DVPSDisplayedArea &source)
undefined private assignment operator
DVPSPresentationSizeMode getPresentationSizeMode()
gets the presentation size mode for this displayed area selection.
DcmDecimalString presentationPixelSpacing
VR=DS, VM=2, Type 1c (required if presentationSizeMode is "TRUE SIZE")
Definition: dvpsda.h:267
void switchVerticalCorners()
swaps the vertical (Y) components of TLHC and BRHC
void switchHorizontalCorners()
swaps the horizontal (X) components of TLHC and BRHC
OFCondition addImageReference(const char *sopclassUID, const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability)
add a new image reference.
DVPSDisplayedArea * clone()
clone method.
Definition: dvpsda.h:56
OFCondition getPresentationPixelMagnificationRatio(double &magnification)
gets the presentation pixel magnification ratio for this displayed area if present.
an item of the displayed area selection sequence in a presentation state.
Definition: dvpsda.h:43
OFBool matchesApplicability(const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability)
checks if this displayed area matches exactly the applicability defined by the instanceUID, frame and applicability parameters.
a class representing the DICOM value representation 'Floating Point Single' (FL)
Definition: dcvrfl.h:40
the list of referenced series contained in a presentation state (internal use only).
Definition: dvpsrsl.h:45
DcmSignedLong displayedAreaTopLeftHandCorner
VR=SL, VM=2, Type 1.
Definition: dvpsda.h:261
DVPSReferencedImage_PList referencedImageList
ReferencedImageSequence, Type 1c.
Definition: dvpsda.h:259
OFCondition read(DcmItem &dset)
reads an displayed area selection from a DICOM dataset.
the list of referenced images contained in a presentation state (internal use only).
Definition: dvpsril.h:46
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Dec 14 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.11