vtkPlane2DView Class Reference

#include <vtkPlane2DView.h>

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

List of all members.

Public Member Functions

 vtkPlane2DView (wxWindow *parent)
 ~vtkPlane2DView ()
void Configure ()
void ExtractPlane ()
int GetImgSize ()
void SetImgSize (int imgSize)
void RotationStart ()
void RotationDrag (double vx, double vy, bool ok_v, bool ok_ang)
virtual int GetActualSlice ()
virtual void SetActualSlice (int slice)
virtual void Refresh ()
vtkMPRBaseDataGetVtkmprbasedata ()
vtkInteractorStylePlane2DGetInteractorstyleplane2D ()
void SetActive (bool active)
void SetVisibleLine (bool ok)
void TransfromCoordViewWorld2 (double &X, double &Y, double &Z)
int GetMipWidth ()
void SetMipWidth (int value)
bool GetMipVisualization ()
void SetMipVisualization (bool ok)
void ResetBack ()
virtual void Configure (bool okimage=true)
vtkBaseDataGetVtkBaseData ()
void SetVtkBaseData (vtkBaseData *vtkbasedata)
virtual void ResetView ()
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 RefreshView ()
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 SetPSource (int sizeIma)
void HorizontalLine ()
void ResetPlane ()
void Extract_One_PlaneVTK ()
void Extract_MIP_PlaneVTK ()

Private Attributes

bool _active
int _mip_width
bool _mip_visualization
double _backX
double _backY
double _backZ
double _backOrient [4]
double _ang
double _vxb
double _vyb
double _n [3]
double _cx
double _cy
double _cz
int _sizeIma
vtkImageData * _imageResult
vtkPoints * _pts
vtkActor * _lineActor
vtkPolyDataMapper * _lineMapper
vtkPolyData * _pd
vtkProbeFilter * _3Dslices
vtkPlaneSource * _pSource
vtkStructuredPoints * _stPoints
vtkImageChangeInformation * _change
vtkTransform * _transform1
vtkTransform * _transform2
vtkInteractorStylePlane2D_interactorstyleplane2D
vtkInfoTextImage_vtkInfoTextImage
vtkInfoTextImageInteractorPlane2D_vtkInfoTextImageInteractorPlane2D

Detailed Description

Definition at line 17 of file vtkPlane2DView.h.


Constructor & Destructor Documentation

vtkPlane2DView::vtkPlane2DView ( wxWindow *  parent  ) 

Definition at line 9 of file vtkPlane2DView.cxx.

References _3Dslices, _active, _backOrient, _backX, _backY, _backZ, _change, _imageResult, _interactorstyleplane2D, _lineActor, _lineMapper, _mip_visualization, _mip_width, _pd, _pSource, _pts, _sizeIma, _stPoints, _transform1, and _transform2.

00010 : wxVtk2DBaseView(parent)
00011 {
00012 
00013         _backX                                  =       -99999;
00014         _backY                                  =       -99999;
00015         _backZ                                  =       -99999;
00016 
00017         _backOrient[0]                  =       -99999;
00018         _backOrient[1]                  =       -99999;
00019         _backOrient[2]                  =       -99999;
00020         _backOrient[3]                  =       -99999;
00021 
00022         _active                                 =   true;
00023         _mip_visualization              =       true;
00024         _mip_width                              =       2;
00025 
00026     _transform1                         =       vtkTransform::New();
00027     _transform2                         =       vtkTransform::New();
00028         _transform1->Identity();
00029         _transform2->Identity();
00030 
00031         _sizeIma                                =       200;
00032 
00033         _pSource                                =       NULL;
00034         _3Dslices                               =       NULL;
00035         _stPoints                               =       NULL;
00036         _change                                 =       NULL;
00037         _imageResult                    =       NULL;
00038 
00039         // line horizontal
00040     _pts                        = NULL;
00041     _lineActor          = NULL;
00042         _lineMapper             = NULL;
00043         _pd                             = NULL;
00044 
00045         _interactorstyleplane2D =       false;
00046 }

vtkPlane2DView::~vtkPlane2DView (  ) 

Definition at line 48 of file vtkPlane2DView.cxx.

References _lineActor, _lineMapper, _pd, _pts, _transform1, _transform2, and ResetPlane().

