OFFIS DCMTK  Version 3.6.0
dicosct.h
1 /*
2  *
3  * Copyright (C) 1996-2011, 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: dcmimage
15  *
16  * Author: Joerg Riesmeier
17  *
18  * Purpose: DicomColorScaleTemplate (Header)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2011-11-17 16:13:14 $
22  * CVS/RCS Revision: $Revision: 1.22 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DICOSCT_H
31 #define DICOSCT_H
32 
33 #include "dcmtk/config/osconfig.h"
34 
35 #include "dcmtk/dcmimage/dicopxt.h"
36 #include "dcmtk/dcmimgle/discalet.h"
37 
38 
39 /*---------------------*
40  * class declaration *
41  *---------------------*/
42 
45 template<class T>
47  : public DiColorPixelTemplate<T>,
48  protected DiScaleTemplate<T>
49 {
50 
51  public:
52 
69  const Uint16 columns,
70  const Uint16 rows,
71  const signed long left_pos,
72  const signed long top_pos,
73  const Uint16 src_cols,
74  const Uint16 src_rows,
75  const Uint16 dest_cols,
76  const Uint16 dest_rows,
77  const Uint32 frames,
78  const int bits,
79  const int interpolate)
80  : DiColorPixelTemplate<T>(pixel, OFstatic_cast(unsigned long, dest_cols) * OFstatic_cast(unsigned long, dest_rows) * frames),
81  DiScaleTemplate<T>(3, columns, rows, left_pos, top_pos, src_cols, src_rows, dest_cols, dest_rows, frames, bits)
82  {
83  if ((pixel != NULL) && (pixel->getCount() > 0))
84  {
85  if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames)
86  scale(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), interpolate);
87  else {
88  DCMIMAGE_WARN("could not scale image ... corrupted data");
89  }
90  }
91  }
92 
96  {
97  }
98 
99 
100  private:
101 
107  inline void scale(const T *pixel[3],
108  const int interpolate)
109  {
110  if (this->Init(pixel))
111  this->scaleData(pixel, this->Data, interpolate);
112  }
113 };
114 
115 
116 #endif
117 
118 
119 /*
120  *
121  * CVS/RCS Log:
122  * $Log: dicosct.h,v $
123  * Revision 1.22 2011-11-17 16:13:14 joergr
124  * Minor fixes to keep XCode 4.2 on Mac OS X Lion (clang compiler) quiet.
125  *
126  * Revision 1.21 2010-10-14 13:16:29 joergr
127  * Updated copyright header. Added reference to COPYRIGHT file.
128  *
129  * Revision 1.20 2010-03-01 09:08:46 uli
130  * Removed some unnecessary include directives in the headers.
131  *
132  * Revision 1.19 2009-10-14 10:25:13 joergr
133  * Fixed minor issues in log output. Also updated copyright date (if required).
134  *
135  * Revision 1.18 2009-10-13 14:08:33 uli
136  * Switched to logging mechanism provided by the "new" oflog module
137  *
138  * Revision 1.17 2006-08-15 16:35:01 meichel
139  * Updated the code in module dcmimage to correctly compile when
140  * all standard C++ classes remain in namespace std.
141  *
142  * Revision 1.16 2005/12/08 16:01:37 meichel
143  * Changed include path schema for all DCMTK header files
144  *
145  * Revision 1.15 2004/04/21 10:00:31 meichel
146  * Minor modifications for compilation with gcc 3.4.0
147  *
148  * Revision 1.14 2004/02/06 11:18:18 joergr
149  * Distinguish more clearly between const and non-const access to pixel data.
150  *
151  * Revision 1.13 2003/12/23 11:45:54 joergr
152  * Adapted type casts to new-style typecast operators defined in ofcast.h.
153  * Removed leading underscore characters from preprocessor symbols (reserved
154  * symbols). Updated copyright header.
155  *
156  * Revision 1.12 2002/12/09 13:37:52 joergr
157  * Renamed parameter/local variable to avoid name clashes with global
158  * declaration left and/or right (used for as iostream manipulators).
159  *
160  * Revision 1.11 2001/11/09 16:45:23 joergr
161  * Updated/Enhanced comments.
162  *
163  * Revision 1.10 2001/06/01 15:49:30 meichel
164  * Updated copyright header
165  *
166  * Revision 1.9 2000/12/08 14:06:02 joergr
167  * Added new checking routines to avoid crashes when processing corrupted image
168  * data.
169  *
170  * Revision 1.8 2000/03/08 16:21:52 meichel
171  * Updated copyright header.
172  *
173  * Revision 1.7 1999/08/25 16:58:06 joergr
174  * Added new feature: Allow clipping region to be outside the image
175  * (overlapping).
176  *
177  * Revision 1.6 1999/04/28 12:52:00 joergr
178  * Corrected some typos, comments and formatting.
179  *
180  * Revision 1.5 1998/11/27 13:51:07 joergr
181  * Added copyright message.
182  *
183  * Revision 1.4 1998/05/11 14:53:14 joergr
184  * Added CVS/RCS header to each file.
185  *
186  *
187  */


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