wxProcessingCTWidget Class Reference

#include <wxProcessingCTWidget.h>

Collaboration diagram for wxProcessingCTWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxProcessingCTWidget (wxWindow *parent, marInterfaceCT *mar)
 ~wxProcessingCTWidget ()
void ConfigureVTK (marImageData *marimagedata, int x, int y, int z)
void Refresh ()
void OnLowThreshold (wxScrollEvent &event)
void OnMidThreshold (wxScrollEvent &event)
void LowThreshold ()
void MidThreshold ()
void OnZSlice (wxScrollEvent &event)
void OnExtract (wxCommandEvent &event)
void OnRefreshView (wxCommandEvent &event)
void SetThreshold (int min, int max)
void GetThreshold (int *min, int *max)
void OnSpinLowThresholdSpin1 (wxScrollEvent &event)
void OnSpinLowThresholdSpin2 (wxScrollEvent &event)

Private Member Functions

wxPanel * CreateControlPanel (wxWindow *parent)
wxPanel * CreateViewPanel (wxWindow *parent)
 DECLARE_EVENT_TABLE ()

Private Attributes

wxWindow * _parent
vtkMarchingCubes * _mCubes
vtkPolyDataMapper * _surfMapper
vtkActor * _surfActor
marInterfaceCT_mar
vtkImageThreshold * _thresh
vtkImageThreshold * _thresh2
vtkImageSeedConnectivity * _connect
vtkImageSeedConnectivity * _connect2
vtkImageCast * cast3
vtkImageCast * cast4
vtkImageData * data
wxSlider * _lowthreshold
wxSlider * _midthreshold
wxSlider * _lowthresholdSpin1
wxSlider * _lowthresholdSpin2
wxSlider * _zslice
wxVtk2DBaseView_imageviewer2D_1
wxVtk2DBaseView_imageviewer2D_2
wxVtk2DBaseView_imageviewer2D_3
wxButton * _extract
vtkBaseData_vtkbasedata_1
vtkBaseData_vtkbasedata_2
vtkBaseData_vtkbasedata_3
int _x
int _y
int _z
double _range [2]

Detailed Description

Definition at line 33 of file wxProcessingCTWidget.h.


Constructor & Destructor Documentation

wxProcessingCTWidget::wxProcessingCTWidget ( wxWindow *  parent,
marInterfaceCT mar 
)

Definition at line 62 of file wxProcessingCTWidget.cxx.

00063 : wxPanel( parent, -1) 
00064 {
00065         wxSplitterWindow                *pnlSplitter            = new wxSplitterWindow( this , -1);
00066         wxPanel                         *viewPanel              = CreateViewPanel(pnlSplitter);
00067         wxPanel                         *controlPanel           = CreateControlPanel(pnlSplitter);
00068 
00069         pnlSplitter     -> SplitVertically( viewPanel, controlPanel ,300);
00070         pnlSplitter     -> SetMinimumPaneSize( 300 );
00071 
00072         wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL  );
00073         sizer           -> Add( pnlSplitter ,1,wxALL|wxGROW  ,0);
00074         this            -> SetSizer(sizer);
00075         this->SetAutoLayout(true);
00076 //      panel->SetSize(400,400);
00077         this->Layout();
00078 
00079 //EEDxx2.4
00080 //      FitInside();
00081         _mar = mar;
00082         _range[0]=0;
00083         _range[1]=255;  
00084 
00085 }

wxProcessingCTWidget::~wxProcessingCTWidget (  ) 

Definition at line 87 of file wxProcessingCTWidget.cxx.

References _connect2, _imageviewer2D_1, _imageviewer2D_2, _imageviewer2D_3, and _thresh2.

00087                                            {
00088 // MAZV 27 sep 2006
00089 //      _thresh->Delete();
00090 //      _connect->Delete();
00091 
00092         _connect2->Delete();
00093         
00094         _thresh2->Delete();
00095 
00096         delete _imageviewer2D_1;
00097         delete _imageviewer2D_2;
00098         delete _imageviewer2D_3;
00099 }


Member Function Documentation

void wxProcessingCTWidget::ConfigureVTK ( marImageData marimagedata,
int  x,
int  y,
int  z 
)

Definition at line 276 of file wxProcessingCTWidget.cxx.

