OsirixParser Class Reference

#include <OsirixParser.h>

List of all members.

Public Member Functions

 OsirixParser (std::string xsdfile="", double *spacing=NULL, int *extent=NULL)
 ~OsirixParser ()
int ParseFile (const char *xmlfile)
std::string getErrorLine ()
std::string getContoursFileName ()
const std::map< int, vector
< vector< double > > > & 
getContoursMapMM ()
const std::map< int, vector
< vector< double > > > & 
getContoursMapPX ()
const std::map< int,
std::string > & 
getContoursNameMM ()
const std::map< int,
std::string > & 
getContoursNamePX ()

Private Types

typedef vector< vector< double > > vectorXYZ

Private Member Functions

void saveCreaContoursFormat ()
void writeHeader (FILE *pFile)
void writeContours (FILE *pFile)
void writeContoursStatic (FILE *pFile)
void setErrorLine (DOMNodeList *list)
void getUserData (DOMElement *element)
void getData (DOMNodeList *list, std::vector< std::string > &vect, std::string tagname)
DOMNode * getLastNode (DOMNodeList *list)
void parseOSIRIX_DICT (DOMNodeList *list)
void parseOSIRIX_POINT_MM (DOMNodeList *list)
void parseOSIRIX_POINT_PX (DOMNodeList *list)

Private Attributes

std::string schema
std::string errorline
int _imageindex
std::string _roiname
const char * OSIRIX_DICT
const char * OSIRIX_KEY
const char * OSIRIX_IMAGES
const char * OSIRIX_ARRAY
const char * OSIRIX_IMAGEINDEX
const char * OSIRIX_INTEGER
const char * OSIRIX_NUMBEROFROIS
const char * OSIRIX_ROIS
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
const char * CREACONTOUR_IMAGESPACING
const char * CREACONTOUR_NUMBEROFCONTOURS
const char * CREACONTOUR_INSTANT
const char * CREACONTOUR_TYPEMODEL
const char * CREACONTOUR_NUMBEROFCONTROLPOINTS
const char * CREACONTOUR_TYPEVIEW
const char * CREACONTOUR_NUMBEROFCONTOURSSTATIC
std::string TEMPIMPORTOSIRIXFILE
double _spacing [3]
int _extent [6]
std::map< int, vectorXYZcontoursmapMM
std::map< int, vectorXYZcontoursmapPX
std::map< int, std::string > contoursnameMM
std::map< int, std::string > contoursnamePX


Detailed Description

Definition at line 39 of file OsirixParser.h.


Member Typedef Documentation

typedef vector< vector<double> > OsirixParser::vectorXYZ [private]

Definition at line 118 of file OsirixParser.h.


Constructor & Destructor Documentation

OsirixParser::OsirixParser ( std::string  xsdfile = "",
double *  spacing = NULL,
int *  extent = NULL 
)

Constructor for the parser, with the information of the pixel spacing and image dimensions

Definition at line 9 of file OsirixParser.cxx.

References _extent, _spacing, CREACONTOUR, CREACONTOUR_IMAGEDIMENSIONS, CREACONTOUR_IMAGESPACING, CREACONTOUR_INSTANT, CREACONTOUR_NUMBEROFCONTOURS, CREACONTOUR_NUMBEROFCONTOURSSTATIC, CREACONTOUR_NUMBEROFCONTROLPOINTS, CREACONTOUR_TYPEMODEL, CREACONTOUR_TYPEVIEW, CREACONTOUR_VERSION, OSIRIX_ARRAY, OSIRIX_DICT, OSIRIX_IMAGEINDEX, OSIRIX_IMAGES, OSIRIX_INTEGER, OSIRIX_KEY, OSIRIX_NAME, OSIRIX_NUMBEROFROIS, OSIRIX_POINT_MM, OSIRIX_POINT_PX, OSIRIX_ROIS, OSIRIX_STRING, schema, and TEMPIMPORTOSIRIXFILE.

