Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

dimocpt.h

00001 /*
00002  *
00003  *  Copyright (C) 1996-2004, 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:  dcmimgle
00019  *
00020  *  Author:  Joerg Riesmeier
00021  *
00022  *  Purpose: DicomMonochromeCopyTemplate (Header)
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2004/04/21 10:00:36 $
00026  *  CVS/RCS Revision: $Revision: 1.10 $
00027  *  Status:           $State: Exp $
00028  *
00029  *  CVS/RCS Log at end of file
00030  *
00031  */
00032 
00033 
00034 #ifndef DIMOCPT_H
00035 #define DIMOCPT_H
00036 
00037 #include "osconfig.h"
00038 #include "dctypes.h"
00039 #include "ofbmanip.h"
00040 #include "ofcast.h"
00041 
00042 #include "dimopxt.h"
00043 
00044 
00045 /*---------------------*
00046  *  class declaration  *
00047  *---------------------*/
00048 
00051 template<class T>
00052 class DiMonoCopyTemplate
00053   : public DiMonoPixelTemplate<T>
00054 {
00055 
00056  public:
00057 
00065     DiMonoCopyTemplate(const DiMonoPixel *pixel,
00066                        const unsigned long fstart,
00067                        const unsigned long fcount,
00068                        const unsigned long fsize)
00069       : DiMonoPixelTemplate<T>(pixel, fcount * fsize)
00070     {
00071         if ((pixel != NULL) && (pixel->getCount() > 0))
00072         {
00073             if ((pixel->getCount() > fstart * fsize) && (pixel->getCount() >= (fstart + fcount) * fsize))
00074                 copy(OFstatic_cast(const T *, pixel->getData()) + fstart * fsize);
00075         }
00076     }
00077 
00080     ~DiMonoCopyTemplate()
00081     {
00082     }
00083 
00084 
00085  private:
00086 
00091     inline void copy(const T *pixel)
00092     {
00093         if (pixel != NULL)
00094         {
00095             this->Data = new T[this->getCount()];
00096             if (this->Data != NULL)
00097                 OFBitmanipTemplate<T>::copyMem(pixel, this->Data, this->getCount());
00098         }
00099     }
00100 };
00101 
00102 
00103 #endif
00104 
00105 
00106 /*
00107  *
00108  * CVS/RCS Log:
00109  * $Log: dimocpt.h,v $
00110  * Revision 1.10  2004/04/21 10:00:36  meichel
00111  * Minor modifications for compilation with gcc 3.4.0
00112  *
00113  * Revision 1.9  2003/12/08 18:26:50  joergr
00114  * Adapted type casts to new-style typecast operators defined in ofcast.h.
00115  * Removed leading underscore characters from preprocessor symbols (reserved
00116  * symbols). Updated copyright header.
00117  *
00118  * Revision 1.8  2001/06/01 15:49:44  meichel
00119  * Updated copyright header
00120  *
00121  * Revision 1.7  2000/09/12 10:04:44  joergr
00122  * Corrected bug: wrong parameter for attribute search routine led to crashes
00123  * when multiple pixel data attributes were contained in the dataset (e.g.
00124  * IconImageSequence). Added new checking routines to avoid crashes when
00125  * processing corrupted image data.
00126  *
00127  * Revision 1.6  2000/03/08 16:24:18  meichel
00128  * Updated copyright header.
00129  *
00130  * Revision 1.5  1999/09/17 12:23:56  joergr
00131  * Added/changed/completed DOC++ style comments in the header files.
00132  *
00133  * Revision 1.4  1999/04/28 14:49:19  joergr
00134  * Changed comments/formatting.
00135  *
00136  * Revision 1.2  1999/02/11 16:01:56  joergr
00137  * Corrected some typos and formatting.
00138  *
00139  * Revision 1.1  1998/11/27 15:15:50  joergr
00140  * Added copyright message.
00141  * Introduced new method and corresponding classes to create a copy of a
00142  * dcmimage object (optional parameters: frame start and count).
00143  *
00144  *
00145  */


Generated on 8 Dec 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.9.1