Using FIJI/ImageJ to adjust and convert a .czi image file into 8-bit tiff

Using FIJI/ImageJ to adjust and convert a .czi image file into 8-bit tiff

Author note: This wiki page is a companion to another page titled “A basic workflow for putting together a figure for publication“.

 

Overview

Unless you are using open-source software to run a camera attached to your light microscope, you will likely be dealing with image files acquired in some proprietary format. And you don’t always have access to the vendor-specific software to process those image files on your own computer. FIJI/ImageJ provides a solution via the Bio-Formats plugin, which adds support for many proprietary formats, including .czi by Zeiss. This wiki page describes an example, in which we used FIJI/ImageJ to open and manipulate a single-channel epifluorescence image in the .czi format, in preparation for a manuscript figure.

Open a .czi image in FIJI

  1. Start FIJI.

  2. Open the folder location containing the image file you are working on, using something like the File Explorer in Windows.

  3. Drag and drop the image file over the FIJI menu bar.

  4. The Bio-Formats Import Options window will open. Here, check "Display metadata", then click "OK".

    01-bio-formats.png
  5. This opens two windows: [1] the image file, and [2] metadata.

  6. Save the metadata as a .csv file. You can close the metadata window at this point.

    02a-metadata-save.png
  7. It is also good to know the image information displayed in the image window. This includes: file name, image dimensions, pixel dimensions, and bit depth.

    02b-image-info-annotated.png
  8. To calculate the scale bar in preparation for your manuscript, you need to obtain the pixel size of the image in one of the following two ways.

    1. Option A: Open the image (.czi) in FIJI, then Image > Properties. Note the pixel width in microns per pixel.

    2. Option B: In the image metadata you saved earlier, search for "Scaling|Distance|Value" towards the bottom of the file. This number should match the number from Option A.
      The metadata also has an entry called "ImageScaling|ImagePixelSize". Do not use this number because it is the pixel size before all magnification factors, such as the objective and camera adapter, are applied.

Adjust the brightness and contrast for the image overall

  1. Image > Adjust > Brightness/Contrast. This brings up the B&C window with the histogram and adjustment sliders.

    03-bc1.png
  2. For this particular image, the histogram ranges from 58 to 16383. Move the "Maximum" slider until the image looks good. An image that looks "good" will still retain details in the brightest and darkest areas (For this image, it is about 4000 at the maximum end). Note that this increases the brightness and contrast at the same time, without affecting the darkest pixels. [Alternative: Instead of using the slider, you can click "Set" and enter specific minimum and maximum values.]

    04-bc2.png

  3. Click "Apply". You can close the B&C window at this point.

Rotate the image to make the slice horizontal

  1. Image > Transform > Rotate. This brings up the “Rotate” window with an adjustment slider for the angle and other options. Check "Preview". You can change the number of grid lines (which are visible only when the rotate tool is active) to assist you.

    05-rotate.png
  2. For this image, a 34-degree angle looks good. Move the slider to the desired angle, or type in the pre-determined angle.

  3. Click "OK". The Rotate window will close automatically.

Save the image as an 8-bit tiff file

  1. File > Save As > Tiff. This opens a window for choosing the location to save the file in. Select the correct location and click "Save". The window closes, and the image displayed is now the newly saved 16-bit tiff image (see the file extension in the window title).

    05-save-as-tif.png
  2. Image > Type > 8-bit. This will convert the file into an 8-bit image. Save this as a separate file. You might want to add something like "8bit" in the file name to indicate this conversion.

    05-8bit-tif.png
  3. Image > Adjust > Scale to DPI. This will open the “Scale by DPI” window. The goal here is to set the image resolution appropriate for print without changing the pixel dimensions. [Alternatively, you can do this in Adobe Photoshop.]

    1. Set “DPI” to “300”.

    2. Calculate and enter the new image width and height based on the resolution of 300 dpi. Example: 2464 pixels / 300 pixels per inch = 6.8533 inches.

    3. Set “Interpolation” to “None”.

    4. Check “Create new window”.

    5. Click “OK”. Save the new file (indicate 300dpi in the file name).

      09-scal-by-dpi.png
  4. Unless you already know the final size of the image, cropping in FIJI/ImageJ is not recommended because it is permanent (i.e., you cannot change the crop dimensions later). Instead, you can [1] place the image into your figure in Adobe Illustrator and use a clipping mask, [2] place the image in Microsoft PowerPoint and crop, or [3] open the image in Adobe Photoshop and crop with “Delete Cropped Pixels” unchecked. The options 1 and 3 are described in this page: A basic workflow for putting together a figure for publication

Place the image into your figure file

  1. Place the 8-bit tiff image into your figure file. If you are using Adobe Illustrator, you can follow the steps described in this page: A basic workflow for putting together a figure for publication