References _connect, _connect2, _imageviewer2D_1, _imageviewer2D_2, _imageviewer2D_3, _lowthreshold, _midthreshold, _range, _thresh, _thresh2, _vtkbasedata_1, _vtkbasedata_2, _vtkbasedata_3, _x, _y, _z, _zslice, cast3, cast4, wxVtk2DBaseView::Configure(), data, marImageData::GetImageData(), vtkBaseData::SetMarImageData(), and wxVtk2DBaseView::SetVtkBaseData().

Referenced by wxMaracasProcessingCT::ConfigureVTK().

00277 {
00278     wxBusyCursor wait;
00279 
00280         _x = x;
00281         _y = y;
00282         _z = z;
00283 
00284         vtkImageData *imagedata=marimagedata->GetImageData();
00285         imagedata->UpdateInformation();
00286         imagedata->SetUpdateExtent(imagedata->GetWholeExtent());
00287         imagedata->Update();
00288 
00289         data = imagedata;
00290 
00291         double puntoactualprov[3];
00292         puntoactualprov[0] = x;
00293         puntoactualprov[1] = y;
00294         puntoactualprov[2] = z;
00295 
00296         double espprin[3];
00297         int extprin[6];                         
00298         
00299         imagedata->GetSpacing(espprin);
00300         imagedata->GetExtent(extprin);
00301 
00302 
00303 // MAZV 27 sep 2006
00304 //      puntoactualprov[0]=puntoactualprov[0]*espprin[0];
00305 //      puntoactualprov[1]=puntoactualprov[1]*espprin[1];
00306 //      puntoactualprov[2]=puntoactualprov[2]*espprin[2];
00307         
00308     imagedata->GetScalarRange( _range );
00309 
00310 
00311         // Update Controls
00312         _lowthreshold->SetRange( (int)(_range[0]), (int)(_range[1]));
00313         _lowthreshold->SetValue( (int)(_range[1]/4) );
00314 
00315         _midthreshold->SetRange( (int)(_range[0]),  (int)(_range[1]));
00316         _midthreshold->SetValue( (int)(_range[1]/2) );
00317 
00318 // MAZV 27 sep 2006
00319 //      _highthreshold->SetRange(_range[0], _range[1]);
00320 //      _highthreshold->SetValue( _range[1] );
00321 
00322         _zslice->SetRange(extprin[4], extprin[5]);
00323         _zslice->SetValue(extprin[5]/2);
00324     
00325         
00326         _thresh = vtkImageThreshold::New();
00327         _thresh->SetInput(imagedata);
00328         //_thresh->ReleaseDataFlagOff();
00329         _thresh->SetInValue(255);
00330         _thresh->SetOutputScalarTypeToUnsignedShort();
00331         _thresh->SetOutValue(0);
00332         _thresh->ThresholdBetween(_lowthreshold->GetValue(), _range[1]);
00333 
00334         vtkImageCast *cast = vtkImageCast::New();
00335         cast->SetInput(_thresh->GetOutput());
00336         cast->SetOutputScalarTypeToUnsignedChar();
00337         cast->Update();
00338 
00339   
00340         _connect = vtkImageSeedConnectivity::New();
00341         _connect->SetInput(cast->GetOutput());
00342         _connect->SetInputConnectValue(255);
00343         _connect->SetOutputConnectedValue(255);
00344         _connect->SetOutputUnconnectedValue(0);
00345         _connect->AddSeed( (int)(puntoactualprov[0]), (int)(puntoactualprov[1]), (int)(puntoactualprov[2]));
00346         _connect->Update();
00347 
00348         cast3 = vtkImageCast::New();
00349         cast3->SetInput(_connect->GetOutput());
00350         cast3->SetOutputScalarTypeToUnsignedShort();
00351         cast3->Update();
00352 
00353         _thresh2 = vtkImageThreshold::New();
00354         _thresh2->SetInput(imagedata);
00355         //_thresh2->ReleaseDataFlagOff();
00356         _thresh2->SetInValue(255);
00357         _thresh2->SetOutputScalarTypeToUnsignedShort();
00358         _thresh2->SetOutValue(0);
00359         _thresh2->ThresholdBetween(_lowthreshold->GetValue(), _midthreshold->GetValue());
00360 
00361         vtkImageCast *cast2 = vtkImageCast::New();
00362         cast2->SetInput(_thresh2->GetOutput());
00363         cast2->SetOutputScalarTypeToUnsignedChar();
00364         cast2->Update();
00365 
00366 
00367         _connect2 = vtkImageSeedConnectivity::New();
00368         _connect2->SetInput(cast2->GetOutput());
00369         _connect2->SetInputConnectValue(255);
00370         _connect2->SetOutputConnectedValue(255);
00371         _connect2->SetOutputUnconnectedValue(0);
00372         _connect2->AddSeed(  (int)(puntoactualprov[0]),  (int)(puntoactualprov[1]),  (int)(puntoactualprov[2]) );
00373         _connect2->Update();
00374 
00375         cast4 = vtkImageCast::New();
00376         cast4->SetInput(_connect2->GetOutput());
00377         cast4->SetOutputScalarTypeToUnsignedShort();
00378         cast4->Update();
00379 
00380         // Interface Update
00381 
00382         _vtkbasedata_1 = new vtkBaseData();
00383         _vtkbasedata_1->SetMarImageData(marimagedata);
00384         
00385 
00386         cast3->GetOutput()->UpdateInformation();
00387         cast3->GetOutput()->SetUpdateExtent( cast3->GetOutput()->GetWholeExtent() );
00388         cast3->GetOutput()->SetUpdateExtent( cast3->GetOutput()->GetWholeExtent() );
00389         
00390         cast3->GetOutput()->Update();
00391         _vtkbasedata_2 = new vtkBaseData();
00392         _vtkbasedata_2->SetMarImageData( new marImageData(cast3->GetOutput()) );
00393 
00394 
00395         cast4->GetOutput()->UpdateInformation();
00396         cast4->GetOutput()->SetUpdateExtent(cast4->GetOutput()->GetWholeExtent());
00397         cast4->GetOutput()->Update();
00398         _vtkbasedata_3 = new vtkBaseData();
00399         _vtkbasedata_3->SetMarImageData( new marImageData(cast4->GetOutput() ));
00400 
00401         _imageviewer2D_1->SetVtkBaseData( _vtkbasedata_1  );
00402         _imageviewer2D_1->Configure();
00403 
00404         _imageviewer2D_2->SetVtkBaseData( _vtkbasedata_2  );
00405         _imageviewer2D_2->Configure();
00406 
00407         _imageviewer2D_3->SetVtkBaseData( _vtkbasedata_3  );
00408         _imageviewer2D_3->Configure();
00409 // EED 31 Mai 2007
00410 //      Refresh();
00411         
00412 }

