wxMaracasIRMViewManagerDataMhd Class Reference

#include <wxMaracasIRMViewManagerDataMhd.h>

Inheritance diagram for wxMaracasIRMViewManagerDataMhd:

Inheritance graph
[legend]
Collaboration diagram for wxMaracasIRMViewManagerDataMhd:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxMaracasIRMViewManagerDataMhd (vtkImageData *imagedata, std::string dataname="")
 ~wxMaracasIRMViewManagerDataMhd ()
void setVtkImageData (vtkImageData *imagedata)
void changeIsoValue (double value)
void checkInvariant ()
int getMaxGreyLevel ()
void contourExtractor (int isovalue)
void setProp3D (vtkProp3D *prop3D)
void changeOpacity (int value)
vtkProp3D * getProp3D ()
int getId ()
void setId (int propid)
std::string getDataname ()
void setDataname (std::string dataname)
void changeColor (double red, double green, double blue)

Protected Attributes

vtkProp3D * _prop3D
std::string _dataname

Private Member Functions

int getMaxLevel (vtkImageData *img)

Private Attributes

vtkImageData * _imagedata
int _maxgreylevel
vtkMarchingCubes * _cubesFilter
vtkCleanPolyData * _cleanFilter
vtkPolyDataMapper * _dataMapper


Detailed Description

Definition at line 12 of file wxMaracasIRMViewManagerDataMhd.h.


Constructor & Destructor Documentation

wxMaracasIRMViewManagerDataMhd::wxMaracasIRMViewManagerDataMhd ( vtkImageData *  imagedata,
std::string  dataname = "" 
)

Definition at line 4 of file wxMaracasIRMViewManagerDataMhd.cxx.

References _cleanFilter, _cubesFilter, _dataMapper, wxMaracasIRMViewManagerData::_dataname, _maxgreylevel, wxMaracasIRMViewManagerData::_prop3D, changeIsoValue(), getMaxLevel(), and setVtkImageData().

00005 : wxMaracasIRMViewManagerData(NULL, dataname)
00006 {
00007 
00008         this->setVtkImageData(imagedata);
00009         _dataname = dataname;
00010         
00011         _maxgreylevel = getMaxLevel(imagedata);
00012         _prop3D=NULL;                   
00013 
00014         _cubesFilter = vtkMarchingCubes::New();
00015         _cleanFilter = vtkCleanPolyData::New();         
00016         _dataMapper = vtkPolyDataMapper::New();
00017         vtkActor* dataActor = vtkActor::New();
00018         
00019         _cubesFilter->SetInput(this->_imagedata);
00020         _cubesFilter->ComputeGradientsOn ();
00021         _cubesFilter->ComputeScalarsOn ();
00022         _cubesFilter->SetNumberOfContours( 1 );
00023         _cleanFilter->SetInput ( _cubesFilter->GetOutput() );
00024         _dataMapper->SetInput(_cleanFilter->GetOutput());
00025         _dataMapper->ScalarVisibilityOff();
00026         _dataMapper->ImmediateModeRenderingOn();
00027         dataActor->SetMapper(_dataMapper);      
00028 
00029         this->_prop3D = dataActor;
00030 
00031         this->changeIsoValue(this->_maxgreylevel);      
00032 
00033 
00034 }

Here is the call graph for this function:

wxMaracasIRMViewManagerDataMhd::~wxMaracasIRMViewManagerDataMhd (  ) 

Definition at line 36 of file wxMaracasIRMViewManagerDataMhd.cxx.

References _cleanFilter, _cubesFilter, and _dataMapper.

00036                                                                {        
00037         _cubesFilter->Delete();
00038         _cleanFilter->Delete();
00039         _dataMapper->Delete();
00040 }


Member Function Documentation

void wxMaracasIRMViewManagerDataMhd::setVtkImageData ( vtkImageData *  imagedata  ) 

Adds a prop3D to the world of the application

Sets the VTK image data

Definition at line 89 of file wxMaracasIRMViewManagerDataMhd.cxx.

References _imagedata.

Referenced by wxMaracasIRMViewManagerDataMhd().

