#include "imageInfoUR.h"
ImageInfoUR::ImageInfoUR() {
- this->m_Image = NULL;
this->m_OnMemory = false;
this->m_OnDisk = false;
}
ImageInfoUR::~ImageInfoUR() {
}
-void ImageInfoUR::SetImageName(const std::string &imgName) {
+void ImageInfoUR::SetImageName(const StringType &imgName) {
this->m_ImageName = imgName;
}
void ImageInfoUR::SetRegion(const RegionStructUR ®ion) {
void ImageInfoUR::SetStatus(const bool& onMemory) {
this->m_OnMemory = onMemory;
}
-void ImageInfoUR::SetImage(vtkImageData* img) {
+void ImageInfoUR::SetImage(VTKImageDataPointerType img) {
this->m_Image = img;
this->SetStatus(true);
}
-std::string ImageInfoUR::GetImageName() {
+ImageInfoUR::StringType ImageInfoUR::GetImageName() {
return (this->m_ImageName);
}
+
+ImageInfoUR::VTKImageDataPointerType ImageInfoUR::GetImage() {
+ return (this->m_Image);
+}
+
RegionStructUR ImageInfoUR::GetRegion() {
return (this->m_Region);
}
bool ImageInfoUR::GetStatus() {
return (this->m_OnMemory);
}
-void ImageInfoUR::RemoveImageFromMemory(const std::string& gPath) {
+void ImageInfoUR::RemoveImageFromMemory(const StringType& gPath) {
if (!this->m_OnDisk) {
this->SaveImageAsMHD(gPath);
}
this->m_Image = NULL;
this->SetStatus(false);
}
-void ImageInfoUR::LoadImageMHDToMemory(const std::string& gPath) {
- std::string filename = gPath + this->m_ImageName;
- vtkSmartPointer<vtkMetaImageReader> reader = vtkSmartPointer<
- vtkMetaImageReader>::New();
+void ImageInfoUR::LoadImageMHDToMemory(const StringType& gPath) {
+ StringType filename = gPath + this->m_ImageName;
+ VTKMetaImageReaderPointerType reader = VTKMetaImageReaderPointerType::New();
reader->SetFileName(filename.c_str());
this->m_Image = reader->GetOutput();
this->m_OnMemory = true;
}
-void ImageInfoUR::SaveImageAsMHD(const std::string& gPath) {
+void ImageInfoUR::SaveImageAsMHD(const StringType& gPath) {
this->m_OnDisk = true;
- std::string filename = gPath + this->m_ImageName;
- vtkSmartPointer<vtkMetaImageWriter> w =
- vtkSmartPointer<vtkMetaImageWriter>::New();
+ StringType filename = gPath + this->m_ImageName;
+ VTKMetaImageWriterPointerType w = VTKMetaImageWriterPointerType::New();
w->SetInput(this->m_Image);
w->SetCompression(false);
w->SetFileDimensionality(this->m_Image->GetDataDimension());
w->Write();
}
-void ImageInfoUR::RemoveImageFromDisk(const std::string& gPath)
-{
+void ImageInfoUR::RemoveImageFromDisk(const StringType& gPath) {
}