    {
        shmsize += Base::intImg->width*sizeof(Scalar);
    }
+#ifdef NOSHMEM
+   if(Base::sliceInterpol)
+       shmsize = 0;
+#endif
 
    uchar4 *d_img = static_cast<vvCudaImg*>(Base::intImg)->getDImg();
-   clearImage <<<to-from, 128, shmsize>>>(d_img, Base::intImg->width, Base::intImg->height, from, to);
+   clearImage <<<to-from, nthreads>>>(d_img, Base::intImg->width, Base::intImg->height, from, to);
 
    if(CompositionFunction compose = selectCompositionWithPrecision(this, sliceStep))
    {

        case 2:
            return tex3D(tex_raw, x, y, z);
    }
#endif

    return -1.f;
}
#endif


       {
           cudaThreadSynchronize();
#ifdef PITCHED
           compose <<<to-from, nthreads, shmsize>>>(
                   d_img, Base::intImg->width, Base::intImg->height,
                   d_voxptr[principal],
                   sliceStep*max(sliceStep*i-MaxCompositeSlices, sliceStep*firstSlice), i,
                   from, to);
#else
           compose <<<to-from, nthreads, shmsize>>>(
                   d_img, Base::intImg->width, Base::intImg->height,
                   (Scalar *)(d_voxels+sizeof(Scalar)*Base::vd->getBPV()*Base::principal*(Base::vd->vox[0]*Base::vd->vox[1]*Base::vd->vox[2])),
                   sliceStep*max(sliceStep*i-MaxCompositeSlices, sliceStep*firstSlice), i,
