wxSphereView Class Reference

#include <wxSphereView.h>

Inheritance diagram for wxSphereView:
Inheritance graph
[legend]
Collaboration diagram for wxSphereView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxSphereView (wxWindow *parent, vtkMPRBaseData *vtkmprbasedata, vtkImageData *imageData)
 ~wxSphereView ()
virtual void Configure ()
void RotationEnd ()
void RotationStart (double vx, double vy, bool ok_v, bool ok_ang)
virtual void RefreshView ()
virtual void SetVoxel (double i, double j, int delta, double id, unsigned short gris)
void SetDeltaVoxel (int delta)
double GetRadio ()
void SetRadio (double radio)
int GetIdOfImage (double radio)
void SetXYZtoParent (double i, double j)
void RefreshPoint ()
virtual void Configure (bool okimage=true)
vtkBaseDataGetVtkBaseData ()
void SetVtkBaseData (vtkBaseData *vtkbasedata)
virtual void Refresh ()
virtual void ResetView ()
virtual int GetActualSlice ()
virtual void SetActualSlice (int slice)
void SetInteractorStyleImage (vtkInteractorStyleBaseView *interactorstylebaseview)
virtual vtkRenderer * GetRenderer ()
virtual vtkRenderWindow * GetRenWin ()
virtual void TransformCoordinate_spacing_ViewToModel (double &X, double &Y, double &Z)
virtual void TransformCoordinate_spacing_ModelToView (double &X, double &Y, double &Z)
virtual void GetSpacing (double spc[3])
void setColorTransferFunction (vtkColorTransferFunction *colortable)
void setWindowLevel (double level)
void setColorLevel (double level)
wxVTKRenderWindowInteractorGetWxVTKRenderWindowInteractor () throw (char*)
virtual void TransFromCoordScreenToWorld (double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2)
void TransCoordScreenToWorld (double &X, double &Y, double &Z, int type=2)
void SetInteractorStyleBaseView (vtkInteractorStyleImage *interactorStyle)
vtkInteractorStyleImage * GetInteractorStyleBaseView ()

Public Attributes

vtkImageViewer2_XYZ_imageViewer2XYZ

Private Member Functions

void FiltreImage (int id, double radio)
void FiltreImageB (int id, double radio, bool ok, int deltaTMP)
void DefineImageSphere ()
void ResetlstId ()
void InitSphere (double points[4][3])
double SphereFindCenter (double P[4][3], double cc[3])
double determinant (double a[4][4], int n)
void GetPointSphere (double p[3], double r1, double angA, double angB)
void RotatePointOverTheSphere (double pp[3], double p[3], double cc[3])
void TransferePoints (double pp1[3], double pp2[3], double AngX, double AngY, vtkImageData *image)

Private Attributes

std::vector< idAlBeRa * > _lstId
int _centerX
int _centerY
int _centerZ
double _radio
double _ang
double _vxb
double _vyb
int _delta
vtkImageData * _imageDataOriginal
vtkImageData * _imageSphere
vtkMPRBaseData_vtkmprbasedata
vtkInteractorStyleSphere_vtkinteractorstylesphere
vtkTransform * _transform
vtkTransform * _transform1
vtkTransform * _transform2

Detailed Description

Definition at line 11 of file wxSphereView.h.


Constructor & Destructor Documentation

wxSphereView::wxSphereView ( wxWindow *  parent,
vtkMPRBaseData vtkmprbasedata,
vtkImageData *  imageData 
)

Definition at line 4 of file wxSphereView.cxx.

References _delta, _imageDataOriginal, _imageSphere, _radio, _transform, _transform1, _transform2, _vtkmprbasedata, vtkBaseData::SetMarImageData(), and wxVtk2DBaseView::SetVtkBaseData().

00005 : wxVtk2DBaseView(parent)
00006 {
00007         _delta                          =       1;
00008         _vtkmprbasedata         =       vtkmprbasedata;
00009         _imageDataOriginal      =       imageData;
00010 
00011         _imageSphere            =       vtkImageData::New();
00012         _imageSphere->SetDimensions (150,150,500);
00013         _imageSphere->SetScalarTypeToUnsignedShort();
00014         _imageSphere->AllocateScalars();   
00015         _imageSphere->Update();   
00016 
00017 
00018         vtkBaseData *vtkbasedata = new vtkBaseData();
00019         vtkbasedata->SetMarImageData( new marImageData(_imageSphere) );
00020         this->SetVtkBaseData(vtkbasedata);
00021 
00022     _transform                  =       vtkTransform::New();
00023     _transform1                 =       vtkTransform::New();
00024     _transform2                 =       vtkTransform::New();
00025         _transform ->Identity();
00026         _transform1->Identity();
00027         _transform2->Identity();
00028 
00029         _radio=25;
00030 }

Here is the call graph for this function:

wxSphereView::~wxSphereView (  ) 

Definition at line 34 of file wxSphereView.cxx.

References _transform, _transform1, _transform2, and ResetlstId().

00035 {
00036         _transform  -> Delete();
00037         _transform1 -> Delete();
00038         _transform2 -> Delete();
00039         ResetlstId();
00040 }

Here is the call graph for this function:


Member Function Documentation

void wxVtk2DBaseView::Configure ( bool  okimage = true  )  [virtual, inherited]

Definition at line 123 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, wxVtk2DBaseView::_vtkIinfoTextImage, wxVtk2DBaseView::_vtkIinfoTextImageInteractor, vtkInfoTextImage::Configure(), wxVtkBaseView::Configure(), marImageData::GetImageData(), wxVtkBaseView::GetInteractorStyleBaseView(), vtkBaseData::GetMarImageData(), wxVtk2DBaseView::GetVtkBaseData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView2D::New(), vtkImageViewer2_XYZ::SetExtentDimension(), vtkInteractorStyleBaseView2D::SetInteractorScrollZ(), wxVtk2DBaseView::SetInteractorStyleImage(), vtkInteractorStyleBaseView2D::SetInteractorWindowLevel(), vtkInfoTextImage::SetMarImageData(), vtkInfoTextImageInteractor::SetModelVtkInfoTextImage(), and vtkInfoTextImage::SetWxVtk2DBaseView().

Referenced by wxMaracas_ViewerWidget::ConfigureVTK(), wxQuantificationWidgetCT::ConfigureVTK(), wxProcessingCTWidget::ConfigureVTK(), wxEmptyPanel_3_Widget::ConfigureVTK(), and wxMaracasImageBrowser02::LoadData().