00089                                                                            {
00090         _imagedata = imagedata;
00091 }

Here is the caller graph for this function:

void wxMaracasIRMViewManagerDataMhd::changeIsoValue ( double  value  ) 

changes the isovalue in a prop3D

Definition at line 46 of file wxMaracasIRMViewManagerDataMhd.cxx.

References _cleanFilter, _cubesFilter, and _dataMapper.

Referenced by wxMaracasIRMViewManagerDataMhd().

00046                                                                {        
00047                 
00048    
00049     _cubesFilter->SetValue(0,value);            
00050         _cubesFilter->Update();    
00051         _cleanFilter->Update();
00052         _dataMapper->Update();  
00053         
00054         
00055         
00056 }

Here is the caller graph for this function:

void wxMaracasIRMViewManagerDataMhd::checkInvariant (  ) 

Check if the variables are setted correctly

Reimplemented from wxMaracasIRMViewManagerData.

int wxMaracasIRMViewManagerDataMhd::getMaxGreyLevel (  ) 

Returns the grey max level of the image

Definition at line 57 of file wxMaracasIRMViewManagerDataMhd.cxx.

References _maxgreylevel.

00057                                                    {
00058         return _maxgreylevel;
00059 }

void wxMaracasIRMViewManagerDataMhd::contourExtractor ( int  isovalue  ) 

creates the image

Reimplemented from wxMaracasIRMViewManagerData.

int wxMaracasIRMViewManagerDataMhd::getMaxLevel ( vtkImageData *  img  )  [private]

Get's the max grey level of the image

Definition at line 64 of file wxMaracasIRMViewManagerDataMhd.cxx.

Referenced by wxMaracasIRMViewManagerDataMhd().

00064                                                                 {
00065 
00066         int ext[6], i, j, k,max=0;
00067         img->GetExtent(ext);
00068 
00069         for(i = ext[0]; i < ext[1];i++){
00070                 for(j = ext[2]; j < ext[3];j++){
00071                         for(k = ext[4]; k < ext[5];k++){
00072                 unsigned short* ptr = (unsigned short*)img->GetScalarPointer(i,j,k);
00073                                 int temp = (int)*ptr;
00074                                 if(temp > max){
00075                     max = temp;
00076                                 }
00077                         }
00078                 }
00079         }
00080         return max;
00081 
00082 
00083 }

Here is the caller graph for this function:

void wxMaracasIRMViewManagerData::setProp3D ( vtkProp3D *  prop3D  )  [inherited]

Adds a prop3D to the world of the application

Definition at line 24 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_prop3D.

00024                                                             {
00025         _prop3D = prop3D;
00026 }

void wxMaracasIRMViewManagerData::changeOpacity ( int  value  )  [inherited]

Changes the opacity in a prop3D

Definition at line 30 of file wxMaracasIRMViewManagerData.cxx.

Referenced by wxMaracasIRMViewManager::changeOpacity().

00030                                                         {
00031         std::cout<<"chage op"<<value<<std::endl;
00032         vtkActor* actor = (vtkActor*)this->_prop3D;     
00033         actor->GetProperty()->SetOpacity((double)value/100.0);
00034 
00035         
00036 
00037 }

Here is the caller graph for this function:

vtkProp3D * wxMaracasIRMViewManagerData::getProp3D (  )  [inherited]

get the prop3D

Definition at line 52 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_prop3D.

Referenced by wxMaracasIRMViewManager::addProp3D(), wxMaracasIRMViewManager::addPropMHD(), and wxMaracasIRMViewManager::addRemoveActor().

00052                                                  {
00053         return this->_prop3D;
00054 }

Here is the caller graph for this function:

int wxMaracasIRMViewManagerData::getId (  )  [inherited]

return the id from the daat

Definition at line 58 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_id.

Referenced by wxMaracasIRMViewManager::addProp3D(), and wxMaracasIRMViewManager::addPropMHD().

00058                                       {
00059         return _id;
00060 }

Here is the caller graph for this function:

void wxMaracasIRMViewManagerData::setId ( int  propid  )  [inherited]

