// 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];
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");
std::string getContoursFileName();
+ // Return ROI as lists of points
+ const std::map<int, vector< vector<double> > >& getContoursMapMM() {
+ return contoursmapMM;
+ }
+ const std::map<int, vector< vector<double> > >& getContoursMapPX() {
+ return contoursmapPX;
+ }
+
+ // Return ROI names
+ const std::map<int, std::string>& getContoursNameMM() {
+ return contoursnameMM;
+ }
+ const std::map<int, std::string>& getContoursNamePX() {
+ return contoursnamePX;
+ }
+
private:
std::string schema;
std::string errorline;
int _imageindex;
+ std::string _roiname;
const char* OSIRIX_DICT;
const char* OSIRIX_KEY;
const char* OSIRIX_POINT_MM;
const char* OSIRIX_POINT_PX;
const char* OSIRIX_STRING;
-
+ const char* OSIRIX_NAME;
+
const char* CREACONTOUR;
const char* CREACONTOUR_VERSION;
const char* CREACONTOUR_IMAGEDIMENSIONS;
std::map<int, vectorXYZ> contoursmapMM;
std::map<int, vectorXYZ> contoursmapPX;
+ std::map<int, std::string> contoursnameMM;
+ std::map<int, std::string> contoursnamePX;
+
void saveCreaContoursFormat();
void writeHeader(FILE* pFile);