    cudaUnbindTexture(tex_tf);
 
    cudaFree(d_tf);
+#ifdef VOL3TEX3D
+   for(int i=0; i<3; ++i)
+     cudaFree(d_voxarr[i]);
+#else
 #ifdef PITCHED
    for(int i=0; i<3; ++i)
        cudaFree(d_voxptr[i].ptr);
 #else
    cudaFree(d_voxels);
+#endif
 #endif
 }
 

texture<uchar4, 1, cudaReadModeNormalizedFloat> tex_tf;
#endif


#ifdef FLOATDATA
typedef float Scalar;

//#define NOLOAD
//#define NODISPLAY
//#define SHMLOAD
#define VOL3TEX3D
//#define PITCHED
#define FLOATDATA
//#define CONSTLOAD
//#define THREADPERVOXEL
