 
     // initialise intermediate image line
     extern __shared__ char smem[];
+#ifdef FLOATIMG
+    float4 *imgLine = (float4 *)smem;
+    const int pixsize = sizeof(float4);
+#else
     uchar4 *imgLine = (uchar4 *)smem;
+    const int pixsize = sizeof(uchar4);
+#endif
 #ifdef SHMLOAD
 #ifdef SHMCLASS
-    uchar4 *voxel = (uchar4 *)(smem+width*4);
-#else
-    Scalar *voxel = (Scalar *)(smem+width*4);
+    uchar4 *voxel = (uchar4 *)(smem+width*pixsize);
+#else
+    Scalar *voxel = (Scalar *)(smem+width*pixsize);
 #endif
 #endif
 
     for (int ix=threadIdx.x; ix<width; ix+=blockDim.x)
     {
+#ifdef FLOATIMG
+        imgLine[ix] = make_float4(0.f,0.f,0.f,0.f);
+#else
         imgLine[ix] = make_uchar4(0,0,0,0);
+#endif
     }
 
     for(int i=0; i<Repetitions; ++i)

//#define NOOP
//#define NOLOAD
//#define NODISPLAY
#define SHMLOAD
//#define ARRAY
#define PITCHED
#define FLOATDATA
//#define CONSTLOAD
#define THREADPERVOXEL
#define CONSTDATA

const int Repetitions = 1;


   }
#endif

#ifdef FLOATIMG
   int shmsize = intImg->width*sizeof(float4);
#else
   int shmsize = intImg->width*vvSoftImg::PIXEL_SIZE;
#endif
#ifdef SHMLOAD
   shmsize += vd->vox[principal]*vd->getBPV()*sizeof(Scalar);
#endif

   // do the computation on the device
#ifdef PITCHED
#define compositeNearest(sliceStep, principal) \
   compositeSlicesNearest<Scalar, 1, sliceStep, principal> <<<to-from, 128, shmsize>>>( \
         d_img, intImg->width, intImg->height, \
         d_voxptr[principal], \
         firstSlice, lastSlice, \
         from, to)
#else
#define compositeNearest(sliceStep, principal) \
   compositeSlicesNearest<Scalar, 1, sliceStep, principal> <<<to-from, 128, shmsize>>>( \
         d_img, intImg->width, intImg->height, \
         (Scalar *)(d_voxels+sizeof(Scalar)*vd->getBPV()*principal*(vd->vox[0]*vd->vox[1]*vd->vox[2])), \
         firstSlice, lastSlice, \
