6 #include <vtkCellLocator.h>
7 #include <vtkImageData.h>
8 #include <vtkPolyData.h>
9 #include <vtkTclUtil.h>
10 #include "marTclInterface.h"
15 %typemap(tcl8,in) std::string& {
18 $target = new std::string( Tcl_GetStringFromObj( $source, &l ) );
22 %typemap(tcl8,freearg) std::string& {
28 %typemap(tcl8,out) std::string {
31 Tcl_AppendElement( interp, $source->c_str( ) );
35 %typemap(tcl8,in) wxStringList& {
40 $target = new wxStringList;
41 Tcl_ListObjLength( interp, $source, &l );
42 for( i = 0; i < l; i++ ) {
44 Tcl_ListObjIndex( interp, $source, i, &tmp );
45 $target->Add( Tcl_GetStringFromObj( tmp, &s ) );
51 %typemap(tcl8,freearg) wxStringList& {
57 %typemap(tcl8,out) wxStringList& {
61 for( i = 0; i < $source->GetCount( ); i++ ) {
63 Tcl_AppendElement( interp, ( *$source )[ i ] );
69 %typemap(tcl8,in) int * {
75 Tcl_ListObjLength( interp, $source, &l );
77 for( i = 0; i < l; i++ ) {
79 Tcl_ListObjIndex( interp, $source, i, &tmp );
80 Tcl_GetIntFromObj( interp, tmp, &c[ i ] );
88 %typemap(tcl8,out) ushort * {
94 if( $source != NULL ) {
96 tam = ( int )$source[ 0 ];
97 for( i = 1; i <= tam; i++ ) {
99 sprintf( cad, "%d", $source[ i ] );
100 Tcl_AppendElement( interp, cad );
108 %typemap(tcl8,out) double * {
114 if( $source != NULL ) {
116 tam = ( int )$source[ 0 ];
117 for( i = 1; i <= tam; i++ ) {
119 sprintf( cad, "%f", $source[ i ] );
120 Tcl_AppendElement( interp, cad );
128 %typemap(tcl8,in) vtkCellLocator * {
133 Tcl_ListObjIndex( interp, $source, 0, &tmp );
134 $target = ( vtkCellLocator* ) vtkTclGetPointerFromObject( Tcl_GetStringFromObj( tmp, &s ), "vtkCellLocator", interp, err );
138 %typemap(tcl8,out) vtkImageData * {
140 int ( *command )( ClientData, Tcl_Interp*, int, char* [] ) = NULL;
142 // this function already sets the return
143 vtkTclGetObjectFromPointer( interp, $source, command );
147 %typemap(tcl8,out) vtkPolyData * {
149 int ( *command )( ClientData, Tcl_Interp*, int, char* [] ) = NULL;
151 // this function already sets the return
152 vtkTclGetObjectFromPointer( interp, $source, command );
158 void freeAllMaracasInterfaces_dll( );
160 // Parameters functions
161 wxStringList params_dll ( );
162 void setParams_dll ( wxStringList& raParams );
163 bool saveParams_dll ( std::string& fName );
164 bool loadParams_dll ( std::string& fName );
165 void SetROIStep_dll ( double vWidth );
166 double GetActualVoxelSize_dll ( );
169 wxStringList studies_dll ( );
170 wxStringList studyData_dll ( std::string& study );
171 wxStringList series_dll ( std::string& study );
172 wxStringList serieData_dll ( std::string& study, std::string& serie );
173 void SubtractSeries_dll( std::string& sl, std::string& sr, std::string& ss, std::string& description );
176 bool LoadImages_dll ( );
177 void LoadTkImages_dll ( wxStringList& tkNames, Tcl_Interp* interp );
178 int GetNumberOfImages_dll ( );
179 wxStringList GetImagesNumbers_dll ( );
181 double GetImageIntensity_dll ( int x, int y, int z );
183 ushort* GetProfilFromTotalVolume_dll( int xO, int yO, int zO, int xF, int yF, int zF );
185 %apply int *OUTPUT { int* min, int* max, int* avg, int* sd, int* size };
186 void GetAreaValuesFromTotalVolume_dll( int xO, int yO, int zO, int xF, int yF, int zF, int* min, int* max, int* avg, int* sd, int* size );
188 // Experiment functions
189 bool SaveExperiment_dll ( std::string& fName );
190 bool LoadExperiment_dll ( std::string& fName );
191 void InitExperiment_dll ( int* voi );
192 void SetStartPoint_dll ( int x, int y, int z );
193 void ExtractAxes_dll ( );
195 int GetNumberOfAxes_dll ( );
196 vtkPolyData* GetAllAxes_dll ( );
197 vtkPolyData* GetActualAxis_dll ( );
198 int GetActualAxisNumberOfPoints_dll ( );
199 double* GetActualAxisPoint_dll ( int i );
200 vtkImageData* GetActualAxisSlice_dll ( int i );
202 void PrepareQuantification_dll( int i );
203 double GetAxisLength_dll( );
205 // VTK data retrieving functions
206 %apply int *OUTPUT { int* min, int* max };
207 void GetImageRange_dll ( int* min, int* max );
208 vtkImageData* GetVTKVolume_dll ( );
210 // Functions to replace
211 %apply double *OUTPUT { double* xI, double* yI, double* zI };
212 extern int IntersectWithLine_dll ( vtkCellLocator* iCellLocator, double x1, double y1, double z1, double x2, double y2, double z2, double tol, double *xI, double *yI, double *zI );
213 %apply double *OUTPUT { double* xP1, double* yP1, double* zP1, double* xP2, double* yP2, double* zP2 };
214 extern void TclPerpendiculars_dll( double xN, double yN, double zN, double angle, double *xP1, double *yP1, double *zP1, double *xP2, double *yP2, double *zP2 );
216 // EOF - local_typemaps.i