 
   iwWarp.identity();
   iwWarp.translate(-1.0f, -1.0f, 0.0f);
-  iwWarp.scale(1.0f / (static_cast<float>(w) * 0.5f), 1.0f / (static_cast<float>(h) * 0.5f), 0.0f);
+  iwWarp.scale(1.0f / (static_cast<float>(vp[2]) * 0.5f), 1.0f / (static_cast<float>(vp[3]) * 0.5f), 0.0f);
 }
 
 #endif

  mapIntImg();

  vvGLTools::Viewport vp = vvGLTools::getViewport();
  const int w = vvToolshed::getTextureSize(vp[2]);
  const int h = vvToolshed::getTextureSize(vp[3]);

  dim3 blockSize(16, 16);
  dim3 gridSize = dim3(iDivUp(w, blockSize.x), iDivUp(h, blockSize.y));

  const vvVector3 size(vd->getSize());
  const vvVector3 size2 = size * 0.5f;



  if (kernel != NULL)
  {
    (kernel)<<<gridSize, blockSize>>>(d_img, vp[2], vp[3], intImg->width, intImg->height,
                                      diagonalVoxels / (float)numSlices,
                                      volSize * 0.5f,
                                      L, H,
