]> Creatis software - gdcm.git/blob - vtk/vtkGdcmWriter.h
1124a58a8187211c26d3892261d2e0bb70e4168f
[gdcm.git] / vtk / vtkGdcmWriter.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: vtkGdcmWriter.h,v $
5   Language:  C++
6   Date:      $Date: 2004/12/10 13:49:08 $
7   Version:   $Revision: 1.4 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18                                                                                 
19 #ifndef __vtkGdcmWriter_h
20 #define __vtkGdcmWriter_h
21
22 #include "gdcmCommon.h" // To avoid warnings concerning the std
23
24 #include <vtkImageWriter.h>
25 #include <vtkLookupTable.h>
26 #include <list>
27 #include <string>
28
29 //-----------------------------------------------------------------------------
30 #define VTK_GDCM_WRITE_TYPE_EXPLICIT_VR 1
31 #define VTK_GDCM_WRITE_TYPE_IMPLICIT_VR 2
32 #define VTK_GDCM_WRITE_TYPE_ACR         3
33 #define VTK_GDCM_WRITE_TYPE_ACR_LIBIDO  4
34
35 //-----------------------------------------------------------------------------
36 class VTK_EXPORT vtkGdcmWriter : public vtkImageWriter
37 {
38 public:
39    static vtkGdcmWriter *New();
40    vtkTypeRevisionMacro(vtkGdcmWriter, vtkImageWriter);
41
42    void PrintSelf(ostream& os, vtkIndent indent);
43
44    vtkSetObjectMacro(LookupTable,vtkLookupTable);
45    vtkGetObjectMacro(LookupTable,vtkLookupTable);
46
47    void SetWriteTypeToDcmImplVR()     { SetWriteType(VTK_GDCM_WRITE_TYPE_EXPLICIT_VR); };
48    void SetWriteTypeToDcmExplVR()     { SetWriteType(VTK_GDCM_WRITE_TYPE_IMPLICIT_VR); };
49    void SetWriteTypeToAcr()           { SetWriteType(VTK_GDCM_WRITE_TYPE_ACR); };
50    void SetWriteTypeToAcrLibido()     { SetWriteType(VTK_GDCM_WRITE_TYPE_ACR_LIBIDO); };
51    vtkSetMacro(WriteType,int);
52    vtkGetMacro(WriteType,int);
53    const char *GetWriteTypeAsString();
54
55 protected:
56    vtkGdcmWriter();
57    ~vtkGdcmWriter();
58
59   virtual void RecursiveWrite(int axis, vtkImageData *image, ofstream *file);
60   virtual void RecursiveWrite(int axis, vtkImageData *image, 
61                               vtkImageData *cache, ofstream *file);
62   void WriteDcmFile(char *fileName,vtkImageData *image);
63
64 private:
65 // Variables
66    vtkLookupTable *LookupTable;
67    int WriteType;
68 };
69
70 //-----------------------------------------------------------------------------
71 #endif
72