00010 {
00011         schema=xsdfile;
00012 
00013         OSIRIX_DICT = "dict";
00014         OSIRIX_KEY = "key";
00015         OSIRIX_IMAGES = "Images";
00016         OSIRIX_ARRAY = "array";
00017         OSIRIX_IMAGEINDEX = "ImageIndex";
00018         OSIRIX_INTEGER = "integer";
00019         OSIRIX_NUMBEROFROIS = "NumberOfROIs";
00020         OSIRIX_ROIS = "ROIs";
00021         OSIRIX_POINT_MM = "Point_mm";
00022         OSIRIX_POINT_PX = "Point_px";
00023         OSIRIX_STRING = "string";
00024         OSIRIX_NAME = "Name";
00025 
00026         if(spacing != NULL){
00027                 _spacing[0] = spacing[0];
00028                 _spacing[1] = spacing[1];
00029                 _spacing[2] = spacing[2];
00030         }else{
00031                 _spacing[0] = 1;
00032                 _spacing[1] = 1;
00033                 _spacing[2] = 1;
00034         }
00035 
00036         if(extent != NULL){
00037                 _extent[0] = extent[0];
00038                 _extent[1] = extent[1];
00039                 _extent[2] = extent[2];
00040                 _extent[3] = extent[3];
00041                 _extent[4] = extent[4];
00042                 _extent[5] = extent[5];
00043                 
00044         }else{
00045                 _extent[0] = 1;
00046                 _extent[1] = 1;
00047                 _extent[2] = 1;         
00048                 _extent[3] = 1;
00049                 _extent[4] = 1;
00050                 _extent[5] = 1;
00051         }
00052 
00053 
00054         /*HEADER*/
00055         CREACONTOUR = "--CreaContour--";
00056         CREACONTOUR_VERSION = "Version 1.0.2";
00057         CREACONTOUR_IMAGEDIMENSIONS = "ImageDimensions";
00058         CREACONTOUR_IMAGESPACING = "ImageSpacing";
00059         CREACONTOUR_NUMBEROFCONTOURS = "NumberOfContours";
00060         /*FOR EACH CONTOUR*/
00061         CREACONTOUR_INSTANT = "Instant";
00062         CREACONTOUR_TYPEMODEL = "TypeModel";
00063         CREACONTOUR_NUMBEROFCONTROLPOINTS = "NumberOfControlPoints";
00064         CREACONTOUR_TYPEVIEW = "TypeView";      
00065         /*STATICCONTOURS*/
00066         CREACONTOUR_NUMBEROFCONTOURSSTATIC = "NumberOfContoursStatic";
00067 
00068         TEMPIMPORTOSIRIXFILE = "";
00069 
00070 #ifdef WIN32
00071 
00072         char currentPath[_MAX_PATH];    
00073         GetModuleFileName(NULL, currentPath, _MAX_PATH);
00074         TEMPIMPORTOSIRIXFILE = currentPath;
00075 
00076         TEMPIMPORTOSIRIXFILE = TEMPIMPORTOSIRIXFILE.substr(0,TEMPIMPORTOSIRIXFILE.find_last_of("\\"));
00077 
00078         TEMPIMPORTOSIRIXFILE.append("\\data\\TEMPIMPORTOSIRIXFILE.roi");
00079         
00080 #else
00081         char * pPath;
00082         pPath = getenv ("HOME");
00083 
00084         if(pPath){
00085             TEMPIMPORTOSIRIXFILE.append(pPath);
00086         }else{
00087             TEMPIMPORTOSIRIXFILE.append(".");
00088         }
00089         TEMPIMPORTOSIRIXFILE.append("/.creaContourDataTemp/TEMPIMPORTOSIRIXFILE.roi");
00090 #endif
00091         
00092 }

OsirixParser::~OsirixParser (  ) 

Desctructor by defect

Definition at line 93 of file OsirixParser.cxx.

00093                            {
00094 
00095 }


Member Function Documentation

std::string OsirixParser::getContoursFileName (  ) 

Definition at line 463 of file OsirixParser.cxx.

References TEMPIMPORTOSIRIXFILE.

00463                                            {
00464         return TEMPIMPORTOSIRIXFILE;
00465 }

const std::map<int, vector< vector<double> > >& OsirixParser::getContoursMapMM (  )  [inline]

Definition at line 63 of file OsirixParser.h.

References contoursmapMM.

00063                                                                          {
00064           return contoursmapMM;
00065         }

