marDictionary Class Reference

#include <marDictionary.h>

List of all members.

Public Member Functions

 marDictionary ()
 ~marDictionary ()
void ResetDictionary ()
void SetLanguage (int language)
char * GetString (int id)
int GetLanguage ()
bool LoadDictionaryFile (char *dictionaryFileName)
void LoadDictionary_English ()
void LoadDictionary_French ()
void LoadDictionary_Japanese ()
void FreeDictionary ()

Private Member Functions

bool ExistFileDictionary (char *dictionaryFileName)
void SetString (int id, char *ss)

Private Attributes

char _emptyStr [30]

Static Private Attributes

static int _language = 0
static std::vector
< marDictFrase * > * 
_frases = 0

Detailed Description

Definition at line 24 of file marDictionary.h.


Constructor & Destructor Documentation

marDictionary::marDictionary (  ) 

Definition at line 41 of file marDictionary.cxx.

References _emptyStr.

00041                             {
00042         strcpy( _emptyStr      , "(...)"         );             
00043 }

marDictionary::~marDictionary (  ) 

Definition at line 45 of file marDictionary.cxx.

00045                              {
00046 } 


Member Function Documentation

bool marDictionary::ExistFileDictionary ( char *  dictionaryFileName  )  [private]

Definition at line 48 of file marDictionary.cxx.

Referenced by LoadDictionaryFile().

00048                                                                {
00049 
00050         bool result=true;
00051         FILE *ff=fopen(dictionaryFileName,"r");
00052         if (ff==NULL){
00053                 result=false;
00054         }
00055         return result;
00056 }

Here is the caller graph for this function:

void marDictionary::FreeDictionary (  ) 

Definition at line 413 of file marDictionary.cxx.

References _frases.

Referenced by wxMaracasFrame::OnQuit(), and ResetDictionary().

00413                                   {
00414         int i,size=_frases->size();
00415         for (i=0;i < size;i++){
00416                 marDictFrase* tmp=(*_frases)[i];
00417                 delete tmp;
00418         }
00419         _frases->clear();
00420 } 

Here is the caller graph for this function:

int marDictionary::GetLanguage (  ) 

Definition at line 444 of file marDictionary.cxx.

References _language.

Referenced by LoadDictionaryFile().

00444                                   {
00445         return _language;
00446 }

Here is the caller graph for this function:

char * marDictionary::GetString ( int  id  ) 

Definition at line 427 of file marDictionary.cxx.

References _emptyStr, _frases, _language, marDictFrase::GetFrase(), and marDictFrase::GetIdFrase().

Referenced by wxMaracasParametersDialog::Apply(), wxQuantificationWidgetCT::CreateControlPanel3D(), wxQuantificationWidgetCT::CreatePanelStatus(), wxQuantificationWidgetCT::CreateStenosisPanel(), wxQuantificationWidget::CreateStenosisPanel(), wxParametersDialog::do_layout(), wxQuantificationWidgetCT::OnCleanAll_BT(), wxQuantificationWidget::OnCleanAll_BT(), wxQuantificationWidget::Set_control(), wxParametersDialog::set_properties(), vtk3DSurfaceWidget::SetInitialPoint(), wxPanelControlsHealthySickSlice2::wxPanelControlsHealthySickSlice2(), wxPanelControlsHealthySickSliceCT::wxPanelControlsHealthySickSliceCT(), wxPanelSizeHealthyRegion::wxPanelSizeHealthyRegion(), wxParametersDialog::wxParametersDialog(), wxPnlContourControl::wxPnlContourControl(), wxPnlManualContour::wxPnlManualContour(), wxPnlModifyContour::wxPnlModifyContour(), wxPnlSearchStenosis::wxPnlSearchStenosis(), wxPnlSearchStenosisAutomatic::wxPnlSearchStenosisAutomatic(), wxPnlSearchStenosisManual::wxPnlSearchStenosisManual(), and wxSurfaceWidget::wxSurfaceWidget().

