OFFIS DCMTK  Version 3.6.0
dimocpt.h
1 /*
2  *
3  * Copyright (C) 1996-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: dcmimgle
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose: DicomMonochromeCopyTemplate (Header)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:26 $
22  * CVS/RCS Revision: $Revision: 1.15 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DIMOCPT_H
31 #define DIMOCPT_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/ofstd/ofbmanip.h"
35 #include "dcmtk/ofstd/ofcast.h"
36 
37 #include "dcmtk/dcmimgle/dimopxt.h"
38 
39 
40 /*---------------------*
41  * class declaration *
42  *---------------------*/
43 
46 template<class T>
48  : public DiMonoPixelTemplate<T>
49 {
50 
51  public:
52 
61  const unsigned long fstart,
62  const unsigned long fcount,
63  const unsigned long fsize)
64  : DiMonoPixelTemplate<T>(pixel, fcount * fsize)
65  {
66  if ((pixel != NULL) && (pixel->getCount() > 0))
67  {
68  if ((pixel->getCount() > fstart * fsize) && (pixel->getCount() >= (fstart + fcount) * fsize))
69  copy(OFstatic_cast(const T *, pixel->getData()) + fstart * fsize);
70  /* need to determine the global min/max value */
71  this->determineMinMax();
72  }
73  }
74 
78  {
79  }
80 
81 
82  private:
83 
88  inline void copy(const T *pixel)
89  {
90  if (pixel != NULL)
91  {
92  this->Data = new T[this->getCount()];
93  if (this->Data != NULL)
94  OFBitmanipTemplate<T>::copyMem(pixel, this->Data, this->getCount());
95  }
96  }
97 };
98 
99 
100 #endif
101 
102 
103 /*
104  *
105  * CVS/RCS Log:
106  * $Log: dimocpt.h,v $
107  * Revision 1.15 2010-10-14 13:16:26 joergr
108  * Updated copyright header. Added reference to COPYRIGHT file.
109  *
110  * Revision 1.14 2010-03-01 09:08:47 uli
111  * Removed some unnecessary include directives in the headers.
112  *
113  * Revision 1.13 2007-12-10 16:11:53 joergr
114  * Fixed compilation problem with gcc 4.1.2 on Linux x86_64.
115  *
116  * Revision 1.12 2007/02/08 17:10:27 joergr
117  * Need to determine global min/max value after copying pixel data.
118  *
119  * Revision 1.11 2005/12/08 16:47:48 meichel
120  * Changed include path schema for all DCMTK header files
121  *
122  * Revision 1.10 2004/04/21 10:00:36 meichel
123  * Minor modifications for compilation with gcc 3.4.0
124  *
125  * Revision 1.9 2003/12/08 18:26:50 joergr
126  * Adapted type casts to new-style typecast operators defined in ofcast.h.
127  * Removed leading underscore characters from preprocessor symbols (reserved
128  * symbols). Updated copyright header.
129  *
130  * Revision 1.8 2001/06/01 15:49:44 meichel
131  * Updated copyright header
132  *
133  * Revision 1.7 2000/09/12 10:04:44 joergr
134  * Corrected bug: wrong parameter for attribute search routine led to crashes
135  * when multiple pixel data attributes were contained in the dataset (e.g.
136  * IconImageSequence). Added new checking routines to avoid crashes when
137  * processing corrupted image data.
138  *
139  * Revision 1.6 2000/03/08 16:24:18 meichel
140  * Updated copyright header.
141  *
142  * Revision 1.5 1999/09/17 12:23:56 joergr
143  * Added/changed/completed DOC++ style comments in the header files.
144  *
145  * Revision 1.4 1999/04/28 14:49:19 joergr
146  * Changed comments/formatting.
147  *
148  * Revision 1.2 1999/02/11 16:01:56 joergr
149  * Corrected some typos and formatting.
150  *
151  * Revision 1.1 1998/11/27 15:15:50 joergr
152  * Added copyright message.
153  * Introduced new method and corresponding classes to create a copy of a
154  * dcmimage object (optional parameters: frame start and count).
155  *
156  *
157  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2