1 /*=========================================================================
4 Module: $RCSfile: vtkGdcmReader.h,v $
6 Date: $Date: 2005/06/29 16:12:43 $
7 Version: $Revision: 1.22 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef __vtkGdcmReader_h
20 #define __vtkGdcmReader_h
22 #include "gdcmCommon.h" // To avoid warnings concerning the std
24 #include <vtkImageReader.h>
28 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
32 class VTK_EXPORT vtkGdcmReader : public vtkImageReader
35 static vtkGdcmReader *New();
36 vtkTypeRevisionMacro(vtkGdcmReader, vtkImageReader);
37 void PrintSelf(ostream& os, vtkIndent indent);
39 virtual void RemoveAllFileName(void);
40 virtual void AddFileName(const char *name);
41 virtual void SetFileName(const char *name);
43 void SetCheckFileCoherenceLight();
46 // If this flag is set and the DICOM reader encounters a dicom file with
47 // lookup table the data will be kept as unsigned chars and a lookuptable
48 // will be exported and accessible through GetLookupTable()
49 vtkSetMacro(AllowLookupTable, int);
50 vtkGetMacro(AllowLookupTable, int);
51 vtkBooleanMacro(AllowLookupTable, int);
53 vtkGetObjectMacro(LookupTable, vtkLookupTable);
56 * \brief Sets the LoadMode as a boolean string.
57 * NO_SEQ, NO_SHADOW, ... (nothing more, right now)
58 * WARNING : before using NO_SHADOW, be sure *all* your files
59 * contain accurate values in the 0x0000 element (if any)
60 * of *each* Shadow Group. The parser will fail if the size is wrong !
61 * @param mode Load mode to be used
63 void SetLoadMode (int mode) { LoadMode = mode; }
69 virtual void ExecuteInformation();
70 virtual void ExecuteData(vtkDataObject *output);
71 virtual void BuildFileListFromPattern();
72 virtual int CheckFileCoherence();
73 virtual int CheckFileCoherenceLight();
76 void RemoveAllInternalFileName(void);
77 void AddInternalFileName(const char* name);
80 size_t LoadImageInMemory(std::string FileName, unsigned char *Dest,
81 const unsigned long UpdateProgressTarget,
82 unsigned long & UpdateProgressCount);
86 vtkLookupTable *LookupTable;
87 vtkTimeStamp fileTime;
92 // Number of columns of the image/volume to be loaded
94 // Number of lines of the image/volume to be loaded
96 // Total number of planes (or images) of the stack to be build.
97 int TotalNumberOfPlanes;
98 // Number of scalar components of the image to be loaded (1=monochrome 3=rgb)
100 // Type of the image[s]: 8/16/32 bits, signed/unsigned:
101 std::string ImageType;
102 // Pixel size (in number of bytes):
104 // List of filenames to be read in order to build a stack of images
105 // or volume. The order in the list shall be the order of the images.
106 std::list<std::string> FileNameList;
108 // List of filenames created in ExecuteInformation and used in
110 // If FileNameList isn't empty, InternalFileNameList is a copy of
112 // Otherwise, InternalFileNameList correspond to the list of
114 std::list<std::string> InternalFileNameList;
117 /// \brief Bit string integer (each one considered as a boolean)
118 /// Bit 0 : Skip Sequences, if possible
119 /// Bit 1 : Skip Shadow Groups if possible
120 /// Probabely, some more to add
124 //-----------------------------------------------------------------------------