+ //managing memory
+ if (this->m_ImgDeque.size() > 0) {
+ this->m_ImgDeque.back().removeImageFromMemory();
+ this->m_ImgDeque.back().setStatus(false);
+ } //fi
+ //This is to take actual Date
+ 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);
+ //end
+ std::string aux(buffer);
+ std::string imageName = "img_" + aux;
+ ImageInfoUR imageInfo;
+ imageInfo.setImageName(imageName);
+ imageInfo.setImage(img);
+ imageInfo.setRegion(region);
+ imageInfo.setStatus(true);
+ //saving to disk
+ std::string fullpath = this->m_globalPath + imageName;
+ this->saveImageAsMHD(img, fullpath);
+ //Adding to deque
+ this->m_ImgDeque.push_back(imageInfo);
+ this->m_currentPos = this->m_ImgDeque.size() - 1;
+