vtkMPR3DDataViewer Class Reference

#include <vtkMPR3DDataViewer.h>

Collaboration diagram for vtkMPR3DDataViewer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 vtkMPR3DDataViewer ()
virtual ~vtkMPR3DDataViewer ()
vtkImageActor * GetImageActor (int id)
vtkActor * GetOutlineActor ()
virtual void Refresh ()
virtual void Configure ()
void SetVisiblePosition (int idPosition, bool visible)
bool GetVisiblePosition (int idPosition)
vtkImageActor * GetvtkActor_saggital ()
vtkImageActor * GetvtkActor_axial ()
vtkImageActor * GetvtkActor_coronal ()
void SetPositionX (int pos)
void SetPositionY (int pos)
void SetPositionZ (int pos)
void SetVtkMPRBaseData (vtkMPRBaseData *vtkmprbasedata)
vtkMPRBaseDataGetVtkMPRBaseData ()
vtkColorTransferFunction * GetvtkColorTransferFunction ()
std::vector< double > * GetctFunVectorPoint ()
std::vector< double > * GetctFunVectorRed ()
std::vector< double > * GetctFunVectorGreen ()
std::vector< double > * GetctFunVectorBlue ()
void setColorTransferFunction (vtkColorTransferFunction *colortable)

Private Attributes

bool _visiblePosition [3]
vtkOutlineFilter * _outlineData
vtkPolyDataMapper * _mapOutline
vtkActor * _outline
vtkColorTransferFunction * _ctfun
std::vector< double > _ctFunVectorPoint
std::vector< double > _ctFunVectorRed
std::vector< double > _ctFunVectorGreen
std::vector< double > _ctFunVectorBlue
vtkImageMapToColors * _saggitalColors
vtkImageActor * _saggital
vtkImageMapToColors * _axialColors
vtkImageActor * _axial
vtkImageMapToColors * _coronalColors
vtkImageActor * _coronal
vtkMPRBaseData_vtkmprbasedata

Detailed Description

Definition at line 13 of file vtkMPR3DDataViewer.h.


Constructor & Destructor Documentation

vtkMPR3DDataViewer::vtkMPR3DDataViewer (  ) 

Definition at line 5 of file vtkMPR3DDataViewer.cxx.

References _axial, _axialColors, _coronal, _coronalColors, _ctfun, _mapOutline, _outline, _outlineData, _saggital, _saggitalColors, _visiblePosition, and _vtkmprbasedata.

00006 {
00007         _visiblePosition[0]=false;
00008         _visiblePosition[1]=false;
00009         _visiblePosition[2]=false;
00010         _ctfun = NULL;
00011         _vtkmprbasedata=NULL;
00012 
00013         _ctfun=NULL;
00014         _saggitalColors=NULL;
00015         _saggital=NULL;
00016         _axialColors=NULL;
00017         _axial=NULL;
00018         _coronalColors=NULL;
00019         _coronal=NULL;
00020         _mapOutline=NULL;
00021         _outline=NULL;
00022         _outlineData=NULL;
00023 }

vtkMPR3DDataViewer::~vtkMPR3DDataViewer (  )  [virtual]

Definition at line 25 of file vtkMPR3DDataViewer.cxx.

References _axial, _axialColors, _coronal, _coronalColors, _ctfun, _mapOutline, _outline, _outlineData, _saggital, and _saggitalColors.

00026 {
00027         _outlineData-> Delete();
00028         _mapOutline-> Delete();
00029         _outline-> Delete();
00030 
00031 //      if (_bwLut)             _bwLut->Delete();
00032 //      if (_hueLut)            _hueLut->Delete();
00033 //      if (_satLut)            _satLut->Delete();
00034         if (_ctfun)             _ctfun->Delete();
00035         if (_saggitalColors)    _saggitalColors ->Delete();
00036         if (_saggital)          _saggital->Delete();
00037         if (_axialColors)       _axialColors->Delete();
00038         if (_axial)             _axial->Delete();
00039         if (_coronalColors)     _coronalColors->Delete();
00040         if (_coronal)           _coronal->Delete();
00041 
00042 }


Member Function Documentation

void vtkMPR3DDataViewer::Configure (  )  [virtual]

Definition at line 114 of file vtkMPR3DDataViewer.cxx.

References _axial, _axialColors, _coronal, _coronalColors, _ctfun, _ctFunVectorBlue, _ctFunVectorGreen, _ctFunVectorPoint, _ctFunVectorRed, _mapOutline, _outline, _outlineData, _saggital, _saggitalColors, _vtkmprbasedata, and vtkBaseData::GetImageData().