00049 {
00050         ResetPlane();
00051 
00052         // Horizontal Line
00053     if (_pts            != NULL)        {       _pts                    -> Delete(); }
00054     if (_lineActor      != NULL)        {       _lineActor              -> Delete(); }
00055     if (_lineMapper     != NULL)        {       _lineMapper             -> Delete(); }
00056     if (_pd                     != NULL)        {       _pd                             -> Delete(); }
00057 
00058         _transform1             -> Delete();
00059         _transform2             -> Delete();
00060 }

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 vtkPlane2DView::Configure (  )  [virtual]

Reimplemented from wxVtkBaseView.

Definition at line 329 of file vtkPlane2DView.cxx.

References _3Dslices, _change, wxVtk2DBaseView::_imageViewer2XYZ, _interactorstyleplane2D, _pSource, _sizeIma, _stPoints, _vtkInfoTextImage, _vtkInfoTextImageInteractorPlane2D, vtkInfoTextImage::Configure(), ExtractPlane(), wxVtkBaseView::GetInteractorStyleBaseView(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), GetVtkmprbasedata(), wxVtkBaseView::GetWxVTKRenderWindowInteractor(), HorizontalLine(), vtkInteractorStyleBaseView2D::New(), vtkInteractorStyleBaseView2D::SetInteractorScrollZ(), wxVtk2DBaseView::SetInteractorStyleImage(), vtkInteractorStyleBaseView2D::SetInteractorWindowLevel(), vtkInfoTextImage::SetMarImageData(), vtkInfoTextImageInteractor::SetModelVtkInfoTextImage(), and vtkInfoTextImage::SetWxVtk2DBaseView().

Referenced by wxMaracas_ViewerWidget::ConfigureVTK().

00330 {
00331         wxVtk2DBaseView::Configure(false);
00332 
00333         HorizontalLine();
00334 // Borrame
00335 //      CircleLine();
00336 
00337         _pSource         = vtkPlaneSource::New( );
00338     _3Dslices    = vtkProbeFilter::New( ) ;
00339         _stPoints        = vtkStructuredPoints::New( );
00340         _change          = vtkImageChangeInformation::New();
00341 
00342         wxVTKRenderWindowInteractor *iren               = GetWxVTKRenderWindowInteractor();
00343         ExtractPlane();
00344 //      SetActive(false);
00345         _imageViewer2XYZ -> GetVtkImageViewer2()        -> SetupInteractor ( iren );
00346 
00348         //RaC 04-2010 Look for the description of new changes in vtkInteractorStyleBaseView2D constructor.
00349         //
00350         // Previous version
00351         // SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
00352         //
00353         // Actual version
00354         vtkInteractorStyleBaseView2D *style2D = vtkInteractorStyleBaseView2D::New();
00355 
00356         manualInteractorWindowLevel *_manualinteractorwindowlevel= new manualInteractorWindowLevel();
00357         style2D->SetInteractorWindowLevel( _manualinteractorwindowlevel );
00358 
00359         vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
00360         style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
00361 
00362         SetInteractorStyleImage( style2D );
00363 
00364         // RaC
00366 
00367         _interactorstyleplane2D = new vtkInteractorStylePlane2D();
00368         ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstyleplane2D );
00369 
00370         vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
00371         
00372         camera->SetViewUp               (       0                       ,       1                               ,       0       );
00373         camera->SetPosition             ((0+_sizeIma)/2 , (0+_sizeIma)/2        , 10000 ); 
00374         
00375         camera->SetFocalPoint   ((0+_sizeIma)/2 , (0+_sizeIma)/2        ,       0       ); 
00376         camera->SetClippingRange(0.01, 100000);
00377         camera->ComputeViewPlaneNormal();
00378         camera->SetParallelScale( _sizeIma/3.0 );
00379 
00380         // text information over the graphic window
00381         _vtkInfoTextImage                                               = new vtkInfoTextImage();
00382         _vtkInfoTextImageInteractorPlane2D              = new vtkInfoTextImageInteractorPlane2D();
00383         _vtkInfoTextImage->SetWxVtk2DBaseView(this);
00384         _vtkInfoTextImage->SetMarImageData(  GetVtkmprbasedata()->GetMarImageData() );
00385         _vtkInfoTextImageInteractorPlane2D->SetModelVtkInfoTextImage(_vtkInfoTextImage);        
00386         _vtkInfoTextImage->Configure();
00387         ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkInfoTextImageInteractorPlane2D);
00388 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::Extract_MIP_PlaneVTK (  )  [private]

Definition at line 223 of file vtkPlane2DView.cxx.

