static void openFile (File file){
		//Opens the file using ImageJ libraries.
		Kappa.imageStack = new ImagePlus(file.getPath());

		//Splits the image into the R, G, and B channels, but only if the image is in RGB color
		if (Kappa.imageStack.getType() == ImagePlus.COLOR_RGB)
			Kappa.imageStackLayers = ChannelSplitter.splitRGB(Kappa.imageStack.getImageStack(), true);

		//Sets the displayed Image Stack to all the channels to begin with.
		Kappa.displayedImageStack = Kappa.imageStack;

		//Sets the image type in the menu
		bit8.setEnabled(true);
		bit16.setEnabled(true);
		bit32.setEnabled(true);
		RGBColor.setEnabled(true);
		if (Kappa.displayedImageStack.getType() == ImagePlus.GRAY8)
			bit8.setSelected(true);
		else if (Kappa.displayedImageStack.getType() == ImagePlus.GRAY16)
			bit16.setSelected(true);
		else if (Kappa.displayedImageStack.getType() == ImagePlus.GRAY32)
			bit32.setSelected(true);
		else
			RGBColor.setSelected(true);

		Kappa.maxLayer = Kappa.imageStack.getNSlices();
		Kappa.maxLayerDigits = Integer.toString(Kappa.maxLayer).length();
		ControlPanel.currentLayerSlider.setValue(Kappa.INIT_LAYER);
		ControlPanel.currentLayerSlider.setMaximum(Kappa.maxLayer);
		ControlPanel.currentLayerSlider.setMajorTickSpacing(Kappa.imageStack.getNSlices()/10);
		ControlPanel.currentLayerSlider.setPaintTicks(true);
		ControlPanel.currentLayerSlider.setEnabled (true);
		ControlPanel.scaleSlider.setEnabled (true);

		//Sets the maximum intensity depending on the bit depth of the image.
		if (RGBColor.isSelected())
			InfoPanel.dataThresholdSlider.setMaximum(256);
		else InfoPanel.dataThresholdSlider.setMaximum((int)(Math.pow(2, Kappa.displayedImageStack.getBitDepth())));

		//We disable export options for stacks if this is just a single image.
		if (Kappa.maxLayer == 1)
			Kappa.exportPanel.perStackPanel.hide();
		else if (Kappa.maxLayer > 1)
			Kappa.exportPanel.perStackPanel.show();
		Kappa.exportPanel.repaint();

		//Sets the buttons to active and selected if the image type is a Color one. Otherwise sets them to inactive
		for (int i = 0; i < 3; i++){
			ControlPanel.channelButtons[i].setEnabled(Kappa.imageStack.getType()== ImagePlus.COLOR_RGB);
			ControlPanel.channelButtons[i].setSelected(Kappa.imageStack.getType() == ImagePlus.COLOR_RGB);
		}

		//Sets the scroll pane in the drawing panel to display the first layer of the image now
		Kappa.imageStack.setZ(1);
		Kappa.currImage = Kappa.displayedImageStack.getBufferedImage();
		Kappa.currImageLabel.setIcon(new ImageIcon (Kappa.currImage));
		Kappa.thresholded = new boolean [Kappa.currImage.getWidth()][Kappa.currImage.getHeight()];

		//Sets the maximum scale to a value that prevents a heap space error from occuring.
		//We set the maximum image size to about 2000 x 2000 pixels = 4,000,000 pixels.
		int avgPixelDim = (Kappa.currImage.getWidth()+Kappa.currImage.getHeight())/2;
		ControlPanel.scaleSlider.setValue(ControlPanel.DEFAULT_SCALE);
		ControlPanel.scaleSlider.setMaximum(Math.min(ControlPanel.MAX_SCALE, ControlPanel.MAX_AVG_PIXEL_DIM/avgPixelDim * 100));

		Kappa.updateThresholded();
		InfoPanel.thresholdChannelsComboBox.setEnabled(true);
		InfoPanel.thresholdSlider.setEnabled(true);
		InfoPanel.rangeAveragingSpinner.setEnabled(true);
		InfoPanel.bgCheckBox.setEnabled(true);
		InfoPanel.apply.setEnabled(true);
		InfoPanel.revert.setEnabled(true);
		fit.setEnabled(true);

		//Enables view checkboxes
		boundingBoxMenu.setEnabled(true);
		scaleCurvesMenu.setEnabled(true);
		antialiasingMenu.setEnabled(true);
		tangentMenu.setEnabled(true);

		//Enables toolbar buttons and selects the direct selection tool
		Kappa.toolPanel.enableAllButtons();

		//Enables Menu Items
		zoomIn.setEnabled (true);
		zoomOut.setEnabled (true);
		for (JMenuItem menuItem : toolMenuItems)
			menuItem.setEnabled(true);
		prevFrame.setEnabled(true);
		nextFrame.setEnabled(true);
		prevKeyframe.setEnabled(true);
		nextKeyframe.setEnabled(true);
		adjustBrightnessContrast.setEnabled(true);

		//Adds file name to the frame.
		Kappa.frame.setTitle(Kappa.APPLICATION_NAME + "- " + file.getName());		
	}