00427                                          {
00428         int i,size;     
00429         char *result=NULL;
00430         size=_frases->size();
00431         for (i=0;i<size;i++){
00432                 marDictFrase* tmp=(*_frases)[i];
00433                 if (tmp->GetIdFrase()==idfrase){
00434                         result=tmp->GetFrase();
00435                 }
00436         }
00437         if (result==NULL){
00438             sprintf(_emptyStr,"(...%d-%d...)",_language,idfrase);
00439                 result=_emptyStr;
00440         }
00441         return result;
00442 }

Here is the call graph for this function:

Here is the caller graph for this function:

void marDictionary::LoadDictionary_English (  ) 

Definition at line 111 of file marDictionary.cxx.

References ResetDictionary(), SetLanguage(), and SetString().

Referenced by wxMaracasFrame::wxMaracasFrame().

00111                                           {
00112         ResetDictionary();
00113         SetLanguage(1);
00114 
00115         SetString(   5 , "MARACAS: MAgnetic Resonance Angiography Computer ASisted analysis ");
00116         SetString(  10 , "Iso Surface values ");
00117         SetString(  15 , "Iso visible ");
00118         SetString(  20 , "Opacity (%) ");
00119         SetString(  25 , "Isovalue ");
00120         SetString(  30 , "0 ");
00121         SetString(  35 , "Select ");
00122         SetString(  40 , "artery ");
00123         SetString(  45 , "1 ");
00124         SetString(  50 , "Axis Extraction ");
00125         SetString(  55 , "2 ");
00126         SetString(  60 , "Quantification ");
00127         SetString(  65 , "Set an initial point. ");
00128         SetString(  70 , "(Double click over the interest artery.) ");
00129         SetString(  73 , "OK ");
00130         SetString(  75 , "Start 3D ");
00131         SetString(  80 , "Plan ");
00132         SetString(  85 , "Parameters ");
00133         SetString(  90 , "Slice ");
00134         SetString( 205 , "Healthy slice ");
00135         SetString( 210 , "Perpendicular section ");
00136         SetString( 215 , "Visible ring ");
00137         SetString( 220 , "Show surface ");
00138         SetString( 225 , "Opacity ");
00139         SetString( 230 , "grayscale         ");
00140         SetString( 235 , "color ");
00141         SetString( 240 , "Isovalue  ");
00142         SetString( 245 , "Add mark contour ");
00143         SetString( 248 , "Save Contours ");
00144         SetString( 250 , "Erase marks contours ");
00145         SetString( 253 , "Erase all marks contours ");
00146         SetString( 255 , "Stenosis (area) ");
00147         SetString( 260 , "Stenosis (diameter) ");
00148         SetString( 265 , "Stenosis search ");
00149         SetString( 270 , "Automatic stenosis search ");
00150         SetString( 273 , "0 ");
00151         SetString( 275 , "Select ");
00152         SetString( 280 , " slice ");
00153         SetString( 283 , "1 ");
00154         SetString( 285 , "    Validate ");
00155         SetString( 290 , "Healthy Slice ");
00156         SetString( 293 , "2 ");
00157         SetString( 295 , "   Validate ");
00158         SetString( 300 , "End Region ");
00159         SetString( 303 , "3 ");
00160         SetString( 305 , "   Find ");
00161         SetString( 310 , "stenosis ");
00162         SetString( 315 , "Automatic ");
00163         SetString( 320 , "Manual ");
00164         SetString( 325 , "Manual stenosis search ");
00165         SetString( 328 , "0 ");
00166         SetString( 330 , "Select ");
00167         SetString( 335 , " slice ");
00168         SetString( 338 , "1 ");
00169         SetString( 340 , "    Select ");
00170         SetString( 345 , "other slice ");
00171         SetString( 348 , "2 ");
00172         SetString( 350 , "    Validate ");
00173         SetString( 355 , "Healthy Slice ");
00174         SetString( 360 , "Healthy region size ");
00175         SetString( 365 , "Healthy region size ");
00176         SetString( 370 , "Size of the healthy region  ( 2xn+1 ) ");
00177         SetString( 373 , "n :  ");
00178         SetString( 375 , "Refresh healthy region ");
00179         SetString( 380 , "Total Axis Lenght ");
00180         SetString( 385 , "Seg. Length ");
00181         SetString( 390 , "Area ");
00182         SetString( 395 , "Ref. Area ");
00183         SetString( 400 , "Perimeter ");
00184         SetString( 405 , "Minimum Diameter ");
00185         SetString( 410 , "Maximum Diameter ");
00186         SetString( 415 , "Average Diameter ");
00187         SetString( 420 , "Ref Average Diam. ");
00188         SetString( 500 , "Maracas parameters... ");
00189         SetString( 505 , "Contour parameters ");
00190         SetString( 510 , "Contour calculation algorithm ");
00191         SetString( 515 , "% Thereshold ");
00192         SetString( 520 , "Debug ");
00193         SetString( 525 , "Visible Diameter? ");
00194         SetString( 530 , "Axis Parameters  ");
00195         SetString( 535 , "Extraction parameters ");
00196         SetString( 540 , "Flexion coefficient: ");
00197         SetString( 545 , "Tension coefficient: ");
00198         SetString( 550 , "Mask size (2*n+1), n: ");
00199         SetString( 555 , "Discret step for axis (1/N): ");
00200         SetString( 560 , "OK ");
00201         SetString( 565 , "Cancel ");
00202         SetString( 570 , "Default ");
00203         SetString( 575 , "Reset ");
00204         SetString( 580 , "Apply ");
00205         SetString( 605 , "The mask size was modified. ");
00206         SetString( 610 , "The threshold was modified. ");
00207         SetString( 615 , "The flexion coeficient was modified. ");
00208         SetString( 620 , "The tension coeficient was modified. ");
00209         SetString( 625 , "The discret step of the axis was modified.   ");
00210         SetString( 630 , " The axe will be regenereted and the contours will be eresed. ");
00211         SetString( 635 , " All contours will be erase.  ");
00212         SetString( 640 , " Do you want to continue?   ");
00213         SetString( 645 , "Alert   ");
00214         SetString( 650 , " %  Threshold  :   ");
00215         SetString( 655 , "Visible diameters? ");
00216         SetString( 660 , "Flexion coefficient: ");
00217         SetString( 665 , "Tension coefficient: ");
00218         SetString( 670 , "Mask size (2*n+1). n:  ");
00219         SetString( 675 , "Discret step for axis (1/N): ");
00220         SetString( 680 , "OK  ");
00221         SetString( 685 , "Cancel ");
00222         SetString( 690 , "Reset ");
00223         SetString( 695 , "Apply ");
00224         SetString( 700 , "Default ");
00225         SetString( 710 , "MARACAS Parameters... ");
00226         SetString( 720 , "Extraction parameters ");
00227         SetString( 725 , "Debug ");
00228         SetString( 730 , "Contour calculation algorithm ");
00229         SetString( 735 , "Contour Parameters ");
00230         SetString( 740 , "Axis Parameters ");
00231         SetString( 745 , "Invert slice order ");
00232         SetString( 800 , "Contour modification ");
00233         SetString( 803 , "Contour modification ");
00234         SetString( 805 , "1 ");
00235         SetString( 810 , "2 ");
00236         SetString( 815 , "3 ");
00237         SetString( 820 , "New ");
00238         SetString( 825 , "Contour ");
00239         SetString( 830 , "Replace ");
00240         SetString( 835 , "End ");
00241         SetString( 840 , "Insert point ");
00242         SetString( 845 , "Delete point ");
00243         SetString( 850 , "Move point ");
00244         SetString( 855 , "Use mouse left button to ");
00245         SetString( 860 , "create the new contour. ");
00246         SetString( 865 , "Alert ");
00247         SetString( 870 , "This option erase all 3D contours. ");
00248         SetString( 875 , "Do you want to continue? ");
00249         SetString( 905 , "Set an initial point. ");
00250         SetString( 910 , "(Double click over the interest artery.) ");
00251         SetString( 915 , "The initial point should be far ");
00252         SetString( 920 , "of the limits of the volume. ");
00253         SetString( 925 , "Threshold ");
00254         SetString( 930 , "Lumen Intensity % ");
00255         SetString( 935 , "Calcification Intensity % ");
00256         SetString( 940 , "Contour control ");
00257 }

