X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FimageUndoRedo%2FimageInfoUR.cxx;fp=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FimageUndoRedo%2FimageInfoUR.cxx;h=3d1093752f0a67b7085eefb0e35d7e74bcd06568;hb=b37bd791f88bd4c1a6146fadcb88864d7cd1a5c3;hp=18c255eeae6ce381f34d7cc203bf4fe96792cf06;hpb=d0338585b83d4b0422ad465dedd0f885b3441600;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx index 18c255e..3d10937 100755 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageInfoUR.cxx @@ -7,7 +7,6 @@ #include "imageInfoUR.h" ImageInfoUR::ImageInfoUR() { - this->m_Image = NULL; this->m_OnMemory = false; this->m_OnDisk = false; } @@ -15,7 +14,7 @@ ImageInfoUR::ImageInfoUR() { 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) { @@ -24,39 +23,42 @@ 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 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 w = - vtkSmartPointer::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()); @@ -64,7 +66,6 @@ void ImageInfoUR::SaveImageAsMHD(const std::string& gPath) { w->Write(); } -void ImageInfoUR::RemoveImageFromDisk(const std::string& gPath) -{ +void ImageInfoUR::RemoveImageFromDisk(const StringType& gPath) { }