public void viewImage() {
	  try {
		printCommandSeparator();
		String infile = inputfiletxt.getText();
		if (infile.toLowerCase().endsWith(".bmp")) {
			BmpImage img = new BmpImage(infile);
			bcifViewer.main(img, (new File(infile)).getName());
		} else if (infile.toLowerCase().matches(".*\\.bcif[0-9]*")) {
			if (stream.isSelected()) {
				bcifEncoder.decompressBcifToStreamableViewer(infile);
			} else {
				bcifEncoder.decompressBcifToViewer(infile);
			}
		} else if (infile == null || infile.equals("")) {
			JOptionPane.showMessageDialog(this, "No input file specified !");
		} else if (! converter.canConvert()) {
			JOptionPane.showMessageDialog(this, "Unrecognized filetype for file: \n" + infile);
		} else {
			try {
				File tf = File.createTempFile("bcifconverter", ".bmp");
				repaint();
				boolean cres = converter.convert(infile, tf.getCanonicalFile().toString());
				if (cres) {
					BmpImage img = new BmpImage(tf.getCanonicalFile().toString());
					bcifViewer.main(img, (new File(infile)).getName());			
				} else {
					String ermsg = "Error: \nConversion from non-BMP file failed.";
					ermsg += "\nPossible cause: imagemagick must be at least of version 6.3.6-9";
					JOptionPane.showMessageDialog(this, ermsg);
				}
			} catch	(Exception e) {
				String ermsg = "Error in opening file " + infile + ": \n" + e.getMessage();				
				JOptionPane.showMessageDialog(this, ermsg);				
			}
		}	
	  }	catch (Exception e) {
		String ermsg = "Error in image visualization: \n" + e.getMessage();				
		JOptionPane.showMessageDialog(this, ermsg);			  	
	  }
	}