class describing an axe in Maracas More...
#include <marAxis.h>
Public Types | |
enum | AxisStateVectorIndexes { INDX_X = 0, INDX_Y, INDX_Z, INDX_V1X, INDX_V1Y, INDX_V1Z, INDX_V2X, INDX_V2Y, INDX_V2Z, INDX_V3X, INDX_V3Y, INDX_V3Z, INDX_LAMBDA1, INDX_LAMBDA2, INDX_LAMBDA3, INDX_MASSE, INDX_RAYON, INDX_INERTIE, INDX_PTAGEMASSE, INDX_PTAGERAYON, INDX_SIGNALVALUE, INDX_count } |
Public Member Functions | |
marAxis (marParameters *p=NULL) | |
~marAxis () | |
std::string & | getDescription () |
void | setDescription (std::string &d) |
void | addAxisPoint (double *p) |
void | changeAxisResolution () |
void | calculateSignal (kVolume *vol) |
int | getActualQuant () |
float | getSignal (uint slice) |
double * | getSplinePoint (uint i) |
int | getHealthySlice () |
int | getHealthySliceStart () |
int | getHealthySliceEnd () |
void | setActualQuant (int act) |
void | setHealthySlice (int hsS, int hs, int hsE) |
void | setStartQuant (int sq) |
void | setFinishQuant (int fq) |
int | getStartQuant () |
int | getFinishQuant () |
void | start () |
void | next () |
void | stop () |
bool | isFinished () |
void | doSpline () |
void | cut (int slice, bool up) |
void | sliceVolumeAxis (kVolume *vol, bool forceCnt=true) |
double * | getNormal (unsigned int slice) |
int | getNumberOfContours () |
int | getNumberOfSplinePoints () |
bool | if3DcontourExist (int i) |
void | Save3Dcontour (FILE *ff, int i) |
void | SaveExisting3DContours (FILE *ff) |
marContour * | getContour (int i, kVolume *vol) |
kVolume * | getSlice (int i, kVolume *vol) |
vtkProbeFilter * | get3DSlice (int i, kVolume *vol) |
vtkPoints * | get3Dcontour (int i, kVolume *vol) |
vtkImageData * | getSliceImage (int i, kVolume *vol) |
vtkPolyData * | get2Dcontour (int i, kVolume *vol) |
vtkPoints * | get2DDiameterMin (int i, kVolume *vol) |
vtkPoints * | get2DDiameterMax (int i, kVolume *vol) |
void | replaceContour2D (int i, int size, double *vx, double *vy) |
void | EraseContour (int i) |
void | createEmptyVectors () |
void | clearAllVectors () |
void | eraseContourVectorsContent () |
void | set_points_disc (PPPOINTAXE p) |
double | getTotalLength () |
double | getSubAxisLength () |
double | getReferenceArea (kVolume *vol) |
double | getReferenceAverDiam (kVolume *vol) |
double | getAverageArea (int pIni, int pEnd, kVolume *vol) |
void | reset () |
void | copyFrom (const marObject &from) |
bool | save (std::ofstream &os) |
bool | load (std::ifstream &is) |
vtkPolyData * | Draw () |
vtkPolyData * | GetAxisData () |
void | Delete () |
double * | getPoints (int i) |
void | AddPointToList (double x, double y, double z, int signal) |
void | setParameters (marParameters *p) |
void | copyParameters (marParameters *p) |
void | makeACopyParameters () |
marParameters * | getParameters () |
bool | parametersOwned () |
virtual void | copyFrom (const marObject &from)=0 |
bool | save (std::string &nw) |
bool | load (std::string &nr) |
Protected Attributes | |
std::vector< marAxisContours * > | quantContours |
std::vector< marPoint * > | vesselPoints |
std::vector< marIsocontour * > | lumenContour |
bool | calibration |
Private Member Functions | |
void | calculateTotalAxisLenght () |
void | calculateSubAxisLength () |
void | calculateReferenceArea (kVolume *vol) |
void | calculateReferenceAverDiam (kVolume *vol) |
void | createContour (int i, kVolume *vol) |
void | createSlice (int i, kVolume *vol) |
void | create3DSlice (int i, kVolume *vol) |
void | create3Dcontour (int i, kVolume *vol) |
void | createSliceImage (int i, kVolume *vol) |
void | create2Dcontour (int i, kVolume *vol) |
void | create2DDiameterMin (int i, kVolume *vol) |
void | create2DDiameterMax (int i, kVolume *vol) |
double | getAxisLenght (int pIni, int pEnd) |
Private Attributes | |
double | _totalAxisLenght |
double | _subAxisLenght |
double | _referenceArea |
double | _referenceAverDiam |
std::string | _description |
std::vector< double * > | _points |
std::vector< marContour * > | _contours |
std::vector< kVolume * > | _slices |
std::vector< vtkProbeFilter * > | _3Dslices |
std::vector< vtkPoints * > | _3Dcontour |
std::vector< vtkImageData * > | _quantificationImages |
std::vector< vtkPolyData * > | _2Dcontours |
std::vector< vtkPoints * > | _2DDiameterMin |
std::vector< vtkPoints * > | _2DDiameterMax |
std::vector< int > | _signal |
int | _healthySlice |
int | _healthySliceStart |
int | _healthySliceEnd |
int | _startQuant |
int | _finishQuant |
int | _actualQuant |
PPPOINTAXE | _points_disc |
vtkPolyData * | _allData |
class describing an axe in Maracas
Definition at line 43 of file marAxis.h.
An enum.
More detailed enum description.
Definition at line 52 of file marAxis.h.
00053 { 00054 INDX_X = 0, 00055 INDX_Y, 00056 INDX_Z, 00057 INDX_V1X, 00058 INDX_V1Y, 00059 INDX_V1Z, 00060 INDX_V2X, 00061 INDX_V2Y, 00062 INDX_V2Z, 00063 INDX_V3X, 00064 INDX_V3Y, 00065 INDX_V3Z, 00066 INDX_LAMBDA1, 00067 INDX_LAMBDA2, 00068 INDX_LAMBDA3, 00069 INDX_MASSE, 00070 INDX_RAYON, 00071 INDX_INERTIE, 00072 INDX_PTAGEMASSE, 00073 INDX_PTAGERAYON, 00074 INDX_SIGNALVALUE, 00075 INDX_count 00076 };
marAxis::marAxis | ( | marParameters * | p = NULL |
) |
Cstor
Definition at line 50 of file marAxis.cpp.
References _allData, _healthySliceEnd, _healthySliceStart, _referenceArea, _referenceAverDiam, _subAxisLenght, _totalAxisLenght, calibration, and reset().
00050 : 00051 marObject( p ), 00052 kCurve( 3, INDX_count - 3 ), 00053 _healthySlice( -1 ), _startQuant( -1 ), 00054 _finishQuant( -1 ), _actualQuant( -1 ) 00055 00056 { 00057 _totalAxisLenght=-1; 00058 _subAxisLenght=-1; 00059 _referenceArea=-1; 00060 _referenceAverDiam=-1; 00061 00062 00063 _allData = NULL; 00064 00065 _healthySliceStart=-1; 00066 _healthySliceEnd=-1; 00067 reset( ); 00068 calibration = false; 00069 }
marAxis::~marAxis | ( | ) | [inline] |
Destructor
Definition at line 88 of file marAxis.h.
References marObject::reset().
00088 { reset( ); };
void marAxis::addAxisPoint | ( | double * | p | ) |
Add a point to the axis
Definition at line 72 of file marAxis.cpp.
References INDX_count, and INDX_SIGNALVALUE.
Referenced by marExperiment::extractVascularTree().
00073 { 00074 double pt[ INDX_count ]; 00075 00076 memcpy( pt, p, sizeof( POINTAXE ) ); 00077 pt[ INDX_SIGNALVALUE ] = 0; 00078 addControlPoint( pt, pt + 3 ); 00079 }
void marAxis::AddPointToList | ( | double | x, | |
double | y, | |||
double | z, | |||
int | signal | |||
) |
Definition at line 1539 of file marAxis.cpp.
References _points, and _signal.
Referenced by wxMaracas_ManualTree_MPRDlg::ExportPoints().
01540 { 01541 double *p; 01542 p=(double *)malloc(sizeof(double)*3); 01543 p[0]=x; 01544 p[1]=y; 01545 p[2]=z; 01546 _points.push_back( p ); 01547 _signal.push_back( signal ); 01548 }
void marAxis::calculateReferenceArea | ( | kVolume * | vol | ) | [private] |
Definition at line 1313 of file marAxis.cpp.
References _healthySliceEnd, _healthySliceStart, _referenceArea, and getAverageArea().
Referenced by getReferenceArea().
01313 { 01314 _referenceArea = getAverageArea(_healthySliceStart,_healthySliceEnd, vol); 01315 }
void marAxis::calculateReferenceAverDiam | ( | kVolume * | vol | ) | [private] |
Definition at line 1324 of file marAxis.cpp.
References _healthySliceEnd, _healthySliceStart, _referenceAverDiam, and getContour().
Referenced by getReferenceAverDiam().
01324 { 01325 marContour *marcontourHealthy; 01326 int ihealthySlice; 01327 double acumDiam=0; 01328 for (ihealthySlice=_healthySliceStart; ihealthySlice<=_healthySliceEnd; ihealthySlice++){ 01329 marcontourHealthy = getContour( ihealthySlice , vol ); 01330 acumDiam = acumDiam + marcontourHealthy->getAverageDiameter(); 01331 } 01332 _referenceAverDiam = acumDiam / (_healthySliceEnd-_healthySliceStart+1); 01333 }
void marAxis::calculateSignal | ( | kVolume * | vol | ) |
PSIGNAL_USHORT <-> unsigned short *
Definition at line 130 of file marAxis.cpp.
References _points, _points_disc, _signal, marParameters::e_mask_size, and marObject::getParameters().
Referenced by marExperiment::extractVascularTree(), and marExperiment::RegenerateSignal().
00131 { 00135 /* PSIGNAL_FLOAT PutSignalValueFloat(PSIGNAL_FLOAT signal, int pos, float value) 00136 { 00137 signal[pos] = value; 00138 return signal; 00139 }*/ 00140 ushort maxlocal; 00141 double *p; 00142 00143 double rayon; 00144 unsigned int i, mask_size = getParameters( )-> getIntParam( marParameters::e_mask_size ); 00145 00146 while( _signal.size( ) > 0 ) _signal.pop_back( ); 00147 // Intensity signal 00148 00149 PSIGNAL_USHORT signal = ( PSIGNAL_USHORT ) IdSigAlloc( _points.size( ), SIG_USHORT ); 00150 for( i = 0; i < _points.size( ); i++ ) { 00151 p = _points[i]; 00152 rayon = RayonLocal( 00153 ( int ) ( p[ 0 ] ), 00154 ( int ) ( p[ 1 ] ), 00155 ( int ) ( p[ 2 ] ), 00156 _points_disc, getNumberOfControlPoints( )); 00157 00158 maxlocal = vol->GetMaxIntSphere2( p, rayon ); 00159 PutSignalValue( signal, i, maxlocal ); 00160 } // rof 00161 00162 PSIGNAL_FLOAT mask_signal = ( PSIGNAL_FLOAT )IdSigAlloc( mask_size, SIG_FLOAT ); 00163 00164 for( i = 0; i < mask_size; i++ ) 00165 PutSignalValueFloat( mask_signal, i, 1 ); 00166 00167 PSIGNAL_USHORT signalfilt = ( PSIGNAL_USHORT )IdSigAlloc( _points.size( ), SIG_USHORT ); 00168 signalfilt = MonSigConvolve( signal, mask_signal, signalfilt, 1.0 / ( double )mask_size, 0 ); 00169 for( i = 0; i < _points.size( ); i++ ){ 00170 _signal.push_back( GetSignalValue( signalfilt, i ) ); 00171 } 00172 IdSigFree( signal ); 00173 IdSigFree( mask_signal ); 00174 IdSigFree( signalfilt ); 00175 }
void marAxis::calculateSubAxisLength | ( | ) | [private] |
Definition at line 1288 of file marAxis.cpp.
References _finishQuant, _startQuant, _subAxisLenght, and getAxisLenght().
Referenced by getSubAxisLength().
01288 { 01289 _subAxisLenght = getAxisLenght( _startQuant , _finishQuant ); 01290 }
void marAxis::calculateTotalAxisLenght | ( | ) | [private] |
Definition at line 1276 of file marAxis.cpp.
References _points, _totalAxisLenght, and getAxisLenght().
Referenced by getTotalLength().
01276 { 01277 _totalAxisLenght = getAxisLenght( 0 , _points.size( ) ); 01278 }
void marAxis::changeAxisResolution | ( | ) |
Definition at line 107 of file marAxis.cpp.
00108 {/* 00109 int i; 00110 int nOut = ( int )ceil( 00111 getParameters( )-> 00112 getDoubleParam( marParameters::e_axis_discret_step ) 00113 * ( double )( GetNumberOfPoints( ) ) 00114 ); 00115 00116 i = GetNumberOfPoints( ); 00117 double d = getParameters( )-> 00118 getDoubleParam( marParameters::e_axis_discret_step ); 00119 00120 SetResolution( nOut ); 00121 for( i = 0; i < _contours.size( ); i++ ) 00122 delete _contours[ i ]; 00123 _contours.clear( ); 00124 for( i = 0; i < nOut; i++ ) 00125 _contours.push_back( new marContour( getParameters( ) ) ); 00126 */ 00127 }
void marAxis::clearAllVectors | ( | ) |
Definition at line 1051 of file marAxis.cpp.
References _2Dcontours, _2DDiameterMax, _2DDiameterMin, _3Dcontour, _3Dslices, _contours, _quantificationImages, and _slices.
Referenced by createEmptyVectors(), and Delete().
01052 { 01053 unsigned int i; 01054 01055 for (i=0;i<_contours.size();i++){ 01056 if (_contours[i]!=NULL) { // DATA-MODEL-2D 01057 delete _contours[i]; 01058 _contours[i]=NULL; 01059 } 01060 } 01061 _contours.clear(); 01062 01063 for (i=0;i<_slices.size();i++){ // DATA-MODEL-Voxel XxYx1 01064 if (_slices[i]!=NULL) { 01065 delete _slices[i]; 01066 _slices[i]=NULL; 01067 } 01068 } 01069 _slices.clear(); 01070 01071 01072 for (i=0;i<_3Dslices.size();i++){ // VISUALISATION_VTK 3D 01073 if (_3Dslices[i]!=NULL) { 01074 _3Dslices[i]->Delete(); 01075 _3Dslices[i]=NULL; 01076 } 01077 } 01078 _3Dslices.clear(); 01079 01080 for (i=0;i<_3Dcontour.size();i++){ // VISUALISATION_VTK 3D 01081 if (_3Dcontour[i]!=NULL) { 01082 _3Dcontour[i]->Delete(); 01083 _3Dcontour[i]=NULL; 01084 } 01085 } 01086 _3Dcontour.clear(); 01087 01088 for (i=0;i<_quantificationImages.size();i++){ // VISUALISATION_VTK 2D 01089 if (_quantificationImages[i]!=NULL) { 01090 // _quantificationImages[i]->Delete(); 01091 // _quantificationImages[i]=NULL; 01092 } 01093 } 01094 _quantificationImages.clear(); 01095 01096 for (i=0;i<_2Dcontours.size();i++){ // VISUALISATION_VTK 2D 01097 if (_2Dcontours[i]!=NULL) { 01098 // EED ??? This object was allready erased bye the VTK pipeline 01099 // _2Dcontours[i]->Delete(); 01100 _2Dcontours[i]=NULL; 01101 } 01102 } 01103 _2Dcontours.clear(); 01104 01105 for (i=0;i<_2DDiameterMin.size();i++){ // VISUALISATION_VTK 2D 01106 if (_2DDiameterMin[i]!=NULL) { 01107 _2DDiameterMin[i]->Delete() ; 01108 _2DDiameterMin[i]=NULL; 01109 } 01110 } 01111 _2DDiameterMin.clear(); 01112 01113 for (i=0;i<_2DDiameterMax.size();i++){ // VISUALISATION_VTK 2D 01114 if (_2DDiameterMax[i]!=NULL) { 01115 _2DDiameterMax[i]->Delete(); 01116 _2DDiameterMax[i]=NULL; 01117 } 01118 } 01119 _2DDiameterMax.clear(); 01120 01121 }
virtual void marObject::copyFrom | ( | const marObject & | from | ) | [pure virtual, inherited] |
void marAxis::copyFrom | ( | const marObject & | from | ) |
Definition at line 1373 of file marAxis.cpp.
void marObject::copyParameters | ( | marParameters * | p | ) | [inherited] |
Definition at line 42 of file marObject.cpp.
References marObject::_parameters, and marObject::_parametersCopied.
00043 { 00044 if( _parametersCopied && _parameters != NULL ) delete _parameters; 00045 _parameters = new marParameters( ); 00046 *_parameters = *p; 00047 _parametersCopied = true; 00048 }
void marAxis::create2Dcontour | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 901 of file marAxis.cpp.
References _2Dcontours, Delete(), marParameters::e_scale, marParameters::e_sigma, marParameters::e_threshold_isocontour, marParameters::getDoubleParam(), marObject::getParameters(), getSignal(), marParameters::getSizeIma(), and getSlice().
Referenced by get2Dcontour().
00902 { 00903 vtkImageData* imagedata; 00904 00905 double thr = getParameters( )->getDoubleParam( marParameters::e_threshold_isocontour ); 00906 int sizeIma = getParameters( )->getSizeIma( ); 00907 double localint = getSignal( i ); 00908 double sigma = getParameters( )->getDoubleParam( marParameters::e_sigma ); 00909 double threshold = localint * thr / 100.0; 00910 00911 int dimIma = ( int ) ( ( double ) sizeIma /getParameters( )->getDoubleParam( marParameters::e_scale ) ); 00912 int vmin = ( int )threshold; 00913 int vmax = ( int )threshold; 00914 00915 int x = -1; 00916 int y = -1; 00917 00918 x = ( x != -1 )? x: sizeIma / 2; 00919 y = ( y != -1 )? y: sizeIma / 2; 00920 00921 // Isocontour 00922 imagedata = (vtkImageData*) ((getSlice( i , vol ))->castVtk( )); 00923 double *range = imagedata->GetScalarRange(); 00924 00925 //vtkKitwareContourFilter* cntVTK = vtkKitwareContourFilter::New( ); 00926 vtkContourFilter* cntVTK = vtkContourFilter::New( ); 00927 cntVTK->SetInput( imagedata ); 00928 cntVTK->SetNumberOfContours( 1 ); 00929 //cntVTK->SetValue( 0, vmin ); 00930 cntVTK->SetValue( 0, (range[1]*thr/100) ); 00931 //cntVTK->SetValue( 1, vmax ); 00932 cntVTK->Update( ); 00933 00934 vtkCleanPolyData* cpd = vtkCleanPolyData::New( ); 00935 cpd->SetInput( cntVTK->GetOutput( ) ); 00936 cpd->ConvertLinesToPointsOff( ); 00937 cpd->Update( ); 00938 00939 vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( ); 00940 //conn->SetMaxRecursionDepth( 3000 ); 00941 00942 // PS -> //conn->SetInput( cntVTK->GetOutput( ) ); PS 00943 conn->SetInput( cpd->GetOutput( ) ); 00944 00945 conn->SetClosestPoint( x, y, 0 ); 00946 conn->SetExtractionModeToClosestPointRegion( ); 00947 conn->Update( ); 00948 00949 vtkCleanPolyData* cpd2 = vtkCleanPolyData::New( ); 00950 cpd2->SetInput( conn->GetOutput( ) ); 00951 cpd2->Update(); 00952 00953 vtkStripper* vtkstripper = vtkStripper::New( ); 00954 vtkstripper->SetInput( cpd2->GetOutput() ); 00955 vtkstripper->Update(); 00956 00957 vtkPolyData* polyDataResult = vtkstripper->GetOutput(); 00958 polyDataResult->Update( ); 00959 00960 cntVTK -> Delete(); 00961 cpd2 -> Delete(); 00962 cpd -> Delete(); 00963 conn -> Delete(); 00964 00965 /* 00966 // EED 27 Oct 2007 00967 double *p; 00968 int ii,size=polyDataResult->GetNumberOfPoints(); 00969 printf("EED marAxis::create2Dcontour size %d\n",size); 00970 for (ii=0;ii<size;ii++) 00971 { 00972 p=polyDataResult->GetPoint(ii); 00973 printf("EED marAxis::create2Dcontour %d >> %f %f %f\n",ii,p[0], p[1], p[2]); 00974 p[2]=-100; 00975 } 00976 00977 for (ii=0;ii<size;ii++) 00978 { 00979 p=polyDataResult->GetPoint(ii); 00980 printf("EED marAxis::create2Dcontour xxxxx %d >> %f %f %f\n",ii,p[0], p[1], p[2]); 00981 } 00982 */ 00983 00984 if ( _2Dcontours[i]!=NULL ) { _2Dcontours[i]->Delete(); } 00985 _2Dcontours[i]=polyDataResult; 00986 }
void marAxis::create2DDiameterMax | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 1011 of file marAxis.cpp.
References _2DDiameterMax, getContour(), marParameters::getDimIma(), marObject::getParameters(), and marParameters::getSizeIma().
Referenced by get2DDiameterMax().
01011 { 01012 double p1[2],p2[2]; 01013 marContour *marcontour=getContour(i,vol); 01014 marcontour->getMaximumLine(p1,p2); 01015 vtkPoints *_vtkPoints = vtkPoints::New(); 01016 int sizeIma = getParameters( )->getSizeIma( ); 01017 01018 double dimIma = getParameters( )->getDimIma( ); 01019 // EED 24 Dec 2007 01020 dimIma=sizeIma/3; 01021 01022 double factor=( float ) sizeIma / dimIma; 01023 p1[0]=p1[0]*factor+sizeIma/2; 01024 p1[1]=p1[1]*factor+sizeIma/2; 01025 p2[0]=p2[0]*factor+sizeIma/2; 01026 p2[1]=p2[1]*factor+sizeIma/2; 01027 _vtkPoints->InsertNextPoint( p1[0] , p1[1] , 1 ); 01028 _vtkPoints->InsertNextPoint( p2[0] , p2[1] , 1 ); 01029 if ( _2DDiameterMax[i]!=NULL ) { _2DDiameterMax[i]->Delete(); } 01030 _2DDiameterMax[i] = _vtkPoints; 01031 }
void marAxis::create2DDiameterMin | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 988 of file marAxis.cpp.
References _2DDiameterMin, getContour(), marParameters::getDimIma(), marObject::getParameters(), and marParameters::getSizeIma().
Referenced by get2DDiameterMin().
00988 { 00989 double p1[2],p2[2]; 00990 marContour *marcontour=getContour(i,vol); 00991 marcontour->getMinimumLine(p1,p2); 00992 vtkPoints *_vtkPoints = vtkPoints::New(); 00993 int sizeIma = getParameters( )->getSizeIma( ); 00994 00995 double dimIma = getParameters( )->getDimIma( ); 00996 00997 // EED 24 Dec 2007 00998 dimIma=sizeIma/3; 00999 01000 double factor=( float ) sizeIma / dimIma; 01001 p1[0]=p1[0]*factor+sizeIma/2; 01002 p1[1]=p1[1]*factor+sizeIma/2; 01003 p2[0]=p2[0]*factor+sizeIma/2; 01004 p2[1]=p2[1]*factor+sizeIma/2; 01005 _vtkPoints->InsertNextPoint( p1[0] , p1[1] , 1 ); 01006 _vtkPoints->InsertNextPoint( p2[0] , p2[1] , 1 ); 01007 if ( _2DDiameterMin[i]!=NULL ) { _2DDiameterMin[i]->Delete(); } 01008 _2DDiameterMin[i] = _vtkPoints; 01009 }
void marAxis::create3Dcontour | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 782 of file marAxis.cpp.
References _3Dcontour, _points, getContour(), and getNormal().
Referenced by get3Dcontour().
00783 { 00784 vtkPoints *_vtkPoints; 00785 double *o; 00786 double *n; 00787 vtkMatrix4x4* mat; 00788 vtkTransform* trans; 00789 double nn[3]; 00790 double c[3],p1[3],p2[3]; 00791 double nA,nB,nC; 00792 00793 _vtkPoints = vtkPoints::New(); 00794 o = _points[i]; 00795 n = getNormal( i ); 00796 mat = vtkMatrix4x4::New(); 00797 trans = vtkTransform::New(); 00798 00799 00800 nn[0]=n[0]; nn[1]=n[1]; nn[2]=n[2]; 00801 nC=sqrt( nn[0]*nn[0] + nn[1]*nn[1] + nn[2]*nn[2] ); 00802 nn[0]=nn[0]/nC; nn[1]=nn[1]/nC; nn[2]=nn[2]/nC; 00803 00804 vtkPlaneSource* pSource = vtkPlaneSource::New( ); 00805 pSource->SetOrigin( 0, 0 , 0 ); 00806 pSource->SetPoint1( 1, 0 , 0 ); 00807 pSource->SetPoint2( 0, 0 , 1.0 ); 00808 pSource->SetCenter( 0,0,0 ); 00809 pSource->SetNormal( nn[ 0 ], nn[ 1 ], nn[ 2 ] ); 00810 pSource->Update( ); 00811 // pSource->Update( ); 00812 pSource->GetOrigin(c); 00813 pSource->GetPoint1(p1); 00814 pSource->GetPoint2(p2); 00815 pSource->Delete(); 00816 p1[0]=p1[0]-c[0]; p1[1]=p1[1]-c[1]; p1[2]=p1[2]-c[2]; 00817 p2[0]=p2[0]-c[0]; p2[1]=p2[1]-c[1]; p2[2]=p2[2]-c[2]; 00818 nA=sqrt( p1[0]*p1[0] + p1[1]*p1[1] + p1[2]*p1[2] ); 00819 nB=sqrt( p2[0]*p2[0] + p2[1]*p2[1] + p2[2]*p2[2] ); 00820 p1[0]=p1[0]/nA; p1[1]=p1[1]/nA; p1[2]=p1[2]/nA; 00821 p2[0]=p2[0]/nB; p2[1]=p2[1]/nB; p2[2]=p2[2]/nB; 00822 00823 mat->SetElement (0,0, nn[0]); 00824 mat->SetElement (1,0, nn[1]); 00825 mat->SetElement (2,0, nn[2]); 00826 mat->SetElement (3,0, 0); 00827 mat->SetElement (0,1, p2[0]); 00828 mat->SetElement (1,1, p2[1]); 00829 mat->SetElement (2,1, p2[2]); 00830 mat->SetElement (3,1, 0); 00831 mat->SetElement (0,2, p1[0]); 00832 mat->SetElement (1,2, p1[1]); 00833 mat->SetElement (2,2, p1[2]); 00834 mat->SetElement (3,2, 0); 00835 mat->SetElement (0,3, 0); 00836 mat->SetElement (1,3, 0); 00837 mat->SetElement (2,3, 0); 00838 mat->SetElement (3,3, 1); 00839 00840 // double deter=mat->Determinant(mat); 00841 trans->Identity(); 00842 trans->SetMatrix(mat); 00843 float ang; 00844 ang=-90; 00845 trans->RotateWXYZ ( ang,0,1,0); 00846 00847 // EED Borrame 00848 // double scale = 1; 00849 // trans->Scale ( scale , scale, scale); 00850 00851 trans->Update(); 00852 00853 vtkMatrix4x4 *m=vtkMatrix4x4::New(); 00854 trans->GetMatrix ( m ); 00855 00856 00857 int j,numberOfPoints; 00858 marContour* contour2D = getContour(i,vol); 00859 numberOfPoints = contour2D->getNumberOfPoints( ); 00860 double fpA[3]; 00861 double pA[3],ppp[3]; 00862 00863 00864 for( j = 0; j <= numberOfPoints; j++ ) { 00865 contour2D->getPoint( fpA,j % numberOfPoints); 00866 00867 pA[0] = fpA[0] + 0.2; // correction EED 00868 pA[1] = fpA[1] + 0.2; // correction EED 00869 00870 pA[2] = 0; 00871 00872 // Why this does not works...(release version)???? 00873 // trans->TransformPoint(pA,ppp); 00874 // or 00875 // trans->TransformVector(pA,ppp); 00876 // so.. 00877 ppp[0] = m->GetElement(0,0)*pA[0] + m->GetElement(0,1)*pA[1] + m->GetElement(0,2)*pA[2] + m->GetElement(0,3); 00878 ppp[1] = m->GetElement(1,0)*pA[0] + m->GetElement(1,1)*pA[1] + m->GetElement(1,2)*pA[2] + m->GetElement(1,3); 00879 ppp[2] = m->GetElement(2,0)*pA[0] + m->GetElement(2,1)*pA[1] + m->GetElement(2,2)*pA[2] + m->GetElement(2,3); 00880 00881 // ppp[0]=ppp[0]+o[0]-c[0]; ppp[1]=ppp[1]+o[1]-c[1]; ppp[2]=ppp[2]+o[2]-c[2]; 00882 ppp[0]=ppp[0]+o[0]; ppp[1]=ppp[1]+o[1]; ppp[2]=ppp[2]+o[2]; 00883 // ppp[0]=ppp[0]+o[0]-c[0]*0.781; ppp[1]=ppp[1]+o[1]-c[1]*0.781;; ppp[2]=ppp[2]+o[2]-c[2]*0.781;; 00884 _vtkPoints->InsertNextPoint( (float)ppp[0],(float)ppp[1],(float)ppp[2] ); 00885 } 00886 00887 m->Delete(); 00888 mat->Delete(); 00889 trans->Delete(); 00890 if (_3Dcontour[i]!=NULL){ _3Dcontour[i]->Delete(); } 00891 _3Dcontour[i]=_vtkPoints; 00892 00893 }
void marAxis::create3DSlice | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 701 of file marAxis.cpp.
References _3Dslices, _points, marParameters::getDimIma(), getNormal(), marObject::getParameters(), and marParameters::getSizeIma().
Referenced by get3DSlice().
00702 { 00703 00704 int k=i; 00705 int sizeIma = getParameters( )->getSizeIma( ); 00706 double dimIma = getParameters( )->getDimIma( ); 00707 00708 dimIma=sizeIma/3; 00709 00710 00711 // double voxSize = getParameters( )->getVoxelSize( ); 00712 00713 // if( forceCnt ) 00714 // for( unsigned int i = 0; i < _contours.size( ); i++ ) 00715 // delete _contours[ i ]; 00716 // _contours.clear( ); 00717 00718 // for( unsigned int i = 0; i < _slices.size( ); i++ ) { 00719 // delete _slices[ i ]; 00720 // _3Dslices[ i ]->Delete( ); 00721 // _quantificationImages[ i ]->Delete( ); 00722 // } 00723 00724 // _slices.clear( ); 00725 // _3Dslices.clear( ); 00726 // _quantificationImages.clear( ); 00727 00728 // "Cutter" initialization 00729 // vtkStructuredPoints* stPoints = vtkStructuredPoints::New( ); 00730 00731 // Perform "cut" 00732 double *p, *n; 00733 // for( int k = 0; k < nCnts; k++ ) { 00734 //s = ( double )k / ( double )( nCnts - 1 ); 00735 p = _points[k]; 00736 n = getNormal( k ); 00737 00738 vtkPlaneSource* pSource = vtkPlaneSource::New( ); 00739 pSource->SetOrigin( p[ 0 ], p[ 1 ], p[ 2 ] ); 00740 pSource->SetPoint1( p[ 0 ] + dimIma - 1.0, p[ 1 ], p[ 2 ] ); 00741 pSource->SetPoint2( p[ 0 ], p[ 1 ], p[ 2 ] + dimIma - 1.0 ); 00742 pSource->SetResolution( sizeIma - 1, sizeIma - 1 ); 00743 pSource->Update( ); 00744 pSource->SetCenter( p[ 0 ], p[ 1 ], p[ 2 ] ); 00745 pSource->SetNormal( n[ 0 ], n[ 1 ], n[ 2 ] ); 00746 pSource->Update( ); 00747 00748 if (_3Dslices[ k ]!=NULL){ _3Dslices[ k ]->Delete(); } 00749 _3Dslices[ k ] = vtkProbeFilter::New( ) ; 00750 _3Dslices[ k ]->SetInput( ( vtkDataSet* )pSource->GetOutput( ) ); 00751 _3Dslices[ k ]->SetSource( vol->castVtk( ) ); 00752 _3Dslices[ k ]->Update( ); 00753 pSource->Delete( ); 00754 00755 // stPoints->GetPointData( )-> 00756 // SetScalars( _3Dslices[ k ]->GetOutput( )-> 00757 // GetPointData( )->GetScalars( ) ); 00758 // stPoints->SetDimensions( sizeIma, sizeIma, 1 ); 00759 // stPoints->SetScalarType( vol->castVtk( )->GetDataObjectType( ) ); 00760 // stPoints->Update( ); 00761 // 00762 // if( forceCnt ) 00763 // { 00764 // marContour* tmp_marContour = new marContour( k, getParameters( ) ) ; 00765 // tmp_marContour->calculateVariables(); 00766 // _contours.push_back( tmp_marContour ); 00767 // } 00768 // _slices.push_back( new kVolume( kVolume::UCHAR, 1, 1, 1 ) ); 00769 // *( _slices[ k ] ) = ( vtkImageData* )stPoints; //copy 00770 // _quantificationImages.push_back( (_slices[ k ])->castVtk( ) ); 00771 // } // rof 00772 00773 // stPoints->Delete( ); 00774 00775 // _3Dslices[i]=NULL; 00776 }
void marAxis::createContour | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 572 of file marAxis.cpp.
References _contours, get2Dcontour(), marParameters::getDimIma(), marObject::getParameters(), and marParameters::getSizeIma().
Referenced by getContour(), and replaceContour2D().
00573 { 00574 00575 int j,id; 00576 int numberOfPoints,numberOfCells; 00577 vtkCell* cell; 00578 vtkIdList* pids; 00579 double p[ 3 ]; 00580 vtkPolyData* vtkPolyData_2DContour; 00581 double x,y; 00582 00583 int sizeIma = getParameters( )->getSizeIma( ); 00584 double dimIma = getParameters( )->getDimIma( ); 00585 00586 // EED 24 Dec 2007 00587 dimIma=sizeIma/3; 00588 00589 _contours[i] = new marContour( i, getParameters( ) ) ; 00590 vtkPolyData_2DContour = get2Dcontour(i,vol); 00591 00592 numberOfCells = vtkPolyData_2DContour->GetNumberOfCells( ); 00593 cell = vtkPolyData_2DContour->GetCell( 0 ); 00594 pids = cell->GetPointIds( ); 00595 numberOfPoints = pids->GetNumberOfIds( ); 00596 00597 for( j = 0; j < numberOfPoints; j++ ) 00598 { 00599 id = pids->GetId( j ); 00600 vtkPolyData_2DContour->GetPoint( id, p); 00601 x=p[0]-64.0; 00602 y=p[1]-64.0; 00603 x=x * dimIma / ( float ) sizeIma; 00604 y=y * dimIma / ( float ) sizeIma; 00605 _contours[ i ]->addContourPoint( x , y ); 00606 } 00607 00608 _contours[i]->do_spline(); 00609 _contours[i]->calculateVariables(); 00610 00611 }
void marAxis::createEmptyVectors | ( | ) |
Definition at line 1033 of file marAxis.cpp.
References _2Dcontours, _2DDiameterMax, _2DDiameterMin, _3Dcontour, _3Dslices, _contours, _quantificationImages, _slices, clearAllVectors(), and getNumberOfSplinePoints().
Referenced by marExperiment::RecalculateAxis(), and marExperiment::RegenerateAxis().
01034 { 01035 int nCnts = ( int ) getNumberOfSplinePoints( ); 01036 clearAllVectors(); 01037 int i; 01038 // int xxxx=getNumberOfContours(); 01039 for (i=0;i<nCnts;i++){ 01040 _contours.push_back( NULL ); 01041 _slices.push_back( NULL ); 01042 _3Dslices.push_back( NULL ); 01043 _3Dcontour.push_back( NULL ); 01044 _quantificationImages.push_back( NULL ); 01045 _2Dcontours.push_back( NULL ); 01046 _2DDiameterMin.push_back( NULL ); 01047 _2DDiameterMax.push_back( NULL ); 01048 } 01049 }
void marAxis::createSlice | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 672 of file marAxis.cpp.
References _points, _slices, get3DSlice(), getNormal(), marObject::getParameters(), and marParameters::getSizeIma().
Referenced by getSlice().
00672 { 00673 int k=i; 00674 int sizeIma = getParameters( )->getSizeIma( ); 00675 00676 vtkStructuredPoints* stPoints = vtkStructuredPoints::New( ); 00677 double *p, *n; 00678 p = _points[k]; 00679 n = getNormal( k ); 00680 00681 stPoints->GetPointData( )->SetScalars( get3DSlice(k,vol)->GetOutput()->GetPointData()->GetScalars() ); 00682 stPoints->SetDimensions( sizeIma, sizeIma, 1 ); 00683 00684 00685 stPoints->SetScalarType( vol->castVtk( )->GetDataObjectType( ) ); 00686 stPoints->SetScalarTypeToShort (); 00687 stPoints->Update(); 00688 00689 vtkImageChangeInformation* change = vtkImageChangeInformation::New(); 00690 change->SetInput( stPoints ); 00691 change->Update(); //important 00692 00693 00694 if (_slices[k]!=NULL) { delete _slices[k]; } 00695 _slices[k] = new kVolume( change->GetOutput() ) ; 00696 00697 stPoints->Delete( ); 00698 change->Delete(); 00699 }
void marAxis::createSliceImage | ( | int | i, | |
kVolume * | vol | |||
) | [private] |
Definition at line 895 of file marAxis.cpp.
References _quantificationImages, and getSlice().
Referenced by getSliceImage().
00896 { 00897 _quantificationImages[i] = getSlice(i,vol)->castVtk( ) ; 00898 00899 }
void marAxis::cut | ( | int | slice, | |
bool | up | |||
) |
Definition at line 194 of file marAxis.cpp.
void marAxis::Delete | ( | ) |
Definition at line 1498 of file marAxis.cpp.
References _allData, _points, _signal, and clearAllVectors().
Referenced by create2Dcontour(), and reset().
01498 { 01499 clearAllVectors(); 01500 01501 int i; 01502 for (i=0;i<_points.size();i++){ 01503 if (_points[i]!=NULL) { 01504 delete _points[i]; 01505 _points[i]=NULL; 01506 } 01507 } 01508 _points.clear(); 01509 _signal.clear(); 01510 01511 01512 if(_allData) { 01513 _allData->Delete(); 01514 _allData = NULL; 01515 } 01516 01517 // reset(); 01518 }
void marAxis::doSpline | ( | ) |
Definition at line 200 of file marAxis.cpp.
References _contours, _healthySlice, _points, marParameters::e_axis_discret_step, marParameters::getDoubleParam(), marObject::getParameters(), INDX_count, INDX_X, INDX_Y, and INDX_Z.
Referenced by marExperiment::extractVascularTree(), and marExperiment::RecalculateAxis().
00201 { 00202 unsigned int i; 00203 unsigned int nop, nip; 00204 float length=0, t; 00205 float p1[ 3 ], p2[ 3 ]; 00206 double p[marAxis::INDX_count]; 00207 00208 vtkKochanekSpline* spX = vtkKochanekSpline::New( ); 00209 vtkKochanekSpline* spY = vtkKochanekSpline::New( ); 00210 vtkKochanekSpline* spZ = vtkKochanekSpline::New( ); 00211 00212 for( i = 0, length = 0.0; i < _controlPoints.size( ); i++ ) { 00213 getControlPoint(i, p, p+3); 00214 p2[ 0 ] = (float) p[marAxis::INDX_X]; 00215 p2[ 1 ] = (float) p[marAxis::INDX_Y]; 00216 p2[ 2 ] = (float) p[marAxis::INDX_Z]; 00217 spX->AddPoint( (float) i, p2[ 0 ] ); 00218 spY->AddPoint( (float) i, p2[ 1 ] ); 00219 spZ->AddPoint( (float) i, p2[ 2 ] ); 00220 if( i > 0 ) 00221 length += (float) (sqrt( (p2[0]-p1[0])*(p2[0]-p1[0]) + 00222 (p2[1]-p1[1])*(p2[1]-p1[1]) + 00223 (p2[2]-p1[2])*(p2[2]-p1[2]) ) ); 00224 p1[ 0 ] = p2[ 0 ]; p1[ 1 ] = p2[ 1 ]; p1[ 2 ] = p2[ 2 ]; 00225 } // rof 00226 00227 nop = ( unsigned int ) ( getParameters( )->getDoubleParam( 00228 marParameters::e_axis_discret_step ) * length ); 00229 nip = _controlPoints.size( ); 00230 _healthySlice = -1; 00231 00232 while( _points.size( ) > 0 ) { 00233 delete _points[ _points.size( ) - 1 ]; 00234 _points.pop_back( ); 00235 } // fwhile 00236 00237 while( _contours.size( ) > 0 ) { 00238 delete _contours[ _contours.size( ) - 1 ]; 00239 _contours.pop_back( ); 00240 } // fwhile 00241 00242 for( i = 0; i < nop; i++ ) { 00243 t = (float) (( ( double ) nip - 1.0 ) / ( ( double ) nop - 1.0 ) * i); 00244 double* np = new double[ 3 ]; 00245 np[ 0 ] = 0; 00246 np[ 1 ] = 0; 00247 np[ 2 ] = 0; 00248 np[ 0 ] = (double) (spX->Evaluate( t )); 00249 np[ 1 ] = (double) (spY->Evaluate( t )); 00250 np[ 2 ] = (double) (spZ->Evaluate( t )); 00251 _points.push_back( np ); 00252 _contours.push_back( new marContour( i, getParameters( ) ) ); 00253 00254 } // rof 00255 00256 spX->Delete( ); 00257 spY->Delete( ); 00258 spZ->Delete( ); 00259 00260 }
vtkPolyData * marAxis::Draw | ( | ) |
Definition at line 1434 of file marAxis.cpp.
References _allData, and _points.
Referenced by wxSurfaceWidget::AddAxisActors(), wxQuantificationWidgetCT::AddAxisActors(), wxQuantificationWidget::AddAxisActors(), wxEmptyPanelWidget_2::PaintVascularTree_MH_JFC(), vtk3DSurfaceSTLWidget::ShowMARACASDataAndAxe(), vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxe(), and vtk3DQuantSurfaceWidget::ShowMARACASDataAndAxeCT().
01435 { 01436 unsigned int i, j; 01437 double *p; 01438 01439 vtkPoints* allPoints = vtkPoints::New( ); 01440 vtkCellArray* allTopology = vtkCellArray::New( ); 01441 01442 allTopology->InsertNextCell( _points.size( ) ); 01443 for( i = 0, j=0; i < _points.size( ); i++, j++ ) { 01444 p = _points[i]; 01445 allPoints->InsertNextPoint( p[ 0 ], p[ 1 ], p[ 2 ] ); 01446 allTopology->InsertCellPoint( j ); 01447 } // rof 01448 01449 _allData = vtkPolyData::New( ); 01450 _allData->SetPoints( allPoints ); 01451 _allData->SetLines( allTopology ); 01452 allPoints->Delete(); 01453 allTopology->Delete(); 01454 01455 return ( _allData ); 01456 }
void marAxis::EraseContour | ( | int | i | ) |
Definition at line 614 of file marAxis.cpp.
References _2Dcontours, _2DDiameterMax, _2DDiameterMin, _3Dcontour, and _contours.
Referenced by marInterfaceCT::EraseContour(), replaceContour2D(), and wxQuantificationWidget::SetManualContour_AddPoint_2DWorld().
00614 { 00615 if (_3Dcontour[i]!=NULL){ 00616 _3Dcontour[i]->Delete(); 00617 _3Dcontour[i]=NULL; 00618 } 00619 00620 if (_2DDiameterMax[i]!=NULL){ 00621 _2DDiameterMax[i]->Delete(); 00622 _2DDiameterMax[i]=NULL; 00623 } 00624 00625 if (_2DDiameterMin[i]!=NULL){ 00626 _2DDiameterMin[i]->Delete(); 00627 _2DDiameterMin[i]=NULL; 00628 } 00629 00630 if (_2Dcontours[i]!=NULL){ 00631 _2Dcontours[i]->Delete(); 00632 _2Dcontours[i]=NULL; 00633 } 00634 00635 if (_contours[i]!=NULL){ 00636 delete _contours[i]; 00637 _contours[i]=NULL; 00638 } 00639 }
void marAxis::eraseContourVectorsContent | ( | ) |
Definition at line 1123 of file marAxis.cpp.
References _2Dcontours, _2DDiameterMax, _2DDiameterMin, _3Dcontour, and _contours.
Referenced by marExperiment::ClearContours(), and marExperiment::RegenerateSignal().
01124 { 01125 unsigned int i; 01126 for (i=0;i<_contours.size();i++){ 01127 if (_contours[i]!=NULL) { // DATA-MODEL-2D 01128 delete _contours[i]; 01129 _contours[i]=NULL; 01130 } 01131 } 01132 for (i=0;i<_2Dcontours.size();i++){ // VISUALISATION_VTK 2D 01133 if (_2Dcontours[i]!=NULL) { 01134 _2Dcontours[i]->Delete(); 01135 _2Dcontours[i]=NULL; 01136 } 01137 } 01138 for (i=0;i<_2DDiameterMin.size();i++){ // VISUALISATION_VTK 2D 01139 if (_2DDiameterMin[i]!=NULL) { 01140 _2DDiameterMin[i]->Delete(); 01141 _2DDiameterMin[i]=NULL; 01142 } 01143 } 01144 for (i=0;i<_2DDiameterMax.size();i++){ // VISUALISATION_VTK 2D 01145 if (_2DDiameterMax[i]!=NULL) { 01146 _2DDiameterMax[i]->Delete(); 01147 _2DDiameterMax[i]=NULL; 01148 } 01149 } 01150 for (i=0;i<_3Dcontour.size();i++){ // VISUALISATION_VTK 3D 01151 if (_3Dcontour[i]!=NULL) { 01152 _3Dcontour[i]->Delete(); 01153 _3Dcontour[i]=NULL; 01154 } 01155 } 01156 }
vtkPolyData * marAxis::get2Dcontour | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1238 of file marAxis.cpp.
References _2Dcontours, and create2Dcontour().
Referenced by createContour().
01238 { // VISUALISATION-VTK 2D 01239 if (_2Dcontours[i]==NULL){ create2Dcontour(i,vol); } 01240 return _2Dcontours[i]; 01241 }
vtkPoints * marAxis::get2DDiameterMax | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1248 of file marAxis.cpp.
References _2DDiameterMax, and create2DDiameterMax().
01248 { // VISUALISATION-VTK 2D 01249 if (_2DDiameterMax[i]==NULL){ create2DDiameterMax(i,vol); } 01250 return _2DDiameterMax[i]; 01251 }
vtkPoints * marAxis::get2DDiameterMin | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1243 of file marAxis.cpp.
References _2DDiameterMin, and create2DDiameterMin().
01243 { // VISUALISATION-VTK 2D 01244 if (_2DDiameterMin[i]==NULL){ create2DDiameterMin(i,vol); } 01245 return _2DDiameterMin[i]; 01246 }
vtkPoints * marAxis::get3Dcontour | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1228 of file marAxis.cpp.
References _3Dcontour, and create3Dcontour().
01228 { // VISUALISATION-VTK 3D 01229 if (_3Dcontour[i]==NULL){ create3Dcontour(i, vol); } 01230 return _3Dcontour[i]; 01231 }
vtkProbeFilter * marAxis::get3DSlice | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1223 of file marAxis.cpp.
References _3Dslices, and create3DSlice().
Referenced by createSlice().
01223 { // VISUALISATION-VTK 3D 01224 if (_3Dslices[i]==NULL){ create3DSlice(i,vol); } 01225 return _3Dslices[i]; 01226 }
int marAxis::getActualQuant | ( | ) | [inline] |
Definition at line 109 of file marAxis.h.
Referenced by marInterfaceCT::getActualQuant(), wxQuantificationWidget::RefreshAxis(), marExperiment::RegenerateAxis(), and wxQuantificationWidget::showVariables().
00109 { return _actualQuant; }
double marAxis::getAverageArea | ( | int | pIni, | |
int | pEnd, | |||
kVolume * | vol | |||
) |
Definition at line 1299 of file marAxis.cpp.
References _points, and getContour().
Referenced by calculateReferenceArea().
01299 { 01300 marContour *marcontourHealthy; 01301 int ihealthySlice,itemp; 01302 double acumArea = 0; 01303 for (ihealthySlice = pIni ; ihealthySlice <= pEnd ; ihealthySlice++ ){ 01304 itemp=ihealthySlice; 01305 if (itemp<0) { itemp=0; } 01306 if (itemp>=_points.size( )) { itemp=_points.size( )-1; } 01307 marcontourHealthy = getContour( itemp , vol ); 01308 acumArea = acumArea + marcontourHealthy->getArea(); 01309 } 01310 return acumArea / (pEnd - pIni + 1); 01311 }
vtkPolyData * marAxis::GetAxisData | ( | ) |
Definition at line 1458 of file marAxis.cpp.
References _allData, INDX_count, INDX_RAYON, INDX_X, INDX_Y, and INDX_Z.
Referenced by TreeExtraction_MH_JFC::Execute(), wxSTLWidget_02::ExtractTree2_JF(), and TreeExtraction_MH_JFC::FindVit().
01459 { 01460 unsigned int i; 01461 double point[ 3 ]; 01462 double radio; 01463 double p[marAxis::INDX_count]; 01464 01465 01466 vtkPoints *allPoints = vtkPoints::New( ); 01467 vtkCellArray *allTopology = vtkCellArray::New( ); 01468 vtkDoubleArray *allRadios = vtkDoubleArray::New( ); 01469 allRadios->SetName("radio"); 01470 01471 for( i = 0; i < _controlPoints.size( ); i++ ) { 01472 getControlPoint(i, p, p+3); 01473 point[ 0 ] = p[marAxis::INDX_X]; 01474 point[ 1 ] = p[marAxis::INDX_Y]; 01475 point[ 2 ] = p[marAxis::INDX_Z]; 01476 radio = p[marAxis::INDX_RAYON]*2.0; 01477 allPoints -> InsertPoint( i, point[ 0 ] , point[ 1 ] , point[ 2 ] ); //para saber exactamante el indice que se le asigno 01478 01479 allRadios -> InsertValue(i,radio); 01480 01481 if(i>0){ 01482 allTopology->InsertNextCell(2); 01483 allTopology->InsertCellPoint(i); 01484 allTopology->InsertCellPoint(i-1); 01485 } 01486 01487 } // rof 01488 01489 _allData = vtkPolyData::New( ); 01490 _allData -> SetPoints( allPoints ); 01491 _allData -> SetLines( allTopology ); 01492 _allData -> GetPointData()->SetScalars(allRadios); 01493 01494 01495 return ( _allData ); 01496 }
double marAxis::getAxisLenght | ( | int | pIni, | |
int | pEnd | |||
) | [private] |
Definition at line 1253 of file marAxis.cpp.
References _points, and marVector::norm2().
Referenced by calculateSubAxisLength(), and calculateTotalAxisLenght().
01253 { 01254 01255 if (pIni>pEnd){ 01256 int tmp=pIni; 01257 pIni=pEnd; 01258 pEnd=tmp; 01259 } 01260 01261 marVector* pO = new marVector(2); 01262 marVector* pF = new marVector(2); 01263 double L; 01264 unsigned int j; 01265 for( j = pIni, L = 0.0; j < pEnd-1; j++ ) { 01266 (*pO)=_points[j]; 01267 (*pF)=_points[j+1]; 01268 (*pF)=(*pF)-(*pO); 01269 L+=pF->norm2(); 01270 } // rof 01271 delete pO; 01272 delete pF; 01273 return L; 01274 }
marContour * marAxis::getContour | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1159 of file marAxis.cpp.
References _contours, and createContour().
Referenced by calculateReferenceAverDiam(), create2DDiameterMax(), create2DDiameterMin(), create3Dcontour(), and getAverageArea().
01160 { 01161 if (_contours[i]==NULL){ createContour(i, vol); } 01162 return _contours[i]; 01163 }
std::string& marAxis::getDescription | ( | ) | [inline] |
Return description as a std::string
Definition at line 93 of file marAxis.h.
00093 { return( _description ); };
int marAxis::getFinishQuant | ( | ) | [inline] |
Definition at line 128 of file marAxis.h.
Referenced by wxQuantificationWidget::showVariables().
00128 { return _finishQuant; };
int marAxis::getHealthySlice | ( | ) | [inline] |
Definition at line 115 of file marAxis.h.
Referenced by marInterfaceCT::getHealthySlice(), wxQuantificationWidget::GetHealthySlice(), wxQuantificationWidget::OnHealthySlice_CB(), vtk3DQuantSurfaceWidget::Set3DHealthySliceActor(), and wxQuantificationWidget::showVariables().
00115 { return( _healthySlice ); };
int marAxis::getHealthySliceEnd | ( | ) | [inline] |
Definition at line 117 of file marAxis.h.
Referenced by marInterfaceCT::getHealthySliceEnd(), wxQuantificationWidget::GetHealthySliceRange(), and wxQuantificationWidget::showVariables().
00117 { return( _healthySliceEnd ); };
int marAxis::getHealthySliceStart | ( | ) | [inline] |
Definition at line 116 of file marAxis.h.
Referenced by wxQuantificationWidget::GetHealthySliceRange(), marInterfaceCT::getHealthySliceStart(), and wxQuantificationWidget::showVariables().
00116 { return( _healthySliceStart ); };
double * marAxis::getNormal | ( | unsigned int | slice | ) |
Definition at line 83 of file marAxis.cpp.
References _points.
Referenced by create3Dcontour(), marAxisCT::create3Dcontours(), create3DSlice(), createSlice(), and vtk3DQuantSurfaceWidget::Set3DSliceActor().
00083 { 00084 00085 double* ret = new double[ 3 ]; 00086 00087 if ( slice == 0 ) { 00088 ret[0] = _points[ slice + 1 ][0] - _points[ slice ][0]; 00089 ret[1] = _points[ slice + 1 ][1] - _points[ slice ][1]; 00090 ret[2] = _points[ slice + 1 ][2] - _points[ slice ][2]; 00091 } 00092 else if ( slice == _points.size( ) - 1 ) { 00093 ret[0] = _points[ slice - 1 ][0] - _points[ slice ][0]; 00094 ret[1] = _points[ slice - 1 ][1] - _points[ slice ][1]; 00095 ret[2] = _points[ slice - 1 ][2] - _points[ slice ][2]; 00096 } 00097 else if ( slice > 0 && slice < _points.size( ) - 1 ) { 00098 ret[0] = _points[ slice - 1 ][0] - _points[ slice + 1 ][0]; 00099 ret[1] = _points[ slice - 1 ][1] - _points[ slice + 1 ][1]; 00100 ret[2] = _points[ slice - 1 ][2] - _points[ slice + 1 ][2]; 00101 } 00102 00103 return( ret ); 00104 }
int marAxis::getNumberOfContours | ( | ) |
Definition at line 338 of file marAxis.cpp.
References _contours.
Referenced by save().
00339 { 00340 return( _contours.size( ) ); 00341 }
int marAxis::getNumberOfSplinePoints | ( | ) |
Definition at line 344 of file marAxis.cpp.
References _points.
Referenced by wxQuantificationWidgetCT::CallBackOnLeftDClick(), wxQuantificationWidget::CallBackOnLeftDClick(), marAxisCT::createEmptyContours(), createEmptyVectors(), and marExperiment::RecalculateAxis().
00345 { 00346 return( _points.size( ) ); 00347 }
marParameters* marObject::getParameters | ( | ) | [inline, inherited] |
Parameters analizers.
Definition at line 55 of file marObject.h.
Referenced by marAxisCT::adjustWall(), calculateSignal(), create2Dcontour(), create2DDiameterMax(), create2DDiameterMin(), marAxisCT::create2DDiametersMax(), marAxisCT::create2DDiametersMin(), create3DSlice(), createContour(), marAxisCT::createContours(), createSlice(), doSpline(), marAxisCT::extractLumen(), marExperiment::extractVascularTree(), marAxisCT::generatePoints(), marDynData::getActualVoxel(), marAxisCT::histogram(), marExperiment::initExperiment(), marExperiment::load(), load(), marRAW2Files::loadActualSerie(), marRAW2AsciiFiles::loadActualSerie(), marRAWFiles::loadActualSerie(), marDynData::loadData(), marSimpleDicom::loadVolumeDXMM(), wxEmptyPanelWidget_2::OnBtnExtractTree_MH_JFC(), wxSurfaceWidget::OnManualAxis(), vtk3DQuantSurfaceWidget::Set3DSliceActor(), vtk3DSurfaceWidget::SetInitialPoint(), marAxisCT::setStartIndex(), marExperimentCT::updateCalcPercentage(), marAxisCT::updateCalcPercentage(), marExperimentCT::updateDiscontinuityThreshold(), marExperimentCT::updateLumenPercentage(), and marAxisCT::updateLumenPercentage().
00055 { return( _parameters ); };
double* marAxis::getPoints | ( | int | i | ) | [inline] |
Definition at line 205 of file marAxis.h.
Referenced by marAxisCT::create3Dcontours(), marAxisCT::generatePoints(), and wxQuantificationWidgetCT::MoveSlider().
00205 { return _points[i]; };
double marAxis::getReferenceArea | ( | kVolume * | vol | ) |
Definition at line 1317 of file marAxis.cpp.
References _referenceArea, and calculateReferenceArea().
01317 { 01318 if (_referenceArea==-1){ 01319 calculateReferenceArea(vol); 01320 } 01321 return _referenceArea; 01322 }
double marAxis::getReferenceAverDiam | ( | kVolume * | vol | ) |
Definition at line 1335 of file marAxis.cpp.
References _referenceAverDiam, and calculateReferenceAverDiam().
01335 { 01336 if (_referenceAverDiam==-1){ 01337 calculateReferenceAverDiam(vol); 01338 } 01339 return _referenceAverDiam; 01340 }
float marAxis::getSignal | ( | uint | slice | ) | [inline] |
Definition at line 111 of file marAxis.h.
Referenced by vtk3DSurfaceSTLWidget::ConvertMarAxisToPolyData(), create2Dcontour(), marExperiment::extractVascularTree(), and wxEmptyPanelWidget_2::WriteSignals().
00111 { return( _signal[ slice ] ); };
kVolume * marAxis::getSlice | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1165 of file marAxis.cpp.
References _slices, and createSlice().
Referenced by create2Dcontour(), marAxisCT::create2Dcontours(), createSliceImage(), marAxisCT::generatePoints(), marAxisCT::histogram(), marAxisCT::markUpLumen(), marAxisCT::performAND(), marAxisCT::performUnion(), and marAxisCT::performXOR().
01166 { 01167 if (_slices[i]==NULL){ createSlice( i , vol ); } 01168 return _slices[i]; 01169 }
vtkImageData * marAxis::getSliceImage | ( | int | i, | |
kVolume * | vol | |||
) |
Definition at line 1233 of file marAxis.cpp.
References _quantificationImages, and createSliceImage().
Referenced by marAxisCT::generateFile().
01233 { // VISUALISATION-VTK 2D 01234 if (_quantificationImages[i]==NULL){ createSliceImage(i,vol); } 01235 return _quantificationImages[i]; 01236 }
double* marAxis::getSplinePoint | ( | uint | i | ) | [inline] |
Definition at line 113 of file marAxis.h.
Referenced by wxQuantificationWidgetCT::CallBackOnLeftDClick(), wxQuantificationWidget::CallBackOnLeftDClick(), and vtk3DQuantSurfaceWidget::Set3DSliceActor().
00113 { return ( _points[ i ] ); };
int marAxis::getStartQuant | ( | ) | [inline] |
Definition at line 127 of file marAxis.h.
Referenced by wxQuantificationWidget::showVariables().
00127 { return _startQuant; };
double marAxis::getSubAxisLength | ( | ) |
Definition at line 1292 of file marAxis.cpp.
References _subAxisLenght, and calculateSubAxisLength().
01292 { 01293 if (_subAxisLenght==-1){ 01294 calculateSubAxisLength(); 01295 } 01296 return _subAxisLenght; 01297 }
double marAxis::getTotalLength | ( | ) |
Definition at line 1280 of file marAxis.cpp.
References _totalAxisLenght, and calculateTotalAxisLenght().
01280 { 01281 if (_totalAxisLenght==-1){ 01282 calculateTotalAxisLenght(); 01283 } 01284 return _totalAxisLenght; 01285 }
bool marAxis::if3DcontourExist | ( | int | i | ) |
Definition at line 1172 of file marAxis.cpp.
References _3Dcontour.
01173 { 01174 bool result=true; 01175 if (_3Dcontour[i]==NULL) 01176 { 01177 result=false; 01178 } 01179 return result; 01180 }
bool marAxis::isFinished | ( | ) | [inline] |
Definition at line 134 of file marAxis.h.
00134 { return( _actualQuant >= _startQuant && _actualQuant <= _finishQuant ); }
bool marObject::load | ( | std::string & | nr | ) | [inherited] |
Definition at line 67 of file marObject.cpp.
References marObject::load().
Referenced by marObject::load().
00068 { 00069 std::ifstream is( nr.c_str( ) ); 00070 00071 if( is ) { 00072 00073 load( is ); 00074 is.close( ); 00075 return( true ); 00076 00077 } // fi 00078 00079 return( false ); 00080 }
bool marAxis::load | ( | std::ifstream & | is | ) | [virtual] |
Implements marObject.
Definition at line 1406 of file marAxis.cpp.
References _contours, _description, marObject::getParameters(), INDX_count, and reset().
Referenced by marExperiment::load().
01407 { 01408 double p[ INDX_count ]; 01409 int i, n; 01410 01411 reset( ); 01412 01413 is.read( ( char* )&n, sizeof( int ) ); 01414 _description.resize( n ); 01415 is.read( ( char* )_description.c_str( ), n * sizeof( char ) ); 01416 01417 is.read( ( char* )&n, sizeof( int ) ); 01418 for( i = 0; i < n; i++ ) { 01419 01420 is.read( ( char* )p, INDX_count * sizeof( double ) ); 01421 addControlPoint( p, p + 3 ); 01422 01423 } // rof 01424 is.read( ( char* )&n, sizeof( int ) ); 01425 for( i = 0; i < n; i++ ) { 01426 01427 _contours.push_back( new marContour( 0, getParameters( ) ) ); 01428 _contours[ i ]->load( is ); 01429 01430 } // rof 01431 return( true ); 01432 }
void marObject::makeACopyParameters | ( | ) | [inline, inherited] |
Definition at line 48 of file marObject.h.
00049 { 00050 copyParameters( _parameters ); 00051 }
void marAxis::next | ( | ) | [inline] |
Definition at line 132 of file marAxis.h.
Referenced by marAxisCT::generatePoints().
00132 { _actualQuant++; };
bool marObject::parametersOwned | ( | ) | [inline, inherited] |
Definition at line 56 of file marObject.h.
00056 { return( _parametersCopied ); };
void marAxis::replaceContour2D | ( | int | i, | |
int | size, | |||
double * | vx, | |||
double * | vy | |||
) |
Definition at line 642 of file marAxis.cpp.
References _2Dcontours, createContour(), and EraseContour().
Referenced by marInterfaceCT::replaceContour2D(), and wxQuantificationWidget::SetManualContour_ReplaceContour().
00642 { 00643 00644 EraseContour(i); 00645 00646 00647 vtkPoints *_pts = vtkPoints::New(); 00648 _pts->SetNumberOfPoints(size); 00649 int j; 00650 00651 for (j=0 ; j<size ; j++){ 00652 _pts->SetPoint(j, vx[j] , vy[j] , 0 ); 00653 } 00654 // _pts->SetPoint(0, vx[0] , vy[0] , 0 ); 00655 00656 vtkCellArray *lines = vtkCellArray::New(); 00657 lines->InsertNextCell( size ); 00658 for ( j=0 ; j<size+1 ; j++ ){ 00659 lines->InsertCellPoint(j % size ); 00660 } 00661 00662 vtkPolyData *_pd = vtkPolyData::New(); 00663 _pd->SetPoints( _pts ); 00664 _pd->SetLines( lines ); 00665 lines->Delete(); //do not delete lines ?? 00666 _pts->Delete(); 00667 00668 _2Dcontours[i]=_pd; 00669 createContour(i,NULL); 00670 }
void marAxis::reset | ( | ) | [virtual] |
General methods
Implements marObject.
Definition at line 1343 of file marAxis.cpp.
References _actualQuant, _description, _finishQuant, _healthySlice, _referenceArea, _referenceAverDiam, _startQuant, _subAxisLenght, and Delete().
Referenced by load(), and marAxis().
01344 { 01345 //EED Borrame 01346 // unsigned int i; 01347 kCurve::reset( ); 01348 01349 _description = ""; 01350 _healthySlice = -1; 01351 _startQuant = -1; 01352 _finishQuant = -1; 01353 _actualQuant = -1; 01354 01355 _subAxisLenght = -1; 01356 _referenceArea = -1; 01357 _referenceAverDiam = -1; 01358 01359 Delete( ); 01360 01361 // EED Borrame 01362 /* 01363 for( i = 0; i < _contours.size( ); i++ ) 01364 delete _contours[ i ]; 01365 _contours.clear( ); 01366 for( i = 0; i < _slices.size( ); i++ ) 01367 delete _slices[ i ]; 01368 _slices.clear( ); 01369 */ 01370 }
bool marObject::save | ( | std::string & | nw | ) | [inherited] |
Persistence methods
Definition at line 51 of file marObject.cpp.
References marObject::save().
00052 { 00053 std::ofstream os( nw.c_str( ) ); 00054 00055 if( os ) { 00056 00057 save( os ); 00058 os.close( ); 00059 return( true ); 00060 00061 } // fi 00062 00063 return( false ); 00064 }
bool marAxis::save | ( | std::ofstream & | os | ) | [virtual] |
Persistence methods
Implements marObject.
Definition at line 1378 of file marAxis.cpp.
References _contours, _description, getNumberOfContours(), and INDX_count.
01379 { 01380 double p[ INDX_count ]; 01381 unsigned int i; 01382 01383 i = _description.length( ); 01384 os.write( ( const char* )&i, sizeof( int ) ); 01385 os.write( ( char* )_description.c_str( ), i * sizeof( char ) ); 01386 01387 i = getNumberOfControlPoints( ); 01388 os.write( ( const char* )&i, sizeof( int ) ); 01389 for( i = 0; i < getNumberOfControlPoints( ); i++ ) { 01390 01391 memcpy( p, _controlPoints[ i ], 3 * sizeof( double ) ); 01392 memcpy( p + 3, _controlState[ i ], 01393 ( INDX_count - 3 ) * sizeof( double ) ); 01394 os.write( ( const char* )p, INDX_count * sizeof( double ) ); 01395 01396 } // rof 01397 i = getNumberOfContours( ); 01398 os.write( ( const char* )&i, sizeof( int ) ); 01399 for( i = 0; i < getNumberOfContours( ); i++ ) 01400 _contours[ i ]->save( os ); 01401 01402 return( true ); 01403 }
void marAxis::Save3Dcontour | ( | FILE * | ff, | |
int | i | |||
) |
Definition at line 1183 of file marAxis.cpp.
References _3Dcontour.
Referenced by SaveExisting3DContours().
01184 { 01185 int i,size; 01186 double point[3]; 01187 if (_3Dcontour[id]!=NULL) 01188 { 01189 //Ramiro fprintf(ff,"contour_id: %d \n", id); 01190 size = _3Dcontour[id]->GetNumberOfPoints(); 01191 //Ramiro fprintf(ff,"numberOfPoints: %d \n", size); 01192 for ( i=0 ; i<size ;i++ ){ 01193 _3Dcontour[id]->GetPoint( i , point ); 01194 fprintf(ff,"%f %f %f %d\n", point[0], point[1],point[2],id); 01195 } 01196 } 01197 }
void marAxis::SaveExisting3DContours | ( | FILE * | ff | ) |
Definition at line 1199 of file marAxis.cpp.
References _3Dcontour, and Save3Dcontour().
Referenced by wxQuantificationWidget::OnSaveContours3D_BT().
01200 { 01201 if (ff!=NULL) 01202 { 01203 // counting existing 3Dcontours 01204 int acum=0; 01205 int i,size=_3Dcontour.size(); 01206 for (i=0; i<size; i++) 01207 { 01208 if (_3Dcontour[i]!=NULL) 01209 { 01210 acum++; 01211 } 01212 } 01213 //Ramiro fprintf(ff, "NumberOf3DContours: %d \n", acum); 01214 // saving existing 3Dcontours 01215 for (i=0; i<size; i++) 01216 { 01217 Save3Dcontour(ff,i); 01218 } 01219 } 01220 }
void marAxis::set_points_disc | ( | PPPOINTAXE | p | ) | [inline] |
Definition at line 182 of file marAxis.h.
Referenced by marExperiment::extractVascularTree().
00182 { _points_disc = p; };
void marAxis::setActualQuant | ( | int | act | ) | [inline] |
Definition at line 119 of file marAxis.h.
Referenced by wxQuantificationWidget::MoveSlider(), marExperiment::RecalculateAxis(), marExperiment::RegenerateAxis(), wxQuantificationWidget::ResetAxis(), marInterfaceCT::setActualQuant(), and wxQuantificationWidget::ShowMARACASData().
00119 { _actualQuant=act; };
void marAxis::setDescription | ( | std::string & | d | ) | [inline] |
Set description as a std::string
Definition at line 98 of file marAxis.h.
Referenced by marExperiment::extractVascularTree().
00098 { _description = d; };
void marAxis::setFinishQuant | ( | int | fq | ) |
Definition at line 1533 of file marAxis.cpp.
References _finishQuant, and _subAxisLenght.
Referenced by vtk3DQuantSurfaceWidget::Set3DEndRegionSliceActor().
01533 { 01534 _finishQuant = fq; 01535 _subAxisLenght = -1; 01536 };
void marAxis::setHealthySlice | ( | int | hsS, | |
int | hs, | |||
int | hsE | |||
) |
Definition at line 1520 of file marAxis.cpp.
References _healthySlice, _healthySliceEnd, _healthySliceStart, _referenceArea, and _referenceAverDiam.
Referenced by wxQuantificationWidget::ResetAxis(), marInterfaceCT::setHealthySlice(), and wxQuantificationWidget::SetHealthySlice().
01520 { 01521 _healthySliceStart = hsS; 01522 _healthySlice = hs; 01523 _healthySliceEnd = hsE; 01524 _referenceArea=-1; 01525 _referenceAverDiam=-1; 01526 };
void marObject::setParameters | ( | marParameters * | p | ) | [inherited] |
Parameters assignation methods.
You can assign a marParameters object by reference (setParameters) or by value (copyParameters). Besides, if you want to make your actual reference to be by value, call makeACopyParameters.
Definition at line 34 of file marObject.cpp.
References marObject::_parameters, and marObject::_parametersCopied.
00035 { 00036 if( _parametersCopied && _parameters != NULL ) delete _parameters; 00037 _parameters = p; 00038 _parametersCopied = false; 00039 }
void marAxis::setStartQuant | ( | int | sq | ) |
Definition at line 1528 of file marAxis.cpp.
References _startQuant, and _subAxisLenght.
Referenced by vtk3DQuantSurfaceWidget::Set3DStartRegionSliceActor().
01528 { 01529 _startQuant = sq; 01530 _subAxisLenght = -1; 01531 };
void marAxis::sliceVolumeAxis | ( | kVolume * | vol, | |
bool | forceCnt = true | |||
) |
Definition at line 265 of file marAxis.cpp.
00266 { 00267 /* 00268 int nCnts = ( int ) getNumberOfSplinePoints( ); 00269 int sizeIma = getParameters( )->getSizeIma( ); 00270 double dimIma = getParameters( )->getDimIma( ); 00271 double voxSize = getParameters( )->getVoxelSize( ); 00272 00273 if( forceCnt ) 00274 for( unsigned int i = 0; i < _contours.size( ); i++ ) 00275 delete _contours[ i ]; 00276 _contours.clear( ); 00277 00278 for( unsigned int i = 0; i < _slices.size( ); i++ ) { 00279 delete _slices[ i ]; 00280 _3Dslices[ i ]->Delete( ); 00281 _quantificationImages[ i ]->Delete( ); 00282 } 00283 00284 _slices.clear( ); 00285 _3Dslices.clear( ); 00286 _quantificationImages.clear( ); 00287 00288 00289 // "Cutter" initialization 00290 vtkStructuredPoints* stPoints = vtkStructuredPoints::New( ); 00291 // Perform "cut" 00292 double *p, *n; 00293 for( int k = 0; k < nCnts; k++ ) { 00294 //s = ( double )k / ( double )( nCnts - 1 ); 00295 p = _points[k]; 00296 n = getNormal( k ); 00297 vtkPlaneSource* pSource = vtkPlaneSource::New( ); 00298 pSource->SetOrigin( p[ 0 ], p[ 1 ], p[ 2 ] ); 00299 pSource->SetPoint1( p[ 0 ] + dimIma - 1.0, p[ 1 ], p[ 2 ] ); 00300 pSource->SetPoint2( p[ 0 ], p[ 1 ], p[ 2 ] + dimIma - 1.0 ); 00301 pSource->SetResolution( sizeIma - 1, sizeIma - 1 ); 00302 pSource->Update( ); 00303 pSource->SetCenter( p[ 0 ], p[ 1 ], p[ 2 ] ); 00304 pSource->SetNormal( n[ 0 ], n[ 1 ], n[ 2 ] ); 00305 pSource->Update( ); 00306 00307 _3Dslices.push_back( vtkProbeFilter::New( ) ); 00308 _3Dslices[ k ]->SetInput( ( vtkDataSet* )pSource->GetOutput( ) ); 00309 _3Dslices[ k ]->SetSource( vol->castVtk( ) ); 00310 _3Dslices[ k ]->Update( ); 00311 pSource->Delete( ); 00312 00313 stPoints->GetPointData( )-> 00314 SetScalars( _3Dslices[ k ]->GetOutput( )-> 00315 GetPointData( )->GetScalars( ) ); 00316 stPoints->SetDimensions( sizeIma, sizeIma, 1 ); 00317 stPoints->SetScalarType( vol->castVtk( )->GetDataObjectType( ) ); 00318 stPoints->Update( ); 00319 if( forceCnt ) 00320 { 00321 marContour* tmp_marContour = new marContour( k, getParameters( ) ) ; 00322 tmp_marContour->calculateVariables(); 00323 _contours.push_back( tmp_marContour ); 00324 } 00325 _slices.push_back( new kVolume( kVolume::UCHAR, 1, 1, 1 ) ); 00326 00327 *( _slices[ k ] ) = ( vtkImageData* )stPoints; //copy 00328 _quantificationImages.push_back( (_slices[ k ])->castVtk( ) ); 00329 } // rof 00330 00331 stPoints->Delete( ); 00332 */ 00333 }
void marAxis::start | ( | ) |
Definition at line 178 of file marAxis.cpp.
00179 { 00180 /* TODO 00181 int swap, n = GetNumberOfPoints( ); 00182 00183 swap = GSL_MIN( _startQuant, _finishQuant ); 00184 _finishQuant = GSL_MAX( _startQuant, _finishQuant ); 00185 _startQuant = swap; 00186 00187 _startQuant = ( _startQuant >= 0 )? _startQuant: 0; 00188 _finishQuant = ( _finishQuant >= n )? _finishQuant: n - 1; 00189 _actualQuant = _startQuant; 00190 */ 00191 }
void marAxis::stop | ( | ) | [inline] |
Definition at line 133 of file marAxis.h.
Referenced by marAxisCT::adjustContour(), marAxisCT::extractLumen(), and marAxisCT::getDiameter().
00133 { _actualQuant = _finishQuant + 1; };
std::vector< vtkPolyData* > marAxis::_2Dcontours [private] |
Definition at line 225 of file marAxis.h.
Referenced by clearAllVectors(), create2Dcontour(), createEmptyVectors(), EraseContour(), eraseContourVectorsContent(), get2Dcontour(), and replaceContour2D().
std::vector< vtkPoints* > marAxis::_2DDiameterMax [private] |
Definition at line 227 of file marAxis.h.
Referenced by clearAllVectors(), create2DDiameterMax(), createEmptyVectors(), EraseContour(), eraseContourVectorsContent(), and get2DDiameterMax().
std::vector< vtkPoints* > marAxis::_2DDiameterMin [private] |
Definition at line 226 of file marAxis.h.
Referenced by clearAllVectors(), create2DDiameterMin(), createEmptyVectors(), EraseContour(), eraseContourVectorsContent(), and get2DDiameterMin().
std::vector< vtkPoints* > marAxis::_3Dcontour [private] |
Definition at line 223 of file marAxis.h.
Referenced by clearAllVectors(), create3Dcontour(), createEmptyVectors(), EraseContour(), eraseContourVectorsContent(), get3Dcontour(), if3DcontourExist(), Save3Dcontour(), and SaveExisting3DContours().
std::vector< vtkProbeFilter* > marAxis::_3Dslices [private] |
Definition at line 222 of file marAxis.h.
Referenced by clearAllVectors(), create3DSlice(), createEmptyVectors(), and get3DSlice().
int marAxis::_actualQuant [private] |
vtkPolyData* marAxis::_allData [private] |
std::vector< marContour* > marAxis::_contours [private] |
Definition at line 220 of file marAxis.h.
Referenced by clearAllVectors(), createContour(), createEmptyVectors(), doSpline(), EraseContour(), eraseContourVectorsContent(), getContour(), getNumberOfContours(), load(), and save().
std::string marAxis::_description [private] |
int marAxis::_finishQuant [private] |
Definition at line 233 of file marAxis.h.
Referenced by calculateSubAxisLength(), reset(), and setFinishQuant().
int marAxis::_healthySlice [private] |
Definition at line 229 of file marAxis.h.
Referenced by doSpline(), reset(), and setHealthySlice().
int marAxis::_healthySliceEnd [private] |
Definition at line 231 of file marAxis.h.
Referenced by calculateReferenceArea(), calculateReferenceAverDiam(), marAxis(), and setHealthySlice().
int marAxis::_healthySliceStart [private] |
Definition at line 230 of file marAxis.h.
Referenced by calculateReferenceArea(), calculateReferenceAverDiam(), marAxis(), and setHealthySlice().
std::vector< double* > marAxis::_points [private] |
Definition at line 219 of file marAxis.h.
Referenced by AddPointToList(), calculateSignal(), calculateTotalAxisLenght(), create3Dcontour(), create3DSlice(), createSlice(), Delete(), doSpline(), Draw(), getAverageArea(), getAxisLenght(), getNormal(), and getNumberOfSplinePoints().
PPPOINTAXE marAxis::_points_disc [private] |
Definition at line 235 of file marAxis.h.
Referenced by calculateSignal().
std::vector< vtkImageData* > marAxis::_quantificationImages [private] |
Definition at line 224 of file marAxis.h.
Referenced by clearAllVectors(), createEmptyVectors(), createSliceImage(), and getSliceImage().
double marAxis::_referenceArea [private] |
Definition at line 215 of file marAxis.h.
Referenced by calculateReferenceArea(), getReferenceArea(), marAxis(), reset(), and setHealthySlice().
double marAxis::_referenceAverDiam [private] |
Definition at line 216 of file marAxis.h.
Referenced by calculateReferenceAverDiam(), getReferenceAverDiam(), marAxis(), reset(), and setHealthySlice().
std::vector< int > marAxis::_signal [private] |
Definition at line 228 of file marAxis.h.
Referenced by AddPointToList(), calculateSignal(), and Delete().
std::vector< kVolume* > marAxis::_slices [private] |
Definition at line 221 of file marAxis.h.
Referenced by clearAllVectors(), createEmptyVectors(), createSlice(), and getSlice().
int marAxis::_startQuant [private] |
Definition at line 232 of file marAxis.h.
Referenced by calculateSubAxisLength(), reset(), and setStartQuant().
double marAxis::_subAxisLenght [private] |
Definition at line 214 of file marAxis.h.
Referenced by calculateSubAxisLength(), getSubAxisLength(), marAxis(), reset(), setFinishQuant(), and setStartQuant().
double marAxis::_totalAxisLenght [private] |
Definition at line 213 of file marAxis.h.
Referenced by calculateTotalAxisLenght(), getTotalLength(), and marAxis().
bool marAxis::calibration [protected] |
Definition at line 265 of file marAxis.h.
Referenced by marAxisCT::create2Dcontours(), marAxisCT::getCalibration(), marAxis(), and marAxisCT::setCalibration().
std::vector<marIsocontour *> marAxis::lumenContour [protected] |
Definition at line 264 of file marAxis.h.
Referenced by marAxisCT::createEmptyContours(), marAxisCT::eraseContours(), marAxisCT::eraseContoursPartial(), marAxisCT::generatePoints(), and marAxisCT::markUpLumen().
std::vector<marAxisContours* > marAxis::quantContours [protected] |
Definition at line 262 of file marAxis.h.
Referenced by marAxisCT::adjustContour(), marAxisCT::cleanContours(), marAxisCT::create2Dcontours(), marAxisCT::create2DDiametersMax(), marAxisCT::create2DDiametersMin(), marAxisCT::create3Dcontours(), marAxisCT::createContours(), marAxisCT::createEmptyContours(), marAxisCT::createSignals(), marAxisCT::eraseContours(), marAxisCT::eraseContoursPartial(), marAxisCT::extractLumen(), marAxisCT::generateFile(), marAxisCT::get2Dcontour(), marAxisCT::get2DDiameterMax(), marAxisCT::get2DDiameterMin(), marAxisCT::get3Dcontour(), marAxisCT::getContour(), marAxisCT::getContourType(), marAxisCT::getMaxIntensity(), marAxisCT::getNumberOfContours(), marAxisCT::getSignal(), marAxisCT::markUpLumen(), marAxisCT::performAND(), marAxisCT::performUnion(), marAxisCT::performXOR(), marAxisCT::replaceContour2D(), marAxisCT::searchContour(), marAxisCT::setStartIndex(), marAxisCT::updateCalcPercentage(), and marAxisCT::updateLumenPercentage().
std::vector<marPoint *> marAxis::vesselPoints [protected] |
Definition at line 263 of file marAxis.h.
Referenced by marAxisCT::eraseContours(), marAxisCT::getPoint(), marAxisCT::getPointSize(), and marAxisCT::markUpLumen().