00001 #include "HistogramDialog.h"
00002 #include <vector>
00003
00004 #include "OpenImage.xpm"
00005 #include "Save.xpm"
00006 #include "Ok.xpm"
00007 #include "Cancel.xpm"
00008 #include "Delete.xpm"
00009
00010 #include "creaSystem.h"
00011
00012
00013
00014
00015
00016
00017
00018 enum {
00019 ID_SAVE = 108,
00020 ID_LOAD,
00021 ID_REFRESH
00022 };
00023
00024
00025
00026
00027 HistogramDialog::HistogramDialog(wxWindow *parent,wxString title,vtkImageData* imageData,bool extracontrols)
00028 :wxDialog(parent,-1,title,wxDefaultPosition,wxDefaultSize,wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE ,_T("dialogBox"))
00029 {
00030
00031 initializeHistogramDialog(extracontrols);
00032 initializeHistogram(imageData);
00033
00034 }
00035
00036 HistogramDialog::HistogramDialog(wxWindow *parent,wxString title,bool extracontrols)
00037 :wxDialog(parent,-1,title,wxDefaultPosition,wxDefaultSize,wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE ,_T("dialogBox")){
00038
00039 initializeHistogramDialog(extracontrols);
00040 }
00041 HistogramDialog::~HistogramDialog(){
00042
00043 }
00044
00045 void HistogramDialog::initializeHistogramDialog(bool extracontrols){
00046 _currentcolorselectedbitmap = -1;
00047 _ctfun=NULL;
00048 _tfun=NULL;
00049 _panextracontrols=NULL;
00050 _maxgreyvalue = 1;
00051
00052 SetBackgroundColour(wxColour(255,255,255));
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 histogramW=new HistogramWidget(this, -1);
00064
00065
00066
00067
00068 wxBitmap bitmap0(Ok_xpm);
00069 okBtn = new wxBitmapButton(this, wxID_OK, bitmap0,wxDefaultPosition,wxDefaultSize);
00070
00071 wxBitmap bitmap1(Cancel_xpm);
00072 cancelBtn = new wxBitmapButton(this, wxID_CANCEL, bitmap1,wxDefaultPosition,wxDefaultSize);
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 wxBoxSizer * upper_box = new wxBoxSizer( wxHORIZONTAL );
00088
00089
00090 upper_box->Add( histogramW, 4, wxGROW);
00091 upper_box->Add( getControls(extracontrols),wxSizerFlags().Center() );
00092
00093
00094 wxBoxSizer *bottomBox = new wxBoxSizer( wxHORIZONTAL );
00095 bottomBox->Add( okBtn, wxSizerFlags().Center());
00096 bottomBox->AddSpacer(40);
00097
00098
00099
00100
00101
00102
00103 bottomBox->Add( cancelBtn,wxSizerFlags().Center() );
00104
00105
00106 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
00107 sizer->Add(upper_box,1,wxEXPAND);
00108 sizer->Add(bottomBox,0,wxCENTER);
00109 SetAutoLayout( TRUE );
00110 SetSizer( sizer );
00111 SetBestSize(wxSize(600,600));
00112 }
00113 wxPanel* HistogramDialog::getPanExtraControls(){
00114 wxBoxSizer* sizer0 = new wxBoxSizer(wxVERTICAL);
00115 _panextracontrols = new wxPanel(this);
00116
00117 _panextracontrols->SetSizer(sizer0);
00118 _panextracontrols->SetAutoLayout(true);
00119
00120 return _panextracontrols;
00121 }
00125 void HistogramDialog::setInfoPanExtraControls(std::vector<HistogramDialogComboBoxItem*> comboitems){
00126 _comboitems = comboitems;
00127 if(_panextracontrols!=NULL){
00128 _panextracontrols->Show(false);
00129 for(int i=0; i < comboitems.size();i++){
00130
00131 wxBitmap bitmap = comboitems[i]->GetBitmap();
00132
00133
00134 _panextracontrols->GetSizer()->Add(getBitmapButtonDelete(bitmap),wxSizerFlags().Center());
00135 _panextracontrols->GetSizer()->AddSpacer(5);
00136
00137 }
00138
00139 wxButton* button = new wxButton(_panextracontrols,wxID_ANY);
00140 button->SetToolTip(wxString("Add the current color to the list of predefined",wxConvUTF8));
00141 button->SetLabel(wxString(_T("Add")));
00142 Connect(button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialog::OnEditColorsCombo);
00143 _panextracontrols->GetSizer()->Add(button);
00144 _panextracontrols->Layout();
00145 _panextracontrols->Refresh();
00146 _panextracontrols->Show(true);
00147 this->Layout();
00148 this->Refresh();
00149
00150 }
00151 }
00152 wxSizer* HistogramDialog::getBitmapButtonDelete(wxBitmap bitmap){
00153
00154 wxBitmap bitmap0(Delete_xpm);
00155 wxBitmapButton* deletebutton = new wxBitmapButton(_panextracontrols,wxID_ANY,bitmap0,wxDefaultPosition,wxSize(20,20));
00156 deletebutton->SetToolTip(wxString("Delete the color from the list",wxConvUTF8));
00157 Connect(deletebutton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialog::OnDeleteColor);
00158 _deletebuttonsvector.push_back(deletebutton);
00159
00160
00161 wxBitmapButton* button = new wxBitmapButton(_panextracontrols,wxID_ANY,bitmap,wxDefaultPosition,wxSize(30,30));
00162 button->SetToolTip(wxString("Load the current color configuration.",wxConvUTF8));
00163 bitmapbuttonsvect.push_back(button);
00164 Connect(button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialog::OnEditColorsCombo);
00165
00166
00167
00168
00169
00170
00171 wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
00172 sizer->Add(button,wxSizerFlags().Center());
00173 sizer->AddSpacer(5);
00174 sizer->Add(deletebutton,wxSizerFlags().Center());
00175 return sizer;
00176 }
00177 void HistogramDialog::OnDeleteColor(wxCommandEvent& event){
00178 for(int i = 0; i < _deletebuttonsvector.size();i++){
00179 if(event.GetId()==_deletebuttonsvector[i]->GetId()){
00180 _currentcolorselectedbitmap = -1;
00181
00182
00183 HistogramDialogComboBoxItem* temp;
00184 temp = _comboitems[i];
00185 _deletebuttonsvector[i]->Hide();
00186 bitmapbuttonsvect[i]->Hide();
00187 delete temp;
00188
00189 _panextracontrols->GetSizer()->Remove(i*2);
00190
00191 _panextracontrols->GetSizer()->Remove(i*2);
00192 for(int k = i; k < _comboitems.size()-1;k++){
00193 _comboitems[k] = _comboitems[k+1];
00194 _deletebuttonsvector[k] = _deletebuttonsvector[k+1];
00195 bitmapbuttonsvect[k] = bitmapbuttonsvect[k+1];
00196 }
00197 _comboitems.pop_back();
00198 _deletebuttonsvector.pop_back();
00199 bitmapbuttonsvect.pop_back();
00200 }
00201 }
00202 _panextracontrols->Layout();
00203 }
00204 void HistogramDialog::OnEditColorsCombo(wxCommandEvent& event){
00205 bool loadconfig = false;
00206 UpdateCurrentComboElement();
00207 for(int i = 0; i < bitmapbuttonsvect.size();i++){
00208 if(event.GetId()==bitmapbuttonsvect[i]->GetId()){
00209 if(i<_comboitems.size()){
00210 _currentcolorselectedbitmap = i;
00211 loadconfig = true;
00212 HistogramDialogComboBoxItem* currentconfig = _comboitems[i];
00213 std::vector<double> greyvect = currentconfig->getGreyVector();
00214 std::vector<double> _redvect = currentconfig->getRedVector();
00215 std::vector<double> _greenvect = currentconfig->getGreenVector();
00216 std::vector<double> _bluevect= currentconfig->getBlueVector();
00217 this->eraseColorPoints();
00218 this->erasePointsTransferenceFunction();
00219 for(int i = 0; i < currentconfig->getGreyVector().size();i++){
00220 double greyv = currentconfig->getGreyVector()[i];
00221 double red = currentconfig->getRedVector()[i];
00222 double green = currentconfig->getGreenVector()[i];
00223 double blue = currentconfig->getBlueVector()[i];
00224
00225 this->addColorPoint(greyv*_maxgreyvalue, red*255.0, green*255.0, blue*255.0);
00226 }
00227 for(int i = 0; i < currentconfig->getGreyVectorTransfer().size();i++){
00228 double greyv = currentconfig->getGreyVectorTransfer()[i];
00229 double value = currentconfig->getValueVector()[i];
00230 std::cout<<"void HistogramDialog::OnEditColorsCombo(wxCommandEvent& event){"<<greyv<<" "<<value<<std::endl;
00231 this->addPointToTransferenceFunction(greyv*_maxgreyvalue, value*100);
00232 }
00233 }
00234 }
00235 }
00236 if(!loadconfig){
00237 AddNewBitmapButton();
00238 }
00239
00240 _panextracontrols->Layout();
00241 this->Layout();
00242 this->Refresh();
00243 }
00244 void HistogramDialog::UpdateCurrentComboElement(){
00245 if(_currentcolorselectedbitmap >= 0 && _currentcolorselectedbitmap < _comboitems.size()){
00246 setCurrentColorConfigurationIntoButton();
00247 }
00248 }
00249 void HistogramDialog::AddNewBitmapButton(){
00250 this->eraseColorPoints();
00251 this->erasePointsTransferenceFunction();
00252 HistogramDialogComboBoxItem* boxitem = new HistogramDialogComboBoxItem();
00253 wxBitmap bitmap = boxitem->GetBitmap();
00254 wxSizer* sizer = getBitmapButtonDelete(bitmap);
00255 _panextracontrols->GetSizer()->Insert(_comboitems.size()*2,sizer,wxSizerFlags().Center());
00256 _panextracontrols->GetSizer()->InsertSpacer(_comboitems.size()*2+1,5);
00257 _comboitems.push_back(boxitem);
00258 _currentcolorselectedbitmap = _comboitems.size()-1;
00259 }
00260 void HistogramDialog::setCurrentColorConfigurationIntoButton(){
00261
00262 std::vector<double> greylevel;
00263 std::vector<double> red;
00264 std::vector<double> green;
00265 std::vector<double> blue;
00266 std::vector<double> red0;
00267 std::vector<double> green0;
00268 std::vector<double> blue0;
00269 GetValuesColorPointsFunction(greylevel,red,green,blue);
00270
00271 for(int i = 0;i< greylevel.size();i++){
00272 greylevel[i] = greylevel[i]/_maxgreyvalue;
00273
00274
00275
00276 red0.push_back(red[i]);
00277 green0.push_back(green[i]);
00278 blue0.push_back(blue[i]);
00279
00280
00281
00282 }
00283
00284 std::vector<double> greylevel1;
00285 std::vector<double> value;
00286 this->GetValuesPointsFunction(greylevel1,value);
00287
00288 for(int i = 0;i< greylevel1.size();i++){
00289 greylevel1[i] = greylevel1[i]/_maxgreyvalue;
00290 value[i] = value[i];
00291 std::cout<<"void HistogramDialog::setCurrentColorConfigurationIntoButton(){"<<greylevel1[i]<<std::endl;
00292 std::cout<<"void HistogramDialog::setCurrentColorConfigurationIntoButton(){"<<value[i]<<std::endl;
00293 }
00294 if(_currentcolorselectedbitmap >= 0 && _currentcolorselectedbitmap < _comboitems.size()){
00295 _comboitems[_currentcolorselectedbitmap]->SetColors(greylevel,red0,green0,blue0);
00296 _comboitems[_currentcolorselectedbitmap]->SetTransferFunction(greylevel1,value);
00297 bitmapbuttonsvect[_currentcolorselectedbitmap]->SetBitmapLabel(_comboitems[_currentcolorselectedbitmap]->GetBitmap());
00298 }
00299 }
00300
00301 wxSizer* HistogramDialog::getControls(bool extracontrols){
00302
00303 wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
00304
00305 wxBitmap bitmap0(OpenImage_xpm);
00306 wxBitmapButton* opendata = new wxBitmapButton(this, -1, bitmap0,wxDefaultPosition,wxSize(30,30));
00307 Connect(opendata->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialog::OnLoadData);
00308 sizer->Add(opendata,wxSizerFlags().Center());
00309 sizer->AddSpacer(5);
00310
00311
00312
00313 wxBitmap bitmap1(Save_xpm);
00314 wxBitmapButton* savedata = new wxBitmapButton(this, -1, bitmap1,wxDefaultPosition,wxSize(30,30));
00315 Connect(savedata->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&HistogramDialog::OnSaveData);
00316 sizer->Add(savedata,wxSizerFlags().Center());
00317 sizer->AddSpacer(5);
00318
00319 if(extracontrols){
00320 sizer->Add(getPanExtraControls(),wxSizerFlags().Center());
00321 }
00322
00323
00324
00325
00326 return sizer;
00327
00328
00329 }
00330
00331
00332
00333
00334
00335 void HistogramDialog::OnSaveData(wxCommandEvent& event)
00336 {
00337 wxString nameF=wxFileSelector(_T("Save Data"), _T(" "),_T(""),_T(""),_T("*.*"),wxSAVE, NULL, -1, -1);
00338 std::ofstream file;
00339 if(nameF.CompareTo( _T("/0") )>0)
00340 file.open( (const char*)(nameF.mb_str()) );
00341
00342 if(file.is_open())
00343 {
00344 file << "<histogram Data>" << std::endl;
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361 file << " <TransferenceFunction>"<< std::endl;
00362 int tfPointS=histogramW->getSizeTransferenceFunction();
00363 int i=0;
00364 int gv,in;
00365 while(i<tfPointS)
00366 {
00367
00368 histogramW->getTransferenceFunctionPoint(i,gv,in);
00369 file << " <Transferencepoint>" << std::endl;
00370 file << " <greyValue>" << gv << "</greyValue>" <<std::endl;
00371 file << " <intensity>" << in << "</intensity> "<<std::endl;
00372 file << " </Transferencepoint>" << std::endl;
00373 i++;
00374 }
00375 file << " </TransferenceFunction>"<< std::endl;
00376
00377 file << " <Colors>"<< std::endl;
00378 int ctfPointS=histogramW->getSizeBarColor();
00379
00380 i=0;
00381 int red,green,blue;
00382 while(i<ctfPointS)
00383 {
00384
00385 histogramW->getDataBarColorPoint(i,gv,red,green,blue);
00386 file << " <greyValueRGBpoint>" << std::endl;
00387 file << " <RGBgreyValue>" << gv << "</RGBgreyValue>" <<std::endl;
00388 file << " <red>" << red << "</red>" <<std::endl;
00389 file << " <green>" << green << "</green>" <<std::endl;
00390 file << " <blue>" << blue << "</blue>" <<std::endl;
00391 file << " </greyValueRGBpoint>" << std::endl;
00392 i++;
00393 }
00394
00395 file << " </Colors>"<< std::endl;
00396 file << "</histogram Data>" << std::endl;
00397 }
00398 file.close();
00399 }
00400
00401 void HistogramDialog::OnLoadData(wxCommandEvent& event)
00402 {
00403 wxString nameF=wxFileSelector(_T("Load Data") );
00404
00405 std::ifstream file;
00406 if(nameF.CompareTo( _T("/0") )>0)
00407 file.open( (const char*) (nameF.mb_str()) );
00408
00409 bool histogramReading=false,tf=false,ctf=false,tfp=false,ctfp=false;
00410 int gv=-1,in=-1,red=-1,gr=-1,bl=-1;
00411 if(file.is_open())
00412 {
00413
00414 erasePointsTransferenceFunction();
00415 eraseColorPoints();
00416
00417
00418
00419
00420 while(!file.eof())
00421 {
00422 std::string line;
00423 std::getline(file,line);
00424
00425 if( (int)(line.find("histogram Data"))!=-1)
00426 {
00427 histogramReading=true;
00428
00429 }
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456 else if( (int)(line.find("TransferenceFunction"))!=-1 && histogramReading)
00457 {
00458 tf=true;
00459 }
00460 else if( (int)(line.find("<Transferencepoint>"))!=-1 && histogramReading && tf)
00461 {
00462 tfp=true;
00463 }
00464 else if( (int)(line.find("greyValue"))!=-1 && histogramReading && tf && tfp)
00465 {
00466 int pos1=line.find(">");
00467 int pos2=line.find("<",pos1+1);
00468 std::string x=line.substr(pos1+1,pos2-pos1-1);
00469 gv=atoi(x.c_str());
00470
00471 }
00472 else if( (int)(line.find("intensity"))!=-1 && histogramReading && tf && tfp)
00473 {
00474 int pos1=line.find(">");
00475 int pos2=line.find("<",pos1+1);
00476 std::string x=line.substr(pos1+1,pos2-pos1-1);
00477 in=atoi(x.c_str());
00478 histogramW->addPointToTransferenceFunction(gv,in);
00479 tfp=false;
00480
00481 }
00482 else if( (int)(line.find("Colors"))!=-1 && histogramReading)
00483 {
00484 ctf=true;
00485 }
00486
00487 else if( (int)(line.find("greyValueRGBpoint"))!=-1 && histogramReading && ctf )
00488 {
00489 ctfp=true;
00490
00491 }
00492 else if( (int)(line.find("RGBgreyValue"))!=-1 && histogramReading && ctf && ctfp)
00493 {
00494 int pos1=line.find(">");
00495 int pos2=line.find("<",pos1+1);
00496 std::string x=line.substr(pos1+1,pos2-pos1-1);
00497 gv=atoi(x.c_str());
00498
00499 }
00500 else if( (int)(line.find("red"))!=-1 && histogramReading && ctf && ctfp)
00501 {
00502 int pos1=line.find(">");
00503 int pos2=line.find("<",pos1+1);
00504 std::string x=line.substr(pos1+1,pos2-pos1-1);
00505 red=atoi(x.c_str());
00506
00507 }
00508 else if( (int)(line.find("green"))!=-1 && histogramReading && ctf && ctfp)
00509 {
00510 int pos1=line.find(">");
00511 int pos2=line.find("<",pos1+1);
00512 std::string x=line.substr(pos1+1,pos2-pos1-1);
00513 gr=atoi(x.c_str());
00514 }
00515 else if( (int)(line.find("blue"))!=-1 && histogramReading && ctf && ctfp)
00516 {
00517 int pos1=line.find(">");
00518 int pos2=line.find("<",pos1+1);
00519 std::string x=line.substr(pos1+1,pos2-pos1-1);
00520 bl=atoi(x.c_str());
00521 histogramW->addColorPoint(gv,red,gr,bl);
00522 ctfp=false;
00523 }
00524 line.clear();
00525 }
00526 }
00527
00528 file.close();
00529 histogramW->updatePlotter();
00530 }
00531
00532
00533
00534
00535 void HistogramDialog::OnRefreshBtn(wxCommandEvent &event)
00536 {
00537 refreshed=true;
00538
00539 int i=0,xi,yi,r,g,b;
00540
00541
00542 int nPointsTF=getSizeTransferenceFunction();
00543
00544 if(nPointsTF>0)
00545 {
00546
00547 int nTFPoints=getSizeTransferenceFunction();
00548 i=0;
00549 while(i<nTFPoints)
00550 {
00551 getTransferenceFunctionPoint(i,xi,yi);
00552 _tfun->AddPoint( xi , yi/100.0 );
00553 i++;
00554 }
00555 }
00556
00557
00558 int nPointsCTF=getSizeBarColor();
00559 if(nPointsCTF>0)
00560 {
00561 _ctfun->RemoveAllPoints();
00562
00563 int nCTFpoints=getSizeBarColor();
00564 i=0;
00565 while(i<nCTFpoints)
00566 {
00567 getDataBarColorPoint(i,xi,r,g,b);
00568 _ctfun->AddRGBPoint(xi,r/255.0,g/255.0,b/255.0 );
00569 i++;
00570 }
00571 }
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589 }
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599 int HistogramDialog::getSizeTransferenceFunction()
00600 {
00601 return histogramW->getSizeTransferenceFunction();
00602
00603 }
00604
00605
00606
00607 int HistogramDialog::getSizeBarColor()
00608 {
00609 return histogramW->getSizeBarColor();
00610 }
00611
00612
00613
00614 void HistogramDialog::getTransferenceFunctionPoint(int index,int& x,int& y)
00615 {
00616 histogramW->getTransferenceFunctionPoint(index,x,y);
00617 }
00618
00619
00620
00621 void HistogramDialog::getDataBarColorPoint(int index,int&x, int& red,int& green,int& blue)
00622 {
00623 histogramW->getDataBarColorPoint(index,x,red,green,blue);
00624 }
00625
00626
00627
00628
00629 int HistogramDialog::getHistogramPoint(int gValue)
00630 {
00631 return histogramW->getHistogramPoint(gValue);
00632 }
00633
00634
00635
00636
00637
00638
00639
00640
00641 float HistogramDialog::getMaxShowedPorcentage()
00642 {
00643 return histogramW->getMaxShowedPorcentage();
00644 }
00645 float HistogramDialog::getMinShowedPorcentage()
00646 {
00647 return histogramW->getMinShowedPorcentage();
00648 }
00649 float HistogramDialog::getActualShowedPorcentage()
00650 {
00651 return histogramW->getActualShowedPorcentage();
00652 }
00653
00654
00655
00656
00657 bool HistogramDialog::addPointToTransferenceFunction(double x, double y)
00658 {
00659 return histogramW->addPointToTransferenceFunction(x,y);
00660 }
00661 bool HistogramDialog::addColorPoint(double x,int red,int green, int blue)
00662 {
00663 return histogramW->addColorPoint(x,red,green,blue);
00664 }
00665
00666
00667
00668
00669
00670
00671
00672 void HistogramDialog::erasePointsTransferenceFunction()
00673 {
00674 histogramW->erasePointsTransferenceFunction();
00675 }
00676
00677
00678
00679 void HistogramDialog::eraseColorPoints()
00680 {
00681 histogramW->eraseColorPoints();
00682 }
00683
00684
00685
00686
00687
00688 void HistogramDialog::setCTF(vtkColorTransferFunction *cf)
00689 {
00690 _ctfun=cf;
00691
00692 }
00693 void HistogramDialog:: setTF(vtkPiecewiseFunction *tf)
00694 {
00695 _tfun=tf;
00696 }
00697
00698 bool HistogramDialog::getRefreshed()
00699 {
00700 return refreshed;
00701 }
00702
00703 void HistogramDialog::setVolumeMapper(vtkVolumeRayCastMapper* volMapper)
00704 {
00705 volumeMapper=volMapper;
00706 }
00707 void HistogramDialog::setVolume(vtkVolume* vol)
00708 {
00709 newvol=vol;
00710 }
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721 void HistogramDialog::setTransferenceFunctionHasPoints(bool hasPoints)
00722 {
00723 histogramW->setTransferenceFunctionHasPoints(hasPoints);
00724 }
00725 void HistogramDialog::setTransferenceFunctionHasColor(bool hasColorPoints)
00726 {
00727 histogramW->setTransferenceFunctionHasColor(hasColorPoints);
00728 }
00729
00730
00731
00732
00733 void HistogramDialog::updatePlotter()
00734 {
00735 histogramW->updatePlotter();
00736 }
00737
00738
00742 void HistogramDialog::initializeHistogram(vtkImageData* img){
00743 _maxgreyvalue = img->GetScalarRange()[1];
00744 histogramW->initializeHistogram(img);
00745 }
00749 void HistogramDialog::GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& value){
00750
00751 histogramW->GetValuesPointsFunction(greylevel, value);
00752 }
00753
00758 void HistogramDialog::GetValuesColorPointsFunction(std::vector<double>& greylevel,
00759 std::vector<double>& red,
00760 std::vector<double>& green,
00761 std::vector<double>& blue)
00762 {
00763 histogramW->GetValuesColorPointsFunction(greylevel, red, green, blue);
00764 }
00765
00766 void HistogramDialog::SetFunctions(vtkPiecewiseFunction* _opac, vtkColorTransferFunction* _color){
00767 _tfun = _opac;
00768 _ctfun = _color;
00769 }