/usr/include/gdcm-2.2/gdcmIconImageGenerator.h is in libgdcm2-dev 2.2.4-1.1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMICONIMAGEGENERATOR_H
#define GDCMICONIMAGEGENERATOR_H
#include "gdcmPixmap.h"
#include "gdcmIconImage.h"
namespace gdcm
{
class IconImageGeneratorInternals;
/**
* \brief IconImageGenerator
* This filter will generate a valid Icon from the Pixel Data element (an
* instance of gdcm::Pixmap).
* To generate a valid Icon, one is only allowed the following Photometric
* Interpretation:
* - MONOCHROME1
* - MONOCHROME2
* - PALETTE_COLOR
*
* The Pixel Bits Allocated is restricted to 8bits, therefore 16 bits image
* needs to be rescaled. By default the filter will use the full scalar range
* of 16bits image to rescale to unsigned 8bits.
* This may not be ideal for some situation, in which case the API
* SetPixelMinMax can be used to overwrite the default min,max interval used.
*
* \see ImageReader
*/
class GDCM_EXPORT IconImageGenerator
{
public:
IconImageGenerator();
~IconImageGenerator();
/// Set/Get File
void SetPixmap(const Pixmap& p) { P = p; }
Pixmap &GetPixmap() { return *P; }
const Pixmap &GetPixmap() const { return *P; }
/// Set Target dimension of output Icon
void SetOutputDimensions(const unsigned int dims[2]);
/// Override default min/max to compute best rescale for 16bits -> 8bits
/// downscale. Typically those value can be read from the SmallestImagePixelValue
/// LargestImagePixelValue DICOM attribute.
void SetPixelMinMax(double min, double max);
/// Instead of explicitely specifying the min/max value for the rescale
/// operation, let the internal mechanism compute the min/max of icon and
/// rescale to best appropriate.
void AutoPixelMinMax(bool b);
/// Converting from RGB to PALETTE_COLOR can be a slow operation. However DICOM
/// standard requires that color icon be described as palette. Set this boolean
/// to false only if you understand the consequences.
/// \default true, false generates invalid Icon Image Sequence
void ConvertRGBToPaletteColor(bool b);
/// Set a pixel value that should be discarded. This happen typically for CT image, where
/// a pixel has been used to pad outside the image (see Pixel Padding Value).
/// Requires AutoPixelMinMax(true)
void SetOutsideValuePixel(double v);
/// Generate Icon
bool Generate();
/// Retrieve generated Icon
const IconImage& GetIconImage() const { return *I; }
protected:
private:
void BuildLUT( Bitmap & bitmap, unsigned int maxcolor );
SmartPointer<Pixmap> P;
SmartPointer<IconImage> I;
IconImageGeneratorInternals *Internals;
};
} // end namespace gdcm
#endif //GDCMICONIMAGEGENERATOR_H
|