]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / imageUndoRedo / imageInfoUR.cxx
index d788dbc06ebc9d5aea9963ba9b8b546a9be2dea8..69c3811aceebfd4d63d639de64aa977187d2189e 100755 (executable)
@@ -50,6 +50,7 @@ void ImageInfoUR::RemoveImageFromMemory(const StringType& gPath) {
 }
 void ImageInfoUR::LoadImageMHDToMemory(const StringType& gPath) {
        StringType filename = gPath + this->m_ImageName;
+       filename.append(".mhd");
        VTKMetaImageReaderPointerType reader = VTKMetaImageReaderPointerType::New();
        reader->SetFileName(filename.c_str());
        this->m_Image = reader->GetOutput();
@@ -59,6 +60,9 @@ void ImageInfoUR::LoadImageMHDToMemory(const StringType& gPath) {
 void ImageInfoUR::SaveImageAsMHD(const StringType& gPath) {
        this->m_OnDisk = true;
        StringType filename = gPath + this->m_ImageName;
+       filename.append(".mhd");
+       //managing temporary files
+//EED-11/11/2011       mkstemp((char*) filename.c_str());
        VTKMetaImageWriterPointerType w = VTKMetaImageWriterPointerType::New();
        w->SetInput(this->m_Image);
        w->SetCompression(false);
@@ -68,5 +72,11 @@ void ImageInfoUR::SaveImageAsMHD(const StringType& gPath) {
 }
 
 void ImageInfoUR::RemoveImageFromDisk(const StringType& gPath) {
-
+       StringType filename = gPath + this->m_ImageName;
+       filename.append(".mhd");
+       StringType filenameRaw = gPath + this->m_ImageName;
+       filenameRaw.append(".raw");
+//EED-11/11/2011       mkstemp((char*) filenameRaw.c_str());
+       unlink((char*) filename.c_str());
+       unlink((char*) filenameRaw.c_str());
 }