X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FOpenImageDialog.cxx;h=4a1038a684d43d68e2e8339f558e346dcda21f50;hb=5380f9e66daf440f27f33bb060e5ae1a646612cd;hp=f80bc74d6682c1b9af3630d478746123a8e43ff9;hpb=641bab7ee015a554fa99e678d713d66273756557;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx index f80bc74..4a1038a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx @@ -1,64 +1,127 @@ #include "OpenImageDialog.h" +#include "creaWx.h" + +#if defined(__GNUC__) +// GCC compiler +// dlopen, dlsym, etc. + #include +#endif typedef vtkImageData* (*GETIMAGEDATADIALOG)(); namespace creaMaracasVisuKernel{ - OpenImageDialog::OpenImageDialog() + OpenImageDialog::OpenImageDialog(bool usegimmick) { - - - img = NULL; - bool gimmicknotfound = true; - - #ifdef WIN32 - HINSTANCE gimmickhandle; - gimmickhandle = LoadLibrary(TEXT("creaImageIO2.dll")); - std::cout<<"imagehandle "<ShowModal()==wxID_OK) { - std::string path= FD->GetPath(); - - vtkMetaImageReader *reader = vtkMetaImageReader::New(); - reader->SetFileName(path.c_str()); - img = reader->GetOutput(); - } - } - - - + std::string path= crea::wx2std(FD->GetPath()); + vtkMetaImageReader* reader = vtkMetaImageReader::New(); + reader->SetFileName(path.c_str()); + reader->Update(); + _filename = path; + img = vtkImageData::New(); + img->DeepCopy(reader->GetOutput()); + //reader->GetOutput()->Delete(); + reader->Delete(); + /*std::cout<<"image reference count "<GetReferenceCount()<GetOutput()->GetSpacing(spacing); + img->SetSpacing(spacing); + reader->GetOutput()->GetExtent(extint); + img->SetExtent(extint); + img->SetScalarType(reader->GetOutput()->GetScalarType()); + img->AllocateScalars(); + std::cout<<"image reference count "<GetReferenceCount()<GetOutput()->GetScalarPointer(i,j,k); + ptr2=(unsigned short*)img->GetScalarPointer(i,j,k); + *ptr2 = *ptr1; + } + } + }*/ + + /*std::cout<<"image reference count "<GetReferenceCount()<