1 /*=========================================================================
4 Module: $RCSfile: vtkGdcmWriter.h,v $
6 Date: $Date: 2006/05/02 10:09:43 $
7 Version: $Revision: 1.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.
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 __vtkGdcmWriter_h
20 #define __vtkGdcmWriter_h
22 #include "gdcmCommon.h" // To avoid warnings concerning the std
23 #include "gdcmFile.h" // for gdcm::File
25 #include <vtkImageWriter.h>
26 #include <vtkLookupTable.h>
29 //-----------------------------------------------------------------------------
31 #define VTK_GDCM_WRITE_TYPE_EXPLICIT_VR 1
32 #define VTK_GDCM_WRITE_TYPE_IMPLICIT_VR 2
33 #define VTK_GDCM_WRITE_TYPE_ACR 3
34 #define VTK_GDCM_WRITE_TYPE_ACR_LIBIDO 4
36 #define VTK_GDCM_WRITE_TYPE_USER_OWN_IMAGE 1
37 #define VTK_GDCM_WRITE_TYPE_FILTERED_IMAGE 2
38 #define VTK_GDCM_WRITE_TYPE_CREATED_IMAGE 3
39 #define VTK_GDCM_WRITE_TYPE_UNMODIFIED_PIXELS_IMAGE 4
41 //-----------------------------------------------------------------------------
43 class vtkMedicalImageProperties;
45 class VTK_EXPORT vtkGdcmWriter : public vtkImageWriter
48 static vtkGdcmWriter *New();
49 vtkTypeRevisionMacro(vtkGdcmWriter, vtkImageWriter);
51 void PrintSelf(ostream &os, vtkIndent indent);
53 //vtkSetObjectMacro(LookupTable, vtkLookupTable);
54 virtual void SetLookupTable(vtkLookupTable*);
55 vtkGetObjectMacro(LookupTable, vtkLookupTable);
57 void SetWriteTypeToDcmImplVR(){SetWriteType(VTK_GDCM_WRITE_TYPE_EXPLICIT_VR);};
58 void SetWriteTypeToDcmExplVR(){SetWriteType(VTK_GDCM_WRITE_TYPE_IMPLICIT_VR);};
59 void SetWriteTypeToAcr() {SetWriteType(VTK_GDCM_WRITE_TYPE_ACR); };
60 void SetWriteTypeToAcrLibido(){SetWriteType(VTK_GDCM_WRITE_TYPE_ACR_LIBIDO); };
62 void SetContentTypeToUserOwnImage() {SetContentType(VTK_GDCM_WRITE_TYPE_USER_OWN_IMAGE);};
63 void SetContentTypeToFilteredImage() {SetContentType(VTK_GDCM_WRITE_TYPE_FILTERED_IMAGE);};
64 void SetContentTypeToUserCreatedImage() {SetContentType(VTK_GDCM_WRITE_TYPE_CREATED_IMAGE);};
65 void SetContentTypeToUnmodifiedPixelsImage(){SetContentType(VTK_GDCM_WRITE_TYPE_UNMODIFIED_PIXELS_IMAGE);};
67 vtkSetMacro(WriteType, int);
68 vtkGetMacro(WriteType, int);
69 const char *GetWriteTypeAsString();
73 vtkSetMacro(GdcmFile, gdcm::File *);
74 vtkGetMacro(GdcmFile, gdcm::File *);
77 vtkSetMacro(ContentType, int);
78 vtkGetMacro(ContentType, int);
81 // To pass in some extra information from a VTK context a user can pass a
82 // vtkMedicalImageProperties object
83 #if (VTK_MAJOR_VERSION >= 5)
84 void SetMedicalImageProperties(vtkMedicalImageProperties*);
86 void SetMedicalImageProperties(vtkMedicalImageProperties*) {}
93 virtual void RecursiveWrite(int axis, vtkImageData *image, ofstream *file);
94 virtual void RecursiveWrite(int axis, vtkImageData *image,
95 vtkImageData *cache, ofstream *file);
96 void WriteDcmFile(char *fileName, vtkImageData *image);
100 vtkLookupTable *LookupTable;
101 vtkMedicalImageProperties *MedicalImageProperties;
104 gdcm::File *GdcmFile;
110 //-----------------------------------------------------------------------------