const std::map<int, vector< vector<double> > >& OsirixParser::getContoursMapPX (  )  [inline]

Definition at line 66 of file OsirixParser.h.

References contoursmapPX.

00066                                                                          {
00067           return contoursmapPX;
00068         }

const std::map<int, std::string>& OsirixParser::getContoursNameMM (  )  [inline]

Definition at line 71 of file OsirixParser.h.

References contoursnameMM.

00071                                                           {
00072           return contoursnameMM;
00073         }

const std::map<int, std::string>& OsirixParser::getContoursNamePX (  )  [inline]

Definition at line 74 of file OsirixParser.h.

References contoursnamePX.

00074                                                           {
00075           return contoursnamePX;
00076         }

void OsirixParser::getData ( DOMNodeList *  list,
std::vector< std::string > &  vect,
std::string  tagname 
) [private]

Definition at line 370 of file OsirixParser.cxx.

00370                                                                                           {
00371 
00372         for(int i = 0; i < (int)(list->getLength()); i++){
00373                 DOMNode* node = list->item(i);
00374                 if(tagname.compare(XMLString::transcode(node->getNodeName()))==0){
00375                         std::cout<<"NODENAME "<<XMLString::transcode(node->getTextContent())<<std::endl;
00376                         vect.push_back(XMLString::transcode(node->getTextContent()));
00377                 }
00378 
00379         }
00380 }

std::string OsirixParser::getErrorLine (  ) 

DOMNode * OsirixParser::getLastNode ( DOMNodeList *  list  )  [private]

Definition at line 197 of file OsirixParser.cxx.

00197                                                    {
00198 
00199 
00200         DOMNode* node;
00201         /*for(int i = list->getLength()-1; i >= 0 ;i--){
00202 
00203                 node = list->item(i);
00204 
00205                 if(node->getNodeType() == DOMNode::ELEMENT_NODE){
00206                         i = -1;
00207                 }
00208 
00209         }*/
00210         node = list->item(list->getLength()-1);
00211 
00212 
00213 
00214         if(node->getChildNodes()->getLength()>0){
00215                 return getLastNode(node->getChildNodes());
00216         }
00217         return node;
00218 
00219 }

void OsirixParser::getUserData ( DOMElement *  element  )  [private]

Definition at line 221 of file OsirixParser.cxx.

References OSIRIX_DICT, and parseOSIRIX_DICT().

Referenced by ParseFile().

00221                                                  {
00222         parseOSIRIX_DICT(element->getElementsByTagName(XMLString::transcode(OSIRIX_DICT)));
00223 }

Here is the call graph for this function:

Here is the caller graph for this function:

int OsirixParser::ParseFile ( const char *  xmlfile  ) 

Definition at line 97 of file OsirixParser.cxx.

References errorline, getUserData(), saveCreaContoursFormat(), and schema.