Here is the call graph for this function:

Here is the caller graph for this function:

void marDictionary::LoadDictionary_French (  ) 

Definition at line 259 of file marDictionary.cxx.

References ResetDictionary(), SetLanguage(), and SetString().

00259                                          {
00260         ResetDictionary();
00261         SetLanguage(2);
00262 
00263         SetString(   5 , "MARACAS: MAgnetic Resonance Angiography Computer ASisted analysis ");
00264         SetString(  10 , "Valeurs de l'Iso surface ");
00265         SetString(  15 , "Iso visible");
00266         SetString(  20 , "Opacit  (%) ");
00267         SetString(  25 , "Isovalue ");
00268         SetString(  30 , "0 ");
00269         SetString(  35 , "Choisir  ");
00270         SetString(  40 , "l'artre  ");
00271         SetString(  45 , "1 ");
00272         SetString(  50 , "Extraction de l'axe  ");
00273         SetString(  55 , "2 ");
00274         SetString(  60 , "Quantification ");
00275         SetString(  65 , "Placez un premier point. ");
00276         SetString(  70 , "(Double clique au-dessus de l'artre d'intrt.) ");
00277         SetString(  73 , "OK ");
00278         SetString(  75 , "Commencer 3D  ");
00279         SetString(  80 , "Plan ");
00280         SetString(  85 , "Paramtres ");
00281         SetString(  90 , "Coupe  ");
00282         SetString( 205 , "Coupe saine ");
00283         SetString( 210 , "Section perpendiculaire ");
00284         SetString( 215 , "Visibilit des anneaux ");
00285         SetString( 220 , "Montrer la surface ");
00286         SetString( 225 , "Opacit  ");
00287         SetString( 230 , "Niveaux des gris         ");
00288         SetString( 235 , "Couleur ");
00289         SetString( 240 , "Isovaleur  ");
00290         SetString( 245 , "Ajouter un marqueur de coupe ");
00291         SetString( 248 , "Enregistre les contours ");
00292         SetString( 250 , "Effacer un marqueur de coupe  ");
00293         SetString( 253 , "Effacer les marquer des coupes ");
00294         SetString( 255 , "Stnoses  (surface) ");
00295         SetString( 260 , "Stnoses (diamtre ) ");
00296         SetString( 265 , "Recherche des stnoses  ");
00297         SetString( 270 , "Recherche automatique de la stnose ");
00298         SetString( 273 , "0 ");
00299         SetString( 275 , "Choisissez ");
00300         SetString( 280 , " la coupe ");
00301         SetString( 283 , "1 ");
00302         SetString( 285 , "Valider la  ");
00303         SetString( 290 , "coupe saine ");
00304         SetString( 293 , "2 ");
00305         SetString( 295 , "Valider la fin ");
00306         SetString( 300 , "de la rgion ");
00307         SetString( 303 , "3 ");
00308         SetString( 305 , "   Chercher ");
00309         SetString( 310 , "   stnoses ");
00310         SetString( 315 , "Automatique ");
00311         SetString( 320 , "Manuel ");
00312         SetString( 325 , "Recherche manuel de la stnose ");
00313         SetString( 328 , "0 ");
00314         SetString( 330 , "Choisir ");
00315         SetString( 335 , " la coupe ");
00316         SetString( 338 , "1 ");
00317         SetString( 340 , " Choisissez ");
00318         SetString( 345 , "autre coupe ");
00319         SetString( 348 , "2 ");
00320         SetString( 350 , "Valider la ");
00321         SetString( 355 , "coupe saine ");
00322         SetString( 360 , "Taille de rgion saine  ");
00323         SetString( 365 , "Taille de rgion saine  ");
00324         SetString( 370 , "( 2xn+1 ) ");
00325         SetString( 373 , "n :  ");
00326         SetString( 375 , "Rgnrer la rgion saine ");
00327         SetString( 380 , "Longeur total de l'axe  ");
00328         SetString( 385 , "Longueur du segment ");
00329         SetString( 390 , "Surface ");
00330         SetString( 395 , "Surface de ref. ");
00331         SetString( 400 , "Primtre ");
00332         SetString( 405 , "Diamtre minimum ");
00333         SetString( 410 , "Diamtre maximum ");
00334         SetString( 415 , "Diamtre moyen ");
00335         SetString( 420 , "Diamtre moyen de ref. ");
00336         SetString( 500 , "Paramtres de MARACAS... ");
00337         SetString( 505 , "Paramtres du contour ");
00338         SetString( 510 , "Algorithme pour le calcule de contour ");
00339         SetString( 515 , "% Seuillage ");
00340         SetString( 520 , "Debug ");
00341         SetString( 525 , "Montrer diamtre? ");
00342         SetString( 530 , "Paramtres de l'axe  ");
00343         SetString( 535 , "Paramtres d'extraction ");
00344         SetString( 540 , "Coefficient de flexion: ");
00345         SetString( 545 , "Coefficient de tension : ");
00346         SetString( 550 , "Taille du masque (2*n+1), n: ");
00347         SetString( 555 , "Pas de discrtisation pour l'axe (1/N): ");
00348         SetString( 560 , "OK ");
00349         SetString( 565 , "Annule ");
00350         SetString( 570 , "Dfaut ");
00351         SetString( 575 , "Remise ");
00352         SetString( 580 , "Appliquer ");
00353         SetString( 605 , "La taille de masque a t modifie. ");
00354         SetString( 610 , "Le seuil a t modifi . ");
00355         SetString( 615 , "Le coefficient de flexion a t modifi. ");
00356         SetString( 620 , "Le coefficient de tension a t modifi . ");
00357         SetString( 625 , "Le pas de discrtisations a t modifi.   ");
00358         SetString( 630 , " L'axe sera rgnr et les coupes seront effaces. ");
00359         SetString( 635 , " Tous les contours seront effacs. ");
00360         SetString( 640 , " Voulez-vous continuer ?   ");
00361         SetString( 645 , "Atention   ");
00362         SetString( 650 , " %  Seuillage  :   ");
00363         SetString( 655 , "Diamtres visible? ");
00364         SetString( 660 , "Coefficient de flexion: ");
00365         SetString( 665 , "Coefficient de tension: ");
00366         SetString( 670 , "Taille du masque (2*n+1). n:  ");
00367         SetString( 675 , "Pas de discrtisations pour l'axe (1/N): ");
00368         SetString( 680 , "OK  ");
00369         SetString( 685 , "Annule ");
00370         SetString( 690 , "Rinitialisation ");
00371         SetString( 695 , "Appliquez ");
00372         SetString( 700 , "Dfaut ");
00373         SetString( 710 , "Paramtres de MARACAS... ");
00374         SetString( 720 , "Extraction de paramtres ");
00375         SetString( 725 , "Debug ");
00376         SetString( 730 , "Algorithme pour le calcul de contour  ");
00377         SetString( 735 , "Paramtres du contour ");
00378         SetString( 740 , "Paramtres de l'axe ");
00379         SetString( 745 , "Invertir l'ordre des coupes ");
00380         SetString( 800 , "Contour modification ");
00381         SetString( 803 , "Modification du contour ");
00382         SetString( 805 , "1 ");
00383         SetString( 810 , "2 ");
00384         SetString( 815 , "3 ");
00385         SetString( 820 , "Nouveau  ");
00386         SetString( 825 , "contour ");
00387         SetString( 830 , "Remplacer ");
00388         SetString( 835 , "Fin ");
00389         SetString( 840 , "Insertion de point ");
00390         SetString( 845 , "Effacement de point  ");
00391         SetString( 850 , "Dplacement de point  ");
00392         SetString( 855 , "Bouton gauche de la sourie  ");
00393         SetString( 860 , "pour crer le contour. ");
00394         SetString( 865 , "Atention ");
00395         SetString( 870 , "Cette option efface tous les contours 3D. ");
00396         SetString( 875 , "Voulez-vous continuer ? ");
00397         SetString( 905 , "Dfinissez  un  point initial. ");
00398         SetString( 910 , "(Double clique sur le vaisseau d'intrt.) ");
00399         SetString( 915 , "Le point initial doit tre ");
00400         SetString( 920 , "loin des bords du volume. ");
00401         SetString( 925 , "Seuil ");
00402         SetString( 930 , "Intensit du Lumen % ");
00403         SetString( 935 , "Intensit des calcifications % ");
00404         SetString( 940 , "Control du contour ");
00405 
00406 }

