public void convolvet(ImageStack s, int center, Kernel1D kernel)
        {
	        // depth slices centered around center.
	        for (int t = -depth/2; t <= depth/2; t++)
	        {
		        float[][] t1 = new float[height][width];
		        if (kernel instanceof Kernel)
		        {
			        /*
			    Around t, convolve over -kernel.halfwidth .. t .. +kernel.halfwidth.
			    For reasons of speed, calculate the contribution of each image
			    image by image instead of pixelwise.
			        */
			        for (int y = 0; y < height; y++)
                                        for (int x = 0; x < width; x++)
                                                v[t+depth/2][y][x] = 0;
			        for (int k = -kernel.halfwidth; k <= kernel.halfwidth; k++)
			        {
			                loadSlice(t1, s, center + t + k + 1);
                                        for (int y = 0; y < height; y++)
                                                for (int x = 0; x < width; x++)
                                                        v[t+depth/2][y][x] += t1[y][x] * kernel.k[k + kernel.halfwidth];
                                }
                        }
		        else
		        {
			        // No temporal filtering: load into v.
			        loadSlice(t1, s, center + t);
                                for (int y = 0; y < height; y++)
                                        for (int x = 0; x < width; x++)
                                                v[t+depth/2][y][x] = t1[y][x];
		        }
	        }
        }