00097                                               {
00098 
00099         xercesc::DOMDocument *doc;
00100 
00101 
00102         try {
00103             XMLPlatformUtils::Initialize();
00104         }
00105         catch (const XMLException& toCatch) {
00106             char* message = XMLString::transcode(toCatch.getMessage());
00107             cout << "Error during initialization! :\n"
00108                  << message << "\n";
00109             XMLString::release(&message);
00110             return 1;
00111         }
00112 
00113         XercesDOMParser* OsirixParser = new XercesDOMParser();
00114 
00115 
00116                 OsirixParser->setDoNamespaces(true);
00117                 OsirixParser->setDoSchema(true);
00118                 OsirixParser->setValidationScheme(XercesDOMParser::Val_Always );
00119                 OsirixParser->setExternalNoNamespaceSchemaLocation(XMLString::transcode(schema.c_str()));
00120                 OsirixParser->setValidationSchemaFullChecking(true);
00121                 OsirixParser->setValidationConstraintFatal(true);
00122                 OsirixParser->setExitOnFirstFatalError(true);
00123 
00124 
00125         ErrorHandler* errHandler = (ErrorHandler*) new OsirixParserErrorHandler();
00126 
00127         OsirixParser->setErrorHandler(errHandler);
00128 
00129 
00130         try {
00131             OsirixParser->parse(xmlfile);
00132 
00133 
00134                         if(OsirixParser->getErrorCount() > 0){
00135 
00136                                 errorline = ((OsirixParserErrorHandler*)OsirixParser->getErrorHandler())->getErrorMsg();
00137 
00138 
00139                                 delete OsirixParser;
00140                                 delete errHandler;
00141                                 return -2;
00142                         }
00143 
00144 
00145 
00146         }
00147         catch (const XMLException& toCatch) {
00148             char* message = XMLString::transcode(toCatch.getMessage());
00149             cout << "Exception message is: \n"
00150                  << message << "\n";
00151             XMLString::release(&message);
00152                         delete OsirixParser;
00153                     delete errHandler;
00154             return -1;
00155         }
00156         catch (const DOMException& toCatch) {
00157             char* message = XMLString::transcode(toCatch.msg);
00158             cout << "Exception message is: \n"
00159                  << message << "\n";
00160             XMLString::release(&message);
00161                         delete OsirixParser;
00162                         delete errHandler;
00163             return -1;
00164         }
00165         catch (...) {
00166             cout << "Unexpected Exception \n" ;
00167                         delete OsirixParser;
00168                         delete errHandler;
00169             return -1;
00170         }
00171 
00172                 std::cout<<"parsing document..."<<std::endl;
00173 
00174 
00175         doc = OsirixParser->getDocument();
00176 //              DOMNodeList* list = doc->getChildNodes();               
00177                 getUserData(doc->getDocumentElement());
00178 
00179 
00180                 saveCreaContoursFormat();
00181 
00182         delete OsirixParser;
00183         delete errHandler;
00184 
00185 
00186 
00187                 return 0;
00188 
00189 }

Here is the call graph for this function:

void OsirixParser::parseOSIRIX_DICT ( DOMNodeList *  list  )  [private]

Definition at line 225 of file OsirixParser.cxx.

References _imageindex, _roiname, OSIRIX_IMAGEINDEX, OSIRIX_INTEGER, OSIRIX_NAME, OSIRIX_POINT_MM, OSIRIX_POINT_PX, OSIRIX_STRING, parseOSIRIX_POINT_MM(), and parseOSIRIX_POINT_PX().

Referenced by getUserData().

00225                                                     {
00226         int i, j;
00227         DOMNode* node, *childnode, *childnode1, *childarray;
00228         std::string point_mm, point_px, osirixinteger, imageindex, temp;
00229         DOMNodeList* childlist;
00230         point_mm = OSIRIX_POINT_MM;
00231         point_px = OSIRIX_POINT_PX;
00232         imageindex = OSIRIX_IMAGEINDEX;
00233         osirixinteger = OSIRIX_INTEGER;
00234         
00235         std::string osirixstring = OSIRIX_STRING;
00236         std::string osirixname = OSIRIX_NAME;
00237         
00238 
00239         for(i = 0; i < (int)(list->getLength()); i++){
00240                 node = list->item(i);           
00241                 childlist = node->getChildNodes();
00242                 for(j = 0; j < (int)(childlist->getLength());j++){
00243                         childnode = childlist->item(j);                 
00244                         temp = XMLString::transcode(childnode->getTextContent());       
00245 
00246 
00247                         if(point_mm.compare(temp)==0){                          
00248                                 childarray = childlist->item(j+2);
00249                                 //temp = XMLString::transcode(childarray->getNodeName());                                       
00250                                 if(childarray != 0){                                    
00251                                         parseOSIRIX_POINT_MM(childarray->getChildNodes());                                      
00252                                 }                               
00253                         }else if(point_px.compare(temp)==0){                            
00254                                 childarray = childlist->item(j+2);
00255                                 //temp = XMLString::transcode(childarray->getNodeName());                                       
00256                                 if(childarray != 0){                                    
00257                                         parseOSIRIX_POINT_PX(childarray->getChildNodes());                                      
00258                                 }                               
00259                         }else if(imageindex.compare(temp) == 0){
00260                                 childnode1 = childlist->item(j+2);
00261                                 if(childnode1 != NULL && osirixinteger.compare(XMLString::transcode(childnode1->getNodeName())) == 0){
00262                                         _imageindex = atoi(XMLString::transcode(childnode1->getTextContent()));                                         
00263                                 }                               
00264                         } else if(osirixname.compare(temp) == 0) {
00265                           // keep information about the name of the ROI
00266                                 childnode1 = childlist->item(j+2);
00267                                 if(childnode1 != NULL && osirixstring.compare(XMLString::transcode(childnode1->getNodeName())) == 0){
00268                                   char* roiname = XMLString::transcode(childnode1->getTextContent());
00269                                   _roiname = string(roiname);
00270                                 }
00271                         }
00272                 }               
00273         }
00274 }

