index++;
    private static ImageData[] getImages(HiViewer model)    {        ImageData[] images = null;        if (model != null) {            Set nodes = model.getBrowser().getSelectedDisplays();            if (nodes != null) {                Iterator i = nodes.iterator();                Object x;                images = new ImageData[nodes.size()];                int index = 0;                while (i.hasNext()) {                    x = ((ImageDisplay) i.next()).getHierarchyObject();                    if (x instanceof ImageData) {                        images[index] = (ImageData) x;                        index++;                    }                    index++;                }            }        }        return images;    }