set data id

Definition at line 64 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_id.

Referenced by wxMaracasIRMViewManager::addProp3D(), and wxMaracasIRMViewManager::addPropMHD().

00064                                                  {
00065         _id = propid;
00066 }

Here is the caller graph for this function:

std::string wxMaracasIRMViewManagerData::getDataname (  )  [inherited]

Get the filanme

Definition at line 71 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_dataname.

00071                                                   {
00072         return _dataname;
00073 }

void wxMaracasIRMViewManagerData::setDataname ( std::string  dataname  )  [inherited]

Set the filanme

Definition at line 77 of file wxMaracasIRMViewManagerData.cxx.

References wxMaracasIRMViewManagerData::_dataname.

00077                                                                {
00078         _dataname = dataname;
00079 }

void wxMaracasIRMViewManagerData::changeColor ( double  red,
double  green,
double  blue 
) [inherited]

Changes the color of the actor

Definition at line 38 of file wxMaracasIRMViewManagerData.cxx.

Referenced by wxMaracasIRMViewManager::changeColor().

00038                                                                                   {
00039         std::cout<<"chage col"<<red<<green<<blue<<std::endl;
00040     vtkActor* actor = (vtkActor*)this->_prop3D; 
00041         actor->GetProperty()->SetColor(red,green,blue); 
00042 }

Here is the caller graph for this function:


Member Data Documentation

vtkImageData* wxMaracasIRMViewManagerDataMhd::_imagedata [private]

Definition at line 47 of file wxMaracasIRMViewManagerDataMhd.h.

Referenced by setVtkImageData().

int wxMaracasIRMViewManagerDataMhd::_maxgreylevel [private]

Definition at line 48 of file wxMaracasIRMViewManagerDataMhd.h.

Referenced by getMaxGreyLevel(), and wxMaracasIRMViewManagerDataMhd().

vtkMarchingCubes* wxMaracasIRMViewManagerDataMhd::_cubesFilter [private]

to the image render

Definition at line 53 of file wxMaracasIRMViewManagerDataMhd.h.

Referenced by changeIsoValue(), wxMaracasIRMViewManagerDataMhd(), and ~wxMaracasIRMViewManagerDataMhd().

vtkCleanPolyData* wxMaracasIRMViewManagerDataMhd::_cleanFilter [private]

Definition at line 54 of file wxMaracasIRMViewManagerDataMhd.h.

Referenced by changeIsoValue(), wxMaracasIRMViewManagerDataMhd(), and ~wxMaracasIRMViewManagerDataMhd().

vtkPolyDataMapper* wxMaracasIRMViewManagerDataMhd::_dataMapper [private]

Definition at line 55 of file wxMaracasIRMViewManagerDataMhd.h.

Referenced by changeIsoValue(), wxMaracasIRMViewManagerDataMhd(), and ~wxMaracasIRMViewManagerDataMhd().

vtkProp3D* wxMaracasIRMViewManagerData::_prop3D [protected, inherited]

Prop 3D (data actor)

Definition at line 66 of file wxMaracasIRMViewManagerData.h.

Referenced by wxMaracasIRMViewManagerData::getProp3D(), wxMaracasIRMViewManagerData::setProp3D(), wxMaracasIRMViewManagerData::wxMaracasIRMViewManagerData(), wxMaracasIRMViewManagerDataMhd(), and wxMaracasIRMViewManagerData::~wxMaracasIRMViewManagerData().

std::string wxMaracasIRMViewManagerData::_dataname [protected, inherited]

Dataname given by the user (ex. filename)

Definition at line 70 of file wxMaracasIRMViewManagerData.h.

Referenced by wxMaracasIRMViewManagerData::getDataname(), wxMaracasIRMViewManagerData::setDataname(), wxMaracasIRMViewManagerData::wxMaracasIRMViewManagerData(), and wxMaracasIRMViewManagerDataMhd().


The documentation for this class was generated from the following files:
Generated on Wed Jul 29 16:36:20 2009 for creaMaracasVisu_lib by  doxygen 1.5.3