Here is the call graph for this function:

Here is the caller graph for this function:

void OsirixParser::parseOSIRIX_POINT_MM ( DOMNodeList *  list  )  [private]

Definition at line 276 of file OsirixParser.cxx.

References _roiname, contoursmapMM, contoursnameMM, and OSIRIX_STRING.

Referenced by parseOSIRIX_DICT().

00276                                                         {
00277         int i, stringfound0, stringfound1;
00278         DOMNode* node;
00279         string temp, osirix_string, numx, numy, numz;
00280         vector<double>* vectorx;
00281         vector<double>* vectory;
00282         vector<double>* vectorz;
00283         vectorXYZ vectorxyz;
00284         double x, y, z; 
00285 
00286         vectorx = new vector<double>;
00287         vectory = new vector<double>;
00288         vectorz = new vector<double>;
00289 
00290         osirix_string = OSIRIX_STRING;
00291 
00292         for(i = 0; i < (int)(list->getLength()); i++){
00293                 node = list->item(i);
00294                 if(osirix_string.compare(XMLString::transcode(node->getNodeName()))==0){
00295                         temp = XMLString::transcode(node->getTextContent());                    
00296 
00297                         stringfound0 = temp.find(",",0);
00298                         numx = temp.substr(1, stringfound0-1);
00299 
00300                         stringfound1 = temp.find(",",stringfound0+1);
00301                         numy = temp.substr(stringfound0+1, stringfound1-stringfound0-1);
00302 
00303                         stringfound0 = temp.find(")",stringfound1+1);
00304                         numz = temp.substr(stringfound1+1, stringfound0-stringfound1-1);
00305 
00306                         x = atof(numx.c_str());         
00307                         y = atof(numy.c_str());         
00308                         z = atof(numz.c_str());         
00309 
00310                         vectorx->push_back(x);
00311                         vectory->push_back(y);
00312                         vectorz->push_back(z);
00313                 }               
00314         }
00315         if(vectorx->size() > 0){
00316                 vectorxyz.push_back(*vectorx);
00317                 vectorxyz.push_back(*vectory);
00318                 vectorxyz.push_back(*vectorz);
00319                 contoursmapMM.insert(pair<int, vectorXYZ>(contoursmapMM.size(), vectorxyz));
00320                 contoursnameMM.insert(pair<int, string>(contoursnameMM.size(), _roiname));
00321         }
00322 }

Here is the caller graph for this function:

void OsirixParser::parseOSIRIX_POINT_PX ( DOMNodeList *  list  )  [private]

Definition at line 324 of file OsirixParser.cxx.

References _imageindex, _roiname, contoursmapPX, contoursnamePX, and OSIRIX_STRING.

Referenced by parseOSIRIX_DICT().

