From b0a60f90532e0fef49b89328910f3b7114796498 Mon Sep 17 00:00:00 2001 From: Juan Prieto Date: Thu, 14 Apr 2011 15:37:26 +0000 Subject: [PATCH] Loading osirix files, problem when installed version --- appli/wxContourGUIExample/wxContourGUIExample.cxx | 2 +- .../KernelManagerContour.cxx | 2 +- .../ParserOsirix/OsirixParser.cxx | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/appli/wxContourGUIExample/wxContourGUIExample.cxx b/appli/wxContourGUIExample/wxContourGUIExample.cxx index 4c26c64..19bccf3 100644 --- a/appli/wxContourGUIExample/wxContourGUIExample.cxx +++ b/appli/wxContourGUIExample/wxContourGUIExample.cxx @@ -124,7 +124,7 @@ bool wxTheApplication :: OnInit() //JCP #ifdef LINUX /* assume this is OSX */ - datadir=datadir+"/../share/creaContours"; + datadir=datadir+"/../share/creaContours"; #endif // MACOSX #ifdef MACOSX /* assume this is OSX */ diff --git a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx index d189cbd..8efa5a9 100644 --- a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx +++ b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx @@ -64,7 +64,7 @@ KernelManagerContour::KernelManagerContour(std::vector images,std /** ** FINISH PERSISTANCE **/ - setVectImages(images); + setVectImages(images); initializeEnvironment(datadir); } diff --git a/lib/kernel_ManagerContour_NDimensions/ParserOsirix/OsirixParser.cxx b/lib/kernel_ManagerContour_NDimensions/ParserOsirix/OsirixParser.cxx index b913b5b..0305904 100644 --- a/lib/kernel_ManagerContour_NDimensions/ParserOsirix/OsirixParser.cxx +++ b/lib/kernel_ManagerContour_NDimensions/ParserOsirix/OsirixParser.cxx @@ -65,6 +65,7 @@ OsirixParser::OsirixParser(std::string xsdfile, double* spacing, int* extent) /*STATICCONTOURS*/ CREACONTOUR_NUMBEROFCONTOURSSTATIC = "NumberOfContoursStatic"; + TEMPIMPORTOSIRIXFILE = ""; #ifdef WIN32 @@ -77,7 +78,15 @@ OsirixParser::OsirixParser(std::string xsdfile, double* spacing, int* extent) TEMPIMPORTOSIRIXFILE.append("\\data\\TEMPIMPORTOSIRIXFILE.roi"); #else - TEMPIMPORTOSIRIXFILE = "./data/TEMPIMPORTOSIRIXFILE"; + char * pPath; + pPath = getenv ("HOME"); + + if(pPath){ + TEMPIMPORTOSIRIXFILE.append(pPath); + }else{ + TEMPIMPORTOSIRIXFILE.append("."); + } + TEMPIMPORTOSIRIXFILE.append("/.creaContourDataTemp/TEMPIMPORTOSIRIXFILE.roi"); #endif } -- 2.47.1