00124 {
00125         double spx,spy,spz;
00126         int x1,x2,y1,y2,z1,z2;
00127         wxVtkBaseView::Configure();
00128 
00129 // EED 17 Oct 2007
00130         if (_imageViewer2XYZ==NULL)
00131         {
00132                 _imageViewer2XYZ = new vtkImageViewer2_XYZ();
00133                 wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00134                 _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
00135 
00137                 //RaC 04-2010 Look for the description of new changes in vtkInteractorStyleBaseView2D constructor.
00138                 //
00139                 // Previous version
00140                 // SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00141                 //
00142                 // Actual version
00143                 vtkInteractorStyleBaseView2D *style2D = vtkInteractorStyleBaseView2D::New();
00144 
00145                 manualInteractorWindowLevel *_manualinteractorwindowlevel= new manualInteractorWindowLevel();
00146                 style2D->SetInteractorWindowLevel( _manualinteractorwindowlevel );
00147 
00148                 vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
00149                 style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
00150 
00151                 SetInteractorStyleImage( style2D );
00152 
00153                 // RaC
00155         }
00156 
00157 
00158         vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
00159         if (imageData!=NULL){
00160                 
00161                 imageData->UpdateInformation();
00162                 imageData->SetUpdateExtent( imageData->GetWholeExtent());
00163                 imageData->Update();
00164                 if (okimage==true){
00165                         imageData->GetSpacing (spx,spy,spz);
00166                         imageData->GetExtent (x1,x2,y1,y2,z1,z2);
00167                         _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
00168                         _imageViewer2XYZ->SetExtentDimension(x1,x2,y1,y2,z1,z2);
00169                         double range[2];
00170                         imageData->GetScalarRange(range);
00171                         if (range[1]<20000){
00172                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow( (range[1]-range[0])/2 );
00173                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( (range[1]+range[0])/4 );
00174                         } else {
00175                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow( 1000 );
00176                                  _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( 500 );
00177                         }
00178 // EED 31 Janvier 2007
00179 //vtkImageActor *vtkimageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor ();
00180 //vtkimageactor->InterpolateOff ();
00181 //vtkLookupTable * _collookup = vtkLookupTable::New( );
00182 //_collookup->SetNumberOfColors( 256 );
00183 //_collookup->SetTableRange( 0 , 255 );
00184 //_collookup->Build( );
00185 //_collookup->SetTableValue( 0  , 1 , 0 , 0 , 1 );
00186 //_collookup->SetTableValue(128 , 0 , 0 , 1 , 1 );
00187 //_collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
00188 //_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel ()->SetLookupTable(_collookup );
00189 
00190 
00191 // EED 17 Oct 2007
00192 //                      SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00193 
00194 
00195                         vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2();
00196                         vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
00197 
00198 //EED 17Avril2009       
00199 /*                      
00200                         camera->SetViewUp               ( spx*0                 , -spy*1                        , spz*0         );
00201                         camera->SetPosition             ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000    ); 
00202                         camera->SetFocalPoint   ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0         ); 
00203 */ 
00204                         camera->SetViewUp               ( spx*0                 , spy*1                 , spz*0         );
00205                         camera->SetPosition             ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000     ); 
00206                         camera->SetFocalPoint   ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0         ); 
00207                         
00208                         
00209                         camera->SetClippingRange( 0.01                  , 1000000 );
00210                         camera->ComputeViewPlaneNormal();
00211                         camera->SetParallelScale( spx*(x2-x1)/3.0 );
00212                         
00213                         // text information over the graphic window
00214                         if(_vtkIinfoTextImage == NULL){
00215                                 _vtkIinfoTextImage              = new vtkInfoTextImage();
00216                                 _vtkIinfoTextImageInteractor    = new vtkInfoTextImageInteractor();                             
00217                                 ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor);
00218                         }
00219                         _vtkIinfoTextImage->SetWxVtk2DBaseView(this);
00220                         _vtkIinfoTextImage->SetMarImageData( GetVtkBaseData()->GetMarImageData() );
00221                         _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage);                             
00222                         _vtkIinfoTextImage->Configure();
00223                         
00224                 } // okimage
00225         } // imageData
00226 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::Configure (  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 62 of file wxSphereView.cxx.

References _vtkinteractorstylesphere, DefineImageSphere(), wxVtkBaseView::GetInteractorStyleBaseView(), and InitSphere().

Referenced by wxMaracas_ViewerWidget::ConfigureVTK().

00063 {
00064         wxVtk2DBaseView::Configure();
00065 
00066         _vtkinteractorstylesphere = new vtkInteractorStyleSphere();
00067         ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _vtkinteractorstylesphere );
00068         double points[4][3];
00069 
00070 // EED purify 12/sep/2006
00071         int i,j;
00072         for (i=0;i<4;i++)
00073         {
00074                 for (j=0;j<3;j++)
00075                 {
00076                         points[i][j]=0;
00077                 }
00078         }
00079 
00080         InitSphere(points);
00081         DefineImageSphere();
00082 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::DefineImageSphere (  )  [private]

Definition at line 267 of file wxSphereView.cxx.

References _radio, GetIdOfImage(), wxVtk2DBaseView::GetVtkBaseData(), and vtkBaseData::SetZ().

Referenced by Configure(), and RefreshView().

00268 {
00269         int id;
00270         id=GetIdOfImage( _radio );
00271         GetVtkBaseData()->SetZ( id );
00272 }

Here is the call graph for this function:

Here is the caller graph for this function:

double wxSphereView::determinant ( double  a[4][4],
int  n 
) [private]

Definition at line 677 of file wxSphereView.cxx.

Referenced by SphereFindCenter().

00678 {
00679     int i, j, j1, j2;
00680     double d;
00681         double m[4][4];
00682 
00683         for (i=0;i<4;i++)
00684         {
00685                 for (j=0;j<4;j++)
00686                 {
00687                         m[i][j]=0;
00688                 }
00689         }
00690 
00691     if (n == 2)                                // terminate recursion
00692     {
00693         d = a[0][0]*a[1][1] - a[1][0]*a[0][1];
00694     }
00695     else 
00696     {
00697         d = 0;
00698         for (j1 = 0; j1 < n; j1++ )            // do each column
00699         {
00700             for (i = 1; i < n; i++)            // create minor
00701             {
00702                 j2 = 0;
00703                 for (j = 0; j < n; j++)
00704                 {
00705                     if (j == j1) continue;
00706                     m[i-1][j2] = a[i][j];
00707                     j2++;
00708                 }
00709             }
00710             
00711             // sum (+/-)cofactor * minor  
00712             d = d + pow(-1.0, j1)*a[0][j1]*determinant( m, n-1 );
00713         }
00714     }
00715 
00716     return d;
00717 }

Here is the caller graph for this function:

void wxSphereView::FiltreImage ( int  id,
double  radio 
) [private]

Definition at line 430 of file wxSphereView.cxx.

References _delta, _transform, _transform1, _transform2, and FiltreImageB().

Referenced by GetIdOfImage().

00431 {
00432 
00433         _transform -> Identity();
00434         _transform -> Concatenate(_transform1);
00435         _transform -> Concatenate(_transform2);
00436 
00437         FiltreImageB(id,radio,false, _delta);
00438         FiltreImageB(id,radio,true, 1);
00439 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::FiltreImageB ( int  id,
double  radio,
bool  ok,
int  deltaTMP 
) [private]

Definition at line 349 of file wxSphereView.cxx.

References _centerX, _centerY, _centerZ, _imageDataOriginal, _imageSphere, RotatePointOverTheSphere(), and SetVoxel().

Referenced by FiltreImage().

00350 {       
00351         double factor = 0.75;
00352         double radioB   = radio/3;
00353         double radio2   = radio*radio;
00354         double pxx,pyy,d2x,d2y;
00355         double cc[3],p[3],pp[3];
00356         cc[0]=_centerX;
00357         cc[1]=_centerY;
00358         cc[2]=_centerZ;
00359         double aa;
00360         unsigned short *pOrig;
00361         int dimRes[3],dimOrig[3];
00362         double i,j;
00363         int ext[6];
00364         _imageSphere->GetExtent(ext);
00365         _imageSphere->GetDimensions(dimRes);
00366         //JCP 24 - 04 -09
00367         //_imageSphere->SetExtent(0,dimRes[0]-1,0,dimRes[1]-1,0,dimRes[2]-1);
00368         _imageSphere->SetExtent(ext);
00369         //JCP 24 - 04 -09
00370         d2x=dimRes[0]/2;
00371         d2y=dimRes[1]/2;
00372 //      double deltaTMP=_delta;
00373         _imageDataOriginal->GetDimensions(dimOrig);
00374 
00375         int start,end;
00376         int limitA,limitB;
00377         limitA  = (int) ( (-radioB/factor)+d2x );
00378         limitB  = (int) ( (radioB/factor)+d2x );
00379         if (ok==true){
00380                 start   = limitA;
00381                 end             = limitB;
00382         } else {
00383                 start=0;
00384                 end=dimRes[0];
00385         }
00386 
00387         for ( i=start ; i<end ; i=i+deltaTMP )
00388         {
00389                 p[0]  = (i - d2x)*factor;
00390                 pxx=p[0]*p[0];
00391                 for (j=start;j<end;j=j+deltaTMP)
00392                 {
00393                         p[1]  = (j - d2y)*factor;
00394                         pyy=p[1]*p[1];
00395                         aa = pxx + pyy;
00396 
00397                         if  (( ((ok==false) && (!((i>limitA) && (i<limitB) && (j>limitA) && (j<limitB)))) )
00398                                     ||
00399                                         (ok==true))
00400                         {
00401                                 if (radio2>aa){
00402                                         aa=radio2-aa;
00403                                         p[2]  = sqrt(aa);
00404                                         RotatePointOverTheSphere( pp, p,cc);
00405                                         if ( (pp[0]>=0) && (pp[0]<dimOrig[0]) && 
00406                                                  (pp[1]>=0) && (pp[1]<dimOrig[1]) && 
00407                                                  (pp[2]>=0) && (pp[2]<dimOrig[2]) )
00408                                         {
00409                                                 pOrig=(unsigned short*)_imageDataOriginal->GetScalarPointer( (int)(pp[0]) , (int)(pp[1]) , (int)(pp[2]) ); 
00410                                                 SetVoxel(i,j,deltaTMP,id,*pOrig);
00411                                         } else {
00412                                                 SetVoxel(i,j,deltaTMP,id,2000);
00413                                         }
00414                                 } else {
00415                                         SetVoxel(i,j,deltaTMP,id,0);
00416                                 }
00417                         }
00418                 }
00419         }
00420 
00421         _imageSphere->Modified();  
00422         _imageSphere->Update();
00423 }

Here is the call graph for this function:

Here is the caller graph for this function:

int wxVtk2DBaseView::GetActualSlice (  )  [virtual, inherited]

Reimplemented in vtkPlane2DView, and wxVtkMPR2DView.

Definition at line 230 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_vtkbasedata, and vtkBaseData::GetZ().

Referenced by vtkInteractorManualPaint::OnMouseMove().

00231 {
00232    return (int)(_vtkbasedata->GetZ());
00233 }

Here is the call graph for this function:

Here is the caller graph for this function:

int wxSphereView::GetIdOfImage ( double  radio  ) 

Definition at line 231 of file wxSphereView.cxx.

References _delta, _imageSphere, _lstId, _radio, and FiltreImage().

Referenced by DefineImageSphere(), and vtkInteractorStyleSphere::OnRightButtonUp().

00232 {
00233         int id=0;
00234         int dim[3];     
00235         _imageSphere->GetDimensions(dim);       
00236         int sizeMaxList = dim[2];
00237         // Search in list >> alpha beta radio
00238         int i,size=_lstId.size();
00239         for (i=0; i<size;i++)
00240         {
00241                 //idAlBeRa *tmp=_lstId[i]; // JPRx
00242                 if ((_lstId[i]->_radio==radio) && (_lstId[i]->_deltavoxel==_delta)) 
00243                 {
00244                         return _lstId[i]->_id;
00245                 }
00246         }
00247         if (size>sizeMaxList)
00248         {
00249                 delete _lstId[size-1];
00250                 _lstId.pop_back(); 
00251         }
00252         if (size!=0){
00253                 id=_lstId[0]->_id+1;
00254                 id = id % sizeMaxList;
00255         } else {
00256                 id = 0;
00257         }
00258 
00259         FiltreImage(id,radio);
00260         _lstId.insert(_lstId.begin(),1,new idAlBeRa(id,radio,_delta) ); 
00261 
00262         return id;
00263 }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView (  )  [inherited]

Definition at line 166 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_interactorStyle.

Referenced by wxWidgetMesure2D::ActiveMessureTool(), wxQuantificationWidgetCT::addManualContours(), wxMaracasRenderTabbedPanel::addMPROptions(), ManualPaintControler::Config(), wxVtkMPR2DView::Configure(), wxVtk2DBaseView::Configure(), Configure(), vtkPlane2DView::Configure(), wxWidgetMesure2D::ConfigureA(), wxManualTree_MPRWidget::ConfigureContour(), wxMPRWidget::ConfigureVTK(), wxManualTree_MPRWidget::ConfigureVTK(), wxSegmentationFM3DWidget::ConfigureVTK(), wxManualSegmentation_MPRWidget::ConfigureVTK(), wxManualRegistration3D::ConfigureVTK(), wxEmptyPanel_3_Widget::ConfigureVTK(), ContourVOIWidget::ConfigureVTK(), wxMaracasCoutourTool::ConfigureVTK(), wxManualRegistration3D::ConfigureVTK_B(), wxImageViewerWidget::ConstructVTK(), vtkmyPWCallback_3DPointWidget::Execute(), wxMaracasImageBrowser02::LoadData(), wxQuantificationWidgetCT::OnContourLumen(), wxQuantificationWidgetCT::OnContourWall(), wxVTKRenderWindowInteractorPlus::OnLeftDClick(), wxVTKRenderWindowInteractorPlus::OnMiddleDClick(), wxVTKRenderWindowInteractorPlus::OnMouseWheel(), wxVTKRenderWindowInteractorPlus::OnRightDClick(), manualContourContainer::refreshCalc(), manualContourContainer::refreshHypo(), manualContourContainer::refreshLumen(), manualContourContainer::refreshWall(), and wxVtkBaseView::TransFromCoordScreenToWorld().

00167 {
00168         return _interactorStyle;
00169 }

Here is the caller graph for this function:

void wxSphereView::GetPointSphere ( double  p[3],
double  r1,
double  angA,
double  angB 
) [private]

Definition at line 146 of file wxSphereView.cxx.

00147 {
00148         double in[3],out[3];
00149         in[0]=0;   
00150         in[1]=r1;   
00151         in[2]=0;
00152         vtkTransform *transform = vtkTransform::New();
00153         transform->Identity();
00154         transform->RotateX(angB);
00155         transform->RotateZ(angA);
00156         transform->TransformPoint(in,out);
00157         p[0]=out[0];
00158         p[1]=out[1];
00159         p[2]=out[2];
00160         transform->Delete(); 
00161 }

double wxSphereView::GetRadio (  ) 

Definition at line 44 of file wxSphereView.cxx.

References _radio.

Referenced by vtkInteractorStyleSphere::OnRightButtonDown(), and vtkInteractorStyleSphere::OnRightButtonUp().

00045 {
00046         return _radio;
00047 }

Here is the caller graph for this function:

vtkRenderer * wxVtk2DBaseView::GetRenderer (  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 285 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by vtkInfoTextImage::Create_Text_Label().

00286 {
00287    return _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer();
00288 }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkRenderWindow * wxVtk2DBaseView::GetRenWin (  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 290 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxMaracasSuperpositionPanel::Refresh().

00291 {
00292    return _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderWindow();
00293 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::GetSpacing ( double  spc[3]  )  [virtual, inherited]

Reimplemented from wxVtkBaseView.

Definition at line 297 of file wxVtk2DBaseView.cxx.

References vtkBaseData::GetImageData(), and wxVtk2DBaseView::GetVtkBaseData().

00298 {
00299    vtkImageData *imageData      = GetVtkBaseData()->GetImageData();
00300    if(imageData){
00301         imageData->GetSpacing(spc);
00302    }else{
00303          spc[0] = 0; 
00304          spc[1] = 0;
00305          spc[2] = 0;
00306    }
00307 }

Here is the call graph for this function:

vtkBaseData * wxVtk2DBaseView::GetVtkBaseData (  )  [inherited]
wxVTKRenderWindowInteractor * wxVtkBaseView::GetWxVTKRenderWindowInteractor (  )  throw (char*) [inherited]

Reimplemented in wxVtk2DView_TMP.

Definition at line 36 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_iren.

Referenced by wxMaracasRenderTabbedPanel::addRemoveActorMPR(), wxVtkClipping3DView::Configure(), wxVtk3DBaseView::Configure(), wxVtk2DBaseView::Configure(), vtkPlane2DView::Configure(), wxWidgetMesure2D::ConfigureA(), wxManualRegistration3D::Create3DView(), wxManualTree_MPRWidget::Create3DViewContour(), wxSegmentationFM3DWidget::Create3DViewContour(), wxManualSegmentation_MPRWidget::Create3DViewContour(), wxMPRWidget::CreateMPRPanel4View(), wxPanelCuttingImageData::CreatePlotHistogrammeInterface(), wxMaracas_ManualContour_Panel::CreateSplitePanel(), wxMPRWidget::CreateView(), wxQuantificationWidgetCT::CreateView2DPanel(), wxProcessingCTWidget::CreateViewPanel(), wxEmptyPanelWidget::CreateViewPanel(), wxEmptyPanel_3_Widget::CreateViewPanel(), vtkInteractorStyleBaseView::EvaluateToRefresh(), wxMaracasImageBrowser02::LoadData(), wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(), wxVtkClipping3DViewVolCntrlPanel::OnBtnVolumeFunctions(), wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(), manualContourBaseControler::OnChar(), wxVtkClipping3DViewCntrlPanel::OnColor(), wxPanelCuttingImageData::OnExtract(), wxVtkClipping3DViewCntrlPanel::OnIsoValue(), manualContourBaseControler::OnLeftButtonDown(), manualContour3DControler::OnLeftButtonDown(), vtkInteractorStyleSphere::OnLeftButtonUp(), manualContourBaseControler::OnLeftButtonUp(), vtkInteractorStyleMPRView::OnLeftDClick(), manualContourBaseControler::OnLeftDClick(), manualInteractorWindowLevel::OnMiddleButtonDown(), manualContourBaseControler::OnMiddleButtonDown(), vtkInfoTextImageInteractorPlane2D::OnMouseMove(), vtkInfoTextImageInteractor::OnMouseMove(), vtkInteractorManualPaint::OnMouseMove(), manualInteractorWindowLevel::OnMouseMove(), manualContourBaseControler::OnMouseMove(), wxVtkClipping3DViewCntrlPanel::OnOpacity(), wxVtkMPR3DViewCntrlPanel::OnPositionX(), wxVtkMPR3DViewCntrlPanel::OnPositionY(), wxVtkMPR3DViewCntrlPanel::OnPositionZ(), wxMaracasRenderTabbedPanel::OnRefreshView(), wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(), manualContourBaseControler::OnRightButtonDown(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY(), wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ(), wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(), wxVtkClipping3DViewVolCntrlPanel::OnVisibleVolume(), wxVtkClipping3DViewCntrlPanel::OnVisibleVolume(), wxVtkBaseView::Refresh(), wxVtk3DBaseView::Refresh(), manualViewBaseContour::Refresh(), wxVtk2DBaseView::ResetView(), vtkInteractorStyle3DView::SelectMarchibCubePoint(), wxVtk2DBaseView::SetInteractorStyleImage(), wxVtkMPR3DViewCntrlPanel::SetVisibleX(), wxVtkMPR3DViewCntrlPanel::SetVisibleY(), wxVtkMPR3DViewCntrlPanel::SetVisibleZ(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().

00037 {
00038 
00039         if(_iren==NULL){
00040                 throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren wxVTKRenderWindowInteractorPlus =NULL";
00041         }
00042    return _iren;
00043 }

void wxSphereView::InitSphere ( double  points[4][3]  )  [private]

Definition at line 583 of file wxSphereView.cxx.

References _centerX, _centerY, _centerZ, _imageDataOriginal, and SphereFindCenter().

Referenced by Configure().

00584 {
00585         double cc[3];
00586     double r = SphereFindCenter(points,cc); // 4-points , center
00587     if (r > 0)
00588     {
00589         _centerX        = (int)(cc[0]);
00590         _centerY        = (int)(cc[1]);
00591         _centerZ        = (int)(cc[2]);
00592     } else {
00593                 int dim[3];
00594                 _imageDataOriginal->GetDimensions(dim);
00595         _centerX        = (int)(dim[0]/2);
00596         _centerY        = (int)(dim[1]/2);
00597         _centerZ        = (int)(dim[2]/2);
00598         }
00599 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::Refresh (  )  [virtual, inherited]
void wxSphereView::RefreshPoint (  ) 

Definition at line 86 of file wxSphereView.cxx.

References _centerX, _centerY, _centerZ, _radio, _transform1, _vtkmprbasedata, vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), vtkBaseData::GetZ(), and RefreshView().

00087 {
00088         double x        = _vtkmprbasedata->GetX() - _centerX;
00089         double y        = _vtkmprbasedata->GetY() - _centerY;
00090         double z        = _vtkmprbasedata->GetZ() - _centerZ;
00091         double alpha= atan2(x,z);
00092         double beta = atan2( y , sqrt(z*z+x*x) );
00093 
00094         alpha           = alpha*180/3.1416;
00095         beta            = beta*180/3.1416;
00096 
00097         _transform1->Identity();
00098         _transform1->RotateY(alpha);
00099         _transform1->RotateX(-beta);
00100 
00101         _radio= sqrt(x*x + y*y +z*z);
00102 
00103         RefreshView();
00104 }

Here is the call graph for this function:

void wxSphereView::RefreshView (  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 108 of file wxSphereView.cxx.

References DefineImageSphere(), and wxVtk2DBaseView::Refresh().

Referenced by vtkInteractorStyleSphere::OnLeftButtonUp(), vtkInteractorStyleSphere::OnMouseMove(), vtkInteractorStyleSphere::OnRightButtonUp(), and RefreshPoint().

00109 {
00110         DefineImageSphere();
00111         wxVtk2DBaseView::Refresh();
00112 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::ResetlstId (  )  [private]

Definition at line 219 of file wxSphereView.cxx.

References _lstId.

Referenced by RotationEnd(), RotationStart(), and ~wxSphereView().

00220 {
00221         int i,size=_lstId.size();
00222         for (i=size-1;i>=0;i--)
00223         {
00224                 delete _lstId[i];
00225         }
00226         _lstId.clear();
00227 }

Here is the caller graph for this function:

void wxVtk2DBaseView::ResetView (  )  [virtual, inherited]

Definition at line 76 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, wxVtkBaseView::Configure(), vtkBaseData::GetImageData(), wxVtk2DBaseView::GetVtkBaseData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkInteractorStyleBaseView2D::New(), vtkInteractorStyleBaseView2D::SetInteractorScrollZ(), wxVtk2DBaseView::SetInteractorStyleImage(), and vtkInteractorStyleBaseView2D::SetInteractorWindowLevel().

Referenced by wxQuantificationWidgetCT::RefreshView().

00077 {
00078         double spx = 0,spy = 0,spz = 0;
00079         int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1;
00080         wxVtkBaseView::Configure();
00081         
00082         wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00083         vtkImageData *imageData = GetVtkBaseData()->GetImageData();
00084         if(imageData){
00085                 imageData->UpdateInformation();
00086                 imageData->SetUpdateExtent( imageData->GetWholeExtent());
00087                 imageData->Update();
00088                 _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
00089                 imageData->GetSpacing (spx,spy,spz);
00090                 imageData->GetExtent (x1,x2,y1,y2,z1,z2);
00091         }
00092 
00093         
00094         _imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2);
00095         _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
00096 
00097         _imageViewer2XYZ->GetVtkImageViewer2()->Render();
00098 
00100         //RaC 04-2010 Look for the description of new changes in vtkInteractorStyleBaseView2D constructor.
00101         //
00102         // Previous version
00103         // SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00104         //
00105         // Actual version
00106         vtkInteractorStyleBaseView2D *style2D = vtkInteractorStyleBaseView2D::New();
00107 
00108         manualInteractorWindowLevel *_manualinteractorwindowlevel= new manualInteractorWindowLevel();
00109         style2D->SetInteractorWindowLevel( _manualinteractorwindowlevel );
00110 
00111         vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
00112         style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
00113 
00114         SetInteractorStyleImage( style2D );
00115 
00116         // RaC
00118         
00119 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::RotatePointOverTheSphere ( double  pp[3],
double  p[3],
double  cc[3] 
) [private]

Definition at line 165 of file wxSphereView.cxx.

References _transform.

Referenced by FiltreImageB(), and SetXYZtoParent().

00166 {
00167 
00168         double out[3];
00169         _transform->TransformPoint(p,out);
00170         pp[0] = out[0] + cc[0];
00171         pp[1] = out[1] + cc[1];
00172         pp[2] = out[2] + cc[2];
00173 
00174 }

Here is the caller graph for this function:

void wxSphereView::RotationEnd (  ) 

Definition at line 116 of file wxSphereView.cxx.

References _ang, _transform1, _transform2, _vxb, _vyb, ResetlstId(), and SetDeltaVoxel().

Referenced by vtkInteractorStyleSphere::OnLeftButtonUp().

00117 {
00118         _transform1->RotateWXYZ(_ang,_vxb,_vyb,0);
00119         _transform2->Identity();
00120         SetDeltaVoxel(1);
00121         ResetlstId();
00122 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::RotationStart ( double  vx,
double  vy,
bool  ok_v,
bool  ok_ang 
)

Definition at line 126 of file wxSphereView.cxx.

References _ang, _transform2, _vxb, _vyb, ResetlstId(), and SetDeltaVoxel().

Referenced by vtkInteractorStyleSphere::OnMouseMove().

00127 {
00128         if (ok_ang==false)
00129         {
00130                 _ang = -sqrt( vx*vx + vy*vy ) / 1.0;
00131         }
00132 
00133         if (ok_v==false){
00134                 _vxb=-vy;
00135                 _vyb=vx;
00136         }
00137 
00138         _transform2->Identity();
00139         _transform2->RotateWXYZ(_ang,_vxb,_vyb,0);
00140         SetDeltaVoxel(3);
00141         ResetlstId();
00142 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::SetActualSlice ( int  slice  )  [virtual, inherited]

Reimplemented in vtkPlane2DView, and wxVtkMPR2DView.

Definition at line 236 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_vtkbasedata, and vtkBaseData::SetZ().

Referenced by wxQuantificationWidgetCT::RefreshView().

00237 {
00238    _vtkbasedata->SetZ(slice);
00239 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::setColorLevel ( double  level  )  [inherited]

Definition at line 324 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, vtkImageViewer2_XYZ::GetVtkImageViewer2(), and wxVtk2DBaseView::Refresh().

Referenced by wxMaracas_ViewerWidget::setColorLevel().

00324                                                {
00325 //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level);
00326         vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
00327         imagemaptowindowlevel->SetLevel(level);
00328         this->Refresh();
00329 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtk2DBaseView::setColorTransferFunction ( vtkColorTransferFunction *  colortable  )  [inherited]

Definition at line 309 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, wxVtk2DBaseView::Refresh(), and vtkImageViewer2_XYZ::setColorTransferFunction().

Referenced by wxMaracas_ViewerWidget::setColorTransferFunction().

00309                                                                                   {
00310         if(_imageViewer2XYZ!=NULL){
00311                 _imageViewer2XYZ->setColorTransferFunction(colortable);
00312                 this->Refresh();
00313         }
00314 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::SetDeltaVoxel ( int  delta  ) 

Definition at line 276 of file wxSphereView.cxx.

References _delta.

Referenced by vtkInteractorStyleSphere::OnMouseMove(), vtkInteractorStyleSphere::OnRightButtonUp(), RotationEnd(), and RotationStart().

00277 {
00278         _delta=delta;
00279 }

Here is the caller graph for this function:

void wxVtkBaseView::SetInteractorStyleBaseView ( vtkInteractorStyleImage *  interactorStyle  )  [inherited]

Definition at line 173 of file wxVtkBaseView.cxx.

References wxVtkBaseView::_interactorStyle.

Referenced by wxVtk3DBaseView::Configure(), wxVtk2DView_TMP::Configure(), and wxVtk2DBaseView::SetInteractorStyleImage().

00174 {
00175         _interactorStyle = interactorStyle;
00176 }

Here is the caller graph for this function:

void wxVtk2DBaseView::SetInteractorStyleImage ( vtkInteractorStyleBaseView interactorstylebaseview  )  [inherited]

Definition at line 267 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, vtkImageViewer2_XYZ::GetVtkImageViewer2(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), vtkMaracasImageViewer2Callback::IV, vtkMaracasImageViewer2Callback::New(), wxVtkBaseView::SetInteractorStyleBaseView(), and vtkInteractorStyleBaseView::SetwxVtkBaseView().

Referenced by wxVtk2DBaseView::Configure(), vtkPlane2DView::Configure(), and wxVtk2DBaseView::ResetView().

00268 {
00269         SetInteractorStyleBaseView(interactorstylebaseview);
00270 
00271         wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
00272         interactorstylebaseview->SetInteractor ( iren );
00273         iren->SetInteractorStyle(interactorstylebaseview);
00274         interactorstylebaseview->SetwxVtkBaseView(this);        
00275 
00276         vtkMaracasImageViewer2Callback * cbk = vtkMaracasImageViewer2Callback::New();
00277         cbk->IV = _imageViewer2XYZ->GetVtkImageViewer2();
00278         interactorstylebaseview->AddObserver( vtkCommand::WindowLevelEvent, cbk );
00279         interactorstylebaseview->AddObserver( vtkCommand::StartWindowLevelEvent, cbk );
00280         interactorstylebaseview->AddObserver( vtkCommand::ResetWindowLevelEvent, cbk );
00281         cbk->Delete();
00282 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::SetRadio ( double  radio  ) 

Definition at line 51 of file wxSphereView.cxx.

References _radio.

Referenced by vtkInteractorStyleSphere::OnMouseMove().

00052 {
00053         if (radio<0)
00054         {
00055                 radio=0;
00056         }
00057         _radio=radio;
00058 }

Here is the caller graph for this function:

void wxSphereView::SetVoxel ( double  i,
double  j,
int  delta,
double  id,
unsigned short  gris 
) [virtual]

Definition at line 282 of file wxSphereView.cxx.

References _imageSphere.

Referenced by FiltreImageB().

00283 {
00284         int ii,jj,delta2;
00285         unsigned short *pRes;
00286         int dimRes[3];
00287         _imageSphere->GetDimensions(dimRes);
00288 
00289         delta2=delta-1;
00290         for ( ii=(int)(i-delta2) ; ii<=(int)(i+delta2) ; ii++ )
00291         {
00292                 for ( jj=(int)(j-delta2) ; jj<=(int)(j+delta2) ; jj++ )
00293                 {
00294                         if ( (ii>=0)&&(ii<dimRes[0]) &&  
00295                                  (jj>=0)&&(jj<dimRes[1]) )
00296                         {
00297                                 pRes = (unsigned short*)_imageSphere->GetScalarPointer( ii , jj , (int)id );
00298                                 *pRes=gris;
00299                         }
00300                 }
00301         }
00302 
00303 }

Here is the caller graph for this function:

void wxVtk2DBaseView::SetVtkBaseData ( vtkBaseData vtkbasedata  )  [inherited]
void wxVtk2DBaseView::setWindowLevel ( double  level  )  [inherited]

Definition at line 316 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, vtkImageViewer2_XYZ::GetVtkImageViewer2(), and wxVtk2DBaseView::Refresh().

Referenced by wxMaracas_ViewerWidget::setWindowLevel().

00316                                                 {
00317 //      _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level);  
00318 
00319         vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
00320         imagemaptowindowlevel->SetWindow(level);
00321         this->Refresh();
00322 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::SetXYZtoParent ( double  i,
double  j 
)

Definition at line 307 of file wxSphereView.cxx.

References _centerX, _centerY, _centerZ, _imageDataOriginal, _imageSphere, _radio, _vtkmprbasedata, RotatePointOverTheSphere(), vtkMPRBaseData::SetX(), vtkMPRBaseData::SetY(), and vtkBaseData::SetZ().

Referenced by vtkInteractorStyleSphere::OnLeftButtonUp().

00308 {
00309 
00310         double factor = 0.75;
00311         double radio2   = _radio*_radio;
00312         double pxx,pyy,d2x,d2y;
00313         double cc[3],p[3],pp[3];
00314         cc[0]=_centerX;
00315         cc[1]=_centerY;
00316         cc[2]=_centerZ;
00317         double aa;
00318         int dimRes[3],dimOrig[3];
00319         _imageSphere->GetDimensions(dimRes);
00320         d2x=dimRes[0]/2;
00321         d2y=dimRes[1]/2;
00322         _imageDataOriginal->GetDimensions(dimOrig);
00323 
00324         p[0]  = (i - d2x)*factor;
00325         pxx=p[0]*p[0];
00326         p[1]  = (j - d2y)*factor;
00327         pyy=p[1]*p[1];
00328         aa = pxx + pyy;
00329         if (radio2>aa){
00330                 aa=radio2-aa;
00331                 p[2]  = sqrt(aa);
00332                 RotatePointOverTheSphere( pp, p,cc);
00333                 if ( (pp[0]>=0) && (pp[0]<dimOrig[0]) && 
00334                          (pp[1]>=0) && (pp[1]<dimOrig[1]) && 
00335                          (pp[2]>=0) && (pp[2]<dimOrig[2]) )
00336                 {
00337                         if (_vtkmprbasedata){
00338                                 _vtkmprbasedata->SetX(pp[0]);
00339                                 _vtkmprbasedata->SetY(pp[1]);
00340                                 _vtkmprbasedata->SetZ(pp[2]);
00341                         }
00342                 }
00343         }
00344 }

Here is the call graph for this function:

Here is the caller graph for this function:

double wxSphereView::SphereFindCenter ( double  P[4][3],
double  cc[3] 
) [private]

Definition at line 606 of file wxSphereView.cxx.

References determinant().

Referenced by InitSphere().

00607 {
00608     int i;
00609     double r, m11, m12, m13, m14, m15;
00610         double a[4][4];
00611 
00612     for (i = 0; i < 4; i++)                    // find minor 11
00613     {
00614         a[i][0] = P[i][0];
00615         a[i][1] = P[i][1];
00616         a[i][2] = P[i][2];
00617         a[i][3] = 1;
00618     }
00619     m11 = determinant( a, 4 );
00620 
00621     for (i = 0; i < 4; i++)                    // find minor 12 
00622     {
00623         a[i][0] = P[i][0]*P[i][0] + P[i][1]*P[i][1] + P[i][2]*P[i][2];
00624         a[i][1] = P[i][1];
00625         a[i][2] = P[i][2];
00626         a[i][3] = 1;
00627     }
00628     m12 = determinant( a, 4 );
00629 
00630     for (i = 0; i < 4; i++)                    // find minor 13
00631     {
00632         a[i][0] = P[i][0]*P[i][0] + P[i][1]*P[i][1] + P[i][2]*P[i][2];
00633         a[i][1] = P[i][0];
00634         a[i][2] = P[i][2];
00635         a[i][3] = 1;
00636     }
00637     m13 = determinant( a, 4 );
00638 
00639     for (i = 0; i < 4; i++)                    // find minor 14
00640     {
00641         a[i][0] = P[i][0]*P[i][0] + P[i][1]*P[i][1] + P[i][2]*P[i][2];
00642         a[i][1] = P[i][0];
00643         a[i][2] = P[i][1];
00644         a[i][3] = 1;
00645     }
00646     m14 = determinant( a, 4 );
00647 
00648 
00649     for (i = 0; i < 4; i++)                    // find minor 15
00650     {
00651         a[i][0] = P[i][0]*P[i][0] + P[i][1]*P[i][1] + P[i][2]*P[i][2];
00652         a[i][1] = P[i][0];
00653         a[i][2] = P[i][1];
00654         a[i][3] = P[i][2];
00655     }
00656     m15 = determinant( a, 4 );
00657 
00658     if (m11 == 0)
00659     {
00660         r = 0;
00661     }
00662     else
00663     {
00664                 // center of sphere
00665         cc[0] =  0.5*m12/m11;   //cx                  
00666         cc[1] = -0.5*m13/m11;   //cy
00667         cc[2] =  0.5*m14/m11;   //cz
00668                 // Sphere radio 
00669         r  = sqrt( cc[0]*cc[0] + cc[1]*cc[1] + cc[2]*cc[2] - m15/m11 );
00670     }
00671 
00672     return r;                                  // the radius
00673 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::TransCoordScreenToWorld ( double &  X,
double &  Y,
double &  Z,
int  type = 2 
) [inherited]

Definition at line 92 of file wxVtkBaseView.cxx.

References wxVtkBaseView::GetRenderer().

Referenced by wxVtkBaseView::TransFromCoordScreenToWorld().

00093 {
00094         GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z);
00095         GetRenderer()->DisplayToWorld();
00096         double fP[4];
00097         GetRenderer()->GetWorldPoint( fP );
00098         if ( fP[3] ){
00099                 fP[0] /= fP[3];
00100                 fP[1] /= fP[3];
00101                 fP[2] /= fP[3];
00102         }
00103 
00104         if (type!=0)
00105         {
00106                 X=fP[0];
00107         }
00108         if (type!=1)
00109         {
00110                 Y=fP[1];
00111         }
00112         if (type!=2)
00113         {
00114                 Z=fP[2];
00115         } 
00116 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxSphereView::TransferePoints ( double  pp1[3],
double  pp2[3],
double  AngX,
double  AngY,
vtkImageData *  image 
) [private]

Definition at line 178 of file wxSphereView.cxx.

References _imageDataOriginal.

00179 {
00180         double t;
00181         double difX = pp2[0]-pp1[0];
00182         double difY = pp2[1]-pp1[1];
00183         double difZ = pp2[2]-pp1[2];
00184 
00185         double  max             = 200;
00186 
00187         int dimOrg[3];
00188         int dimRes[3];
00189         int z;
00190         _imageDataOriginal->GetDimensions(dimOrg);              
00191         image->GetDimensions(dimRes);           
00192 
00193         int i;
00194         double x1=pp1[0];
00195         double y1=pp1[1];
00196         double z1=pp1[2];
00197         int xx=-1,yy=-1,zz=-1;
00198 
00199         for (i=0;i<max;i++)
00200         {
00201                 t  = i/max;
00202                 xx = (int) (x1+t*difX);
00203                 yy = (int) (y1+t*difY);
00204                 zz = (int) (z1+t*difZ);
00205 
00206                 z=i;
00207                 if ((xx>=0) && (xx<dimOrg[0]) && (yy>=0) && (yy<dimOrg[1]) && (zz>=0) && (zz<dimOrg[2]) &&
00208                         (AngX>=0) && (AngX<dimRes[0]) && (AngY>=0) && (AngY<dimRes[1]) && (z>=0) && (z<dimRes[2]) )
00209                 {
00210                         unsigned short *pOrg=(unsigned short*)_imageDataOriginal->GetScalarPointer (xx,yy,zz); 
00211                         unsigned short *pRes=(unsigned short*)image->GetScalarPointer( (int)AngX , (int)AngY , z ); 
00212                         *pRes=*pOrg;
00213                 }
00214         }
00215 }

void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView ( double &  X,
double &  Y,
double &  Z 
) [virtual, inherited]

Definition at line 54 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

00055 {
00056 //EEDx5
00057         double spc[3];
00058 //      GetVtkBaseData()->GetImageData()->GetSpacing(spc);
00059 //JCP 04/08/10  W/O Image this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput()->GetSpacing(spc);
00060         vtkImageData* image = this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput();
00061         if(image){
00062                 image->GetSpacing(spc);
00063         }else{
00064                 spc[0] = 1;
00065                 spc[1] = 1;
00066                 spc[2] = 1;
00067         }
00068 //
00069         X=X*spc[0];
00070         Y=Y*spc[1];
00071         Z=Z*spc[2];
00072 
00073 }

Here is the call graph for this function:

void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel ( double &  X,
double &  Y,
double &  Z 
) [virtual, inherited]

Definition at line 31 of file wxVtk2DBaseView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by wxVtkBaseView::TransFromCoordScreenToWorld().

00032 {
00033 //EEDx5
00034         double spc[3];
00035 //      GetVtkBaseData()->GetImageData()->GetSpacing(spc);
00036 //JCP 04/08/10  W/O Image this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput()->GetSpacing(spc);
00037         vtkImageData* image = this->_imageViewer2XYZ->GetVtkImageViewer2()->GetInput();
00038         if(image){
00039                 image->GetSpacing(spc);
00040         }else{
00041                 spc[0] = 1;
00042                 spc[1] = 1;
00043                 spc[2] = 1;
00044         }
00045         
00046 
00047         X = X / spc[0];
00048         Y = Y / spc[1];
00049         Z = Z / spc[2];
00050 
00051 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::TransFromCoordScreenToWorld ( double &  X,
double &  Y,
double &  Z,
bool  keepNormalDirection = false,
int  type = 2 
) [virtual, inherited]

Reimplemented in wxVtkMPR2DView.

Definition at line 119 of file wxVtkBaseView.cxx.

References wxVtkBaseView::GetInteractorStyleBaseView(), vtkInteractorStyleBaseView::GetWxVtk2DBaseView(), wxVtkBaseView::TransCoordScreenToWorld(), and wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel().

Referenced by manualViewPerpPlaneContour::ifTouchContour(), vtkInfoTextImageInteractor::OnMouseMove(), vtkInteractorManualPaint::OnMouseMove(), manualViewBaseContour::TransfromCoordViewWorld(), and vtkPlane2DView::TransfromCoordViewWorld2().

00120 {
00121         double xx = X;
00122         double yy = Y;
00123         double zz = Z;
00124 
00125         //RaC 03-2010
00126         TransCoordScreenToWorld(xx,yy,zz,type);
00127 
00128         X = xx;
00129         Y = yy;
00130         Z=zz;
00131 
00132 // EEDx5
00133         //JCP 13/05/2009
00134         vtkInteractorStyleBaseView* interactorstyle = (vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView();
00135     wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)interactorstyle->GetWxVtk2DBaseView();
00136 
00137         double fP[3];
00138         fP[0] = X;
00139         fP[1] = Y;
00140         fP[2] = Z;
00141 
00142         baseview->TransformCoordinate_spacing_ViewToModel( fP[0] , fP[1] , fP[2] );
00143         //JCP 13/05/2009
00144 
00145         if (type!=0)
00146         {
00147                 X=fP[0];
00148         }
00149         if (type!=1)
00150         {
00151                 Y=fP[1];
00152         }
00153         if (type!=2)
00154         {
00155                 Z=fP[2];
00156         } 
00157 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

double wxSphereView::_ang [private]

Definition at line 36 of file wxSphereView.h.

Referenced by RotationEnd(), and RotationStart().

int wxSphereView::_centerX [private]

Definition at line 31 of file wxSphereView.h.

Referenced by FiltreImageB(), InitSphere(), RefreshPoint(), and SetXYZtoParent().

int wxSphereView::_centerY [private]

Definition at line 32 of file wxSphereView.h.

Referenced by FiltreImageB(), InitSphere(), RefreshPoint(), and SetXYZtoParent().

int wxSphereView::_centerZ [private]

Definition at line 33 of file wxSphereView.h.

Referenced by FiltreImageB(), InitSphere(), RefreshPoint(), and SetXYZtoParent().

int wxSphereView::_delta [private]

Definition at line 40 of file wxSphereView.h.

Referenced by FiltreImage(), GetIdOfImage(), SetDeltaVoxel(), and wxSphereView().

vtkImageData* wxSphereView::_imageDataOriginal [private]
vtkImageData* wxSphereView::_imageSphere [private]

Definition at line 43 of file wxSphereView.h.

Referenced by FiltreImageB(), GetIdOfImage(), SetVoxel(), SetXYZtoParent(), and wxSphereView().

std::vector<idAlBeRa*> wxSphereView::_lstId [private]

Definition at line 29 of file wxSphereView.h.

Referenced by GetIdOfImage(), and ResetlstId().

double wxSphereView::_radio [private]
vtkTransform* wxSphereView::_transform [private]

Definition at line 48 of file wxSphereView.h.

Referenced by FiltreImage(), RotatePointOverTheSphere(), wxSphereView(), and ~wxSphereView().

vtkTransform* wxSphereView::_transform1 [private]

Definition at line 49 of file wxSphereView.h.

Referenced by FiltreImage(), RefreshPoint(), RotationEnd(), wxSphereView(), and ~wxSphereView().

vtkTransform* wxSphereView::_transform2 [private]

Definition at line 50 of file wxSphereView.h.

Referenced by FiltreImage(), RotationEnd(), RotationStart(), wxSphereView(), and ~wxSphereView().

Definition at line 46 of file wxSphereView.h.

Referenced by Configure().

Definition at line 45 of file wxSphereView.h.

Referenced by RefreshPoint(), SetXYZtoParent(), and wxSphereView().

double wxSphereView::_vxb [private]

Definition at line 37 of file wxSphereView.h.

Referenced by RotationEnd(), and RotationStart().

double wxSphereView::_vyb [private]

Definition at line 38 of file wxSphereView.h.

Referenced by RotationEnd(), and RotationStart().


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

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1