References _imageResult, wxVtk2DBaseView::_imageViewer2XYZ, _mip_width, _pSource, _sizeIma, vtkBaseData::GetImageData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), GetVtkmprbasedata(), and SetPSource().

Referenced by ExtractPlane().

00224 {
00225 
00226         int mipWidth;
00227         double sp;
00228         int sizeWidth = (_mip_width*2)+1 ;
00229         int deltaPixel;
00230         int iWidth,itmp,tmpSizeWith;
00231 
00232         double spc[3];
00233         vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
00234         SetPSource(_sizeIma);
00235         imagedata->GetSpacing(spc);
00236 
00237         bool heightDefinition=false;
00238         if (_mip_width<3)
00239         {
00240                 heightDefinition=true;
00241         }
00242 
00243         if (heightDefinition==true)
00244         {
00245                 mipWidth        =       _mip_width;
00246                 sp                      =       spc[0];
00247                 deltaPixel      =       1;
00248         } else {
00249                 mipWidth        =       2;
00250                 tmpSizeWith =   (mipWidth*2) + 1;
00251                 sp                      =       (spc[0]*sizeWidth)/tmpSizeWith;
00252                 sizeWidth       =       tmpSizeWith;
00253                 deltaPixel      =       4;
00254         }
00255 
00256 
00257 
00258         std::vector< vtkProbeFilter* > slicesLST;
00259 
00260         _pSource->Push( -mipWidth * sp );
00261         _pSource->Update();
00262 
00263         for ( iWidth=0 ; iWidth<sizeWidth ; iWidth++ )
00264         {       
00265                 vtkProbeFilter *slice = vtkProbeFilter::New();
00266                 slice -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
00267                 slice -> SetSource( imagedata );
00268                 slice -> Update( );
00269                 slicesLST.push_back( slice );
00270                 _pSource->Push( sp );
00271         }
00272         
00273         if (_imageResult ==NULL)
00274         {
00275                 _imageResult = vtkImageData::New();
00276                 _imageResult -> SetDimensions(_sizeIma,_sizeIma,1);
00277                 _imageResult -> SetSpacing(1,1,1);
00278                 _imageResult -> SetScalarType( imagedata->GetScalarType() );
00279                 _imageResult -> SetExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
00280                 _imageResult -> SetWholeExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
00281                 _imageResult -> AllocateScalars();
00282                 _imageResult -> Update();
00283         }
00284 
00285         unsigned short *pTemp;
00286         unsigned short *pResult;
00287         pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 ); 
00288 
00289         int iPixels , sizePixels = _sizeIma*_sizeIma;
00290         for(iPixels=0 ; iPixels<sizePixels ; iPixels=iPixels+deltaPixel)
00291         {
00292 
00293                 pTemp = (unsigned short*)slicesLST[0]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
00294 
00295                 pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 ); 
00296                 pResult[iPixels] = pTemp[iPixels];
00297 
00298                 for (iWidth=1;iWidth<sizeWidth;iWidth++)
00299                 {
00300                         pTemp = (unsigned short*)slicesLST[iWidth]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
00301 
00302                         if (pResult[iPixels]< pTemp[iPixels])
00303                         {
00304                                 pResult[iPixels] = pTemp[iPixels];
00305                         }
00306                 }
00307 
00308                 if (deltaPixel!=1)
00309                 {
00310                         for (itmp=1;itmp<deltaPixel;itmp++)
00311                         {
00312                                 pResult[iPixels+itmp] = pResult[iPixels];
00313                         }
00314                 }
00315 
00316         }
00317 
00318         for (iWidth=0;iWidth<sizeWidth;iWidth++)
00319         {       
00320                 slicesLST[iWidth]->Delete();
00321         }
00322 
00323         _imageResult->Modified();
00324         _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageResult );
00325 
00326 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::Extract_One_PlaneVTK (  )  [private]

Definition at line 202 of file vtkPlane2DView.cxx.

References _3Dslices, wxVtk2DBaseView::_imageViewer2XYZ, _pSource, _sizeIma, _stPoints, vtkBaseData::GetImageData(), vtkImageViewer2_XYZ::GetVtkImageViewer2(), GetVtkmprbasedata(), and SetPSource().

Referenced by ExtractPlane().

