3 * @brief This file contains the ImageInfoUR class.
5 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
15 #include <vtkImageData.h>
16 #include <vtkMetaImageWriter.h>
17 #include <vtkMetaImageReader.h>
18 #include <vtkSmartPointer.h>
19 #include "regionStructUR.h"
20 #include "imageModificationManager.h"
22 /*! @class ImageInfoUR imageInfoUR.h "imageInfoUR.cxx"
23 * @brief This class contains the information of the undo/redo
24 * @details This class contains the two images (undo and redo) and the ImageMManager.
30 // ----------------------------------------------------------------------------------
31 /*! @typedef vtkSmartPointer<vtkImageData> VTKImageDataPointerType;
32 * @brief Defines the pointer of vtkImageDate type.
34 typedef vtkSmartPointer<vtkImageData> VTKImageDataPointerType;
35 // ----------------------------------------------------------------------------------
36 /*! @typedef vtkSmartPointer<vtkMetaImageReader> VTKMetaImageReaderPointerType;
37 * @brief Defines the pointer of vtkMetaImageReader type.
39 typedef vtkSmartPointer<vtkMetaImageReader> VTKMetaImageReaderPointerType;
40 // ----------------------------------------------------------------------------------
41 /*! @typedef vtkSmartPointer<vtkMetaImageWriter> VTKMetaImageWriterPointerType;
42 * @brief Defines the pointer of vtkMetaImageWriter type.
44 typedef vtkSmartPointer<vtkMetaImageWriter> VTKMetaImageWriterPointerType;
45 // ----------------------------------------------------------------------------------
46 /*! @typedef std::string StringType;
47 * @brief Redefinition of the string type.
49 typedef std::string StringType;
50 // ----------------------------------------------------------------------------------
51 /*! @typedef ImageMManager ImageMManagerType;
52 * @brief Definition of the ImageMManager type.
54 typedef ImageMManager ImageMManagerType;
55 // ----------------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------------
58 /*! @fn ImageInfoUR();
59 * @brief This is the default constructor.
62 // ----------------------------------------------------------------------------------
63 /*! @fn virtual ~ImageInfoUR();
64 * @brief This is the destructor.
66 virtual ~ImageInfoUR();
67 // ----------------------------------------------------------------------------------
68 /*! @fn void SetImageName(const StringType &imgName);
69 * @brief This method sets the image name for the undo/redo.
70 * @param imgName The imageName.
72 void SetImageName(const StringType &imgName);
73 // ----------------------------------------------------------------------------------
74 /*! @fn void SetImageMManager(ImageMManagerType *imMManager);
75 * @brief This method set the image modification manager.
76 * @param imMManager The pointer of the manager.
78 void SetImageMManager(ImageMManagerType *imMManager);
79 // ----------------------------------------------------------------------------------
80 /*! @fn void SetStatus(const bool& onMemory);
81 * @brief This method sets the memory status of the images.
82 * @param onMemory This is true if the images are in the memory.
84 void SetStatus(const bool& onMemory);
85 // ----------------------------------------------------------------------------------
86 /*! @fn void SetImages(VTKImageDataPointerType imgUndo,
87 VTKImageDataPointerType imgRedo);
88 * @brief This method sets the undo/redo Images.
89 * @param imgUndo The undo image.
90 * @param imgRedo The redo image.
92 void SetImages(VTKImageDataPointerType imgUndo,
93 VTKImageDataPointerType imgRedo);
94 // ----------------------------------------------------------------------------------
95 /*! @fn void LoadImagesToMemory(const StringType& gPath);
96 * @brief This method takes the images from disk and load them to the principal memory.
97 * @param gPath The global path where the images are stored.
99 void LoadImagesToMemory(const StringType& gPath);
100 // ----------------------------------------------------------------------------------
101 /*! @fn void RemoveImagesFromMemory(const StringType& gPath);
102 * @brief This method removes the images from the principal memory.
103 * @param gPath The global path where the images are stored.
105 void RemoveImagesFromMemory(const StringType& gPath);
106 // ----------------------------------------------------------------------------------
107 /*! @fn void SaveImagesOnDisk(const StringType& gPath);
108 * @brief This method stores the images in the hard disk.
109 * @param gPath The global path where the images are stored.
111 void SaveImagesOnDisk(const StringType& gPath);
112 // ----------------------------------------------------------------------------------
113 /*! @fn void RemoveImagesFromDisk(const StringType& gPath);
114 * @brief This method removes the images from the hard disk (permanently)
115 * @param gPath The global path where the images are stored.
117 void RemoveImagesFromDisk(const StringType& gPath);
118 // ----------------------------------------------------------------------------------
119 /*! @fn VTKImageDataPointerType GetUndoImage();
120 * @brief This method returns the undo image.
123 VTKImageDataPointerType GetUndoImage();
124 // ----------------------------------------------------------------------------------
125 /*! @fn VTKImageDataPointerType GetRedoImage();
126 * @brief This method returns the redo image.
129 VTKImageDataPointerType GetRedoImage();
130 // ----------------------------------------------------------------------------------
131 /*! @fn StringType GetImageName();
132 * @brief This method returns the ImagesName.
135 StringType GetImageName();
136 // ----------------------------------------------------------------------------------
137 /*! @fn ImageMManagerType* GetImageMManager();
138 * @brief This method returns the Image Modification Manager.
141 ImageMManagerType* GetImageMManager();
142 // ----------------------------------------------------------------------------------
143 /*! @fn void SaveImageAsMHD(const StringType& filename,
144 VTKImageDataPointerType image);
145 * @brief This method saves an image in a MHD format.
146 * @param filename The filename.
147 * @param VTKImageDataPointerType image.
149 void SaveImageAsMHD(const StringType& filename,
150 VTKImageDataPointerType image);
151 // ----------------------------------------------------------------------------------
152 /*! @fn bool GetStatus();
153 * @brief This method returns true if the images are located in the principal memory.
157 // ----------------------------------------------------------------------------------
159 VTKImageDataPointerType m_UndoImage; //!<This is the undo image.
160 VTKImageDataPointerType m_RedoImage; //!<This is the redo image
161 StringType m_ImageName; //!<This is the base name of the images.
162 ImageMManagerType* m_ImageMManager; //!<This is the modification manager of the images.
163 bool m_OnMemory; //!<This is true if the images are in memory.
164 bool m_OnDisk; //!<This is true if the images are in disk.
168 #endif /* IMAGEINFO_H_ */