int numPixThisRound = 0;
    public synchronized void createLOSImage() {        if (Debug.debugging("los")) {            Debug.output("createLOSimage: Entered with diameter = " + LOSedge);        }        if (layer == null || layer.frameCache == null) {            Debug.error("LOSGenerator:  can't access the DTED data through the terrain layer.");            return;        }        int squareRadius = LOSedge / 2 + 1;        int[] newPixels = new int[LOSedge * LOSedge];        float[] azimuthVals = new float[8 * (squareRadius - 1)];        // center point of raster        newPixels[((LOSedge / 2) * LOSedge) + squareRadius] = MAYBEVISIBLE;        if (Debug.debugging("los")) {            Debug.output("createLOSimage: size of azimuth array = "                    + azimuthVals.length);        }        fireProgressUpdate(ProgressEvent.START,                "Building LOS Image Mask...",                0,                100);        int x, y;        int numPixThisRound = 0;        boolean mark = false;        int markColor = colortable[INVISIBLE];        int range;        float pix_arc_interval = (float) (2 * Math.PI / azimuthVals.length);        //  Do this in a spiral, around the center point.        for (int round = 1; round < squareRadius; round++) {            if (Debug.debugging("los")) {                Debug.output("createLOSimage: round " + round);            }            y = LOScenterP.y - round;            x = LOScenterP.x - round;            if (round == 1) {                mark = true;                markColor = colortable[MAYBEVISIBLE];            }            else                mark = false;            if (LOSprecision == AZIMUTH) { // As of now, this is the                // only option                range = ((LOSedge * 4) - 4) / (round * 16);                for (; x < LOScenterP.x + round; x++)                    // top                    resolveImagePoint(x,                            y,                            newPixels,                            azimuthVals,                            range,                            pix_arc_interval,                            mark,                            markColor);                for (; y < LOScenterP.y + round; y++)                    // right                    resolveImagePoint(x,                            y,                            newPixels,                            azimuthVals,                            range,                            pix_arc_interval,                            mark,                            markColor);                for (; x > LOScenterP.x - round; x--)                    // bottom                    resolveImagePoint(x,                            y,                            newPixels,                            azimuthVals,                            range,                            pix_arc_interval,                            mark,                            markColor);                for (; y > LOScenterP.y - round; y--)                    // left                    resolveImagePoint(x,                            y,                            newPixels,                            azimuthVals,                            range,                            pix_arc_interval,                            mark,                            markColor);            }            int whereWeAre = (int) (100f * ((float) round / (float) squareRadius));            fireProgressUpdate(ProgressEvent.UPDATE,                    "Analyzing data...",                    whereWeAre,                    100);        }        fireProgressUpdate(ProgressEvent.UPDATE, "Creating Mask", 100, 100);        LOSimage = new OMRaster(LOScenterLLP.getLatitude(), LOScenterLLP.getLongitude(), (-1 - LOSedge / 2), (-1 - LOSedge / 2), LOSedge, LOSedge, newPixels);        LOSimage.generate(proj);        graphics.clear();        graphics.add(LOSimage);        fireProgressUpdate(ProgressEvent.DONE, "LOS mask complete", 100, 100);        if (Debug.debugging("los")) {            Debug.output("createLOSimage: Done...");        }    }