00324                                                         {
00325         int i, stringfound0, stringfound1;
00326         DOMNode* node;
00327         string temp, osirix_string, numx, numy;
00328         vector<double>* vectorx;
00329         vector<double>* vectory;        
00330         vector<double>* vectorz;        
00331         vectorXYZ vectorxyz;
00332         double x, y, z; 
00333 
00334         vectorx = new vector<double>;
00335         vectory = new vector<double>;   
00336         vectorz = new vector<double>;   
00337 
00338         osirix_string = OSIRIX_STRING;
00339 
00340         for(i = 0; i < (int)(list->getLength()); i++){
00341                 node = list->item(i);
00342                 if(osirix_string.compare(XMLString::transcode(node->getNodeName()))==0){
00343                         temp = XMLString::transcode(node->getTextContent());                    
00344 
00345                         stringfound0 = temp.find(",",0);
00346                         numx = temp.substr(1, stringfound0-1);                                  
00347 
00348                         stringfound1 = temp.find(")",stringfound0+1);
00349                         numy = temp.substr(stringfound0+1, stringfound1-stringfound0-1);
00350 
00351                         x = atof(numx.c_str());         
00352                         y = atof(numy.c_str());                                 
00353 
00354                         vectorx->push_back(x);
00355                         vectory->push_back(y);  
00356                         vectorz->push_back(_imageindex);
00357                 }               
00358         }
00359         if(vectorx->size() > 0){
00360                 vectorxyz.push_back(*vectorx);
00361                 vectorxyz.push_back(*vectory);  
00362                 vectorxyz.push_back(*vectorz);  
00363                 contoursmapPX.insert(pair<int, vectorXYZ>(contoursmapPX.size(), vectorxyz));
00364                 contoursnamePX.insert(pair<int, string>(contoursnamePX.size(), _roiname));
00365         }       
00366 }

Here is the caller graph for this function:

void OsirixParser::saveCreaContoursFormat (  )  [private]

Definition at line 382 of file OsirixParser.cxx.

References TEMPIMPORTOSIRIXFILE, writeContours(), writeContoursStatic(), and writeHeader().

Referenced by ParseFile().

00382                                          {
00383         FILE *pFile=fopen(TEMPIMPORTOSIRIXFILE.c_str(),"w+");
00384 
00385         if(pFile){
00386                 writeHeader(pFile);
00387                 writeContours(pFile);
00388                 writeContoursStatic(pFile);
00389                 fclose(pFile);
00390         }
00391 }

Here is the call graph for this function:

Here is the caller graph for this function:

void OsirixParser::setErrorLine ( DOMNodeList *  list  )  [private]

Definition at line 191 of file OsirixParser.cxx.

References errorline.

00191                                                 {
00192 
00193         DOMNode* node = list->item(0);
00194         this->errorline =       XMLString::transcode(node->getTextContent());
00195 
00196 }

void OsirixParser::writeContours ( FILE *  pFile  )  [private]

Definition at line 402 of file OsirixParser.cxx.

References _extent, _spacing, contoursmapPX, CREACONTOUR_INSTANT, CREACONTOUR_NUMBEROFCONTROLPOINTS, CREACONTOUR_TYPEMODEL, and CREACONTOUR_TYPEVIEW.

Referenced by saveCreaContoursFormat().

00402                                            {
00403         
00404         map<int, vectorXYZ>::iterator itPX;
00405         vector<double> vectx, vecty, vectz;
00406         int i, valuez;
00407         int dimz = 0, dimy = 0;
00408 
00409         if(_extent != 0){
00410                 dimz = _extent[5] - _extent[4] + 1;
00411                 dimy = _extent[3] - _extent[2] + 1;
00412         }
00413 
00414         /*for (itMM = contoursmapMM.begin(),  itPX = contoursmapPX.begin(); 
00415                         itMM != contoursmapMM.end(), itPX != contoursmapPX.end(); 
00416                         itMM++, itPX++ ){*/
00417         for (itPX = contoursmapPX.begin(); itPX != contoursmapPX.end(); itPX++ ){
00418 
00419                 vectx = ((*itPX).second)[0];
00420                 vecty = ((*itPX).second)[1];
00421                 vectz = ((*itPX).second)[2];
00422 
00423                 if(!vectz.empty()){
00424 
00425                         valuez = (int) vectz[0] / _spacing[2];
00426 
00427                         fprintf(pFile, CREACONTOUR_INSTANT);
00428                         fprintf(pFile, " 1 %d 1 1 1 1\n",dimz - valuez);
00429                         fprintf(pFile, CREACONTOUR_TYPEMODEL);
00430                         fprintf(pFile, " 1\n");
00431                         fprintf(pFile, CREACONTOUR_NUMBEROFCONTROLPOINTS);
00432                         fprintf(pFile, " %d\n", vectz.size());
00433                         for(i = 0; i < vectx.size(); i++){
00434                           fprintf(pFile, "%f %f 900.00\n", vectx[i]/ _spacing[0], dimy - vecty[i]/ _spacing[1]);
00435                           // fprintf(pFile, "%f %f %f\n", vectx[i] , vecty[i], vectz[i]);
00436                         }               
00437                         fprintf(pFile, CREACONTOUR_TYPEVIEW);
00438                         fprintf(pFile, " 1\n");
00439                         
00440                 }
00441         }
00442 }

