#include "vtkActor.h"
#include "vtkAppendFilter.h"
#include "vtkCamera.h"
#include "vtkCallbackCommand.h"
#include "vtkCellArray.h"
#include "vtkCylinderSource.h"
#include "vtkClosePolyData.h"
#include "vtkCommand.h"
#include "vtkDoubleArray.h"
#include "vtkExtractVOI.h"
#include "vtkImageReader.h"
#include "vtkImageViewer.h"
#include "vtkImageViewer2.h"
#include "vtkImageToStructuredPoints.h"
#include "vtkImageThreshold.h"
#include "vtkImageWriter.h"
#include "vtkImageClip.h"
#include "vtkImageResample.h"
#include "vtkImageReslice.h"
#include "vtkImageCast.h"
#include "vtkImageData.h"
#include "vtkMath.h"
#include "vtkMarchingCubes.h"
#include "vtkObjectFactory.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkPolyDataConnectivityFilter.h"
#include "vtkProperty.h"
#include "vtkPriorityQueue.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolyDataWriter.h"
#include "vtkPolyDataReader.h"
#include "vtkPointData.h"
#include "vtkSphereSource.h"
#include "vtkSTLWriter.h"
#include "vtkStripper.h"
#include "vtkTriangleFilter.h"
#include "vtkTransform.h"
#include "wxPathologyWidget_01.h"
#include "kernel/vtkOtsuSphereSource.h"
#include <wx/splitter.h>
Go to the source code of this file.
Functions | |
double | GetDistanciaEuclideana (double *a, double *b) |
double | GetValorPromedio (vtkImageData *data) |
double | GetDistanciaAPolydata (double *punto, vtkPoints *centers) |
double | GetProductoPunto (double *vectorA, double *vectorB) |
double | GetNormaVector (double *vector) |
void | GetVector (double *p0, double *p1, double *resultado) |
void | VectorUnitario (double *v) |
void | GetNormalCelda (double *p0, double *p1, double *p2, double *normal) |
void | GetNormal (vtkPoints *puntosCelda, double *normal) |
int | GetClosestCellOnPolyData (double *punto, vtkPoints *centers) |
double | GetProjectionOnNormal (double *vector, double *normal) |
int GetClosestCellOnPolyData | ( | double * | punto, | |
vtkPoints * | centers | |||
) |
Definition at line 853 of file wxPathologyWidget_01.cxx.
Referenced by wxPathologyWidget_01::OnBtnExtractAxis().
00853 { 00854 double distancia = 0.0; 00855 double minima = 1e100; 00856 int ID = -1; 00857 double vertice[3]; 00858 int N = centers->GetNumberOfPoints(); 00859 00860 for(int i = 0; i < N; i++){ 00861 centers->GetPoint(i,vertice); 00862 distancia = sqrt(((punto[0]-vertice[0])*(punto[0]-vertice[0]))+((punto[1]-vertice[1])*(punto[1]-vertice[1]))+((punto[2]-vertice[2])*(punto[2]-vertice[2]))); 00863 00864 if (distancia < minima){ 00865 minima = distancia; 00866 ID = i; 00867 } 00868 } 00869 00870 //printf("distancia del punto p: (%.2f,%.2f,%.2f) al polydata es %.2f (ID %i)\n", punto[0], punto[1], punto [2], minima, ID); 00871 return ID; 00872 }
double GetDistanciaAPolydata | ( | double * | punto, | |
vtkPoints * | centers | |||
) |
Definition at line 783 of file wxPathologyWidget_01.cxx.
00783 { 00784 double distancia = 0.0; 00785 double minima = 1e100; 00786 double vertice[3]; 00787 int N = centers->GetNumberOfPoints(); 00788 00789 for(int i = 0; i < N; i++){ 00790 centers->GetPoint(i,vertice); 00791 distancia = sqrt(((punto[0]-vertice[0])*(punto[0]-vertice[0]))+((punto[1]-vertice[1])*(punto[1]-vertice[1]))+((punto[2]-vertice[2])*(punto[2]-vertice[2]))); 00792 00793 if (distancia < minima){ 00794 minima = distancia; 00795 } 00796 } 00797 return minima; 00798 }
double GetDistanciaEuclideana | ( | double * | a, | |
double * | b | |||
) |
Definition at line 458 of file wxPathologyWidget_01.cxx.
Referenced by wxPathologyWidget_01::OnBtnExtractAxis(), wxPathologyWidget_01::OnBtnExtractPat(), and wxPathologyWidget_01::OnBtnSetPat().
00458 { 00459 return sqrt(((a[0]-b[0])*(a[0]-b[0]))+((a[1]-b[1])*(a[1]-b[1]))+((a[2]-b[2])*(a[2]-b[2]))); 00460 }
void GetNormal | ( | vtkPoints * | puntosCelda, | |
double * | normal | |||
) |
Definition at line 841 of file wxPathologyWidget_01.cxx.
References GetNormalCelda().
Referenced by wxPathologyWidget_01::OnBtnExtractAxis().
00841 { 00842 double p0[3], p1[3], p2[3]; 00843 00844 puntosCelda->GetPoint(0, p0); 00845 puntosCelda->GetPoint(1, p1); 00846 puntosCelda->GetPoint(2, p2); 00847 00848 GetNormalCelda(p0,p1,p2, normal); 00849 }
void GetNormalCelda | ( | double * | p0, | |
double * | p1, | |||
double * | p2, | |||
double * | normal | |||
) |
Definition at line 828 of file wxPathologyWidget_01.cxx.
References GetVector(), and VectorUnitario().
Referenced by GetNormal().
00828 { 00829 00830 double U[3],V[3]; 00831 GetVector(p1,p2,U); //p2-p1 00832 GetVector(p1,p0,V); //p0-p1 00833 00834 00835 normal[0] = (U[1]*V[2])-(U[2]*V[1]); 00836 normal[1] = -((U[0]*V[2])-(U[2]*V[0])); 00837 normal[2] = (U[0]*V[1])-(U[1]*V[0]); 00838 VectorUnitario(normal); 00839 }
double GetNormaVector | ( | double * | vector | ) |
Definition at line 806 of file wxPathologyWidget_01.cxx.
References GetProductoPunto().
Referenced by GetProjectionOnNormal(), and VectorUnitario().
00806 { 00807 return sqrt(GetProductoPunto(vector, vector)); 00808 }
double GetProductoPunto | ( | double * | vectorA, | |
double * | vectorB | |||
) |
Definition at line 801 of file wxPathologyWidget_01.cxx.
Referenced by GetNormaVector(), and GetProjectionOnNormal().
00801 { 00802 return (vectorA[0]*vectorB[0] + vectorA[1]*vectorB[1] + vectorA[2]*vectorB[2]); 00803 }
double GetProjectionOnNormal | ( | double * | vector, | |
double * | normal | |||
) |
Definition at line 874 of file wxPathologyWidget_01.cxx.
References GetNormaVector(), and GetProductoPunto().
Referenced by wxPathologyWidget_01::OnBtnExtractAxis().
00874 { 00875 double pp = GetProductoPunto(vector, normal); 00876 double vv = GetNormaVector(normal); 00877 double pr = pp / vv; 00878 return pr; 00879 }
double GetValorPromedio | ( | vtkImageData * | data | ) |
Definition at line 463 of file wxPathologyWidget_01.cxx.
00463 { 00464 int ext[6]; 00465 int i, j, k; 00466 int numVoxels = 0; 00467 double promedio = 0; 00468 double valor; 00469 00470 00471 data->GetExtent(ext); 00472 00473 00474 for(i=ext[0];i<=ext[1];i++){ 00475 for(j=ext[2];j<=ext[3];j++){ 00476 for(k=ext[4];k<=ext[5];k++){ 00477 valor =data->GetScalarComponentAsDouble(i,j,k,0); 00478 promedio += valor; 00479 numVoxels++; 00480 } 00481 } 00482 } 00483 return (double)promedio/(double)numVoxels; 00484 }
void GetVector | ( | double * | p0, | |
double * | p1, | |||
double * | resultado | |||
) |
Definition at line 811 of file wxPathologyWidget_01.cxx.
Referenced by GetNormalCelda(), and wxPathologyWidget_01::OnBtnExtractAxis().
00811 { //p1:destino - p0:origen 00812 00813 resultado[0] = p1[0] - p0[0]; 00814 resultado[1] = p1[1] - p0[1]; 00815 resultado[2] = p1[2] - p0[2]; 00816 00817 }
void VectorUnitario | ( | double * | v | ) |
Definition at line 820 of file wxPathologyWidget_01.cxx.
References GetNormaVector().
Referenced by GetNormalCelda(), and wxPathologyWidget_01::OnBtnExtractAxis().
00820 { 00821 double norma = GetNormaVector(v); 00822 v[0] = v[0] / norma; 00823 v[1] = v[1] / norma; 00824 v[2] = v[2] / norma; 00825 }