Here is the call graph for this function:

void marDictionary::LoadDictionary_Japanese (  ) 

Definition at line 408 of file marDictionary.cxx.

References ResetDictionary(), and SetLanguage().

00408                                             {
00409         ResetDictionary();
00410         SetLanguage(3);
00411 }

Here is the call graph for this function:

bool marDictionary::LoadDictionaryFile ( char *  dictionaryFileName  ) 

Definition at line 66 of file marDictionary.cxx.

References _frases, ExistFileDictionary(), GetLanguage(), ResetDictionary(), SetLanguage(), and SetString().

00066                                                               {
00067         ResetDictionary();
00068 
00069         bool result=false;
00070 
00071         if ((_frases->size()==0) && (ExistFileDictionary(dictionaryFileName)==true) ){
00072                 long idText;
00073                 long idLanguage;
00074                 char idTextStr[50];
00075                 char idLanguageStr[50];
00076                 char text[256];
00077                 char line[256];
00078                 char name[50];
00079                 FILE *fileIn;
00080                 fileIn=fopen(dictionaryFileName,"r");
00081 
00082                 fgets(line, 256, fileIn);
00083                 sscanf(line,"%s %d" , name,&idLanguage);                
00084 
00085                 if (strcmp(name,"MARACAS_LANGUAGE")==0){
00086                         SetLanguage(idLanguage);
00087                         while (!feof(fileIn)) {
00088                                 fgets(line, 256, fileIn);
00089                                 if (strlen(line)>5){
00090                                         sscanf(line,"%s %s " , idLanguageStr,idTextStr);                
00091                                         sscanf(idLanguageStr,"%d " , &idLanguage);      
00092                                         if (GetLanguage()==idLanguage){
00093                                                 sscanf(idTextStr,"%d " , &idText);              
00094                                                 char    *start  = line + strlen(idLanguageStr)+1 + strlen(idTextStr)+1;
00095                                                 int             size    = strlen(line) -  (strlen(idLanguageStr)+1 + strlen(idTextStr)+1);
00096                                                 memcpy(text,start,size-1);
00097                                                 text[size]='\0';
00098                                                 SetString(idText,text);
00099                                         }
00100                                 }
00101                         }
00102                         result=true;
00103                 } else {
00104                 }
00105                 fclose(fileIn);
00106         }  // if _frases->size()==0
00107         return result;
00108 } 

