INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView )
-#DCH
+#DFCH
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer )
-#DCH
+INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo )
+#DFCH
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/CutModule/interface )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/CutModule/kernel )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/../../../ )
FILE(GLOB ${LIBRARY_NAME}_HEADERS_PPLOTTER "src/interface/wxWindows/widgets/pPlotter/*.h")
FILE(GLOB ${LIBRARY_NAME}_SOURCES_PPLOTTER src/interface/wxWindows/widgets/pPlotter/*.cxx src/interface/wxWindows/widgets/pPlotter/*.cpp src/interface/wxWindows/widgets/pPlotter/*.cc)
-#DCH
+#DFCH
FILE(GLOB ${LIBRARY_NAME}_HEADERS_CBUTTONCONTAINER "src/interface/wxWindows/widgets/creaButtonContainer/model/*.h" "src/interface/wxWindows/widgets/creaButtonContainer/model/*.txx" "src/interface/wxWindows/widgets/creaButtonContainer/view/*.h" "src/interface/wxWindows/widgets/creaButtonContainer/controller/*.h" )
FILE(GLOB ${LIBRARY_NAME}_SOURCES_CBUTTONCONTAINER src/interface/wxWindows/widgets/creaButtonContainer/model/*.cxx src/interface/wxWindows/widgets/creaButtonContainer/view/*.cxx src/interface/wxWindows/widgets/creaButtonContainer/controller/*.cxx )
FILE(GLOB ${LIBRARY_NAME}_HEADERS_CPBUTTONCONTAINER "src/interface/wxWindows/widgets/creaPanelButtonContainer/*.h" )
FILE(GLOB ${LIBRARY_NAME}_SOURCES_CPBUTTONCONTAINER src/interface/wxWindows/widgets/creaPanelButtonContainer/*.cxx )
-#DCH
+ FILE(GLOB ${LIBRARY_NAME}_HEADERS_UNDO_REDO "src/interface/wxWindows/widgets/imageUndoRedo/*.h")
+ FILE(GLOB ${LIBRARY_NAME}_SOURCES_UNDO_REDO src/interface/wxWindows/widgets/imageUndoRedo/*.cxx )
+#DFCH
FILE(GLOB ${LIBRARY_NAME}_HEADERS_MANUAL_CONTOUR "src/interface/wxWindows/widgets/manualContour/*.h")
FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_CONTOUR src/interface/wxWindows/widgets/manualContour/*.cpp )
${${LIBRARY_NAME}_HEADERS_CUTMODULE}
${${LIBRARY_NAME}_HEADERS_CBUTTONCONTAINER}
${${LIBRARY_NAME}_HEADERS_CPBUTTONCONTAINER}
+ ${${LIBRARY_NAME}_HEADERS_UNDO_REDO}
)
#----------------------------------------------------------------------------
${${LIBRARY_NAME}_SOURCES_CUTMODULE}
${${LIBRARY_NAME}_SOURCES_CBUTTONCONTAINER}
${${LIBRARY_NAME}_SOURCES_CPBUTTONCONTAINER}
+ ${${LIBRARY_NAME}_SOURCES_UNDO_REDO}
)
#----------------------------------------------------------------------------
#jhcl-Start===========================================================================
--- /dev/null
+#include "image3DDequeUR.h"
+
+Image3DDequeUR::Image3DDequeUR() {
+ this->m_GlobalPath = "/tmp/";
+ this->m_CurrentUndoPos = -1;
+ this->m_CurrentRedoPos = -1;
+}
+//virtual
+Image3DDequeUR::~Image3DDequeUR() {
+
+}
+//virtual
+void Image3DDequeUR::AddImageToUndoContainer(ImageType* img,
+ const RegionS& region) {
+ //managing memory
+ if (this->m_ImgUndoDeque.size() > 0) {
+ this->m_ImgUndoDeque.back().RemoveImageFromMemory(this->m_GlobalPath);
+ } //fi
+ //Adding image
+ ImageInfoUR imageInfo;
+ imageInfo.SetImageName(this->GetImageName());
+ imageInfo.SetImage(img);
+ imageInfo.SetRegion(region);
+ imageInfo.SaveImageAsMHD(this->m_GlobalPath);
+ //cleaning deque from current position
+ this->CleanUndoContainerFromIndex(this->m_CurrentUndoPos);
+ this->CleanRedoContainerFromIndex(0);
+ this->m_ImgRedoDeque.clear();
+ //Adding to deque
+ this->m_ImgUndoDeque.push_back(imageInfo);
+ this->m_CurrentUndoPos = this->m_ImgUndoDeque.size() - 1;
+}
+//virtual
+void Image3DDequeUR::AddImageToRedoContainer(ImageType* img,
+ const RegionS& region) {
+ //managing memory
+ if (this->m_ImgRedoDeque.size() > 0) {
+ this->m_ImgRedoDeque.back().RemoveImageFromMemory(this->m_GlobalPath);
+ } //fi
+ //adding image
+ ImageInfoUR imageInfo;
+ imageInfo.SetImageName(this->GetImageName());
+ imageInfo.SetImage(img);
+ imageInfo.SetRegion(region);
+ imageInfo.SaveImageAsMHD(this->m_GlobalPath);
+ //Adding to deque
+ this->m_ImgRedoDeque.push_back(imageInfo);
+ this->m_CurrentUndoPos = this->m_ImgRedoDeque.size() - 1;
+}
+//virtual
+void Image3DDequeUR::CleanUndoContainerFromIndex(const unsigned int& index) {
+ for (int i = this->m_ImgUndoDeque.size() - 1; i > this->m_CurrentUndoPos;
+ i--) {
+ this->m_ImgUndoDeque[i].RemoveImageFromMemory(this->m_GlobalPath);
+ this->m_ImgUndoDeque[i].RemoveImageFromDisk(this->m_GlobalPath);
+ this->m_ImgUndoDeque.pop_back();
+ }
+}
+//virtual
+void Image3DDequeUR::CleanRedoContainerFromIndex(const unsigned int& index) {
+ for (int i = this->m_ImgRedoDeque.size() - 1; i > this->m_CurrentRedoPos;
+ i--) {
+ this->m_ImgRedoDeque[i].RemoveImageFromMemory(this->m_GlobalPath);
+ this->m_ImgRedoDeque[i].RemoveImageFromDisk(this->m_GlobalPath);
+ this->m_ImgRedoDeque.pop_back();
+ }
+}
+
+//virtual
+ImageInfoUR Image3DDequeUR::Undo() {
+ ImageInfoUR imgRet;
+ if ((this->m_ImgUndoDeque.size() > 0) && (this->m_CurrentUndoPos != -1)) {
+ //removing from memory
+ if ((this->m_CurrentUndoPos + 1) < this->m_ImgUndoDeque.size()) {
+ this->m_ImgUndoDeque[(m_CurrentUndoPos + 1)].RemoveImageFromMemory(
+ this->m_GlobalPath);
+ } //fi
+ ImageInfoUR imgRet = this->m_ImgUndoDeque[m_CurrentUndoPos];
+ this->m_CurrentUndoPos--;
+ //adding to memory
+ if (this->m_CurrentUndoPos != -1) {
+ //Loading image
+ std::string fullPath = this->m_GlobalPath
+ + this->m_ImgUndoDeque[m_CurrentUndoPos].GetImageName();
+ this->m_ImgUndoDeque[m_CurrentUndoPos].LoadImageMHDToMemory(
+ this->m_GlobalPath);
+ } //fi
+ } //fi
+ return (imgRet);
+}
+//virtual
+ImageInfoUR Image3DDequeUR::Redo() {
+
+ ImageInfoUR imgRet;
+ //managing undo deque
+ if (this->m_ImgUndoDeque.size() > 0) {
+ if ((m_CurrentUndoPos - 1) != -1) {
+ this->m_ImgUndoDeque[m_CurrentUndoPos - 1].RemoveImageFromMemory(
+ this->m_GlobalPath);
+ } //fi
+ this->m_CurrentUndoPos++; //ready to do undo
+ if (this->m_CurrentUndoPos < ((int) this->m_ImgUndoDeque.size())) {
+ this->m_ImgUndoDeque[m_CurrentUndoPos].LoadImageMHDToMemory(
+ this->m_GlobalPath);
+ } //fi
+ //end of undo management
+ } //fi
+ //managing redo
+ if ((this->m_ImgRedoDeque.size() > 0) && (this->m_CurrentRedoPos != -1)) {
+ if ((this->m_CurrentRedoPos + 1) < this->m_ImgRedoDeque.size()) {
+ this->m_ImgRedoDeque[(m_CurrentRedoPos + 1)].RemoveImageFromMemory(
+ this->m_GlobalPath);
+ } //fi
+ imgRet = this->m_ImgRedoDeque[this->m_CurrentRedoPos];
+ this->m_CurrentRedoPos--;
+ if (this->m_CurrentRedoPos != -1) {
+ this->m_ImgRedoDeque[m_CurrentRedoPos].LoadImageMHDToMemory(
+ this->m_GlobalPath);
+ } //fi
+ //end of redo management
+ }
+ return (imgRet);
+}
+//virtual
+void Image3DDequeUR::CleanContainers() {
+ for (unsigned int i = 0; i < this->m_ImgUndoDeque.size(); i++) {
+ this->m_ImgUndoDeque[i].RemoveImageFromMemory(this->m_GlobalPath);
+ this->m_ImgUndoDeque[i].RemoveImageFromDisk(this->m_GlobalPath);
+ } //rof
+ for (unsigned int i = 0; i < this->m_ImgRedoDeque.size(); i++) {
+ this->m_ImgRedoDeque[i].RemoveImageFromMemory(this->m_GlobalPath);
+ this->m_ImgRedoDeque[i].RemoveImageFromDisk(this->m_GlobalPath);
+ } //rof
+ this->m_ImgRedoDeque.clear();
+ this->m_ImgUndoDeque.clear();
+}
+
+void Image3DDequeUR::SetGlobalPath(const std::string& globalPath) {
+ this->m_GlobalPath = globalPath;
+}
+
+std::string Image3DDequeUR::GetGlobalPath() {
+ return (this->m_GlobalPath);
+}
+
+std::string Image3DDequeUR::GetImageName() {
+//Giving a name to an image using the date and time
+ time_t rawtime;
+ struct tm * timeinfo;
+ char buffer[80];
+ time(&rawtime);
+ timeinfo = localtime(&rawtime);
+ strftime(buffer, 80, "%a_%d_%b_%y_%H_%M_S", timeinfo);
+ std::string date(buffer);
+ std::string aux(buffer);
+ std::string imageName = "img_" + aux;
+ return (imageName);
+}
#include "imageDequeUR.h"
#include <ctime>
-#include "vtkMetaImageWriter.h"
class Image3DDequeUR: public ImageDequeUR {
private:
ImageInfoDeque m_ImgUndoDeque;
ImageInfoDeque m_ImgRedoDeque;
- int m_currentUndoPos;
- std::string m_globalPath;
+ int m_CurrentUndoPos;
+ int m_CurrentRedoPos;
+ std::string m_GlobalPath;
public:
Image3DDequeUR();
virtual ~Image3DDequeUR();
+ void SetGlobalPath(const std::string& globalPath);
+ std::string GetGlobalPath();
+ std::string GetImageName();
virtual void AddImageToUndoContainer(ImageType* img, const RegionS& region);
virtual void AddImageToRedoContainer(ImageType* img, const RegionS& region);
- virtual void LoadUndoImageToPMemory(const unsigned int& index);
- virtual void RemoveUndoImageFromPMemory(const unsigned int& index);
- virtual void LoadRedoImageToPMemory(const unsigned int& index);
- virtual void RemoveRedoImageFromPMemory(const unsigned int& index);
- virtual void SaveImageAsMHD(ImageType* img, const std::string& filename);
+ virtual void CleanUndoContainerFromIndex(const unsigned int& index);
+ virtual void CleanRedoContainerFromIndex(const unsigned int& index);
+ virtual void CleanContainers();
virtual ImageInfoUR Undo();
virtual ImageInfoUR Redo();
- void CleanContainers();
- void SetGlobalPath(const std::string& globalPath);
- std::string GetGlobalPath();
- std::string GetImageName();
};
#endif /* IMAGE3DDEQUEUR_H_ */
}
void ImageDequeUR::AddImageToUndoContainer(ImageType* img,
const RegionS& region) {
-
}
void ImageDequeUR::AddImageToRedoContainer(ImageType* img,
const RegionS& region) {
-
-}
-void ImageDequeUR::LoadUndoImageToPMemory(const unsigned int& index) {
-
}
-void ImageDequeUR::RemoveUndoImageFromPMemory(const unsigned int& index) {
+void ImageDequeUR::CleanUndoContainerFromIndex(const unsigned int& index) {
}
-void ImageDequeUR::LoadRedoImageToPMemory(const unsigned int& index) {
-
-}
-void ImageDequeUR::RemoveRedoImageFromPMemory(const unsigned int& index) {
-
+void ImageDequeUR::CleanRedoContainerFromIndex(const unsigned int& index) {
}
-void ImageDequeUR::SaveImageAsMHD(ImageType* img, const std::string& filename) {
-}
ImageInfoUR ImageDequeUR::Undo() {
ImageInfoUR im;
return im;
virtual ~ImageDequeUR();
virtual void AddImageToUndoContainer(ImageType* img, const RegionS& region);
virtual void AddImageToRedoContainer(ImageType* img, const RegionS& region);
- virtual void LoadUndoImageToPMemory(const unsigned int& index);
- virtual void RemoveUndoImageFromPMemory(const unsigned int& index);
- virtual void LoadRedoImageToPMemory(const unsigned int& index);
- virtual void RemoveRedoImageFromPMemory(const unsigned int& index);
- virtual void SaveImageAsMHD(ImageType* img, const std::string& filename);
+ virtual void CleanUndoContainerFromIndex(const unsigned int& index);
+ virtual void CleanRedoContainerFromIndex(const unsigned int& index);
+ virtual void CleanContainers();
virtual ImageInfoUR Undo();
virtual ImageInfoUR Redo();
};
--- /dev/null
+/*
+ * ImageInfo.cxx
+ *
+ * Created on: Sep 22, 2011
+ * Author: caceres
+ */
+#include "imageInfoUR.h"
+
+ImageInfoUR::ImageInfoUR() {
+ this->m_Image = NULL;
+ this->m_OnMemory = false;
+ this->m_OnDisk = false;
+}
+
+ImageInfoUR::~ImageInfoUR() {
+ this->m_Image->Delete();
+}
+
+void ImageInfoUR::SetImageName(const std::string &imgName) {
+ this->m_ImageName = imgName;
+}
+void ImageInfoUR::SetRegion(const RegionStructUR ®ion) {
+ this->m_Region = region;
+}
+void ImageInfoUR::SetStatus(const bool& onMemory) {
+ this->m_OnMemory = onMemory;
+}
+void ImageInfoUR::SetImage(vtkImageData* img) {
+ this->m_Image = img;
+ this->SetStatus(true);
+}
+std::string ImageInfoUR::GetImageName() {
+ return (this->m_ImageName);
+}
+RegionStructUR ImageInfoUR::GetRegion() {
+ return (this->m_Region);
+}
+bool ImageInfoUR::GetStatus() {
+ return (this->m_OnMemory);
+}
+void ImageInfoUR::RemoveImageFromMemory(const std::string& gPath) {
+ if (!this->m_OnDisk) {
+ this->SaveImageAsMHD(gPath);
+ }
+ this->m_Image->Delete();
+ this->SetStatus(false);
+}
+void ImageInfoUR::LoadImageMHDToMemory(const std::string& gPath) {
+ std::string filename = gPath + this->m_ImageName;
+ vtkSmartPointer<vtkMetaImageReader> reader = vtkSmartPointer<
+ vtkMetaImageReader>::New();
+ reader->SetFileName(filename.c_str());
+ this->m_Image = reader->GetOutput();
+ this->m_OnMemory = true;
+}
+void ImageInfoUR::SaveImageAsMHD(const std::string& gPath) {
+ this->m_OnDisk = true;
+ std::string filename = gPath + this->m_ImageName;
+ vtkSmartPointer<vtkMetaImageWriter> w =
+ vtkSmartPointer<vtkMetaImageWriter>::New();
+ w->SetInput(this->m_Image);
+ w->SetCompression(false);
+ w->SetFileDimensionality(this->m_Image->GetDataDimension());
+ w->SetFileName(filename.c_str());
+ w->Update();
+ w->Write();
+ w->Delete();
+}
+
+void ImageInfoUR::RemoveImageFromDisk(const std::string& gPath)
+{
+
+}
#include <iostream>
#include <string>
#include <vtkImageData.h>
+#include <vtkMetaImageWriter.h>
+#include <vtkMetaImageReader.h>
+#include <vtkSmartPointer.h>
#include "regionStructUR.h"
class ImageInfoUR {
std::string m_ImageName;
RegionStructUR m_Region;
bool m_OnMemory;
+ bool m_OnDisk;
public:
ImageInfoUR();
virtual ~ImageInfoUR();
void SetRegion(const RegionStructUR ®ion);
void SetStatus(const bool& onMemory);
void SetImage(vtkImageData* img);
+ void RemoveImageFromMemory(const std::string& gPath);
+ void LoadImageMHDToMemory(const std::string& gPath);
+ void SaveImageAsMHD(const std::string& gPath);
+ void RemoveImageFromDisk(const std::string& gPath);
std::string GetImageName();
RegionStructUR GetRegion();
bool GetStatus();
- void RemoveImageFromMemory();
};
#endif /* IMAGEINFO_H_ */
void ImageUndoRedo::Redo() {
ImageInfoUR imageInfo = this->m_ImagesDeque->Redo();
this->DrawUR(imageInfo);
- imageInfo.RemoveImageFromMemory();
}
-void ImageUndoRedo::SetImage(vtkImageData *image)
-{
+void ImageUndoRedo::SetImage(vtkImageData *image) {
this->m_CurrentImage = image;
this->m_CurrentImage->Update();
this->m_OriginalImage = ImageType::New();
}
//virtual
void ImageUndoRedo::SetUndoImage(const RegionSType& region) {
- vtkExtractVOI* extract;
- extract->New();
+ vtkSmartPointer<vtkExtractVOI> extract =
+ vtkSmartPointer<vtkExtractVOI>::New();
extract->SetVOI(region.minX, region.maxX, region.minY, region.maxY,
region.minZ, region.maxZ);
extract->SetSampleRate(1, 1, 1);
}
//virtual
void ImageUndoRedo::SetRedoImage(const RegionSType& region) {
- vtkExtractVOI* extract;
- extract->New();
+ vtkSmartPointer<vtkExtractVOI> extract =
+ vtkSmartPointer<vtkExtractVOI>::New();
extract->SetVOI(region.minX, region.maxX, region.minY, region.maxY,
region.minZ, region.maxZ);
extract->SetSampleRate(1, 1, 1);
#include "managerUR.h"
#include <vtkExtractVOI.h>
+#include <vtkSmartPointer.h>
class ImageUndoRedo: public ManagerUR {
+++ /dev/null
-#include "image3DDequeUR.h"
-
-Image3DDequeUR::Image3DDequeUR() {
- this->m_globalPath = "/tmp/";
- this->m_currentUndoPos = -1;
-}
-//virtual
-Image3DDequeUR::~Image3DDequeUR() {
-
-}
-//virtual
-void Image3DDequeUR::AddImageToUndoContainer(ImageType* img,
- const RegionS& region) {
- //managing memory
- if (this->m_ImgUndoDeque.size() > 0) {
- this->m_ImgUndoDeque.back().RemoveImageFromMemory();
- } //fi
- ImageInfoUR imageInfo;
- imageInfo.SetImageName(this->GetImageName());
- imageInfo.SetImage(img);
- imageInfo.SetRegion(region);
- //saving to disk
- std::string fullpath = this->m_globalPath + imageInfo.GetImageName()
- + "_UNDO.MHD";
- this->SaveImageAsMHD(img, fullpath);
- //Adding to deque
- this->m_ImgUndoDeque.push_back(imageInfo);
- this->m_currentUndoPos = this->m_ImgUndoDeque.size() - 1;
-}
-//virtual
-void Image3DDequeUR::AddImageToRedoContainer(ImageType* img,
- const RegionS& region) {
- //managing memory
- if (this->m_ImgRedoDeque.size() > 0) {
- this->m_ImgRedoDeque.back().RemoveImageFromMemory();
- } //fi
- ImageInfoUR imageInfo;
- imageInfo.SetImageName(this->GetImageName());
- imageInfo.SetImage(img);
- imageInfo.SetRegion(region);
- //saving to disk
- std::string fullpath = this->m_globalPath + imageInfo.GetImageName()
- + "_REDO.MHD";
- this->SaveImageAsMHD(img, fullpath);
- //Adding to deque
- this->m_ImgRedoDeque.push_back(imageInfo);
-}
-//virtual
-void Image3DDequeUR::LoadUndoImageToPMemory(const unsigned int& index) {
-
-}
-//virtual
-void Image3DDequeUR::RemoveUndoImageFromPMemory(const unsigned int& index) {
- this->m_ImgUndoDeque[index].RemoveImageFromMemory();
-}
-//virtual
-void Image3DDequeUR::LoadRedoImageToPMemory(const unsigned int& index) {
-
-}
-//virtual
-void Image3DDequeUR::RemoveRedoImageFromPMemory(const unsigned int& index) {
- this->m_ImgRedoDeque[index].RemoveImageFromMemory();
-}
-//virtual
-void Image3DDequeUR::SaveImageAsMHD(ImageType* img,
- const std::string& filename) {
- vtkMetaImageWriter* w = vtkMetaImageWriter::New();
- w->SetInput(img);
- w->SetCompression(false);
- w->SetFileDimensionality(img->GetDataDimension());
- w->SetFileName(filename.c_str());
- w->Update();
- w->Write();
- w->Delete();
-}
-
-//virtual
-ImageInfoUR Image3DDequeUR::Undo() {
- ImageInfoUR imgRet;
- if (this->m_currentUndoPos < (this->m_ImgUndoDeque.size() + 1)) {
- this->m_ImgUndoDeque[(unsigned int) (m_currentUndoPos + 1)].RemoveImageFromMemory();
- } //fi
- if (this->m_currentUndoPos != -1) {
- //removing from memory
- if ((this->m_currentUndoPos + 1) < this->m_ImgUndoDeque.size()) {
- this->m_ImgUndoDeque[(unsigned int) (m_currentUndoPos + 1)].RemoveImageFromMemory();
- } //fi
- ImageInfoUR imgRet =
- this->m_ImgUndoDeque[(unsigned int) m_currentUndoPos];
- this->m_currentUndoPos--;
- //adding to memory
- if (this->m_currentUndoPos != -1) {
- this->LoadUndoImageToPMemory((unsigned int) m_currentUndoPos);
- } //fi
- } //fi
- return (imgRet);
-}
-//virtual
-ImageInfoUR Image3DDequeUR::Redo() {
- ImageInfoUR imgRet;
- if (this->m_currentUndoPos >= (this->m_ImgRedoDeque.size() - 1)
- && (this->m_ImgRedoDeque.size() > 0)) {
- this->m_ImgUndoDeque[(unsigned int) (m_currentUndoPos)].RemoveImageFromMemory();
- this->m_currentUndoPos++;
- this->LoadUndoImageToPMemory((unsigned int) m_currentUndoPos);
- imgRet = this->m_ImgRedoDeque.back();
- this->m_ImgRedoDeque.pop_back();
- if (this->m_ImgRedoDeque.size() > 0) {
- LoadRedoImageToPMemory(
- (unsigned int) (this->m_ImgRedoDeque.size() - 1));
- } //fi
- } //fi
- return (imgRet);
-}
-
-void Image3DDequeUR::CleanContainers() {
- for (unsigned int i = 0; i < this->m_ImgUndoDeque.size(); i++) {
- this->m_ImgUndoDeque[i].RemoveImageFromMemory();
- } //rof
- for (unsigned int i = 0; i < this->m_ImgRedoDeque.size(); i++) {
- this->m_ImgRedoDeque[i].RemoveImageFromMemory();
- } //rof
- this->m_ImgRedoDeque.clear();
- this->m_ImgUndoDeque.clear();
-}
-
-void Image3DDequeUR::SetGlobalPath(const std::string& globalPath) {
- this->m_globalPath = globalPath;
-}
-
-std::string Image3DDequeUR::GetGlobalPath() {
- return (this->m_globalPath);
-}
-
-std::string Image3DDequeUR::GetImageName() {
- //Giving a name to an image using the date and time
- time_t rawtime;
- struct tm * timeinfo;
- char buffer[80];
- time(&rawtime);
- timeinfo = localtime(&rawtime);
- strftime(buffer, 80, "%a_%d_%b_%y_%H_%M_S", timeinfo);
- std::string date(buffer);
- std::string aux(buffer);
- std::string imageName = "img_" + aux;
- return (imageName);
-}
+++ /dev/null
-/*
- * ImageInfo.cxx
- *
- * Created on: Sep 22, 2011
- * Author: caceres
- */
-#include "imageInfoUR.h"
-
-ImageInfoUR::ImageInfoUR() {
- this->m_Image = NULL;
-}
-
-ImageInfoUR::~ImageInfoUR() {
- this->RemoveImageFromMemory();
-}
-
-void ImageInfoUR::SetImageName(const std::string &imgName) {
- this->m_ImageName = imgName;
-}
-void ImageInfoUR::SetRegion(const RegionStructUR ®ion) {
- this->m_Region = region;
-}
-void ImageInfoUR::SetStatus(const bool& onMemory) {
- this->m_OnMemory = onMemory;
-}
-void ImageInfoUR::SetImage(vtkImageData* img) {
- this->m_Image = img;
- this->SetStatus(true);
-}
-std::string ImageInfoUR::GetImageName() {
- return (this->m_ImageName);
-}
-RegionStructUR ImageInfoUR::GetRegion() {
- return (this->m_Region);
-}
-bool ImageInfoUR::GetStatus() {
- return (this->m_OnMemory);
-}
-void ImageInfoUR::RemoveImageFromMemory() {
- this->m_Image->Delete();
- this->SetStatus(false);
-}