From: jean-pierre roux Date: Tue, 20 Apr 2010 16:11:34 +0000 (+0000) Subject: remove home-made 'uint', 'uchar', 'ushort', etc replace by uint32_t, uint8_t, uint16_t X-Git-Tag: CREATOOLS.2-0-3~26 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=66588eac91068d9b7f9d45bffc5e09c27511eaac;p=creaMaracasVisu.git remove home-made 'uint', 'uchar', 'ushort', etc replace by uint32_t, uint8_t, uint16_t to avoid unpredictable results on 64 bits processors --- diff --git a/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx b/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx index 7dc928a..64d1c1f 100644 --- a/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx +++ b/bbtk/src/bbcreaMaracasVisuPlaneDirection.cxx @@ -2,13 +2,11 @@ #include "bbcreaMaracasVisuPackage.h" namespace bbcreaMaracasVisu { - + BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,PlaneDirection) BBTK_BLACK_BOX_IMPLEMENTATION(PlaneDirection,bbtk::WxBlackBox); void PlaneDirection::Process() { - - int radio = bbGetInputArrowSize(); std::vector lstPointsx = bbGetInputlstPointsX(); std::vector lstPointsy = bbGetInputlstPointsY(); @@ -48,13 +46,14 @@ void PlaneDirection::Process() _planedir->WriteInformation(filename,spc); } } - } + void PlaneDirection::CreateWidget(wxWindow* parent) { _planedir = PlaneDirectionViewer::getInstance(parent, radio, colour, opacity); bbSetOutputWidget( _planedir ); } + void PlaneDirection::bbUserSetDefaultValues() { radio = 5; @@ -63,6 +62,7 @@ void PlaneDirection::bbUserSetDefaultValues() colour[2] = 0; opacity = 100; } + void PlaneDirection::bbUserInitializeProcessing() { std::vector temp; @@ -72,8 +72,8 @@ void PlaneDirection::bbUserInitializeProcessing() bbSetInputlstPointsX(temp); bbSetInputlstPointsY(temp); bbSetInputlstPointsZ(temp); - } + void PlaneDirection::bbUserFinalizeProcessing() { diff --git a/lib/maracasVisuLib/include/mathdefs.h b/lib/maracasVisuLib/include/mathdefs.h index 47c9f5f..177bd74 100644 --- a/lib/maracasVisuLib/include/mathdefs.h +++ b/lib/maracasVisuLib/include/mathdefs.h @@ -39,14 +39,15 @@ #define GTM_MAX( a, b ) ( ( ( a ) > ( b ) )? ( a ): ( b ) ) #define GTM_POW2( a ) ( ( a ) * ( a ) ) -// Useful typedefs. +// Useful typedefs. // Useless now // JPR +/* typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; +*/ namespace gtm { - /** Rounds a double number. * * @param n Number. @@ -60,9 +61,7 @@ namespace gtm return( tmp ); else return( ceil( n ) ); - } - } #endif // GTMLIB__MATH__MATHDEFS__HXX diff --git a/lib/maracasVisuLib/include/matrix.h b/lib/maracasVisuLib/include/matrix.h index 9689f59..40eaba8 100644 --- a/lib/maracasVisuLib/include/matrix.h +++ b/lib/maracasVisuLib/include/matrix.h @@ -50,11 +50,11 @@ namespace gtm */ //@{ /// Default constructor. - TMatrix( uint N = 3, uint M = 3, T data = ( T )0 ); + TMatrix( uint32_t N = 3, uint32_t M = 3, T data = ( T )0 ); /// Copy constructor. TMatrix( const TMatrix< T >& r ); /// ANSI casting constructor. - TMatrix( T** block, uint N, uint M ); + TMatrix( T** block, uint32_t N, uint32_t M ); //@} /// Destructor. @@ -87,15 +87,15 @@ namespace gtm //@} /// Reference operator. - T& operator()( uint i, uint j ) { + T& operator()( uint32_t i, uint32_t j ) { return( _matrix[ i ][ j ] ); }; /// Columns - uint GetN( ) { + uint32_t GetN( ) { return( _N ); }; /// Rows - uint GetM( ) { + uint32_t GetM( ) { return( _M ); }; /// Returns the ANSI (C/C++) reference. @@ -178,9 +178,9 @@ namespace gtm /// Memory block. T** _matrix; /// Columns. - uint _N; + uint32_t _N; /// Rows. - uint _M; + uint32_t _M; //@} }; @@ -189,7 +189,7 @@ namespace gtm template< class T > TVector< T >& TVector< T >::operator=( TMatrix< T >& r ) { - uint i, j, k, min; + uint32_t i, j, k, min; // This min calc. avoids to reserve temporary memory, so, be careful. min = GTM_MIN( r.GetN( ) * r.GetM( ), _N ); @@ -211,7 +211,7 @@ namespace gtm // ----------------------------------------------------------------------------- template< class T > - TMatrix< T >::TMatrix( uint N, uint M, T data ) + TMatrix< T >::TMatrix( uint32_t N, uint32_t M, T data ) { _N = N; _M = M; @@ -232,7 +232,7 @@ namespace gtm // ----------------------------------------------------------------------------- template< class T > - TMatrix< T >::TMatrix( T** block, uint N, uint M ) + TMatrix< T >::TMatrix( T** block, uint32_t N, uint32_t M ) { _N = N; _M = M; @@ -260,8 +260,8 @@ namespace gtm template< class T > TMatrix< T >& TMatrix< T >::operator=( TVector< T >& r ) { - uint i; - uint n = r.GetN( ); + uint32_t i; + uint32_t n = r.GetN( ); bool column = ( r.GetType( ) == COL_VECTOR ); MatrixFreeMemory< T >( _matrix, _N ); @@ -286,7 +286,7 @@ namespace gtm template< class T > bool TMatrix< T >::operator==( const TMatrix< T >& r ) { - uint i, j; + uint32_t i, j; bool ret; for( @@ -306,7 +306,7 @@ namespace gtm template< class T > bool TMatrix< T >::operator!=( const TMatrix< T >& r ) { - uint i, j; + uint32_t i, j; bool ret; for( @@ -393,7 +393,7 @@ namespace gtm TMatrix< T > TMatrix< T >::operator-( ) { TMatrix< T > ret( _N, _M ); - uint i, j; + uint32_t i, j; for( i = 0; i < _N; i++ ) for( j = 0; j < _M; ret._matrix[ i ][ j ] = ( T )0 - _matrix[ i ][ j ], j++ ); diff --git a/lib/maracasVisuLib/include/vector.h b/lib/maracasVisuLib/include/vector.h index edadd11..580deb7 100644 --- a/lib/maracasVisuLib/include/vector.h +++ b/lib/maracasVisuLib/include/vector.h @@ -60,11 +60,11 @@ namespace gtm */ //@{ /// Default constructor. - TVector( uint N = 3, T data = ( T )0, int type = COL_VECTOR ); + TVector( uint32_t N = 3, T data = ( T )0, int type = COL_VECTOR ); /// Copy constructor. TVector( const TVector< T >& r ); /// Use this to treat an ANSI array as a TVector. - TVector( T* block, uint N, bool copy = true, int type = COL_VECTOR ); + TVector( T* block, uint32_t N, bool copy = true, int type = COL_VECTOR ); //@} /// Destructor. @@ -73,7 +73,7 @@ namespace gtm }; /// Size change - void SetN( uint N ); + void SetN( uint32_t N ); /** Assignation operators. * @@ -108,7 +108,7 @@ namespace gtm //@} /// Reference operator. - T& operator()( uint i ) { + T& operator()( uint32_t i ) { return( _vector[ i ] ); }; /// ANSI (C/C++ array) reference. @@ -116,7 +116,7 @@ namespace gtm return( _vector ); }; /// Vector's cardinality. - uint GetN( ) { + uint32_t GetN( ) { return( _N ); }; /// Vector's type (ROW_VECTOR/COL_VECTOR). @@ -197,7 +197,7 @@ namespace gtm /// Memory block. T* _vector; /// Cardinality. - uint _N; + uint32_t _N; /// Type (ROW_VECTOR/COL_VECTOR). int _type; /// Have I created _vector? @@ -208,7 +208,7 @@ namespace gtm // ----------------------------------------------------------------------------- template< class T > - TVector< T >::TVector( uint N, T data, int type ) + TVector< T >::TVector( uint32_t N, T data, int type ) { _N = N; _type = type; @@ -231,7 +231,7 @@ namespace gtm // ----------------------------------------------------------------------------- template< class T > - TVector< T >::TVector( T* block, uint N, bool copy, int type ) + TVector< T >::TVector( T* block, uint32_t N, bool copy, int type ) { _N = N; _type = type; @@ -242,7 +242,7 @@ namespace gtm // ----------------------------------------------------------------------------- template< class T > - void TVector< T >::SetN( uint N ) + void TVector< T >::SetN( uint32_t N ) { if( _myMemory ) VectorFreeMemory< T >( _vector ); _N = N; @@ -269,7 +269,7 @@ namespace gtm template< class T > bool TVector< T >::operator==( const TVector< T >& r ) { - uint i; + uint32_t i; bool ret; for( @@ -285,7 +285,7 @@ namespace gtm template< class T > bool TVector< T >::operator!=( const TVector< T >& r ) { - uint i; + uint32_t i; bool ret; for( @@ -346,7 +346,7 @@ namespace gtm TVector< T > TVector< T >::operator-( ) { TVector< T > ret( _N ); - uint i; + uint32_t i; for( i = 0; i < _N; ret._vector[ i ] = ( T )0 - _vector[ i ], i++ ); return( ret ); diff --git a/lib/maracasVisuLib/include/vmfuncs.h b/lib/maracasVisuLib/include/vmfuncs.h index 976cd2c..9abbaf6 100644 --- a/lib/maracasVisuLib/include/vmfuncs.h +++ b/lib/maracasVisuLib/include/vmfuncs.h @@ -29,6 +29,8 @@ #include #include "mathdefs.h" +#include + using namespace std; namespace gtm @@ -47,14 +49,14 @@ namespace gtm */ template< class T > inline - void VectorPrint( std::ostream& o, T* v, uint n, bool col ) + void VectorPrint( std::ostream& o, T* v, uint32_t n, bool col ) { - uint i; + uint32_t i; o << n << ": ["; if( col ) o << endl; else o << " "; - for( uint i = 0; i < n; i++ ) { + for( uint32_t i = 0; i < n; i++ ) { o << v[ i ]; if( col ) o << endl; @@ -72,7 +74,7 @@ namespace gtm */ template< class T > inline - T* VectorAllocateMemory( uint n ) + T* VectorAllocateMemory( uint32_t n ) { T* v = new T[ n ]; @@ -103,7 +105,7 @@ namespace gtm */ template< class T > inline - void VectorAssignMemory( T* v, T* v_o, uint n ) + void VectorAssignMemory( T* v, T* v_o, uint32_t n ) { memcpy( v, v_o, sizeof( T ) * n ); @@ -117,7 +119,7 @@ namespace gtm */ template< class T > inline - T* VectorCopyMemory( T* v, uint n ) + T* VectorCopyMemory( T* v, uint32_t n ) { T* n_v = VectorAllocateMemory< T >( n ); VectorAssignMemory< T >( n_v, v, n ); @@ -134,9 +136,9 @@ namespace gtm */ template< class T > inline - void VectorAssignScalar( T* v, T s, uint n ) + void VectorAssignScalar( T* v, T s, uint32_t n ) { - uint i; + uint32_t i; for( i = 0; i < n; v[ i ] = s, i++ ); @@ -153,9 +155,9 @@ namespace gtm */ template< class T > inline - void VectorMatrixCast( T** ma, T* v, uint n, uint m, bool col ) + void VectorMatrixCast( T** ma, T* v, uint32_t n, uint32_t m, bool col ) { - uint i; + uint32_t i; for( i = 0; i < ( ( col )? m: n ); i++ ) ma[ ( col )? n: i ][ ( col )? i: m ] = v[ i ]; @@ -172,9 +174,9 @@ namespace gtm */ template< class T > inline - void VectorAdd( T* v, T* v_l, T* v_r, uint n ) + void VectorAdd( T* v, T* v_l, T* v_r, uint32_t n ) { - uint i; + uint32_t i; for( i = 0; i < n; v[ i ] = v_l[ i ] + v_r[ i ], i++ ); @@ -190,9 +192,9 @@ namespace gtm */ template< class T > inline - void VectorSubtract( T* v, T* v_l, T* v_r, uint n ) + void VectorSubtract( T* v, T* v_l, T* v_r, uint32_t n ) { - uint i; + uint32_t i; for( i = 0; i < n; v[ i ] = v_l[ i ] - v_r[ i ], i++ ); @@ -225,10 +227,10 @@ namespace gtm */ template< class T > inline - T VectorDotProduct( T* v_l, T* v_r, uint n ) + T VectorDotProduct( T* v_l, T* v_r, uint32_t n ) { T ret; - uint i; + uint32_t i; for( i = 0, ret = ( T )0; i < n; ret = ret + ( v_l[ i ] * v_r[ i ] ), i++ ); return( ret ); @@ -245,9 +247,9 @@ namespace gtm */ template< class T > inline - void VectorScalarProduct( T* v, T* v_l, T s, uint n ) + void VectorScalarProduct( T* v, T* v_l, T s, uint32_t n ) { - uint i; + uint32_t i; for( i = 0; i < n; v[ i ] = v_l[ i ] * s, i++ ); @@ -261,7 +263,7 @@ namespace gtm */ template< class T > inline - T VectorNorm( T* v, uint n ) + T VectorNorm( T* v, uint32_t n ) { return( ( T )( sqrt( ( double )( VectorDotProduct< T >( v, v, n ) ) ) ) ); @@ -276,9 +278,9 @@ namespace gtm */ template< class T > inline - void VectorNormalize( T* v, T* v_o, uint n ) + void VectorNormalize( T* v, T* v_o, uint32_t n ) { - uint i; + uint32_t i; T norm = VectorNorm< T >( v_o, n ); norm = ( norm == ( T )0 )? ( T )1: norm; @@ -300,9 +302,9 @@ namespace gtm */ template< class T > inline - void MatrixPrint( std::ostream& o, T** ma, uint n, uint m ) + void MatrixPrint( std::ostream& o, T** ma, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; o << n << " x " << m << endl; for( j = 0; j < m; j++ ) { @@ -322,9 +324,9 @@ namespace gtm */ template< class T > inline - T** MatrixAllocateMemory( uint n, uint m ) + T** MatrixAllocateMemory( uint32_t n, uint32_t m ) { - uint i; + uint32_t i; T** ma = new T*[ n ]; for( i = 0; i < n; i++ ) { @@ -347,9 +349,9 @@ namespace gtm */ template< class T > inline - void MatrixAssignMemory( T** ma, T** ma_o, uint n, uint m ) + void MatrixAssignMemory( T** ma, T** ma_o, uint32_t n, uint32_t m ) { - uint i; + uint32_t i; for( i = 0; i < n; i++ ) memcpy( ma[ i ], ma_o[ i ], sizeof( T ) * m ); @@ -365,7 +367,7 @@ namespace gtm */ template< class T > inline - T** MatrixCopyMemory( T** ma, uint n, uint m ) + T** MatrixCopyMemory( T** ma, uint32_t n, uint32_t m ) { T** n_ma = MatrixAllocateMemory< T >( n, m ); MatrixAssignMemory< T >( n_ma, ma, n, m ); @@ -383,9 +385,9 @@ namespace gtm */ template< class T > inline - void MatrixAssignScalar( T** ma, T s, uint n, uint m ) + void MatrixAssignScalar( T** ma, T s, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; for( i = 0; i < n; i++ ) for( j = 0; j < m; j++ ) @@ -404,9 +406,9 @@ namespace gtm */ template< class T > inline - void MatrixVectorCast( T* v, T** ma, uint n, uint m, bool col ) + void MatrixVectorCast( T* v, T** ma, uint32_t n, uint32_t m, bool col ) { - uint i; + uint32_t i; for( i = 0; i < ( ( col )? m: n ); i++ ) v[ i ] = ma[ ( col )? n: i ][ ( col )? i: m ]; @@ -421,9 +423,9 @@ namespace gtm */ template< class T > inline - void MatrixFreeMemory( T** ma, uint n ) + void MatrixFreeMemory( T** ma, uint32_t n ) { - uint i; + uint32_t i; if( ma ) { @@ -446,9 +448,9 @@ namespace gtm */ template< class T > inline - void MatrixAdd( T** ma, T** ma_l, T** ma_r, uint n, uint m ) + void MatrixAdd( T** ma, T** ma_l, T** ma_r, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; for( i = 0; i < n; i++ ) for( j = 0; j < m; ma[ i ][ j ] = ma_l[ i ][ j ] + ma_r[ i ][ j ], j++ ); @@ -466,9 +468,9 @@ namespace gtm */ template< class T > inline - void MatrixSubtract( T** ma, T** ma_l, T** ma_r, uint n, uint m ) + void MatrixSubtract( T** ma, T** ma_l, T** ma_r, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; for( i = 0; i < n; i++ ) for( j = 0; j < m; ma[ i ][ j ] = ma_l[ i ][ j ] - ma_r[ i ][ j ], j++ ); @@ -487,7 +489,7 @@ namespace gtm */ template< class T > inline - void MatrixProduct( T** ma, T** ma_l, T** ma_r, uint n, uint m, uint nr ) + void MatrixProduct( T** ma, T** ma_l, T** ma_r, uint32_t n, uint32_t m, uint32_t nr ) { unsigned i, j, k; @@ -512,9 +514,9 @@ namespace gtm */ template< class T > inline - void MatrixScalarProduct( T** ma, T** ma_l, T s, uint n, uint m ) + void MatrixScalarProduct( T** ma, T** ma_l, T s, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; for( i = 0; i < n; i++ ) for( j = 0; j < m; ma[ i ][ j ] = ma_l[ i ][ j ] * s, j++ ); @@ -533,9 +535,9 @@ namespace gtm */ template< class T > inline - void MatrixCofactor( T** ma, T** ma_o, uint i, uint j, uint n, uint m ) + void MatrixCofactor( T** ma, T** ma_o, uint32_t i, uint32_t j, uint32_t n, uint32_t m ) { - uint k, l; + uint32_t k, l; for( k = 0; k < i; k++ ) { @@ -561,9 +563,9 @@ namespace gtm */ template< class T > inline - T MatrixDeterminant( T** ma, uint n ) + T MatrixDeterminant( T** ma, uint32_t n ) { - uint k; + uint32_t k; T** tmp = NULL; T ret = ( T )0, c; @@ -614,9 +616,9 @@ namespace gtm */ template< class T > inline - void MatrixInverseAdjoint( T** ma, T** ma_o, uint n ) + void MatrixInverseAdjoint( T** ma, T** ma_o, uint32_t n ) { - uint i, j; + uint32_t i, j; T** tmp; T c; @@ -649,9 +651,9 @@ namespace gtm */ template< class T > inline - void MatrixInverseGauss( T** ma, T** ma_o, uint n ) + void MatrixInverseGauss( T** ma, T** ma_o, uint32_t n ) { - uint i, j, k, n2 = 2 * n; + uint32_t i, j, k, n2 = 2 * n; T** ma_a = MatrixAllocateMemory< T >( n2, n ); T a, b; @@ -699,9 +701,9 @@ namespace gtm */ template< class T > inline - void MatrixTranspose( T** ma, T** ma_o, uint n, uint m ) + void MatrixTranspose( T** ma, T** ma_o, uint32_t n, uint32_t m ) { - uint i, j; + uint32_t i, j; for( i = 0; i < m; i++ ) for( j = 0; j < n; ma[ i ][ j ] = ma_o[ j ][ i ], j++ ); @@ -716,9 +718,9 @@ namespace gtm */ template< class T > inline - void MatrixLoadIdentity( T** ma, uint n ) + void MatrixLoadIdentity( T** ma, uint32_t n ) { - uint i, j; + uint32_t i, j; for( i = 0; i < n; i++ ) for( j = 0; j < n; ma[ i ][ j ] = ( i == j )? ( T )1: ( T )0, j++ ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp index 63d9b5c..0f5a183 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp @@ -71,7 +71,7 @@ manualContourBaseControler* creaContoursFactory::getContourControler(int typeCon manContourControl = new manualContour3V3DControler(); } - return manContourControl; + return manContourControl; } @@ -124,9 +124,6 @@ manualContourBaseControler* creaContoursFactory::getContourControler(std::string { manContourControl = getContourControler(12); } - - - return manContourControl; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.h index 68f0a29..5a15477 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.h @@ -23,7 +23,6 @@ #include "manualView3DContour.h" #include "manualContour3V3DControler.h" - class creaMaracasVisu_EXPORT creaContoursFactory { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.cpp index 8150aed..9088b92 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.cpp @@ -6,8 +6,9 @@ // ---------------------------------------------------------------------------- manualContour3V3DControler::manualContour3V3DControler() + : +_manualcontour3Vcontroler(NULL) { - _manualcontour3Vcontroler=NULL; } // ---------------------------------------------------------------------------- manualContour3V3DControler::~manualContour3V3DControler() diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.h index 784eb90..cc1dcbc 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3V3DControler.h @@ -26,7 +26,6 @@ public: virtual void InsertPoint(int x, int y, int z); virtual void ResetContour(); - protected: private: manualContour3VControler *_manualcontour3Vcontroler; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index af6723b..6247a2b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: wxMaracas_ViewerWidget.cxx,v $ Language: C++ - Date: $Date: 2010/04/20 14:42:41 $ - Version: $Revision: 1.26 $ + Date: $Date: 2010/04/20 16:11:37 $ + Version: $Revision: 1.27 $ Copyright: (c) 2002, 2003 License: @@ -47,13 +47,13 @@ if (vtkmprbasedata==NULL) { - minternalVtkmprbasedata = true; - mvtkmprbasedata = new vtkMPRBaseData(); + minternalVtkmprbasedata = true; + mvtkmprbasedata = new vtkMPRBaseData(); marImageData *marimagedata = new marImageData( imagedata ); mvtkmprbasedata->SetMarImageData(marimagedata); } else { minternalVtkmprbasedata = false; - mvtkmprbasedata = vtkmprbasedata; + mvtkmprbasedata = vtkmprbasedata; } mvtk2Dbaseview = NULL; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index a62ae3c..00cfbdc 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -24,8 +24,6 @@ wxVtkBaseView::wxVtkBaseView(wxWindow *parent) // _iren->UseCaptureMouseOn(); // _iren = new wxVTKRenderWindowInteractor(_parent,-1); _interactorStyle = NULL; - - } //------------------------------------------------------------------- @@ -119,8 +117,7 @@ void wxVtkBaseView::TransCoordScreenToWorld(double &X, double &Y, double &Z, int //---------------------------------------------------------------------------- void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2 -{ - +{ double xx = X; double yy = Y; double zz = Z; diff --git a/lib/maracasVisuLib/src/kernel/include/curve.cxx b/lib/maracasVisuLib/src/kernel/include/curve.cxx index f7ce241..bfcb435 100644 --- a/lib/maracasVisuLib/src/kernel/include/curve.cxx +++ b/lib/maracasVisuLib/src/kernel/include/curve.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: curve.cxx,v $ Language: C++ - Date: $Date: 2010/04/20 14:42:45 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/04/20 16:11:41 $ + Version: $Revision: 1.3 $ Copyright: (c) 2002, 2003 License: @@ -103,7 +103,7 @@ kCurve& kCurve::operator=( const kCurve& r ) } // ------------------------------------------------------------------------- -uint kCurve::getClosestControlPoint( double* p ) +uint32_t kCurve::getClosestControlPoint( double* p ) { int res; // PS -> gslobj_vector vp( p, _dimension ), cp( _dimension ); //PS @@ -184,7 +184,7 @@ void kCurve::getNormal( double* n, double s ) void kCurve::getBinormal( double* b, double s ) { // PS -> //gslobj_vector tg( _dimension ), n( _dimension ); //PS - marVector tg( _dimension ), n( _dimension ); + marVector tg( _dimension ), n( _dimension ); double t; int i; @@ -311,7 +311,7 @@ double kCurve::projectOverControlPoints( double* pr, double* pt ) marVector xpr( pr, 3 ); double sina, sinn, cosa, cosn, tha, thn; double d, e, t, l, tca, tcn, lca, lcn; - uint icp = getClosestControlPoint( pt ); + uint32_t icp = getClosestControlPoint( pt ); getControlPoint( icp, ( double* )xpc, NULL ); diff --git a/lib/maracasVisuLib/src/kernel/include/curve.hxx b/lib/maracasVisuLib/src/kernel/include/curve.hxx index d8118af..f91e66c 100644 --- a/lib/maracasVisuLib/src/kernel/include/curve.hxx +++ b/lib/maracasVisuLib/src/kernel/include/curve.hxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: curve.hxx,v $ Language: C++ - Date: $Date: 2009/05/14 13:55:07 $ - Version: $Revision: 1.1 $ + Date: $Date: 2010/04/20 16:11:41 $ + Version: $Revision: 1.2 $ Copyright: (c) 2002, 2003 License: @@ -34,17 +34,17 @@ class MAR_KERNEL_EXPORT kCurve kCurve& operator=( const kCurve& r ); - uint getDimension( ) const + uint32_t getDimension( ) const { return( _dimension ); } - uint getStateDimension( ) const + uint32_t getStateDimension( ) const { return( _stateDim ); } - uint getClosestControlPoint( double* p ); + uint32_t getClosestControlPoint( double* p ); void getPoint( double* p, double s ); void getState( double* st, double s ); @@ -55,7 +55,7 @@ class MAR_KERNEL_EXPORT kCurve void addControlPoint( double* cp, double* sp ); void getControlPoint( int i, double* cp, double* sp ); void setControlPoint( int i, double* cp, double* sp ); - uint getNumberOfControlPoints( ) + uint32_t getNumberOfControlPoints( ) { return( _controlPoints.size( ) ); } @@ -82,8 +82,8 @@ class MAR_KERNEL_EXPORT kCurve std::vector< double* > _controlPoints; std::vector< double* > _controlState; - uint _dimension; - uint _stateDim; + uint32_t _dimension; + uint32_t _stateDim; private: diff --git a/lib/maracasVisuLib/src/kernel/include/marAxis.h b/lib/maracasVisuLib/src/kernel/include/marAxis.h index 76eb864..6106474 100644 --- a/lib/maracasVisuLib/src/kernel/include/marAxis.h +++ b/lib/maracasVisuLib/src/kernel/include/marAxis.h @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: marAxis.h,v $ Language: C++ - Date: $Date: 2009/05/14 13:55:07 $ - Version: $Revision: 1.1 $ + Date: $Date: 2010/04/20 16:11:41 $ + Version: $Revision: 1.2 $ Copyright: (c) 2002, 2003 License: @@ -106,17 +106,17 @@ public: void calculateSignal( kVolume* vol ); - int getActualQuant( ) { return _actualQuant; } + int getActualQuant( ) { return _actualQuant; } - float getSignal( uint slice ) { return( _signal[ slice ] ); }; + float getSignal( uint32_t slice ) { return( _signal[ slice ] ); }; - double* getSplinePoint( uint i ) { return ( _points[ i ] ); }; + double* getSplinePoint( uint32_t i ) { return ( _points[ i ] ); }; - int getHealthySlice( ) { return( _healthySlice ); }; - int getHealthySliceStart( ) { return( _healthySliceStart ); }; - int getHealthySliceEnd( ) { return( _healthySliceEnd ); }; + int getHealthySlice( ) { return( _healthySlice ); }; + int getHealthySliceStart( ) { return( _healthySliceStart ); }; + int getHealthySliceEnd( ) { return( _healthySliceEnd ); }; - void setActualQuant(int act) { _actualQuant=act; }; + void setActualQuant(int act) { _actualQuant=act; }; void setHealthySlice( int hsS, int hs, int hsE ); @@ -157,13 +157,13 @@ public: */ - bool if3DcontourExist(int i); - void Save3Dcontour(FILE *ff,int i); - void SaveExisting3DContours(FILE *ff); + bool if3DcontourExist(int i); + void Save3Dcontour(FILE *ff,int i); + void SaveExisting3DContours(FILE *ff); marContour* getContour( int i , kVolume* vol ); // DATA-MODEL-2D - kVolume* getSlice( int i , kVolume* vol ); // DATA-MODEL-Voxel XxYx1 + kVolume* getSlice( int i , kVolume* vol ); // DATA-MODEL-Voxel XxYx1 vtkProbeFilter* get3DSlice( int i , kVolume* vol ); // VISUALISATION-VTK 3D vtkPoints* get3Dcontour( int i , kVolume* vol ); // VISUALISATION-VTK 3D vtkImageData* getSliceImage( int i , kVolume* vol ); // VISUALISATION-VTK 2D diff --git a/lib/maracasVisuLib/src/kernel/include/marExperiment.cpp b/lib/maracasVisuLib/src/kernel/include/marExperiment.cpp index 9653fd6..f012ade 100644 --- a/lib/maracasVisuLib/src/kernel/include/marExperiment.cpp +++ b/lib/maracasVisuLib/src/kernel/include/marExperiment.cpp @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: marExperiment.cpp,v $ Language: C++ - Date: $Date: 2009/05/14 13:55:07 $ - Version: $Revision: 1.1 $ + Date: $Date: 2010/04/20 16:11:41 $ + Version: $Revision: 1.2 $ Copyright: (c) 2002, 2003 License: @@ -324,8 +324,8 @@ bool marExperiment::load( std::ifstream& is ) // ---------------------------------------------------------------------------- void marExperiment::DeleteAxis( unsigned int index ) { - /* Very naughty bug, when doing a - 1, where a is uint result is still - uint, imaging when a=0 :) need to cast to int*/ + /* Very naughty bug, when doing a - 1, where a is uint32_t result is still + uint32_t, imaging when a=0 :) need to cast to int*/ int axesize=_axes.size( )-1; index=index+1; diff --git a/lib/maracasVisuLib/src/kernel/marDynData.cpp b/lib/maracasVisuLib/src/kernel/marDynData.cpp index 29f1e6f..bc2cd13 100644 --- a/lib/maracasVisuLib/src/kernel/marDynData.cpp +++ b/lib/maracasVisuLib/src/kernel/marDynData.cpp @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: marDynData.cpp,v $ Language: C++ - Date: $Date: 2009/05/14 13:54:43 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/04/20 16:11:40 $ + Version: $Revision: 1.3 $ Copyright: (c) 2002, 2003 License: @@ -147,8 +147,8 @@ void marDynData::copyFrom( const marObject& from ) bool marDynData::save( std::ofstream& os ) { void* data = _volume->getData1D( ); - uint dims[ 3 ]; - ulong dSize = _volume->getRawSizeInBytes( ); + uint32_t dims[ 3 ]; + ulong dSize = _volume->getRawSizeInBytes( ); // How many bytes for a 'ulong'? // JPR double sizes[ 3 ]; kVolume::Type type = _volume->getType( ); @@ -159,7 +159,7 @@ bool marDynData::save( std::ofstream& os ) sizes[ 1 ] = _volume->getYsize( ); sizes[ 2 ] = _volume->getZsize( ); - os.write( ( const char* )dims, 3 * sizeof( uint ) ); + os.write( ( const char* )dims, 3 * sizeof( uint32_t ) ); os.write( ( const char* )sizes, 3 * sizeof( double ) ); os.write( ( const char* )&type, sizeof( kVolume::Type ) ); os.write( ( const char* )&dSize, sizeof( ulong ) ); @@ -171,19 +171,19 @@ bool marDynData::save( std::ofstream& os ) // ------------------------------------------------------------------------- bool marDynData::load( std::ifstream& is ) { - uchar* data; - uint dims[ 3 ]; + uint8_t* data; + uint32_t dims[ 3 ]; ulong dSize; double sizes[ 3 ]; kVolume::Type type; reset( ); - is.read( ( char* )dims, 3 * sizeof( uint ) ); + is.read( ( char* )dims, 3 * sizeof( uint32_t ) ); is.read( ( char* )sizes, 3 * sizeof( double ) ); is.read( ( char* )&type, sizeof( kVolume::Type ) ); is.read( ( char* )&dSize, sizeof( ulong ) ); - data = new uchar[ dSize ]; + data = new uint8_t[ dSize ]; is.read( ( char* )data, dSize ); _volume = new kVolume( type, dims, sizes, ( void* )data ); diff --git a/lib/maracasVisuLib/src/kernel/volume.cxx b/lib/maracasVisuLib/src/kernel/volume.cxx index 43d1364..7fbe85c 100644 --- a/lib/maracasVisuLib/src/kernel/volume.cxx +++ b/lib/maracasVisuLib/src/kernel/volume.cxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: volume.cxx,v $ Language: C++ - Date: $Date: 2010/04/20 14:42:44 $ - Version: $Revision: 1.7 $ + Date: $Date: 2010/04/20 16:11:40 $ + Version: $Revision: 1.8 $ Copyright: (c) 2002, 2003 License: @@ -44,8 +44,8 @@ const void* kVolume::BLANK = ( void* ) 0; const void* kVolume::NOALLOC = ( void* )-1; const int kVolume::SIZETypes[] = { sizeof( char ), sizeof( float ), sizeof( double ), sizeof( int ), - sizeof( short ), sizeof( uchar ), - sizeof( uint ), sizeof( ushort ) }; + sizeof( short ), sizeof( uint8_t ), + sizeof( uint32_t ), sizeof( uint16_t ) }; // --------------------------------------------------------------------------- template< class FROM, class TO > @@ -108,7 +108,7 @@ kVolume::kVolume( ) // ------------------------------------------------------------------------- kVolume::kVolume( Type type, - uint xdim, uint ydim, uint zdim, + uint32_t xdim, uint32_t ydim, uint32_t zdim, double xsize, double ysize, double zsize, void* data ) : _type( type ), @@ -136,7 +136,7 @@ kVolume::kVolume( Type type, // ------------------------------------------------------------------------- kVolume::kVolume( Type type, - const uint *dims, + const uint32_t *dims, const double *sizes, void* data ) : _type( type ), @@ -149,7 +149,7 @@ kVolume::kVolume( Type type, #endif // KGFO_USE_VTK { - memcpy( _dims, dims, 3 * sizeof( uint ) ); + memcpy( _dims, dims, 3 * sizeof( uint32_t ) ); memcpy( _sizes, sizes, 3 * sizeof( double ) ); if( data != NOALLOC ) { @@ -194,7 +194,7 @@ void kVolume::copyFrom( const kVolume& org ) _columns = 0; _images = 0; - memcpy( _dims, org._dims, 3 * sizeof( uint ) ); + memcpy( _dims, org._dims, 3 * sizeof( uint32_t ) ); memcpy( _sizes, org._sizes, 3 * sizeof( double ) ); if( org._raw ) { @@ -214,20 +214,20 @@ bool kVolume::sameDimension( const kVolume& comp ) } // ------------------------------------------------------------------------- -double kVolume::getPixel( uint x, uint y, uint z ) const +double kVolume::getPixel( uint32_t x, uint32_t y, uint32_t z ) const { double p; switch( _type ) { - case CHAR: p = ( double )( ( char*** )_images )[ z ][ y ][ x ]; break; + case CHAR: p = ( double )( ( int8_t*** )_images )[ z ][ y ][ x ]; break; case FLOAT: p = ( double )( ( float*** )_images )[ z ][ y ][ x ]; break; case DOUBLE: p = ( double )( ( double*** )_images )[ z ][ y ][ x ]; break; - case INT: p = ( double )( ( int*** )_images )[ z ][ y ][ x ]; break; - case SHORT: p = ( double )( ( short*** )_images )[ z ][ y ][ x ]; break; - case UCHAR: p = ( double )( ( uchar*** )_images )[ z ][ y ][ x ]; break; - case UINT: p = ( double )( ( uint*** )_images )[ z ][ y ][ x ]; break; - case USHORT: p = ( double )( ( ushort*** )_images )[ z ][ y ][ x ]; break; + case INT: p = ( double )( ( int32_t*** )_images )[ z ][ y ][ x ]; break; + case SHORT: p = ( double )( ( int16_t*** )_images )[ z ][ y ][ x ]; break; + case UCHAR: p = ( double )( ( uint8_t*** )_images )[ z ][ y ][ x ]; break; + case UINT: p = ( double )( ( uint32_t*** )_images )[ z ][ y ][ x ]; break; + case USHORT: p = ( double )( ( uint16_t*** )_images )[ z ][ y ][ x ]; break; default: p = 0.0; break; } // fswitch @@ -236,19 +236,19 @@ double kVolume::getPixel( uint x, uint y, uint z ) const } // ------------------------------------------------------------------------- -void kVolume::setPixel( double v, uint x, uint y, uint z ) +void kVolume::setPixel( double v, uint32_t x, uint32_t y, uint32_t z ) { switch( _type ) { - case CHAR: ( ( char*** )_images )[ z ][ y ][ x ] = ( char )v; break; - case FLOAT: ( ( float*** )_images )[ z ][ y ][ x ] = ( float )v; break; - case DOUBLE: ( ( double*** )_images )[ z ][ y ][ x ] = ( double )v; break; - case INT: ( ( int*** )_images )[ z ][ y ][ x ] = ( int )v; break; - case SHORT: ( ( short*** )_images )[ z ][ y ][ x ] = ( short )v; break; - case UCHAR: ( ( uchar*** )_images )[ z ][ y ][ x ] = ( uchar )v; break; - case UINT: ( ( uint*** )_images )[ z ][ y ][ x ] = ( uint )v; break; - case USHORT: ( ( ushort*** )_images )[ z ][ y ][ x ] = ( ushort )v; break; + case CHAR: ( ( int8_t*** )_images )[ z ][ y ][ x ] = ( int8_t )v; break; + case FLOAT: ( ( float*** )_images )[ z ][ y ][ x ] = ( float )v; break; + case DOUBLE: ( ( double*** )_images )[ z ][ y ][ x ] = ( double )v; break; + case INT: ( ( int32_t*** )_images )[ z ][ y ][ x ] = ( int32_t )v; break; + case SHORT: ( ( int16_t*** )_images )[ z ][ y ][ x ] = ( int16_t )v; break; + case UCHAR: ( ( uint8_t*** )_images )[ z ][ y ][ x ] = ( uint8_t )v; break; + case UINT: ( ( uint32_t*** )_images )[ z ][ y ][ x ] = ( uint32_t )v; break; + case USHORT: ( ( uint16_t*** )_images )[ z ][ y ][ x ] = ( uint16_t )v; break; default: break; } // fswitch @@ -262,20 +262,20 @@ void kVolume::convertCast( Type type ) void* buffer; ulong size = getRawSize( ); - buffer = ( void* )new uchar[ size * SIZETypes[ type ] ]; + buffer = ( void* )new uint8_t[ size * SIZETypes[ type ] ]; switch( _type ) { case CHAR: switch( type ) { - case SHORT: convertCastT( ( char* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( char* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( char* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( char* )_raw, ( uint* )buffer, size ); break; + case SHORT: convertCastT( ( char* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( char* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( char* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( char* )_raw, ( uint32_t* )buffer, size ); break; case FLOAT: convertCastT( ( char* )_raw, ( float* )buffer, size ); break; case DOUBLE: convertCastT( ( char* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( char* )_raw, ( uchar* )buffer, size ); break; + case UCHAR: convertCastT( ( char* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch @@ -284,13 +284,13 @@ void kVolume::convertCast( Type type ) case SHORT: switch( type ) { - case CHAR: convertCastT( ( short* )_raw, ( char* )buffer, size ); break; - case INT: convertCastT( ( short* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( short* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( short* )_raw, ( uint* )buffer, size ); break; - case FLOAT: convertCastT( ( short* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( short* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( short* )_raw, ( uchar* )buffer, size ); break; + case CHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; + case INT: convertCastT( ( int16_t* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( int16_t* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( int16_t* )_raw, ( uint32_t* )buffer, size ); break; + case FLOAT: convertCastT( ( int16_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( int16_t* )_raw, ( double* )buffer, size ); break; + case UCHAR: convertCastT( ( int16_t* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -298,13 +298,13 @@ void kVolume::convertCast( Type type ) case INT: switch( type ) { - case CHAR: convertCastT( ( int* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( int* )_raw, ( short* )buffer, size ); break; - case USHORT: convertCastT( ( int* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( int* )_raw, ( uint* )buffer, size ); break; - case FLOAT: convertCastT( ( int* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( int* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( int* )_raw, ( uchar* )buffer, size ); break; + case CHAR: convertCastT( ( int32_t* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( int32_t* )_raw, ( int16_t* )buffer, size ); break; + case USHORT: convertCastT( ( int32_t* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( int32_t* )_raw, ( uint32_t* )buffer, size ); break; + case FLOAT: convertCastT( ( int32_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( int32_t* )_raw, ( double* )buffer, size ); break; + case UCHAR: convertCastT( ( int32_t* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -312,13 +312,13 @@ void kVolume::convertCast( Type type ) case USHORT: switch( type ) { - case CHAR: convertCastT( ( ushort* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( ushort* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( ushort* )_raw, ( int* )buffer, size ); break; - case UINT: convertCastT( ( ushort* )_raw, ( uint* )buffer, size ); break; - case FLOAT: convertCastT( ( ushort* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( ushort* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( ushort* )_raw, ( uchar* )buffer, size ); break; + case CHAR: convertCastT( ( uint16_t* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( uint16_t* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( uint16_t* )_raw, ( int32_t* )buffer, size ); break; + case UINT: convertCastT( ( uint16_t* )_raw, ( uint32_t* )buffer, size ); break; + case FLOAT: convertCastT( ( uint16_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( uint16_t* )_raw, ( double* )buffer, size ); break; + case UCHAR: convertCastT( ( uint16_t* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -326,13 +326,13 @@ void kVolume::convertCast( Type type ) case UINT: switch( type ) { - case CHAR: convertCastT( ( uint* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( uint* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( uint* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( uint* )_raw, ( ushort* )buffer, size ); break; - case FLOAT: convertCastT( ( uint* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( uint* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( uint* )_raw, ( uchar* )buffer, size ); break; + case CHAR: convertCastT( ( uint32_t* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( uint32_t* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( uint32_t* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( uint32_t* )_raw, ( uint16_t* )buffer, size ); break; + case FLOAT: convertCastT( ( uint32_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( uint32_t* )_raw, ( double* )buffer, size ); break; + case UCHAR: convertCastT( ( uint32_t* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -340,13 +340,13 @@ void kVolume::convertCast( Type type ) case FLOAT: switch( type ) { - case CHAR: convertCastT( ( float* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( float* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( float* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( float* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( float* )_raw, ( uint* )buffer, size ); break; + case CHAR: convertCastT( ( float* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( float* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( float* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( float* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( float* )_raw, ( uint32_t* )buffer, size ); break; case DOUBLE: convertCastT( ( float* )_raw, ( double* )buffer, size ); break; - case UCHAR: convertCastT( ( float* )_raw, ( uchar* )buffer, size ); break; + case UCHAR: convertCastT( ( float* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -354,13 +354,13 @@ void kVolume::convertCast( Type type ) case DOUBLE: switch( type ) { - case CHAR: convertCastT( ( double* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( double* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( double* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( double* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( double* )_raw, ( uint* )buffer, size ); break; + case CHAR: convertCastT( ( double* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( double* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( double* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( double* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( double* )_raw, ( uint32_t* )buffer, size ); break; case FLOAT: convertCastT( ( double* )_raw, ( float* )buffer, size ); break; - case UCHAR: convertCastT( ( double* )_raw, ( uchar* )buffer, size ); break; + case UCHAR: convertCastT( ( double* )_raw, ( uint8_t* )buffer, size ); break; default : break; } // fswitch break; @@ -368,13 +368,13 @@ void kVolume::convertCast( Type type ) case UCHAR: switch( type ) { - case CHAR: convertCastT( ( uchar* )_raw, ( char* )buffer, size ); break; - case SHORT: convertCastT( ( uchar* )_raw, ( short* )buffer, size ); break; - case INT: convertCastT( ( uchar* )_raw, ( int* )buffer, size ); break; - case USHORT: convertCastT( ( uchar* )_raw, ( ushort* )buffer, size ); break; - case UINT: convertCastT( ( uchar* )_raw, ( uint* )buffer, size ); break; - case FLOAT: convertCastT( ( uchar* )_raw, ( float* )buffer, size ); break; - case DOUBLE: convertCastT( ( uchar* )_raw, ( double* )buffer, size ); break; + case CHAR: convertCastT( ( uint8_t* )_raw, ( int8_t* )buffer, size ); break; + case SHORT: convertCastT( ( uint8_t* )_raw, ( int16_t* )buffer, size ); break; + case INT: convertCastT( ( uint8_t* )_raw, ( int32_t* )buffer, size ); break; + case USHORT: convertCastT( ( uint8_t* )_raw, ( uint16_t* )buffer, size ); break; + case UINT: convertCastT( ( uint8_t* )_raw, ( uint32_t* )buffer, size ); break; + case FLOAT: convertCastT( ( uint8_t* )_raw, ( float* )buffer, size ); break; + case DOUBLE: convertCastT( ( uint8_t* )_raw, ( double* )buffer, size ); break; default : break; } // fswitch break; @@ -408,119 +408,119 @@ void kVolume::convertScale( Type type, double min, double max ) void* buffer; ulong size = getRawSize( ); - buffer = ( void* )new uchar[ size * SIZETypes[ type ] ]; + buffer = ( void* )new uint8_t[ size * SIZETypes[ type ] ]; switch( _type ) { case CHAR: switch( type ) { - case CHAR: convertScaleT( ( char* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( char* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( char* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( char* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( char* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( char* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( char* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( char* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( int8_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( int8_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( int8_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( int8_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( int8_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( int8_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( int8_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( int8_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case SHORT: switch( type ) { - case CHAR: convertScaleT( ( short* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( short* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( short* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( short* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( short* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( short* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( short* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( short* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( int16_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( int16_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( int16_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( int16_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( int16_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( int16_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( int16_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( int16_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case INT: switch( type ) { - case CHAR: convertScaleT( ( int* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( int* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( int* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( int* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( int* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( int* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( int* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( int* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( int32_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( int32_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( int32_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( int32_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( int32_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( int32_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( int32_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( int32_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case USHORT: switch( type ) { - case CHAR: convertScaleT( ( ushort* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( ushort* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( ushort* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( ushort* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( ushort* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( ushort* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( ushort* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( ushort* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( uint16_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( uint16_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( uint16_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( uint16_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( uint16_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( uint16_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( uint16_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( uint16_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case UINT: switch( type ) { - case CHAR: convertScaleT( ( uint* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( uint* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( uint* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( uint* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( uint* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( uint* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( uint* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( uint* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( uint32_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( uint32_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( uint32_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( uint32_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( uint32_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( uint32_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( uint32_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( uint32_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case UCHAR: switch( type ) { - case CHAR: convertScaleT( ( uchar* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( uchar* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( uchar* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( uchar* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( uchar* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( uchar* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( uchar* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( uchar* )_raw, ( uchar* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( uint8_t* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( uint8_t* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( uint8_t* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( uint8_t* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( uint8_t* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( uint8_t* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( uint8_t* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( uint8_t* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case DOUBLE: switch( type ) { - case CHAR: convertScaleT( ( double* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( double* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( double* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( double* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( double* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; - case FLOAT: convertScaleT( ( double* )_raw, ( float* )buffer, size, smin, tmin, a ); break; - case DOUBLE: convertScaleT( ( double* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( uchar* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( double* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( double* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( double* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( double* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( double* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; + case FLOAT: convertScaleT( ( double* )_raw, ( float* )buffer, size, smin, tmin, a ); break; + case DOUBLE: convertScaleT( ( double* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( double* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; case FLOAT: switch( type ) { - case CHAR: convertScaleT( ( float* )_raw, ( char* )buffer, size, smin, tmin, a ); break; - case SHORT: convertScaleT( ( float* )_raw, ( short* )buffer, size, smin, tmin, a ); break; - case INT: convertScaleT( ( float* )_raw, ( int* )buffer, size, smin, tmin, a ); break; - case USHORT: convertScaleT( ( float* )_raw, ( ushort* )buffer, size, smin, tmin, a ); break; - case UINT: convertScaleT( ( float* )_raw, ( uint* )buffer, size, smin, tmin, a ); break; + case CHAR: convertScaleT( ( float* )_raw, ( int8_t* )buffer, size, smin, tmin, a ); break; + case SHORT: convertScaleT( ( float* )_raw, ( int16_t* )buffer, size, smin, tmin, a ); break; + case INT: convertScaleT( ( float* )_raw, ( int32_t* )buffer, size, smin, tmin, a ); break; + case USHORT: convertScaleT( ( float* )_raw, ( uint16_t* )buffer, size, smin, tmin, a ); break; + case UINT: convertScaleT( ( float* )_raw, ( uint32_t* )buffer, size, smin, tmin, a ); break; case FLOAT: convertScaleT( ( float* )_raw, ( float* )buffer, size, smin, tmin, a ); break; case DOUBLE: convertScaleT( ( float* )_raw, ( double* )buffer, size, smin, tmin, a ); break; - case UCHAR: convertScaleT( ( float* )_raw, ( double* )buffer, size, smin, tmin, a ); break; + case UCHAR: convertScaleT( ( float* )_raw, ( uint8_t* )buffer, size, smin, tmin, a ); break; } // fswitch break; @@ -541,14 +541,14 @@ void kVolume::getMinMax( double& min, double& max ) const switch( _type ) { - case CHAR: getMinMaxT( ( char* )_raw, size, min, max ); break; - case FLOAT: getMinMaxT( ( float* )_raw, size, min, max ); break; - case DOUBLE: getMinMaxT( ( double* )_raw, size, min, max ); break; - case INT: getMinMaxT( ( int* )_raw, size, min, max ); break; - case SHORT: getMinMaxT( ( short* )_raw, size, min, max ); break; - case UCHAR: getMinMaxT( ( uchar* )_raw, size, min, max ); break; - case UINT: getMinMaxT( ( uint* )_raw, size, min, max ); break; - case USHORT: getMinMaxT( ( ushort* )_raw, size, min, max ); break; + case CHAR: getMinMaxT( ( int8_t* )_raw, size, min, max ); break; + case FLOAT: getMinMaxT( ( float* )_raw, size, min, max ); break; + case DOUBLE: getMinMaxT( ( double* )_raw, size, min, max ); break; + case INT: getMinMaxT( ( int32_t* )_raw, size, min, max ); break; + case SHORT: getMinMaxT( ( int16_t* )_raw, size, min, max ); break; + case UCHAR: getMinMaxT( ( uint8_t* )_raw, size, min, max ); break; + case UINT: getMinMaxT( ( uint32_t* )_raw, size, min, max ); break; + case USHORT: getMinMaxT( ( uint16_t* )_raw, size, min, max ); break; } // fswitch } @@ -600,7 +600,7 @@ double kVolume::getMax( ) const for( v( 1 ) = minY; v( 1 ) <= maxY; v( 1 )++ ) for( v( 2 ) = minZ; v( 2 ) <= maxZ; v( 2 )++ ) if( ( v - vP ).norm2( ) <= r ) { - tmp = this->getPixel( ( uint )v(0), ( uint )v(1), ( uint )v(2)); + tmp = this->getPixel( ( uint32_t )v(0), ( uint32_t )v(1), ( uint32_t )v(2)); maxint = ( tmp > maxint || start )? tmp: maxint; start = false; } // fi @@ -664,7 +664,7 @@ void kVolume::allocate( ) if( _creator == SELF ) { - _raw = ( void* )new uchar[ size ]; + _raw = ( void* )new uint8_t[ size ]; memset( _raw, 0, size ); } // fi @@ -675,24 +675,24 @@ void kVolume::buildIndex( ) { ulong size; - size = ( _dims[ CZ ] * sizeof( uchar** ) ) + + size = ( _dims[ CZ ] * sizeof( uint8_t** ) ) + ( _dims[ CZ ] * _dims[ CY ] * sizeof( void* ) ); - _images = ( void*** )new uchar[ size ]; + _images = ( void*** )new uint8_t[ size ]; _columns = ( void** )( _images + _dims[ CZ ] ); void** plane = _columns; - for( uint z = 0; z < _dims[ CZ ]; z++ ) { + for( uint32_t z = 0; z < _dims[ CZ ]; z++ ) { _images[ z ] = plane; plane += _dims[ CY ]; } // rof void* line = _raw; - for( uint y = 0; y < _dims[ CZ ] * _dims[ CY ]; y++ ) { + for( uint32_t y = 0; y < _dims[ CZ ] * _dims[ CY ]; y++ ) { _columns[ y ] = line; - line = ( void* )( ( uchar* ) line + + line = ( void* )( ( uint8_t* ) line + _dims[ CX ] * SIZETypes[ _type ] ); } // rof @@ -730,7 +730,7 @@ void kVolume::buildIndex( ) case UCHAR: ucarray = vtkUnsignedCharArray::New( ); ucarray->SetNumberOfComponents( 1 ); - ucarray->SetArray( ( uchar* )( _raw ), size, 1 ); + ucarray->SetArray( ( uint8_t* )( _raw ), size, 1 ); _vtk->SetScalarType( VTK_UNSIGNED_CHAR ); _vtk->GetPointData( )->SetScalars( ucarray ); ucarray->Delete( ); @@ -739,7 +739,7 @@ void kVolume::buildIndex( ) case SHORT: sarray = vtkShortArray::New( ); sarray->SetNumberOfComponents( 1 ); - sarray->SetArray( ( short* )( _raw ), size, 1 ); + sarray->SetArray( ( int16_t* )( _raw ), size, 1 ); _vtk->SetScalarType( VTK_SHORT ); _vtk->GetPointData( )->SetScalars( sarray ); sarray->Delete( ); @@ -748,7 +748,7 @@ void kVolume::buildIndex( ) case INT: iarray = vtkIntArray::New( ); iarray->SetNumberOfComponents( 1 ); - iarray->SetArray( ( int* )( _raw ), size, 1 ); + iarray->SetArray( ( int32_t* )( _raw ), size, 1 ); _vtk->SetScalarType( VTK_INT ); _vtk->GetPointData( )->SetScalars( iarray ); iarray->Delete( ); @@ -757,7 +757,7 @@ void kVolume::buildIndex( ) case USHORT: usarray = vtkUnsignedShortArray::New( ); usarray->SetNumberOfComponents( 1 ); - usarray->SetArray( ( ushort* )( _raw ), size, 1 ); + usarray->SetArray( ( uint16_t* )( _raw ), size, 1 ); _vtk->SetScalarType( VTK_UNSIGNED_SHORT ); _vtk->GetPointData( )->SetScalars( usarray ); usarray->Delete( ); @@ -766,7 +766,7 @@ void kVolume::buildIndex( ) case UINT: uiarray = vtkUnsignedIntArray::New( ); uiarray->SetNumberOfComponents( 1 ); - uiarray->SetArray( ( uint* )( _raw ), size, 1 ); + uiarray->SetArray( ( uint32_t* )( _raw ), size, 1 ); _vtk->SetScalarType( VTK_UNSIGNED_INT ); _vtk->GetPointData( )->SetScalars( uiarray ); uiarray->Delete( ); @@ -804,11 +804,11 @@ void kVolume::deallocate( ) if( _vtk ) _vtk->Delete(); _vtk = NULL; #endif // KGFO_USE_VTK - delete[] ( uchar* )_images; + delete[] ( uint8_t* )_images; if( _raw && _creator == SELF ) //EED purify 12/sept/2006 -// delete[] ( uchar* )_raw; +// delete[] ( uint8_t* )_raw; free ( _raw ); @@ -849,9 +849,9 @@ kVolume::kVolume( vtkImageData* org ) } // fswitch org->GetDimensions( itmp ); - _dims[ CX ] = ( uint )itmp[ 0 ]; - _dims[ CY ] = ( uint )itmp[ 1 ]; - _dims[ CZ ] = ( uint )itmp[ 2 ]; + _dims[ CX ] = ( uint32_t )itmp[ 0 ]; + _dims[ CY ] = ( uint32_t )itmp[ 1 ]; + _dims[ CZ ] = ( uint32_t )itmp[ 2 ]; org->GetSpacing( ftmp ); _sizes[ CX ] = ( double )ftmp[ 0 ]; _sizes[ CY ] = ( double )ftmp[ 1 ]; @@ -909,9 +909,9 @@ void kVolume::copyFrom( vtkImageData* org ) } // fswitch org->GetDimensions( itmp ); - _dims[ CX ] = ( uint )itmp[ 0 ]; - _dims[ CY ] = ( uint )itmp[ 1 ]; - _dims[ CZ ] = ( uint )itmp[ 2 ]; + _dims[ CX ] = ( uint32_t )itmp[ 0 ]; + _dims[ CY ] = ( uint32_t )itmp[ 1 ]; + _dims[ CZ ] = ( uint32_t )itmp[ 2 ]; org->GetSpacing( ftmp ); _sizes[ CX ] = ( double )ftmp[ 0 ]; _sizes[ CY ] = ( double )ftmp[ 1 ]; diff --git a/lib/maracasVisuLib/src/kernel/volume.hxx b/lib/maracasVisuLib/src/kernel/volume.hxx index 31d20f6..112b6a6 100644 --- a/lib/maracasVisuLib/src/kernel/volume.hxx +++ b/lib/maracasVisuLib/src/kernel/volume.hxx @@ -3,8 +3,8 @@ Program: wxMaracas Module: $RCSfile: volume.hxx,v $ Language: C++ - Date: $Date: 2010/03/15 14:12:30 $ - Version: $Revision: 1.6 $ + Date: $Date: 2010/04/20 16:11:40 $ + Version: $Revision: 1.7 $ Copyright: (c) 2002, 2003 License: @@ -49,11 +49,11 @@ class creaMaracasVisu_EXPORT kVolume kVolume( ); kVolume( Type type, - uint xdim, uint ydim, uint zdim, + uint32_t xdim, uint32_t ydim, uint32_t zdim, double xsize = 1, double ysize = 1, double zsize = 1, void* data = 0 ); kVolume( Type type, - const uint *dims, + const uint32_t *dims, const double *sizes, void* data = 0 ); @@ -67,30 +67,30 @@ class creaMaracasVisu_EXPORT kVolume bool sameDimension( const kVolume& comp ); - const uint* getDimensions( ) const { return( _dims ); } - uint getWidth( ) const { return( _dims[ CX ] ); } - uint getHeight( ) const { return( _dims[ CY ] ); } - uint getDepth( ) const { return( _dims[ CZ ] ); } - uint getNcols( ) const { return( _dims[ CX ] ); } - uint getNrows( ) const { return( _dims[ CY ] ); } - uint getNplanes( ) const { return( _dims[ CZ ] ); } - uint getXdim( ) const { return( _dims[ CX ] ); } - uint getYdim( ) const { return( _dims[ CY ] ); } - uint getZdim( ) const { return( _dims[ CZ ] ); } - - void setDimensions( uint* dims ) + const uint32_t* getDimensions( ) const { return( _dims ); } + uint32_t getWidth( ) const { return( _dims[ CX ] ); } + uint32_t getHeight( ) const { return( _dims[ CY ] ); } + uint32_t getDepth( ) const { return( _dims[ CZ ] ); } + uint32_t getNcols( ) const { return( _dims[ CX ] ); } + uint32_t getNrows( ) const { return( _dims[ CY ] ); } + uint32_t getNplanes( ) const { return( _dims[ CZ ] ); } + uint32_t getXdim( ) const { return( _dims[ CX ] ); } + uint32_t getYdim( ) const { return( _dims[ CY ] ); } + uint32_t getZdim( ) const { return( _dims[ CZ ] ); } + + void setDimensions( uint32_t* dims ) { - memcpy( _dims, dims, 3 * sizeof( uint ) ); + memcpy( _dims, dims, 3 * sizeof( uint32_t ) ); } - void setWidth( uint w ) { _dims[ CX ] = w; } - void setHeight( uint h ) { _dims[ CY ] = h; } - void setDepth( uint d ) { _dims[ CZ ] = d; } - void setNcols( uint c ) { _dims[ CX ] = c; } - void setNrows( uint r ) { _dims[ CY ] = r; } - void setNplanes( uint p ) { _dims[ CZ ] = p; } - void setXdim( uint x ) { _dims[ CX ] = x; } - void setYdim( uint y ) { _dims[ CY ] = y; } - void setZdim( uint z ) { _dims[ CZ ] = z; } + void setWidth( uint32_t w ) { _dims[ CX ] = w; } + void setHeight( uint32_t h ) { _dims[ CY ] = h; } + void setDepth( uint32_t d ) { _dims[ CZ ] = d; } + void setNcols( uint32_t c ) { _dims[ CX ] = c; } + void setNrows( uint32_t r ) { _dims[ CY ] = r; } + void setNplanes( uint32_t p ) { _dims[ CZ ] = p; } + void setXdim( uint32_t x ) { _dims[ CX ] = x; } + void setYdim( uint32_t y ) { _dims[ CY ] = y; } + void setZdim( uint32_t z ) { _dims[ CZ ] = z; } const double *getSizes( ) const { return( _sizes ); } double getXsize( ) const { return( _sizes[ CX ] ); } @@ -127,8 +127,8 @@ class creaMaracasVisu_EXPORT kVolume return( SIZETypes[ _type ] * getRawSize( ) ); } - double getPixel( uint x, uint y, uint z ) const; - void setPixel( double v, uint x, uint y, uint z ); + double getPixel( uint32_t x, uint32_t y, uint32_t z ) const; + void setPixel( double v, uint32_t x, uint32_t y, uint32_t z ); void convertCast( Type type ); void convertScale( Type type, double min, double max ); @@ -154,7 +154,7 @@ class creaMaracasVisu_EXPORT kVolume Type _type; Creator _creator; - uint _dims[ 3 ]; + uint32_t _dims[ 3 ]; double _sizes[ 3 ]; void* _raw; void** _columns;