Here is the call graph for this function:

Here is the caller graph for this function:

wxPanel * wxProcessingCTWidget::CreateControlPanel ( wxWindow *  parent  )  [private]

Definition at line 124 of file wxProcessingCTWidget.cxx.

References _extract, _lowthreshold, _lowthresholdSpin1, _lowthresholdSpin2, _midthreshold, _parent, _zslice, OnExtract(), OnLowThreshold(), OnMidThreshold(), OnSpinLowThresholdSpin1(), OnSpinLowThresholdSpin2(), and OnZSlice().

00125 {
00126         _parent=parent;
00127         wxPanel *panel          = new wxPanel(parent,-1);
00128         _lowthreshold           = new wxSlider( panel, -1,65000 , 64000, 65000, wxDefaultPosition, wxSize(25,25), wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS  );
00129         _lowthreshold->SetTickFreq(50,0);
00130 
00131         _midthreshold           = new wxSlider( panel, -1, 65000 , 64000, 65000, wxDefaultPosition, wxSize(25,25), wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS );
00132         _midthreshold->SetTickFreq(50,0);
00133 
00134 
00135         _lowthresholdSpin1      = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT  );
00136         _lowthresholdSpin1->SetRange(1,8);
00137         _lowthresholdSpin1->SetValue(5);
00138         Connect(_lowthresholdSpin1->GetId()  , wxEVT_COMMAND_SLIDER_UPDATED      , (wxObjectEventFunction) &wxProcessingCTWidget::OnSpinLowThresholdSpin1 ); 
00139 //      Connect(_lowthresholdSpin1->GetId()  , wxEVT_SCROLL_THUMBTRACK   , (wxObjectEventFunction) &wxProcessingCTWidget::OnSpinLowThresholdSpin1 ); 
00140 
00141         _lowthresholdSpin2      = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT  );
00142         _lowthresholdSpin2->SetRange(1,8);
00143         _lowthresholdSpin2->SetValue(5);
00144         Connect(_lowthresholdSpin2->GetId()  , wxEVT_COMMAND_SLIDER_UPDATED      , (wxObjectEventFunction) &wxProcessingCTWidget::OnSpinLowThresholdSpin2 ); 
00145 //      Connect(_lowthresholdSpin2->GetId()  , wxEVT_SCROLL_THUMBTRACK   , (wxObjectEventFunction) &wxProcessingCTWidget::OnSpinLowThresholdSpin2 ); 
00146 
00147 
00148 
00149 // MAZV 27 sep 2006
00150 //      _highthreshold          = new wxSlider( panel, -1, 50, 0, 100 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
00151         _zslice                         = new wxSlider( panel, -1, 50, 0, 100 , wxDefaultPosition, wxSize(25,25), wxSL_HORIZONTAL | wxSL_LABELS | wxSL_AUTOTICKS );
00152         _zslice->SetTickFreq(10,0);
00153         _extract                        = new wxButton( panel, -1, _T("Axis extraction"));
00154 //      _midthreshold->SetSize(250,20);
00155 // MAZV 27 sep 2006
00156         //_highthreshold->SetSize(250,20);  // Result Volume
00157 
00158 //          wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
00159     wxBoxSizer *sizer   = new wxBoxSizer(wxVERTICAL );
00160 
00161         int flag = wxALL | wxGROW ;
00162 
00163         sizer->Add(new wxStaticText(panel,-1,_T("  "))                                                  , 1, flag, 0);
00164         sizer->Add(new wxStaticText(panel,-1,_T("  "))                                                  , 1, flag, 0);
00165         sizer->Add(new wxStaticText(panel,-1,_T("Lower vascular threshold"))                            , 1, flag, 0);  
00166 
00167     wxBoxSizer *sizerLowThreshold       = new wxBoxSizer(wxHORIZONTAL );
00168         sizerLowThreshold->Add(_lowthresholdSpin1                                                       );
00169         sizerLowThreshold->Add(_lowthreshold                                                            , 1, wxALL | wxGROW , 0);
00170         sizer->Add(sizerLowThreshold                                                                    , 1, wxALL | wxGROW , 0);
00171 
00172         sizer->Add(new wxStaticText(panel,-1,_T("  "))                                                  , 1, flag, 0);
00173         sizer->Add(new wxStaticText(panel,-1,_T("Higher vascular threshold"))                           , 1, flag, 0);
00174 
00175     wxBoxSizer *sizerMidThreshold       = new wxBoxSizer(wxHORIZONTAL );
00176         sizerMidThreshold->Add(_lowthresholdSpin2                                                       );
00177         sizerMidThreshold->Add(_midthreshold                                                            , 1, flag, 0);
00178         sizer->Add(sizerMidThreshold                                                                    , 1, flag, 0);
00179         
00180 
00181 // MAZV 27 sep 2006
00182 //      sizer->Add(new wxStaticText(panel,-1,"  "));
00183 //      sizer->Add(new wxStaticText(panel,-1,"Calcification threshold"));
00184 //      sizer->Add(_highthreshold);
00185 
00186 
00187         sizer->Add(new wxStaticText(panel,-1,_T("  "))                                                  , 1, flag, 0);
00188         sizer->Add(new wxStaticText(panel,-1,_T("Z Slice"))                                             , 1, flag, 0);
00189         sizer->Add(_zslice                                                                              , 1, flag, 0);
00190         sizer->Add(new wxStaticText(panel,-1,_T("  "))                                                  , 1, flag, 0);
00191         sizer->Add(_extract                                                                             , 1, flag, 0);
00192 
00193 //      panel->SetSize(200,200);
00194         panel->SetSizer(sizer);
00195         panel->SetAutoLayout(true);
00196         panel->Layout();
00197 //      panel->FitInside(parent);
00198 
00199         Connect(_lowthreshold->GetId()  , wxEVT_SCROLL_CHANGED                  , (wxObjectEventFunction) &wxProcessingCTWidget::OnLowThreshold); 
00200         Connect(_lowthreshold->GetId()  , wxEVT_SCROLL_THUMBTRACK               , (wxObjectEventFunction) &wxProcessingCTWidget::OnLowThreshold); 
00201         Connect(_midthreshold->GetId()  , wxEVT_SCROLL_CHANGED                  , (wxObjectEventFunction) &wxProcessingCTWidget::OnMidThreshold ); 
00202         Connect(_midthreshold->GetId()  , wxEVT_SCROLL_THUMBTRACK               , (wxObjectEventFunction) &wxProcessingCTWidget::OnMidThreshold ); 
00203 
00204 
00205 // MAZV 27 sep 2006
00206 //  Connect(_highthreshold->GetId() , wxEVT_SCROLL_THUMBTRACK           , (wxObjectEventFunction) &wxProcessingCTWidget::OnHighThreshold );
00207 
00208         Connect(_zslice->GetId()                , wxEVT_SCROLL_CHANGED                  , (wxObjectEventFunction) &wxProcessingCTWidget::OnZSlice );
00209         Connect(_zslice->GetId()                , wxEVT_SCROLL_THUMBTRACK               , (wxObjectEventFunction) &wxProcessingCTWidget::OnZSlice );
00210 
00211         Connect(_extract->GetId()               , wxEVT_COMMAND_BUTTON_CLICKED  , (wxObjectEventFunction) &wxProcessingCTWidget::OnExtract );
00212         return panel;
00213 }

