public void backproject(Volume v)
        {
                int width = v.getWidth();
                // Compute center of volume vc.
                int cvx = v.getWidth() / 2;
                int cvy = v.getHeight() / 2;
                int cvz = v.getDepth() / 2;
                // Compute center of projection image ic.
                int cix = sliceWidth / 2;
                // Compute line (actually plane) equation of vc to ic.
                // Traverse all projections.
                VJInterpolator interpolator = new VJTrilinear();
                for (int i = 0; i < n; i++)
                {
                        float currentTheta = theta[i];
                        float costheta = (float) Math.cos(currentTheta);
                        float sintheta = (float) Math.sin(currentTheta);
                        // Traverse all voxels.
                        for (int z = 0; z < v.getDepth(); z++)
                        for (int y = 0; y < v.getHeight(); y++)
                        for (int x = 0; x < v.getWidth(); x++)
                        {
                                StringBuffer sb = new StringBuffer("Backproject "); sb.append(theta[i]);
                                sb.append("degrees "); sb.append((z*100)/v.getDepth()); sb.append("%");
                                VJUserInterface.status(sb.toString());
                                VJVoxelLoc vl = new VJVoxelLoc(x, y, z);
                                if (interpolator.isValid(vl, v))
                                {
                                        // Compute x and y position relative to center of volume.
                                        float vx = x - cvx;
                                        float vy = y - cvy;
                                        // d=distance of current voxel to line between vc and ic.
                                        float d = vx * costheta + vy * sintheta;
                                        // Compute position in projection image.
                                        float imagex = d + cix;
                                        int imageix = (int) imagex;
                                        float dx = imagex - (float) imageix;
                                        if (VJTrilinear.valid(v.getWidth(), v.getHeight(), imageix, y))
                                        {
                                                // Interpolate in projection image at x, z.
                                                float value;
                                                if (type == BYTE)
                                                                value = VJTrilinear.value((byte []) sliceArray[i], width, imageix, z, dx, 0f);
                                                else if (type == SHORT)
                                                                value = VJTrilinear.value((short []) sliceArray[i], width, imageix, z, dx, 0f);
                                                else if (type == FLOAT)
                                                                value = VJTrilinear.value((float []) sliceArray[i], width, imageix, z, dx, 0f);
                                                else
                                                                value = 0;
                                                // Summate for voxel at x,y,z over all projections i.
                                                float sum = (float) ((Number) v.get(x, y, z)).floatValue() + value;
                                                v.set(new Float(sum), x, y, z);
                                        }
                                }
                        }
                }
        }