fw4spl
ImageRGBLookupLazyStream.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "fwDcmtkIO/config.hpp"
10 
11 #include <fwCore/base.hpp>
12 
13 #include <fwMedData/DicomSeries.hpp>
14 
15 #include <fwMemory/stream/in/IFactory.hpp>
16 
17 #include <fwTools/Type.hpp>
18 
19 #include <boost/iostreams/stream.hpp>
20 
21 #include <vector>
22 
23 namespace fwDcmtkIO
24 {
25 namespace reader
26 {
27 namespace rgblookup
28 {
29 
30 //------------------------------------------------------------------------------
31 
35 class FWDCMTKIO_CLASS_API ImageRGBLookupLazyInformation
36 {
37 public:
38  typedef SPTR ( ImageRGBLookupLazyInformation ) sptr;
39 
41  ::fwMedData::DicomSeries::csptr m_dicomSeries;
42 
44  unsigned int m_rows;
45 
47  unsigned int m_columns;
48 
50  unsigned int m_depth;
51 
53  unsigned short m_bitsAllocated;
54 
56  unsigned short m_pixelValueBitsAllocated;
57 
60 
61 };
62 
63 //------------------------------------------------------------------------------
64 
68 class FWDCMTKIO_CLASS_API ImageRGBLookupLazySource
69 {
70 public:
71  typedef char char_type;
72  typedef ::boost::iostreams::source_tag category;
73 
78  ImageRGBLookupLazySource( ImageRGBLookupLazyInformation::sptr dcmInfo );
79 
85  std::streamsize read(char* stream, std::streamsize size);
86 
87 private:
89  ImageRGBLookupLazyInformation::sptr m_dcmInfo;
90 
92  size_t m_frameSize;
93 
95  int m_currentFrame;
96 
98  size_t m_currentPosition;
99 
101  char* m_frame;
102 
104  ::fwMedData::DicomSeries::DicomContainerType::const_iterator m_currentDicom;
105 
107  void* m_redLookup;
108 
110  void* m_greenLookup;
111 
113  void* m_blueLookup;
114 
115 };
116 
117 //------------------------------------------------------------------------------
118 
123 {
124 
125 public:
126 
131  ImageRGBLookupLazyStream( ImageRGBLookupLazyInformation::sptr dcmInfo );
132 
133 protected:
134 
136  SPTR(std::istream) get();
137 
139  ImageRGBLookupLazyInformation::sptr m_dcmInfo;
140 };
141 
142 //------------------------------------------------------------------------------
143 
144 } //rgblookup
145 } //reader
146 } //fwDcmtkIO
#define SPTR(_cls_)
unsigned short m_pixelValueBitsAllocated
Pixel value bits allocated.
Class used to build a std::istream using the ::boost::iostreams api.
Class used to perform a lazy reading of dicom images with fw4spl system.
Class describing an elementary C++ type aka unsigned char, signed char, .... int, float...
Definition: Type.hpp:32
::fwMedData::DicomSeries::csptr m_dicomSeries
Dicom series used to get the paths of the instances.
fwDcmtkIO contains classes used to pull Dicom images from a pacs using dcmtk library.
Definition: Codec.hpp:12
Basic class used to store informations in order to read DICOM images.
ImageRGBLookupLazyInformation::sptr m_dcmInfo
To conserve dicom information.