00203 {
00204         vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
00205         SetPSource(_sizeIma);
00206         _3Dslices -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
00207         _3Dslices -> SetSource( imagedata );
00208         _3Dslices -> Update( );
00209         _stPoints -> GetPointData( )->SetScalars(  _3Dslices->GetOutput()->GetPointData()->GetScalars()  );
00210         _stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
00211         _stPoints -> SetScalarType( imagedata->GetScalarType() );
00212         _stPoints -> SetScalarTypeToShort();
00213         _stPoints -> Update();
00214 //      _change   -> SetInput( _stPoints );  
00215 //      _change   -> Update();    //important
00216         _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _stPoints );
00217 //      _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _change->GetOutput() );
00218         //      vtkImageActor *imageActor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
00219 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::ExtractPlane (  ) 

Definition at line 134 of file vtkPlane2DView.cxx.

References _active, _backOrient, _backX, _backY, _backZ, _interactorstyleplane2D, _mip_visualization, Extract_MIP_PlaneVTK(), Extract_One_PlaneVTK(), vtkBaseData::GetImageData(), vtkInteractorStylePlane2D::GetStateRotate(), vtkMPRBaseData::GetTransformOrientation(), GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), and vtkBaseData::GetZ().

Referenced by Configure(), and Refresh().

00135 {
00136 
00137         double x = GetVtkmprbasedata()->GetX();
00138         double y = GetVtkmprbasedata()->GetY();
00139         double z = GetVtkmprbasedata()->GetZ();
00140 
00141         double spc[3];
00142         vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
00143         imagedata->GetSpacing(spc);
00144         x=x*spc[0];
00145         y=y*spc[1];
00146         z=z*spc[2];
00147 
00148         vtkTransform *transform = GetVtkmprbasedata()->GetTransformOrientation();
00149         double orientation[4];
00150         transform->GetOrientationWXYZ(orientation);
00151 
00152         bool okOrientation=true;
00153         if ((orientation[0]!=_backOrient[0]) || (orientation[1]!=_backOrient[1]) ||
00154                 (orientation[2]!=_backOrient[2]) || (orientation[3]!=_backOrient[3]))
00155         {
00156                 okOrientation=false;
00157         }
00158 
00159         bool okPosicion=true;
00160         if ( (x!=_backX) || (y!=_backY) || (z!=_backZ) )
00161         {
00162                 okPosicion=false;
00163         }
00164 
00165         if ((okPosicion==false) || (okOrientation==false) ) {
00166                 if (_active==true){
00167 
00168                         bool ok = false;
00169 
00170                         if ( _mip_visualization==true )
00171                         {
00172                                 if (_interactorstyleplane2D!=NULL)
00173                                 {
00174                                         if (_interactorstyleplane2D->GetStateRotate()==false )
00175                                         {
00176                                                 ok=true;
00177                                         }
00178                                 }
00179                         }
00180 //                      ok=true;
00181 
00182                         if (ok==true)
00183                         {
00184                                 Extract_MIP_PlaneVTK();
00185                         } else {
00186                                 Extract_One_PlaneVTK();
00187                         } // ok
00188 
00189                 } // active
00190                 _backX=x;
00191                 _backY=y;
00192                 _backZ=z;
00193                 _backOrient[0]=orientation[0];
00194                 _backOrient[1]=orientation[1];
00195                 _backOrient[2]=orientation[2];
00196                 _backOrient[3]=orientation[3];
00197         } //okPosition okOrientation
00198 }

Here is the call graph for this function:

Here is the caller graph for this function:

int vtkPlane2DView::GetActualSlice (  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 471 of file vtkPlane2DView.cxx.

References _cx, _cy, _cz, GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), and vtkBaseData::GetZ().

00472 {
00473         _cx = GetVtkmprbasedata()->GetX();
00474         _cy = GetVtkmprbasedata()->GetY();
00475         _cz = GetVtkmprbasedata()->GetZ();
00476         return 0;
00477 }

Here is the call graph for this function:

int vtkPlane2DView::GetImgSize (  ) 

Definition at line 466 of file vtkPlane2DView.cxx.

References _sizeIma.

Referenced by wxWidgetMesure2D_Plane::ConfigureCircleLine(), manualViewPerpPlaneContour::FilterCordinateXYZ(), manualViewPerpPlaneContour::RefreshContour(), and TransfromCoordViewWorld2().

00467 {
00468         return _sizeIma;
00469 }

Here is the caller graph for this function:

vtkInteractorStyleImage * wxVtkBaseView::GetInteractorStyleBaseView (  )  [inherited]
vtkInteractorStylePlane2D * vtkPlane2DView::GetInteractorstyleplane2D (  ) 