Here is the caller graph for this function:

void OsirixParser::writeContoursStatic ( FILE *  pFile  )  [private]

Definition at line 393 of file OsirixParser.cxx.

References _extent, _spacing, CREACONTOUR_IMAGEDIMENSIONS, CREACONTOUR_IMAGESPACING, and CREACONTOUR_NUMBEROFCONTOURSSTATIC.

Referenced by saveCreaContoursFormat().

00393                                                  {
00394         fprintf(pFile, CREACONTOUR_IMAGEDIMENSIONS);
00395         fprintf(pFile, " %d %d %d\n", _extent[1] - _extent[0],_extent[3] - _extent[2], _extent[5] - _extent[4]);
00396         fprintf(pFile, CREACONTOUR_IMAGESPACING);
00397         fprintf(pFile, " %f %f %f\n", _spacing[0], _spacing[1], _spacing[2]);
00398         fprintf(pFile, CREACONTOUR_NUMBEROFCONTOURSSTATIC);
00399         fprintf(pFile, " 0\n");
00400 }

Here is the caller graph for this function:

void OsirixParser::writeHeader ( FILE *  pFile  )  [private]

Definition at line 444 of file OsirixParser.cxx.

References _extent, _spacing, contoursmapPX, CREACONTOUR, CREACONTOUR_IMAGEDIMENSIONS, CREACONTOUR_IMAGESPACING, CREACONTOUR_NUMBEROFCONTOURS, and CREACONTOUR_VERSION.

Referenced by saveCreaContoursFormat().

00444                                          { 
00445          
00446 
00447         fprintf(pFile, CREACONTOUR);
00448         fprintf(pFile, "\n");
00449         fprintf(pFile, CREACONTOUR_VERSION);
00450         fprintf(pFile, "\n");
00451         fprintf(pFile, CREACONTOUR_IMAGEDIMENSIONS);
00452         fprintf(pFile, " %d %d %d\n", _extent[1] - _extent[0],_extent[3] - _extent[2], _extent[5] - _extent[4]);
00453         fprintf(pFile, CREACONTOUR_IMAGESPACING);
00454         fprintf(pFile, " %f %f %f\n", _spacing[0], _spacing[1], _spacing[2]);
00455         fprintf(pFile, CREACONTOUR_NUMBEROFCONTOURS);
00456         fprintf(pFile, " %d\n", contoursmapPX.size());
00457 
00458 
00459 
00460 }

Here is the caller graph for this function:


Member Data Documentation

int OsirixParser::_extent[6] [private]

Definition at line 116 of file OsirixParser.h.

Referenced by OsirixParser(), writeContours(), writeContoursStatic(), and writeHeader().

Definition at line 84 of file OsirixParser.h.

Referenced by parseOSIRIX_DICT(), and parseOSIRIX_POINT_PX().

std::string OsirixParser::_roiname [private]

Definition at line 85 of file OsirixParser.h.

Referenced by parseOSIRIX_DICT(), parseOSIRIX_POINT_MM(), and parseOSIRIX_POINT_PX().

double OsirixParser::_spacing[3] [private]

Definition at line 115 of file OsirixParser.h.

Referenced by OsirixParser(), writeContours(), writeContoursStatic(), and writeHeader().

std::map<int, vectorXYZ> OsirixParser::contoursmapMM [private]

Definition at line 119 of file OsirixParser.h.

Referenced by getContoursMapMM(), and parseOSIRIX_POINT_MM().

std::map<int, vectorXYZ> OsirixParser::contoursmapPX [private]

Definition at line 120 of file OsirixParser.h.

Referenced by getContoursMapPX(), parseOSIRIX_POINT_PX(), writeContours(), and writeHeader().

std::map<int, std::string> OsirixParser::contoursnameMM [private]

Definition at line 122 of file OsirixParser.h.

Referenced by getContoursNameMM(), and parseOSIRIX_POINT_MM().

