9 #include "fwDcmtkIO/config.hpp" 11 #include <fwMedData/DicomSeries.hpp> 13 #include <dcmtk/config/osconfig.h> 14 #include <dcmtk/dcmdata/dcdeftag.h> 15 #include <dcmtk/dcmdata/dcfilefo.h> 16 #include <dcmtk/dcmimgle/dcmimage.h> 17 #include <dcmtk/dcmnet/diutil.h> 33 typedef ::fwMedData::DicomSeries::DicomContainerType DicomContainerType;
49 template<
typename T,
typename U >
52 DicomContainerType& instances,
53 void* destination,
const T* redLookup,
57 U* tempoBuffer = ::fwDcmtkIO::reader::main::ImageReader::createTemporaryBuffer<U>(
58 rows, columns, depth, instances);
60 T* arrayBuffer =
static_cast< T*
>(destination);
61 unsigned short x, y, z;
62 unsigned int frameSize = columns * rows;
64 for (x = 0; x < columns; ++x)
66 for (y = 0; y < rows; ++y)
68 unsigned int yshift = x * rows;
70 for (z = 0; z < depth; ++z)
72 unsigned int position = y + yshift + z * frameSize;
73 U value = tempoBuffer[position];
75 arrayBuffer[position*3] =
static_cast< T
>((redLookup[value]/(double)0xffff)*256);
76 arrayBuffer[position*3+1] =
static_cast< T
>((greenLookup[value]/(double)0xffff)*256);
77 arrayBuffer[position*3+2] =
static_cast< T
>((blueLookup[value]/(double)0xffff)*256);
fwDcmtkIO contains classes used to pull Dicom images from a pacs using dcmtk library.
static void fillImageBuffer(unsigned int rows, unsigned int columns, unsigned int depth, DicomContainerType &instances, void *destination, const T *redLookup, const T *greenLookup, const T *blueLookup)
Fill the buffer of an image The template T is used to determine color format The template U is used t...
This class is used to read the buffer of a DICOM image in DIRECT mode when a pixel lookup must be per...