Referenced by wxMaracasRenderTabbedPanel::addMPROptions(), wxManualRegistration3D::AddPanelControl_B(), wxMaracas_ViewerWidget::ConfigureVTK(), wxManualRegistration3D::Create3DView(), wxManualTree_MPRWidget::Create3DViewContour(), wxSegmentationFM3DWidget::Create3DViewContour(), wxManualSegmentation_MPRWidget::Create3DViewContour(), wxMPRWidget::CreateMPRPanel4View(), wxMPRWidget::CreateView(), and wxMaracas_ViewerWidget::wxMaracas_ViewerWidget().

00115 {
00116 /*
00117   // Start by creatin a black/white lookup table.
00118         _bwLut = vtkLookupTable::New();
00119     _bwLut->SetTableRange (0, 2000);
00120     _bwLut->SetSaturationRange (0, 0);
00121     _bwLut->SetHueRange (0, 0);
00122     _bwLut->SetValueRange (0, 1);
00123 
00124   // Now create a lookup table that consists of the full hue circle
00125   // (from HSV).
00126         _hueLut = vtkLookupTable::New();
00127     _hueLut->SetTableRange (0, 2000);
00128     _hueLut->SetHueRange (0, 1);
00129     _hueLut->SetSaturationRange (1, 1);
00130     _hueLut->SetValueRange (1, 1);
00131 
00132   // Finally, create a lookup table with a single hue but having a range
00133   // in the saturation of the hue.
00134         _satLut = vtkLookupTable::New();
00135     _satLut->SetTableRange (0, 2000);
00136     _satLut->SetHueRange (.6, .6);
00137     _satLut->SetSaturationRange (0, 1);
00138     _satLut->SetValueRange (1, 1);
00139 */
00140 
00141 
00142         double range[2];
00143         double max;
00144         
00145         if(_vtkmprbasedata->GetImageData()){
00146                 _vtkmprbasedata->GetImageData()->GetScalarRange(range);
00147                 max = range[1];
00148                 
00149                 
00150                 _ctFunVectorPoint.clear();
00151                 _ctFunVectorPoint.push_back(max*0/4);
00152                 _ctFunVectorPoint.push_back(max*1/4);
00153                 _ctFunVectorPoint.push_back(max*2/4);
00154                 _ctFunVectorPoint.push_back(max*3/4);
00155                 _ctFunVectorPoint.push_back(max*4/4);
00156 
00157                 _ctFunVectorRed.clear();
00158                 _ctFunVectorRed.push_back(0.0);
00159                 _ctFunVectorRed.push_back(1.0);
00160                 _ctFunVectorRed.push_back(0.0);
00161                 _ctFunVectorRed.push_back(0.0);
00162                 _ctFunVectorRed.push_back(0.0);
00163 
00164                 _ctFunVectorGreen.clear();
00165                 _ctFunVectorGreen.push_back(0.0);
00166                 _ctFunVectorGreen.push_back(0.0);
00167                 _ctFunVectorGreen.push_back(0.0);
00168                 _ctFunVectorGreen.push_back(1.0);
00169                 _ctFunVectorGreen.push_back(0.2);
00170 
00171                 _ctFunVectorBlue.clear();
00172                 _ctFunVectorBlue.push_back(0.0);
00173                 _ctFunVectorBlue.push_back(0.0);
00174                 _ctFunVectorBlue.push_back(1.0);
00175                 _ctFunVectorBlue.push_back(0.0);
00176                 _ctFunVectorBlue.push_back(0.0);
00177 
00178 
00179                 if(_ctfun==NULL){
00180                         _ctfun = vtkColorTransferFunction::New();
00181                 }
00182                 _ctfun->RemoveAllPoints();
00183 
00184                 int i,size=_ctFunVectorPoint.size();
00185                 for (i=0;i<size;i++)
00186                 {
00187                         _ctfun->AddRGBPoint( _ctFunVectorPoint[i] , _ctFunVectorRed[i],_ctFunVectorGreen[i],_ctFunVectorBlue[i]);
00188                         
00189                 }
00190         /*
00191                 _ctfun->AddRGBPoint( 100 ,0 ,0,0);
00192                 _ctfun->AddRGBPoint( 200 ,1 ,0,0);
00193                 _ctfun->AddRGBPoint( 300 ,0 ,1,0);
00194                 _ctfun->AddRGBPoint( 400 ,0 ,0,1);
00195         */
00196         //      void *p=this; // JPRx
00197 
00198         // Create the first of the three planes. The filter vtkImageMapToColors
00199         // maps the data through the corresponding lookup table created above.  The
00200         // vtkImageActor is a type of vtkProp and conveniently displays an image on
00201         // a single quadrilateral plane. It does this using texture mapping and as
00202         // a result is quite fast. (Note: the input image has to be unsigned char
00203         // values, which the vtkImageMapToColors produces.) Note also that by
00204         // specifying the DisplayExtent, the pipeline requests data of this extent
00205         // and the vtkImageMapToColors only processes a slice of data.
00206                 
00207                 if(_saggitalColors==NULL){
00208                         _saggitalColors = vtkImageMapToColors::New();
00209                 }
00210                 _saggitalColors->RemoveAllInputs();
00211                 _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
00212                 
00213         //    _saggitalColors->SetLookupTable(_bwLut);
00214                 
00215                 _saggitalColors->SetLookupTable(_ctfun);
00216                 
00217 
00218                 if(_saggital==NULL){
00219                         _saggital = vtkImageActor::New();
00220                         _saggital->SetInput(_saggitalColors->GetOutput());
00221                 }       
00222                 //_saggitalColors->Update();
00223         
00224 
00225 
00226         // Create the second (axial) plane of the three planes. We use the
00227         // same approach as before except that the extent differs.
00228 
00229                 
00230                 if(_axialColors==NULL){
00231                         _axialColors = vtkImageMapToColors::New();
00232                 }
00233 
00234                 _axialColors->RemoveAllInputs();
00235                 _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
00236         //    _axialColors->SetLookupTable(_hueLut);
00237                 _axialColors->SetLookupTable(_ctfun);
00238 
00239                 if(_axial==NULL){
00240                         _axial = vtkImageActor::New();
00241                         _axial->SetInput(_axialColors->GetOutput());
00242                 }
00243                 
00244                 //_axialColors->Update();
00245         
00246 
00247                 // Create the third (coronal) plane of the three planes. We use 
00248         // the same approach as before except that the extent differs.
00249                 if(_coronalColors==NULL){
00250                         _coronalColors = vtkImageMapToColors::New();
00251                 }
00252                 _coronalColors->RemoveAllInputs();
00253                 _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
00254         //    _coronalColors->SetLookupTable(_satLut);
00255                 _coronalColors->SetLookupTable(_ctfun);
00256 
00257                 if(_coronal==NULL){
00258                         _coronal = vtkImageActor::New();
00259                         _coronal->SetInput(_coronalColors->GetOutput());
00260                 }
00261                 
00262         
00263 
00264         // An outline provides context around the data.
00265         //
00266                 if(_outlineData==NULL){
00267                         _outlineData = vtkOutlineFilter::New();
00268                 }
00269                 _outlineData->RemoveAllInputs();
00270                 if(_vtkmprbasedata->GetImageData()){
00271                         _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
00272                 }
00273 
00274                 if(_mapOutline==NULL){
00275                         _mapOutline = vtkPolyDataMapper::New();
00276                         _mapOutline->SetInput(_outlineData->GetOutput());
00277                 }
00278                 _mapOutline->Update();    
00279                 //_mapOutline->RemoveAllInputs();
00280         
00281                 if(_outline==NULL){
00282                         _outline = vtkActor::New();
00283                         _outline->SetMapper(_mapOutline);
00284                         _outline->GetProperty()->SetColor(0,0,0);
00285                 }
00286         }
00287         
00288         
00289 
00290         
00291         
00292     
00293 
00294         //int ext[6];
00295         //_vtkmprbasedata->GetImageData()->GetExtent(ext);
00296 
00297         
00298 
00299 
00300 }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< double > * vtkMPR3DDataViewer::GetctFunVectorBlue (  ) 

