public LocalImage(File f) {
        name = f.getName();
        
        imageStack = new ArrayList<BufferedImage>(1);
        
        //Handling of ACR file types
        if(name.endsWith(".acr")){
            FileImageInputStream imageFile = null;
            try {
                imageFile = new FileImageInputStream(f);
                imageFile.seek(0x2000);
            }
            catch (FileNotFoundException e) {
                System.err.print("Error opening file: ");
                System.err.println(e.getMessage());
                System.exit(2);
            }
            catch (IOException e) {
                System.err.print("IO error on file: ");
                System.err.println(e.getMessage());
                System.exit(2);
            }

            int sliceWidth = 256;
            int sliceHeight = 256;

            BufferedImage sliceBuffer = 
                new BufferedImage( sliceWidth,sliceHeight,
                                   BufferedImage.TYPE_USHORT_GRAY );

            for ( int i = 0; i < sliceBuffer.getHeight(); i++ ) {
                for ( int j = 0; j < sliceBuffer.getWidth(); j++ ) {

                    int pixelHigh = 0;
                    int pixelLow = 0;
                    int pixel;

                    try {
                        pixelHigh = imageFile.read();
                        pixelLow = imageFile.read();
                        pixel = pixelHigh << 4 | pixelLow >> 4;

                        sliceBuffer.setRGB( j, i,
                                          pixel << 16 | pixel << 8 | pixel);

                    }
                    catch (IOException e) {
                        System.err.print("IO error readin byte: ");
                        System.err.println(e.getMessage());
                        System.exit(2);
                    }


                }
            }
            imageStack.add(sliceBuffer);
        } else {
            
            BufferedImage image;
            try {
                image = ImageIO.read(f);
            } catch (IOException ex) {
                // Can't do anything about this.
                Logger.getLogger(LocalImage.class.getName()).log(Level.SEVERE, null, ex);
                image = null;
            }
            imageStack.add(image);
        }
    }