+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
//----------------------------------------------------------------------------------------------------------------
// Class definition include
//----------------------------------------------------------------------------------------------------------------
#include "OsirixParser.h"
-
#include <stdio.h>
OSIRIX_POINT_MM = "Point_mm";
OSIRIX_POINT_PX = "Point_px";
OSIRIX_STRING = "string";
+ OSIRIX_NAME = "Name";
if(spacing != NULL){
_spacing[0] = spacing[0];
/*STATICCONTOURS*/
CREACONTOUR_NUMBEROFCONTOURSSTATIC = "NumberOfContoursStatic";
+ TEMPIMPORTOSIRIXFILE = "";
#ifdef WIN32
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
}
imageindex = OSIRIX_IMAGEINDEX;
osirixinteger = OSIRIX_INTEGER;
+ std::string osirixstring = OSIRIX_STRING;
+ std::string osirixname = OSIRIX_NAME;
for(i = 0; i < (int)(list->getLength()); i++){
if(childnode1 != NULL && osirixinteger.compare(XMLString::transcode(childnode1->getNodeName())) == 0){
_imageindex = atoi(XMLString::transcode(childnode1->getTextContent()));
}
+ } else if(osirixname.compare(temp) == 0) {
+ // keep information about the name of the ROI
+ childnode1 = childlist->item(j+2);
+ if(childnode1 != NULL && osirixstring.compare(XMLString::transcode(childnode1->getNodeName())) == 0){
+ char* roiname = XMLString::transcode(childnode1->getTextContent());
+ _roiname = string(roiname);
+ }
}
}
}
vectorxyz.push_back(*vectory);
vectorxyz.push_back(*vectorz);
contoursmapMM.insert(pair<int, vectorXYZ>(contoursmapMM.size(), vectorxyz));
+ contoursnameMM.insert(pair<int, string>(contoursnameMM.size(), _roiname));
}
}
vectorxyz.push_back(*vectory);
vectorxyz.push_back(*vectorz);
contoursmapPX.insert(pair<int, vectorXYZ>(contoursmapPX.size(), vectorxyz));
+ contoursnamePX.insert(pair<int, string>(contoursnamePX.size(), _roiname));
}
}
fprintf(pFile, CREACONTOUR_NUMBEROFCONTROLPOINTS);
fprintf(pFile, " %d\n", vectz.size());
for(i = 0; i < vectx.size(); i++){
- fprintf(pFile, "%f %f 900.00\n", vectx[i]/ _spacing[0],dimy - vecty[i]/ _spacing[1]);
+ fprintf(pFile, "%f %f 900.00\n", vectx[i]/ _spacing[0], dimy - vecty[i]/ _spacing[1]);
+ // fprintf(pFile, "%f %f %f\n", vectx[i] , vecty[i], vectz[i]);
}
fprintf(pFile, CREACONTOUR_TYPEVIEW);
fprintf(pFile, " 1\n");