Definition at line 108 of file vtkMPR3DDataViewer.cxx.

References _ctFunVectorBlue.

Referenced by wxVtkMPR3DViewCntrlPanel::OnEditColorTable().

00109 {
00110         return &_ctFunVectorBlue;
00111 }

Here is the caller graph for this function:

std::vector< double > * vtkMPR3DDataViewer::GetctFunVectorGreen (  ) 

Definition at line 102 of file vtkMPR3DDataViewer.cxx.

References _ctFunVectorGreen.

Referenced by wxVtkMPR3DViewCntrlPanel::OnEditColorTable().

00103 {
00104         return &_ctFunVectorGreen;
00105 }

Here is the caller graph for this function:

std::vector< double > * vtkMPR3DDataViewer::GetctFunVectorPoint (  ) 

Definition at line 91 of file vtkMPR3DDataViewer.cxx.

References _ctFunVectorPoint.

Referenced by wxVtkMPR3DViewCntrlPanel::OnEditColorTable().

00092 {
00093         return &_ctFunVectorPoint;
00094 }

Here is the caller graph for this function:

std::vector< double > * vtkMPR3DDataViewer::GetctFunVectorRed (  ) 

Definition at line 96 of file vtkMPR3DDataViewer.cxx.

References _ctFunVectorRed.

