        {
            cudaThreadSynchronize();
 #ifdef PITCHED
-           compose <<<to-from, 128, shmsize>>>(
+           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, 128, shmsize>>>(
+           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,

        uchar4 *dest = img + line*width+ix;
        blend(dest, imgLine[ix]);
    }
}
#endif


   {
       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, nthreads>>>(d_img, Base::intImg->width, Base::intImg->height, from, to);

   if(CompositionFunction compose = selectCompositionWithPrecision(this, sliceStep))
   {