Definition at line 501 of file vtkPlane2DView.cxx.

References _interactorstyleplane2D.

Referenced by wxManualTree_MPRWidget::ConfigureContour().

00502 {
00503         return this->_interactorstyleplane2D;
00504 }

Here is the caller graph for this function:

bool vtkPlane2DView::GetMipVisualization (  ) 

Definition at line 481 of file vtkPlane2DView.cxx.

References _mip_visualization.

00482 {
00483         return _mip_visualization;
00484 }

int vtkPlane2DView::GetMipWidth (  ) 

Definition at line 487 of file vtkPlane2DView.cxx.

References _mip_width.

00488 {
00489         return _mip_width;
00490 }

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]
vtkMPRBaseData * vtkPlane2DView::GetVtkmprbasedata (  ) 
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(), 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 vtkPlane2DView::HorizontalLine (  )  [private]

Definition at line 391 of file vtkPlane2DView.cxx.

References wxVtk2DBaseView::_imageViewer2XYZ, _lineActor, _lineMapper, _pd, _pts, and vtkImageViewer2_XYZ::GetVtkImageViewer2().

Referenced by Configure().

00392 {
00393 // Axe Horizontal
00394         _pts = vtkPoints::New();
00395         _pts->SetNumberOfPoints(2);
00396         _pts->SetPoint(0, -1000 , -1000 , -1000 );
00397         _pts->SetPoint(1,  1000 ,  1000 ,  1000 );
00398         vtkCellArray *lines = vtkCellArray::New();
00399         lines->InsertNextCell(2);
00400         lines->InsertCellPoint(0);
00401         lines->InsertCellPoint(1);
00402         _pd = vtkPolyData::New();
00403     _pd->SetPoints( _pts );
00404     _pd->SetLines( lines );
00405         lines->Delete();  //do not delete lines ??
00406         _lineActor                                      =       vtkActor::New();
00407     _lineMapper                                 =       vtkPolyDataMapper::New();
00408         _lineMapper->SetInput(_pd);
00409         _lineMapper->ImmediateModeRenderingOn();
00410         _lineActor->SetMapper(_lineMapper);
00411         _lineActor->GetProperty()->BackfaceCullingOn();
00412         _lineActor->GetProperty()->SetDiffuseColor(0,0,1);
00413         _lineActor->GetProperty()->SetLineWidth(2);
00414         _lineActor->GetProperty()->SetOpacity(0);
00415     _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineActor );
00416 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::Refresh (  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 455 of file vtkPlane2DView.cxx.

References ExtractPlane().

Referenced by wxWidgetMesure2D_Plane_in_MPR::OnActiveLink(), wxMaracas_ManualContour_Panel::OnRefreshView(), and wxMaracas_ViewerWidget::RefreshView().

00456 {
00457         ExtractPlane();
00458         wxVtkBaseView::Refresh();
00459 }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView::RefreshView (  )  [virtual, inherited]
void vtkPlane2DView::ResetBack (  ) 

Definition at line 63 of file vtkPlane2DView.cxx.

References _backOrient, _backX, _backY, and _backZ.

Referenced by vtkInteractorStylePlane2D::OnLeftButtonUp().

00064 {
00065                 _backX=-1;
00066                 _backY=-1;
00067                 _backZ=-1;
00068                 _backOrient[0]=-1;
00069                 _backOrient[1]=-1;
00070                 _backOrient[2]=-1;
00071                 _backOrient[3]=-1;
00072 }

Here is the caller graph for this function:

void vtkPlane2DView::ResetPlane (  )  [private]

Definition at line 75 of file vtkPlane2DView.cxx.

References _3Dslices, _change, _pSource, and _stPoints.

Referenced by ~vtkPlane2DView().

00075                                {
00076         if (_pSource    !=NULL) { _pSource      -> Delete();    }
00077         if (_3Dslices   !=NULL) { _3Dslices     -> Delete();    }
00078         if (_stPoints   !=NULL) { _stPoints     -> Delete();    }
00079         if (_change             !=NULL) { _change       -> Delete();    }
00080 }

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 vtkPlane2DView::RotationDrag ( double  vx,
double  vy,
bool  ok_v,
bool  ok_ang 
)

Definition at line 426 of file vtkPlane2DView.cxx.

References _ang, _pts, _sizeIma, _transform1, _transform2, _vxb, _vyb, wxVtk2DBaseView::GetVtkBaseData(), and vtkMPRBaseData::InitTransformOrientation().

Referenced by vtkInteractorStylePlane2D::OnMouseMove().

00427 { 
00428         if (ok_ang==false)
00429         {
00430                 _ang =sqrt( vx*vx + vy*vy ) / 1.5;
00431         }
00432 
00433         if (ok_v==false){
00434                 _vxb=-vy;
00435                 _vyb=vx;
00436         }
00437         _transform2->Identity();
00438         _transform2->RotateWXYZ(_ang,0,_vxb,_vyb);
00439 
00440         vtkMPRBaseData  *mprbasedata = (vtkMPRBaseData*)this->GetVtkBaseData();
00441         vtkTransform *transform          =      vtkTransform::New();
00442         transform->Identity();
00443         transform->Concatenate(_transform1);
00444         transform->Concatenate(_transform2);
00445         mprbasedata->InitTransformOrientation(transform);
00446         transform->Delete();
00447 
00448         // Refresh Horizontal Line
00449         _pts->SetPoint( 0 , (_sizeIma/2) - _vxb*2       , (_sizeIma/2) - _vyb*2 , 1 );
00450         _pts->SetPoint( 1 , (_sizeIma/2) + _vxb*2       , (_sizeIma/2) + _vyb*2 , 1 );
00451 //      RefreshCircleLine();
00452 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::RotationStart (  ) 

Definition at line 419 of file vtkPlane2DView.cxx.

References _transform1, vtkMPRBaseData::GetTransformOrientation(), and wxVtk2DBaseView::GetVtkBaseData().

Referenced by vtkInteractorStylePlane2D::OnLeftButtonDown().

00420 {
00421         vtkMPRBaseData  *mprbasedata = (vtkMPRBaseData*)this->GetVtkBaseData();
00422         vtkTransform    *transform       = mprbasedata->GetTransformOrientation();
00423         _transform1->SetMatrix( transform->GetMatrix() );
00424 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::SetActive ( bool  active  ) 

Definition at line 506 of file vtkPlane2DView.cxx.

References _active.

Referenced by wxWidgetMesure2D_Plane_in_MPR::OnActiveLink(), and wxWidgetMesure2D_Plane_in_MPR::SetActiveLink().

00507 {
00508         _active = active;
00509 }

Here is the caller graph for this function:

void vtkPlane2DView::SetActualSlice ( int  slice  )  [virtual]

Reimplemented from wxVtk2DBaseView.

Definition at line 493 of file vtkPlane2DView.cxx.

References _cx, _cy, _cz, _n, GetVtkmprbasedata(), vtkMPRBaseData::SetX(), vtkMPRBaseData::SetY(), and vtkBaseData::SetZ().

00494 {
00495         double dir=(double)slice/3.0;
00496         GetVtkmprbasedata()->SetX( _cx + (_n[0]*dir) );
00497         GetVtkmprbasedata()->SetY( _cy + (_n[1]*dir) );
00498         GetVtkmprbasedata()->SetZ( _cz + (_n[2]*dir) );
00499 }

Here is the call 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 vtkPlane2DView::SetImgSize ( int  imgSize  ) 

Definition at line 461 of file vtkPlane2DView.cxx.

References _sizeIma.

Referenced by wxMPRWidget::CreateMPRPanel4View(), wxMaracas_ManualContour_Panel::CreateSplitePanel(), wxMPRWidget::CreateView(), and wxPnlSearchStenosisAutomatic::OnBtAxisMPR().

00462 {
00463         _sizeIma = imgSize;
00464 }

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(), 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 vtkPlane2DView::SetMipVisualization ( bool  ok  ) 

Definition at line 513 of file vtkPlane2DView.cxx.

References _mip_visualization.

00514 {
00515         _mip_visualization=ok;
00516 }

void vtkPlane2DView::SetMipWidth ( int  value  ) 

Definition at line 520 of file vtkPlane2DView.cxx.

References _mip_width.

00521 {
00522         _mip_width=value;
00523 }

void vtkPlane2DView::SetPSource ( int  sizeIma  )  [private]

Definition at line 88 of file vtkPlane2DView.cxx.

References _n, _pSource, vtkBaseData::GetImageData(), vtkMPRBaseData::GetTransformOrientation(), wxVtk2DBaseView::GetVtkBaseData(), GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), and vtkBaseData::GetZ().

Referenced by Extract_MIP_PlaneVTK(), and Extract_One_PlaneVTK().

00088                                           {
00089         int dimIma      = sizeIma; 
00090 
00091         double x = GetVtkmprbasedata()->GetX();
00092         double y = GetVtkmprbasedata()->GetY();
00093         double z = GetVtkmprbasedata()->GetZ();
00094 
00095         double spc[3];
00096         vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
00097         imagedata->GetSpacing(spc);
00098         x=x*spc[0];
00099         y=y*spc[1];
00100         z=z*spc[2];
00101 
00102 
00103         vtkMPRBaseData  *mprbasedata = (vtkMPRBaseData*)this->GetVtkBaseData();
00104         vtkTransform    *transform       = mprbasedata->GetTransformOrientation();
00105 
00106         double in[3];  // temp
00107         double pA[3];
00108         double pB[3];
00109         in[0]=1;                in[1]=0;                        in[2]=0;
00110         transform->TransformPoint(in,_n);
00111 
00112         in[0]=0;        in[1]=dimIma-1;         in[2] = 0;
00113         transform->TransformPoint(in,pA);
00114 
00115         in[0]=0;        in[1]=0;                in[2]=dimIma-1;
00116         transform->TransformPoint(in,pB);
00117 
00118     _pSource -> SetPoint1( pA   );
00119     _pSource -> SetPoint2( pB   );
00120 
00121         _pSource -> SetOrigin( 0        , 0             , 0             );
00122     _pSource -> SetResolution( sizeIma-1 , sizeIma -1 );
00123         _pSource -> Update();
00124         _pSource -> SetCenter( x, y, z );
00125     _pSource -> SetNormal( _n );
00126     _pSource -> Update( );
00127 
00128 // EED Borrame
00129 //      transform->Delete();
00130 
00131 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkPlane2DView::SetVisibleLine ( bool  ok  ) 

Definition at line 526 of file vtkPlane2DView.cxx.

References _lineActor.

Referenced by wxWidgetMesure2D_Plane::OnActiveLine().

00527 {
00528         double opacity;
00529         if (ok==true)
00530         {
00531                 opacity=1;
00532         } else {
00533                 opacity=0;
00534         }
00535         _lineActor->GetProperty()->SetOpacity(opacity);
00536 }

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 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 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 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:

void vtkPlane2DView::TransfromCoordViewWorld2 ( double &  X,
double &  Y,
double &  Z 
)

Definition at line 538 of file vtkPlane2DView.cxx.

References vtkBaseData::GetImageData(), GetImgSize(), vtkMPRBaseData::GetTransformOrientation(), GetVtkmprbasedata(), vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), vtkBaseData::GetZ(), and wxVtkBaseView::TransFromCoordScreenToWorld().

Referenced by vtkInteractorStylePlane2D::OnLeftDClick(), vtkInfoTextImageInteractorPlane2D::OnMouseMove(), and manualViewPerpPlaneContour::TransfromCoordViewWorld().

00539 {
00540         double spc[3];
00541         GetVtkmprbasedata()->GetImageData()->GetSpacing(spc);
00542 
00543         double xx = X;
00544         double yy = Y;
00545         double zz = 0;
00546 
00547         TransFromCoordScreenToWorld(xx,yy,zz);
00548 
00549 
00550         vtkTransform *transf1 = vtkTransform::New();
00551         transf1->Identity();
00552         vtkTransform *transf2 = GetVtkmprbasedata()->GetTransformOrientation();
00553         transf1->Concatenate(transf2->GetMatrix());
00554         double in[4], out[4];
00555         double center = GetImgSize() / 2;
00556         in[0] = 0;
00557         in[1] = xx - center;
00558         in[2] = yy - center;
00559         in[3] = 0;
00560 
00561         transf1->MultiplyPoint(in,out);
00562         transf1->Delete();
00563 
00564         X = out[0] + GetVtkmprbasedata()->GetX() ;
00565         Y = out[1] + GetVtkmprbasedata()->GetY() ;
00566         Z = out[2] + GetVtkmprbasedata()->GetZ() ;
00567 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

vtkProbeFilter* vtkPlane2DView::_3Dslices [private]

Definition at line 79 of file vtkPlane2DView.h.

Referenced by Configure(), Extract_One_PlaneVTK(), ResetPlane(), and vtkPlane2DView().

bool vtkPlane2DView::_active [private]

Definition at line 51 of file vtkPlane2DView.h.

Referenced by ExtractPlane(), SetActive(), and vtkPlane2DView().

double vtkPlane2DView::_ang [private]

Definition at line 60 of file vtkPlane2DView.h.

Referenced by RotationDrag().

double vtkPlane2DView::_backOrient[4] [private]

Definition at line 58 of file vtkPlane2DView.h.

Referenced by ExtractPlane(), ResetBack(), and vtkPlane2DView().

double vtkPlane2DView::_backX [private]

Definition at line 55 of file vtkPlane2DView.h.

Referenced by ExtractPlane(), ResetBack(), and vtkPlane2DView().

double vtkPlane2DView::_backY [private]

Definition at line 56 of file vtkPlane2DView.h.

Referenced by ExtractPlane(), ResetBack(), and vtkPlane2DView().

double vtkPlane2DView::_backZ [private]

Definition at line 57 of file vtkPlane2DView.h.

Referenced by ExtractPlane(), ResetBack(), and vtkPlane2DView().

vtkImageChangeInformation* vtkPlane2DView::_change [private]

Definition at line 82 of file vtkPlane2DView.h.

Referenced by Configure(), ResetPlane(), and vtkPlane2DView().

double vtkPlane2DView::_cx [private]

Definition at line 65 of file vtkPlane2DView.h.

Referenced by GetActualSlice(), and SetActualSlice().

double vtkPlane2DView::_cy [private]

Definition at line 66 of file vtkPlane2DView.h.

Referenced by GetActualSlice(), and SetActualSlice().

double vtkPlane2DView::_cz [private]

Definition at line 67 of file vtkPlane2DView.h.

Referenced by GetActualSlice(), and SetActualSlice().

vtkImageData* vtkPlane2DView::_imageResult [private]

Definition at line 71 of file vtkPlane2DView.h.

Referenced by Extract_MIP_PlaneVTK(), and vtkPlane2DView().

vtkActor* vtkPlane2DView::_lineActor [private]

Definition at line 75 of file vtkPlane2DView.h.

Referenced by HorizontalLine(), SetVisibleLine(), vtkPlane2DView(), and ~vtkPlane2DView().

vtkPolyDataMapper* vtkPlane2DView::_lineMapper [private]

Definition at line 76 of file vtkPlane2DView.h.

Referenced by HorizontalLine(), vtkPlane2DView(), and ~vtkPlane2DView().

Definition at line 52 of file vtkPlane2DView.h.

Referenced by Extract_MIP_PlaneVTK(), GetMipWidth(), SetMipWidth(), and vtkPlane2DView().

double vtkPlane2DView::_n[3] [private]

Definition at line 63 of file vtkPlane2DView.h.

Referenced by SetActualSlice(), and SetPSource().

vtkPolyData* vtkPlane2DView::_pd [private]

Definition at line 77 of file vtkPlane2DView.h.

Referenced by HorizontalLine(), vtkPlane2DView(), and ~vtkPlane2DView().

vtkPlaneSource* vtkPlane2DView::_pSource [private]
vtkPoints* vtkPlane2DView::_pts [private]

Definition at line 74 of file vtkPlane2DView.h.

Referenced by HorizontalLine(), RotationDrag(), vtkPlane2DView(), and ~vtkPlane2DView().

int vtkPlane2DView::_sizeIma [private]
vtkStructuredPoints* vtkPlane2DView::_stPoints [private]

Definition at line 81 of file vtkPlane2DView.h.

Referenced by Configure(), Extract_One_PlaneVTK(), ResetPlane(), and vtkPlane2DView().

vtkTransform* vtkPlane2DView::_transform1 [private]

Definition at line 83 of file vtkPlane2DView.h.

Referenced by RotationDrag(), RotationStart(), vtkPlane2DView(), and ~vtkPlane2DView().

vtkTransform* vtkPlane2DView::_transform2 [private]

Definition at line 84 of file vtkPlane2DView.h.

Referenced by RotationDrag(), vtkPlane2DView(), and ~vtkPlane2DView().

Definition at line 88 of file vtkPlane2DView.h.

Referenced by Configure().

Definition at line 89 of file vtkPlane2DView.h.

Referenced by Configure().

double vtkPlane2DView::_vxb [private]

Definition at line 61 of file vtkPlane2DView.h.

Referenced by RotationDrag().

double vtkPlane2DView::_vyb [private]

Definition at line 62 of file vtkPlane2DView.h.

Referenced by RotationDrag().


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

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1