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

vtkGdcmReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: vtkGdcmReader.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/12/09 10:59:59 $
00007   Version:   $Revision: 1.20 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018                                                                                 
00019 #ifndef __vtkGdcmReader_h
00020 #define __vtkGdcmReader_h
00021 
00022 #include "gdcmCommon.h" // To avoid warnings concerning the std
00023 
00024 #include <vtkImageReader.h>
00025 #include <list>
00026 #include <string>
00027 
00028 //-----------------------------------------------------------------------------
00029 class vtkLookupTable;
00030 
00031 //-----------------------------------------------------------------------------
00032 class VTK_EXPORT vtkGdcmReader : public vtkImageReader
00033 {
00034 public:
00035    static vtkGdcmReader *New();
00036    vtkTypeRevisionMacro(vtkGdcmReader, vtkImageReader);
00037    void PrintSelf(ostream& os, vtkIndent indent);
00038 
00039    virtual void RemoveAllFileName(void);
00040    virtual void AddFileName(const char* name);
00041    virtual void SetFileName(const char *name);
00042    
00043    // Description:
00044    // If this flag is set and the DICOM reader encounters a dicom file with 
00045    // lookup table the data will be kept as unsigned chars and a lookuptable 
00046    // will be exported and accessible through GetLookupTable() 
00047    vtkSetMacro(AllowLookupTable,int);
00048    vtkGetMacro(AllowLookupTable,int);
00049    vtkBooleanMacro(AllowLookupTable,int);
00050 
00051    vtkGetObjectMacro(LookupTable,vtkLookupTable);
00052 
00053 protected:
00054    vtkGdcmReader();
00055    ~vtkGdcmReader();
00056 
00057    virtual void ExecuteInformation();
00058    virtual void ExecuteData(vtkDataObject *output);
00059    virtual void BuildFileListFromPattern();
00060    virtual int CheckFileCoherence();
00061 
00062 private:
00063    void RemoveAllInternalFileName(void);
00064    void AddInternalFileName(const char* name);
00065 
00066    //BTX
00067    size_t LoadImageInMemory(std::string FileName, unsigned char * Dest,
00068                            const unsigned long UpdateProgressTarget,
00069                            unsigned long & UpdateProgressCount);
00070    //ETX
00071 
00072 // Variables
00073    vtkLookupTable *LookupTable;
00074    vtkTimeStamp fileTime;
00075    int AllowLookupTable;
00076 
00077    //BTX
00078    // Number of columns of the image/volume to be loaded
00079    int NumColumns;
00080    // Number of lines of the image/volume to be loaded
00081    int NumLines;
00082    // Total number of planes (or images) of the stack to be build.
00083    int TotalNumberOfPlanes;
00084    // Number of scalar components of the image to be loaded (1=monochrome 3=rgb)
00085    int NumComponents;
00086    // Type of the image[s]: 8/16/32 bits, signed/unsigned:
00087    std::string ImageType;
00088    // Pixel size (in number of bytes):
00089    size_t PixelSize;
00090    // List of filenames to be read in order to build a stack of images
00091    // or volume. The order in the list shall be the order of the images.
00092    std::list<std::string> FileNameList;
00093 
00094    // List of filenames created in ExecuteInformation and used in
00095    // ExecuteData.
00096    // If FileNameList isn't empty, InternalFileNameList is a copy of
00097    //    FileNameList
00098    // Otherwise, InternalFileNameList correspond to the list of 
00099    //    files patterned
00100    std::list<std::string> InternalFileNameList;
00101    //ETX
00102 };
00103 
00104 //-----------------------------------------------------------------------------
00105 #endif
00106 

Generated on Thu Feb 10 22:18:01 2005 for gdcm by doxygen 1.3.6