Here is the call graph for this function:

wxPanel * wxProcessingCTWidget::CreateViewPanel ( wxWindow *  parent  )  [private]

Definition at line 101 of file wxProcessingCTWidget.cxx.

References _imageviewer2D_1, _imageviewer2D_2, _imageviewer2D_3, and wxVtkBaseView::GetWxVTKRenderWindowInteractor().

00102 {
00103         wxPanel *panel          =       new wxPanel(parent,-1);
00104     wxBoxSizer *sizer   =       new wxBoxSizer(wxVERTICAL);
00105 
00106         _imageviewer2D_1 = new wxVtk2DBaseView(panel);
00107         _imageviewer2D_2 = new wxVtk2DBaseView(panel);
00108         _imageviewer2D_3 = new wxVtk2DBaseView(panel);
00109         wxVTKRenderWindowInteractor *iren   = _imageviewer2D_1->GetWxVTKRenderWindowInteractor();
00110         wxVTKRenderWindowInteractor *iren_2 = _imageviewer2D_2->GetWxVTKRenderWindowInteractor();
00111         wxVTKRenderWindowInteractor *iren_3 = _imageviewer2D_3->GetWxVTKRenderWindowInteractor();
00112         sizer->Add(iren , 1, wxGROW, 0);
00113         sizer->Add(iren_2, 1, wxGROW, 0);
00114         sizer->Add(iren_3, 1, wxGROW, 0);
00115 
00116 
00117         panel->SetSizer(sizer);
00118         panel->SetAutoLayout(true);
00119 //      panel->SetSize(400,400);
00120         panel->Layout();
00121         return panel;
00122 }