Referenced by wxVtkMPR3DViewCntrlPanel::OnEditColorTable().

00097 {
00098         return &_ctFunVectorRed;
00099 }

Here is the caller graph for this function:

vtkImageActor * vtkMPR3DDataViewer::GetImageActor ( int  id  ) 

Definition at line 49 of file vtkMPR3DDataViewer.cxx.

References GetvtkActor_axial(), GetvtkActor_coronal(), and GetvtkActor_saggital().

Referenced by wxVtkMPR3DView::VisibleImageActor().

00050 {
00051         vtkImageActor *tmpVtkActor=NULL;
00052         if (id==0){
00053                 tmpVtkActor = GetvtkActor_saggital();
00054         }
00055         if (id==1){
00056                 tmpVtkActor = GetvtkActor_coronal();
00057         }
00058         if (id==2){
00059                 tmpVtkActor = GetvtkActor_axial();
00060         }
00061         return tmpVtkActor;
00062 }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkActor * vtkMPR3DDataViewer::GetOutlineActor (  ) 

Definition at line 44 of file vtkMPR3DDataViewer.cxx.

References _outline.

Referenced by wxVtkMPR3DView::Configure(), and wxVtkMPR3DView::showOutlineActor().

00045 {
00046         return _outline;
00047 }

Here is the caller graph for this function:

bool vtkMPR3DDataViewer::GetVisiblePosition ( int  idPosition  ) 

Definition at line 348 of file vtkMPR3DDataViewer.cxx.

References _visiblePosition.

Referenced by wxVtkMPR3DView::VisibleImageActor().

00349 {
00350         return _visiblePosition[idPosition];
00351 }

Here is the caller graph for this function:

vtkImageActor * vtkMPR3DDataViewer::GetvtkActor_axial (  ) 

Definition at line 313 of file vtkMPR3DDataViewer.cxx.

References _axial.

Referenced by GetImageActor().

00314 {
00315         return _axial;
00316 }

Here is the caller graph for this function:

vtkImageActor * vtkMPR3DDataViewer::GetvtkActor_coronal (  ) 

Definition at line 308 of file vtkMPR3DDataViewer.cxx.

References _coronal.

Referenced by GetImageActor().

00309 {
00310         return _coronal;
00311 }

Here is the caller graph for this function:

vtkImageActor * vtkMPR3DDataViewer::GetvtkActor_saggital (  ) 

Definition at line 303 of file vtkMPR3DDataViewer.cxx.

References _saggital.

Referenced by GetImageActor().

00304 {
00305         return _saggital;
00306 }

Here is the caller graph for this function:

vtkColorTransferFunction * vtkMPR3DDataViewer::GetvtkColorTransferFunction (  ) 

Definition at line 85 of file vtkMPR3DDataViewer.cxx.

References _ctfun.

Referenced by wxVtkMPR3DViewCntrlPanel::OnEditColorTable().

00086 {
00087         return _ctfun;
00088 }

Here is the caller graph for this function:

vtkMPRBaseData * vtkMPR3DDataViewer::GetVtkMPRBaseData (  ) 
void vtkMPR3DDataViewer::Refresh (  )  [virtual]

Definition at line 64 of file vtkMPR3DDataViewer.cxx.

References _vtkmprbasedata, vtkMPRBaseData::GetX(), vtkMPRBaseData::GetY(), vtkBaseData::GetZ(), SetPositionX(), SetPositionY(), and SetPositionZ().

00065 {
00066         int x = (int)(_vtkmprbasedata->GetX());
00067         int y = (int)(_vtkmprbasedata->GetY());
00068         int z = (int)(_vtkmprbasedata->GetZ());
00069         SetPositionX( x );
00070         SetPositionY( y );
00071         SetPositionZ( z );
00072 }

Here is the call graph for this function:

void vtkMPR3DDataViewer::setColorTransferFunction ( vtkColorTransferFunction *  colortable  ) 

Definition at line 353 of file vtkMPR3DDataViewer.cxx.

References _axialColors, _coronalColors, and _saggitalColors.