Here is the call graph for this function:

void marDictionary::ResetDictionary (  ) 

Definition at line 58 of file marDictionary.cxx.

References _frases, and FreeDictionary().

Referenced by LoadDictionary_English(), LoadDictionary_French(), LoadDictionary_Japanese(), and LoadDictionaryFile().

00058                                    {
00059         if (_frases!=NULL){
00060                 FreeDictionary();
00061                 delete _frases;
00062         }
00063         _frases=new std::vector<marDictFrase*>();
00064 }

Here is the call graph for this function:

Here is the caller graph for this function:

void marDictionary::SetLanguage ( int  language  ) 

Definition at line 423 of file marDictionary.cxx.

References _language.

Referenced by LoadDictionary_English(), LoadDictionary_French(), LoadDictionary_Japanese(), and LoadDictionaryFile().

00423                                            {
00424         _language=language;
00425 }

Here is the caller graph for this function:

void marDictionary::SetString ( int  id,
char *  ss 
) [private]

Definition at line 448 of file marDictionary.cxx.

References _frases.

Referenced by LoadDictionary_English(), LoadDictionary_French(), and LoadDictionaryFile().

00448                                             {
00449         if (_frases!=NULL){
00450                 marDictFrase *mf = new marDictFrase(id,ss);
00451                 _frases->push_back(mf);
00452         }
00453 }

Here is the caller graph for this function:


Member Data Documentation

char marDictionary::_emptyStr[30] [private]

Definition at line 41 of file marDictionary.h.

Referenced by GetString(), and marDictionary().

std::vector< marDictFrase * > * marDictionary::_frases = 0 [static, private]
int marDictionary::_language = 0 [static, private]

Definition at line 42 of file marDictionary.h.

Referenced by GetLanguage(), GetString(), and SetLanguage().


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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1