std::map<int, std::string> OsirixParser::contoursnamePX [private]

Definition at line 123 of file OsirixParser.h.

Referenced by getContoursNamePX(), and parseOSIRIX_POINT_PX().

const char* OsirixParser::CREACONTOUR [private]

Definition at line 100 of file OsirixParser.h.

Referenced by OsirixParser(), and writeHeader().

Definition at line 102 of file OsirixParser.h.

Referenced by OsirixParser(), writeContoursStatic(), and writeHeader().

Definition at line 103 of file OsirixParser.h.

Referenced by OsirixParser(), writeContoursStatic(), and writeHeader().

const char* OsirixParser::CREACONTOUR_INSTANT [private]

Definition at line 106 of file OsirixParser.h.

Referenced by OsirixParser(), and writeContours().

Definition at line 104 of file OsirixParser.h.

Referenced by OsirixParser(), and writeHeader().

Definition at line 111 of file OsirixParser.h.

Referenced by OsirixParser(), and writeContoursStatic().

Definition at line 108 of file OsirixParser.h.

Referenced by OsirixParser(), and writeContours().

const char* OsirixParser::CREACONTOUR_TYPEMODEL [private]

Definition at line 107 of file OsirixParser.h.

Referenced by OsirixParser(), and writeContours().

const char* OsirixParser::CREACONTOUR_TYPEVIEW [private]

Definition at line 109 of file OsirixParser.h.

Referenced by OsirixParser(), and writeContours().

const char* OsirixParser::CREACONTOUR_VERSION [private]

Definition at line 101 of file OsirixParser.h.

Referenced by OsirixParser(), and writeHeader().

std::string OsirixParser::errorline [private]

Definition at line 82 of file OsirixParser.h.

Referenced by ParseFile(), and setErrorLine().

const char* OsirixParser::OSIRIX_ARRAY [private]

Definition at line 90 of file OsirixParser.h.

Referenced by OsirixParser().

const char* OsirixParser::OSIRIX_DICT [private]

Definition at line 87 of file OsirixParser.h.

Referenced by getUserData(), and OsirixParser().

const char* OsirixParser::OSIRIX_IMAGEINDEX [private]

Definition at line 91 of file OsirixParser.h.

Referenced by OsirixParser(), and parseOSIRIX_DICT().

const char* OsirixParser::OSIRIX_IMAGES [private]

Definition at line 89 of file OsirixParser.h.

Referenced by OsirixParser().

const char* OsirixParser::OSIRIX_INTEGER [private]

Definition at line 92 of file OsirixParser.h.

Referenced by OsirixParser(), and parseOSIRIX_DICT().

const char* OsirixParser::OSIRIX_KEY [private]

Definition at line 88 of file OsirixParser.h.

Referenced by OsirixParser().

const char* OsirixParser::OSIRIX_NAME [private]

Definition at line 98 of file OsirixParser.h.

Referenced by OsirixParser(), and parseOSIRIX_DICT().

const char* OsirixParser::OSIRIX_NUMBEROFROIS [private]

Definition at line 93 of file OsirixParser.h.

Referenced by OsirixParser().

const char* OsirixParser::OSIRIX_POINT_MM [private]

Definition at line 95 of file OsirixParser.h.

Referenced by OsirixParser(), and parseOSIRIX_DICT().

const char* OsirixParser::OSIRIX_POINT_PX [private]

Definition at line 96 of file OsirixParser.h.

Referenced by OsirixParser(), and parseOSIRIX_DICT().

const char* OsirixParser::OSIRIX_ROIS [private]

Definition at line 94 of file OsirixParser.h.

Referenced by OsirixParser().

const char* OsirixParser::OSIRIX_STRING [private]

std::string OsirixParser::schema [private]

Definition at line 80 of file OsirixParser.h.

Referenced by OsirixParser(), and ParseFile().

std::string OsirixParser::TEMPIMPORTOSIRIXFILE [private]

Definition at line 113 of file OsirixParser.h.

Referenced by getContoursFileName(), OsirixParser(), and saveCreaContoursFormat().


The documentation for this class was generated from the following files:

Generated on Wed Jun 27 23:28:34 2012 for creaContours_lib by  doxygen 1.5.7.1