Referenced by wxVtkMPR3DView::setColorTransferFunction().

00353                                                                                      {
00354         if(_saggitalColors){
00355                 _saggitalColors->SetLookupTable(colortable);
00356                 _coronalColors->SetLookupTable(colortable);
00357                 _axialColors->SetLookupTable(colortable);
00358         }
00359 }

Here is the caller graph for this function:

void vtkMPR3DDataViewer::SetPositionX ( int  pos  ) 

Definition at line 319 of file vtkMPR3DDataViewer.cxx.

References _saggital, _vtkmprbasedata, and vtkMPRBaseData::GetDimensionExtention().

Referenced by Refresh().

00319                                             {
00320         int x1,x2,y1,y2,z1,z2;
00321         _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
00322         if(_saggital){
00323                 _saggital->SetDisplayExtent( pos , pos , y1 ,y2 , z1 , z2 );
00324         }
00325 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkMPR3DDataViewer::SetPositionY ( int  pos  ) 

Definition at line 327 of file vtkMPR3DDataViewer.cxx.

References _coronal, _vtkmprbasedata, and vtkMPRBaseData::GetDimensionExtention().

Referenced by Refresh().

00327                                             {
00328         int x1,x2,y1,y2,z1,z2;
00329         _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
00330         if(_coronal){
00331                 _coronal->SetDisplayExtent(x1,x2, pos,pos, z1,z2);
00332         }
00333 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkMPR3DDataViewer::SetPositionZ ( int  pos  ) 

Definition at line 335 of file vtkMPR3DDataViewer.cxx.

References _axial, _vtkmprbasedata, and vtkMPRBaseData::GetDimensionExtention().

Referenced by Refresh().

00335                                             {
00336         int x1,x2,y1,y2,z1,z2;
00337         _vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
00338         if(_axial){
00339                 _axial->SetDisplayExtent(x1,x2, y1,y2, pos,pos);
00340         }
00341 }

Here is the call graph for this function:

Here is the caller graph for this function:

void vtkMPR3DDataViewer::SetVisiblePosition ( int  idPosition,
bool  visible 
)

Definition at line 343 of file vtkMPR3DDataViewer.cxx.

References _visiblePosition.

Referenced by wxVtkMPR3DView::VisibleImageActor().

00344 {
00345         _visiblePosition[idPosition]=visible;
00346 }

Here is the caller graph for this function:

void vtkMPR3DDataViewer::SetVtkMPRBaseData ( vtkMPRBaseData vtkmprbasedata  ) 

Member Data Documentation

vtkImageActor* vtkMPR3DDataViewer::_axial [private]
vtkImageMapToColors* vtkMPR3DDataViewer::_axialColors [private]
vtkImageActor* vtkMPR3DDataViewer::_coronal [private]
vtkImageMapToColors* vtkMPR3DDataViewer::_coronalColors [private]
vtkColorTransferFunction* vtkMPR3DDataViewer::_ctfun [private]
std::vector<double> vtkMPR3DDataViewer::_ctFunVectorBlue [private]

Definition at line 54 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), and GetctFunVectorBlue().

std::vector<double> vtkMPR3DDataViewer::_ctFunVectorGreen [private]

Definition at line 53 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), and GetctFunVectorGreen().

std::vector<double> vtkMPR3DDataViewer::_ctFunVectorPoint [private]

Definition at line 51 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), and GetctFunVectorPoint().

std::vector<double> vtkMPR3DDataViewer::_ctFunVectorRed [private]

Definition at line 52 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), and GetctFunVectorRed().

vtkPolyDataMapper* vtkMPR3DDataViewer::_mapOutline [private]

Definition at line 46 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), vtkMPR3DDataViewer(), and ~vtkMPR3DDataViewer().

vtkActor* vtkMPR3DDataViewer::_outline [private]
vtkOutlineFilter* vtkMPR3DDataViewer::_outlineData [private]

Definition at line 45 of file vtkMPR3DDataViewer.h.

Referenced by Configure(), vtkMPR3DDataViewer(), and ~vtkMPR3DDataViewer().

vtkImageActor* vtkMPR3DDataViewer::_saggital [private]
vtkImageMapToColors* vtkMPR3DDataViewer::_saggitalColors [private]

Definition at line 42 of file vtkMPR3DDataViewer.h.

Referenced by GetVisiblePosition(), SetVisiblePosition(), and vtkMPR3DDataViewer().


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

Generated on 20 Oct 2010 for creaMaracasVisu_lib by  doxygen 1.6.1