Here is the call graph for this function:

wxProcessingCTWidget::DECLARE_EVENT_TABLE (  )  [private]
void wxProcessingCTWidget::GetThreshold ( int *  min,
int *  max 
)

Definition at line 589 of file wxProcessingCTWidget.cxx.

References _lowthreshold, and _midthreshold.

Referenced by wxMaracasProcessingCT::GetThreshold().

00590 {
00591         *min = _lowthreshold->GetValue();
00592         *max = _midthreshold->GetValue();
00593 }

Here is the caller graph for this function:

void wxProcessingCTWidget::LowThreshold (  ) 

Definition at line 424 of file wxProcessingCTWidget.cxx.

References _lowthreshold, _range, _thresh, and MidThreshold().

Referenced by OnLowThreshold(), and SetThreshold().

00425 {
00426 // MAZV 27 sep 2006
00427 //      _thresh->ThresholdBetween(_lowthreshold->GetValue(), _highthreshold->GetValue());
00428 //      _thresh->Update();
00429 
00430 // MAZV 3 oct 2006
00431         _thresh->ThresholdBetween(_lowthreshold->GetValue(), _range[1] );
00432         _thresh->Update();
00433         
00434         MidThreshold();
00435 
00436 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::MidThreshold (  ) 

Definition at line 416 of file wxProcessingCTWidget.cxx.

References _lowthreshold, _midthreshold, and _thresh2.

Referenced by LowThreshold(), and OnMidThreshold().

00417 {
00418         _thresh2->ThresholdBetween(_lowthreshold->GetValue(), _midthreshold->GetValue());
00419         _thresh2->Update();
00420 }

Here is the caller graph for this function:

void wxProcessingCTWidget::OnExtract ( wxCommandEvent &  event  ) 

Definition at line 465 of file wxProcessingCTWidget.cxx.

References _mar, _parent, _vtkbasedata_3, _x, _y, _z, marInterfaceCT::appendAxis(), marParameters::copyFrom(), marParameters::e_RescaleIntercept, marParameters::e_RescaleSlope, marExperiment::extractVascularTree(), marExperiment::getAxis(), vtkBaseData::GetImageData(), marInterfaceCT::getNumberOfSlices(), marInterfaceCT::getParameters(), marExperiment::initExperiment(), marInterfaceCT::prepareQuantification(), marInterfaceCT::setAxis(), marParameters::setDoubleParam(), marExperiment::setStartPoint(), and marExperiment::setVOI().

Referenced by CreateControlPanel().

00465                                                          {
00466         
00467     wxBusyCursor wait;
00468     int ext[6];
00469 
00470     vtkImageChangeInformation* change = vtkImageChangeInformation::New();
00471     change->SetInput( _vtkbasedata_3->GetImageData() );
00472     
00473         _vtkbasedata_3->GetImageData()->GetWholeExtent(ext);
00474     change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
00475     change->Update();
00476         
00477     vtkImageData *image = change->GetOutput();
00478 
00479     marParameters *marParam  = new marParameters();
00480     marParam->copyFrom ( *(_mar->getParameters()) );
00481     marParam->setDoubleParam( marParameters::e_RescaleIntercept , 0 );
00482     marParam->setDoubleParam( marParameters::e_RescaleSlope     , 1 );
00483 
00484     marExperiment *newExperiment = new marExperiment( marParam );
00485 
00486     kVolume *vol = new kVolume( image  );
00487     newExperiment->setVOI(ext);
00488     newExperiment->initExperiment(vol);
00489     newExperiment->setStartPoint( _x, _y, _z);
00490     newExperiment->extractVascularTree();
00491 
00492         //_mar->_experiment->initExperiment(new kVolume(data));
00493         _mar->appendAxis(newExperiment->getAxis(0));
00494         //_mar->_experiment->setVOI(ext);
00495         _mar->setAxis(0);
00496         _mar->prepareQuantification( );
00497 
00498         wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED,20005);
00499         _parent->ProcessEvent( ev );
00500 
00501         int size = _mar->getNumberOfSlices( );
00502 
00503         if (size != 0){
00504                 wxString msg;
00505                 msg.Printf(_T("Axis Extracted"));
00506                 wxMessageDialog(this, msg,_T("Information")).ShowModal();
00507         }
00508         
00509 
00510 /*
00511         FILE *ff;
00512     ff=fopen("c:/Temp/DATOS.txt","a+");
00513         fprintf(ff,"z:%d -  x:%d y:%d\n",size,ext[1]+1,ext[3]+1,ext[5]+1);
00514         fclose(ff);
00515 
00516         vtkImageWriter *w = vtkImageWriter::New();
00517 
00518         
00519         for (int i = 0; i < size; i++){
00520                 std::string path = "C:/TEMP/";
00521                 w->SetInput(_mar->_experiment->getSliceImage(i));
00522                 char *f = "";
00523                 f = itoa(i, f, 10);
00524                 std::string fil(f);
00525 
00526                 path.append(fil.c_str());
00527                 w->SetFileName(path.c_str());
00528                 w->Write();
00529         }
00530         w->Delete();
00531 */
00532 
00533 
00534 /*      vtkBMPWriter *w = vtkBMPWriter::New();
00535         vtkImageCast *c = vtkImageCast::New();
00536 
00537         for (int i = 0; i < size; i++){
00538                 std::string path = "C:/TEMP/";
00539                 
00540 
00541                 c->SetInput(_mar->_experiment->getSliceImage(i));
00542                 c->SetOutputScalarTypeToUnsignedChar();
00543                 c->Update();
00544 
00545                 w->SetInput(c->GetOutput());
00546                 char *f = "";
00547                 f = itoa(i, f, 10);
00548                 std::string fil(f);
00549 
00550                 path.append(fil.c_str());
00551                 path.append(".bmp");
00552                 w->SetFileName(path.c_str());
00553                 w->Write();
00554         }*/
00555 
00556         //Escritura a pcx con LibIDO
00557 /*
00558         for ( int i = 0; i < size; i++){
00559                 PPIMAGE_USHORT imalibido = (PPIMAGE_USHORT) IdImaAlloc(128,128, IMA_USHORT);
00560                 for (int j = 0; j < 128; j++){
00561                         for (int k = 0; k < 128; k++){
00562                                 imalibido[k][j] = (unsigned short)_mar->_experiment->getSliceImage(i)->GetScalarComponentAsDouble(j, k, 0, 0);
00563                         }
00564                 }
00565                 std::string path = "C:/TEMP/";
00566                 char *f = "";
00567                 f = itoa(i, f, 10);
00568                 std::string fil(f);
00569                 path.append(fil.c_str());
00570                 path.append(".pcx");
00571                 PPIMAGE_UCHAR imagennueva =  IdImaRecad16To8(imalibido, -1, -1);
00572                 IdImaWritePCXFile((char*)path.c_str(), imagennueva);
00573                 IdImaClear((PPIMAGE)imalibido);
00574         }
00575 
00576 */
00577 
00578 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::OnLowThreshold ( wxScrollEvent &  event  ) 

Definition at line 439 of file wxProcessingCTWidget.cxx.

References LowThreshold(), and Refresh().

Referenced by CreateControlPanel().

00440 {       
00441         LowThreshold();
00442         Refresh();
00443 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::OnMidThreshold ( wxScrollEvent &  event  ) 

Definition at line 445 of file wxProcessingCTWidget.cxx.

References MidThreshold(), and Refresh().

Referenced by CreateControlPanel().

00445                                                              {
00446         MidThreshold();
00447         Refresh();
00448 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::OnRefreshView ( wxCommandEvent &  event  ) 

Definition at line 269 of file wxProcessingCTWidget.cxx.

References Refresh().

00270 {
00271         Refresh();
00272 }

Here is the call graph for this function:

void wxProcessingCTWidget::OnSpinLowThresholdSpin1 ( wxScrollEvent &  event  ) 

Definition at line 238 of file wxProcessingCTWidget.cxx.

References _lowthreshold, _lowthresholdSpin1, and min.

Referenced by CreateControlPanel().

00239 {
00240         int value = _lowthreshold->GetValue();
00241         int delta = (int) (pow( 4 , _lowthresholdSpin1->GetValue() ));
00242         int min   = value - delta/2;
00243         int max   = value + delta/2;
00244         if (min<0)
00245         {
00246                 min=0;
00247                 max=delta;
00248         }
00249         _lowthreshold->SetRange(min,max);
00250 }

Here is the caller graph for this function:

void wxProcessingCTWidget::OnSpinLowThresholdSpin2 ( wxScrollEvent &  event  ) 

Definition at line 253 of file wxProcessingCTWidget.cxx.

References _lowthresholdSpin2, _midthreshold, and min.

Referenced by CreateControlPanel().

00254 {
00255         int value = _midthreshold->GetValue();
00256         int delta = (int)(pow( 4 , _lowthresholdSpin2->GetValue() ));
00257         int min=value - delta/2;
00258         int max=value + delta/2;
00259         if (min<0)
00260         {
00261                 min=0;
00262                 max=delta;
00263         }
00264         _midthreshold->SetRange(min,max);
00265 }

Here is the caller graph for this function:

void wxProcessingCTWidget::OnZSlice ( wxScrollEvent &  event  ) 

Definition at line 458 of file wxProcessingCTWidget.cxx.

References _vtkbasedata_1, _zslice, Refresh(), and vtkBaseData::SetZ().

Referenced by CreateControlPanel().

00458                                                        {
00459         _vtkbasedata_1->SetZ( _zslice->GetValue() );
00460 //      _vtkbasedata_2->SetZ( _zslice->GetValue() );
00461 //      _vtkbasedata_3->SetZ( _zslice->GetValue() );
00462         Refresh();
00463 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::Refresh (  ) 

Definition at line 218 of file wxProcessingCTWidget.cxx.

References _imageviewer2D_1, _imageviewer2D_2, _imageviewer2D_3, _vtkbasedata_1, _vtkbasedata_2, _vtkbasedata_3, vtkBaseData::GetZ(), wxVtk2DBaseView::Refresh(), wxVtkBaseView::RefreshView(), and vtkBaseData::SetZ().

Referenced by OnLowThreshold(), OnMidThreshold(), OnRefreshView(), OnZSlice(), and wxMaracasProcessingCT::Refresh().

00219 {
00220         int z = (int)(_vtkbasedata_1->GetZ( ));
00221 
00222         _vtkbasedata_1->SetZ( z );
00223         _vtkbasedata_2->SetZ( z );
00224         _vtkbasedata_3->SetZ( z );
00225 
00226         _imageviewer2D_3->Refresh();
00227         _imageviewer2D_1->Refresh();
00228         _imageviewer2D_2->Refresh();
00229 
00230         _imageviewer2D_3->RefreshView();
00231         _imageviewer2D_1->RefreshView();
00232         _imageviewer2D_2->RefreshView();
00233 
00234 
00235 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxProcessingCTWidget::SetThreshold ( int  min,
int  max 
)

Definition at line 582 of file wxProcessingCTWidget.cxx.

References _lowthreshold, _midthreshold, and LowThreshold().

Referenced by wxMaracasProcessingCT::SetThreshold().

00583 {
00584         _lowthreshold->SetValue(min);
00585         _midthreshold->SetValue(max);
00586         LowThreshold();
00587 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

vtkImageSeedConnectivity* wxProcessingCTWidget::_connect [private]

Definition at line 74 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK().

vtkImageSeedConnectivity* wxProcessingCTWidget::_connect2 [private]

Definition at line 75 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and ~wxProcessingCTWidget().

wxButton* wxProcessingCTWidget::_extract [private]

Definition at line 95 of file wxProcessingCTWidget.h.

Referenced by CreateControlPanel().

Definition at line 84 of file wxProcessingCTWidget.h.

Referenced by CreateControlPanel(), and OnSpinLowThresholdSpin1().

Definition at line 85 of file wxProcessingCTWidget.h.

Referenced by CreateControlPanel(), and OnSpinLowThresholdSpin2().

Definition at line 66 of file wxProcessingCTWidget.h.

Referenced by OnExtract().

vtkMarchingCubes* wxProcessingCTWidget::_mCubes [private]

Definition at line 62 of file wxProcessingCTWidget.h.

wxWindow* wxProcessingCTWidget::_parent [private]

Definition at line 59 of file wxProcessingCTWidget.h.

Referenced by CreateControlPanel(), and OnExtract().

double wxProcessingCTWidget::_range[2] [private]

Definition at line 105 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and LowThreshold().

vtkActor* wxProcessingCTWidget::_surfActor [private]

Definition at line 64 of file wxProcessingCTWidget.h.

vtkPolyDataMapper* wxProcessingCTWidget::_surfMapper [private]

Definition at line 63 of file wxProcessingCTWidget.h.

vtkImageThreshold* wxProcessingCTWidget::_thresh [private]

Definition at line 70 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and LowThreshold().

vtkImageThreshold* wxProcessingCTWidget::_thresh2 [private]

Definition at line 71 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), MidThreshold(), and ~wxProcessingCTWidget().

Definition at line 97 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), OnZSlice(), and Refresh().

Definition at line 98 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and Refresh().

Definition at line 99 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), OnExtract(), and Refresh().

int wxProcessingCTWidget::_x [private]

Definition at line 104 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and OnExtract().

int wxProcessingCTWidget::_y [private]

Definition at line 104 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and OnExtract().

int wxProcessingCTWidget::_z [private]

Definition at line 104 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), and OnExtract().

wxSlider* wxProcessingCTWidget::_zslice [private]

Definition at line 90 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK(), CreateControlPanel(), and OnZSlice().

vtkImageCast* wxProcessingCTWidget::cast3 [private]

Definition at line 76 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK().

vtkImageCast* wxProcessingCTWidget::cast4 [private]

Definition at line 77 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK().

vtkImageData* wxProcessingCTWidget::data [private]

Definition at line 78 of file wxProcessingCTWidget.h.

Referenced by ConfigureVTK().


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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1