Dr. Paul Gignac, an Associate Professor at the Department of Anatomy & Cell Biology at Oklahoma State University Center for Health Sciences in Tulsa, Oklahoma, created a list of instructions for working with image stacks in FIJI (FIJI Is Just ImageJ) with editing and additions by Dr. Claire Terhune.  Thank you, Paul and Claire!

Here is a link to the downloadable PDF of the file:  Working with Data in Fiji

Instructions for Working with Image Stacks in FIJI (FIJI Is Just ImageJ)

 Opening an image stack:

  1. Select File > Import > Image Sequence from the menu bar
    • Note that all data for a single image stack should be in a single folder, as FIJI will only allow you to select one file and will then load all .tif files in that directory
  2. The window that pops up will provide information about the image sequence to be loaded—confirm that the number of images matches the stack you intend to load
    • “Sort names numerically” should be checked, whereas all other options are unchecked—you may select the other options, which will be executed when the image stack is loaded (note, such changes will not alter the original image stack). Generally, you will not need to check the other boxes.
  3. Click OK
  • The stack will appear, and you can now scroll through it using either your mouse or the slider bar at the bottom of the viewer. Note that the slice number changes as you move through the stack, and this corresponds to the specific image in the folder containing your image stack
  • The small “play” icon in the bottom left of the viewer will automate the slices
  1. You can view data about the image stack by selecting Image > Show Info…
    • This is particularly useful for .dicom image stacks where the metadata will also be imported into FIJI
  2. To view your CT data in 3D go to Plugins > Volume Viewer

 

Adjusting image brightness and contrast:

  1. If the grayscale values for any image stack are washed out to the extreme (i.e., completely black and white), then select Image > Adjust > Brightness and Contrast from the menu bar
  • Utilize the “Auto” and “Reset” buttons or manually adjust the “Minimum,” “Maximum,” “Brightness,” and “Contrast” sliders until you are happy with the grayscale image
  • Scroll through the stack to ensure that there are no extremely white or extremely black regions. If you find these, then continue to adjust options in the Brightness and Contrast window until satisfied.
  • When satisfied that the entire stack looks good, click “Apply”

 

Duplicating a stack

  1. Because many changes made in FIJI cannot be undone, duplicating a stack before making such changes provides an “undo” opportunity
  2. Select Image > Duplicate… from the menu bar
    • The window that pops up will provide the option to “Duplicate stack”, which you will need to select in order to duplicate each image in the image stack (note, if you wish to duplicate only a section of the image stack, enter the range of images in the text box to duplicate just that portion of the stack).
  3. Click “OK”

 

Saving a modified stack:

  1. At any point in time you can save the image stack you are working on by selecting File > Save as > Image Sequence… from the menu bar
  2. Choose your format (TIFF is a non-compressed image format, which is preferred to maintain grayscale value integrity)
  3. Name the stack as you wish—the name will be assigned to every image in the stack, followed by a number indicating that image’s specific sequence within the stack.
    • It is recommended that you add one or more hyphens (“-“) or lines (“­_”) after the end of the file name so that the appended number sequence is visually spaced from the sample name
    • Find the directory for saving the modified stack—it is recommended that you create a new folder in this directory and name it appropriately.
  4. Select “Open”, which will cause the stack to save.
  5. If you used the Crop-3D plug-in to create new image stacks, each one will have to be saved individually.

 

Editing images in an image stack:

  1. If there are small inclusions or artifacts included in only a few image slices, these artifacts can be removed manually by using the selection tools on the menu bar (rectangle, oval, polygon, freehand etc.) to select the region of the image you wish to remove and then selecting Control +X.
  2. If multiple images are affected, you will have to scroll sequentially through the images selecting and deleting regions of interest.

 

Rotating a stack:

  1. Scroll to a part of the image stack that is informative about the position of your sample.
  2. Select Image > Transform > Rotate… from the menu bar
  • The window that pops up will provide options about how much rotation to invoke:
    • First select both “Enlarge Image” and “Preview” (the former ensures that you don’t accidental rotate your sample out of the field of view; the latter allows you to see how the current slice will be rotated given your input value)
    • “Grid Lines” provides the opportunity to see a grid overlaid onto the image, which can help with alignment preview
  1. Change “Angle (degrees)” using the keyboard or the slider until you find the rotation that fits your needs (note, you can rotate using whole numbers, decimals, and negative or positive values).
  2. Once satisfied, click “OK” and confirm “YES” that you want to process the whole stack. (Once again, these changes do not impact your original stack files.)

 

Cropping a stack in 2D:

  1. Use the left mouse button to click and drag over the current slice in your image stack, this will create a yellow box, which represents the region down to which the stack will be cropped
    • The yellow reticle can be resized by left-click-and-holding the white squares at its corners and sides, and dragging these to the correct locations
    • Scroll through the entire stack to make sure nothing of interest will be cropped out
  2. Select Image > Crop from the menu bar
  • Note, if you have already done the Crop-3D step, you will not be able to Crop in 2D. It is recommended that you Crop in 2D before Cropping in 3D. This can involve iteratively saving intermediate stacks, and re-opening them anew, which allows you to then Crop them in 2D

 

Re-slicing your stack into other planes:

  1. Select Plug-ins > Stacks > Crop-3D… from the menu bar
    • The window that pops up will provide options that are currently selected; leave them selected
  2. Click “OK”; after some processing, two new windows will appear. Each will be at 90º orientation from the other two windows;
  • If the grayscale values are washed out to the extreme follow the directions for adjusting image brightness and contrast above.
  1. Change the crop area either by changing the values in the “Crop Options” box or by clicking and dragging the corners of the purple selection box in the viewer windows.
  2. If you are not satisfied with the orientation of all three image stacks , they you may continue to Rotate (see above) and Crop-3D the stacks until you all three stacks are oriented as you wish, understanding that they will always be re-sliced at 90º from the reference stack.

 

Saving a stack as a video:

  1. Select File > Save as > AVI… from the menu bar
    • Select compression options, if desired
    • Choose frame rate (note, all frames will be saved, but the total time length of the video will be determined by number of slices (frames) that are viewed per second when playing the video—7 is default; large numbers create shorter length, faster progressing videos; lower numbers create longer length, shorter progressing videos)
  2. Click “OK”
  3. Name the file as appropriate and choose the location for saving.
  4. Click “Save”

 

3D stitching two overlapping image stacks:

(also see https://imagej.net/Stitching_2D/3D for fine details of the parameters you can change)

  1. Fully reconstruct both image stacks and export the files as 16-bit TIFFs (each stack can be cropped to a different size before stitching if you wish, this will not impact centering, but it can save on memory usage and file size)
  2. Open both image stacks in Fiji (File > Import > Image Sequence)
  3. There should be ~10–15% overlap in the two scans, so go to the same slice in both stacks
  4. Using the left mouse button, click and drag a square over the same section of anatomy in both stacks—the resulting box should contain both your darkest and lightest values in the image
  5. Go to Plugins > Stitching > Depreciated > 3D Stitching
  6. Assign stacks in the correct order (i.e., the region of overlap should be at the end of the first stack and the beginning of the second stack)
  7. Change the value for “Peaks” from 5 to 15 (this will sample the histogram over the boxed region in both stacks more thoroughly, provided a better alignment and blending of grayscale values); otherwise the standard values are usually fine
  8. Click OK—a log window will pop up, providing updates on the blending process. Another window showing the blend happening in real time will also appear. When the log box indicates that blending has finished you will be able to scroll through the new image stack.
  9. Save the new image stack using the menus Save as… > Image Sequence and choose TIFF to ensure you have a loss-less file type

Additional stitching notes:

  • If you have to fuse more than two stacks, you will repeat the above process but with the stitched image stack and another stack.
  • You can crop away excessive black space to save on file size; Fiji will add in pure black pixels if it needs to match the pixel dimensions of one stack with the other
  • Once the stacks are stitched, any brightness/contrast/sharpness modifications will be made to the entire stack. So, if you need to adjust these values in only one of the stacks, apply them to the stack prior to stitching.

 

Resizing and downsampling an image stack:

  1. There are two options for reducing the size of your image stack, but both should only be used when scale and resolution are not of importance for later analysis.
  2. To downsample data from 16-bit (65,536 shades of gray) to 8-bit (256 shades of gray) data, select Image > Type > 8-bit. Beware that this will automatically convert your current image stack and this is not reversible without reloading your original data.
    • Downsampling your data in this way will cut your file size roughly in half, but you will lose considerable resolution in the data.
  3. Another option for decreasing image stack size is to resize your image stack by selecting Image > Scale…
    • When the control box appears, you can either select the number of pixels or scale by a percentage of the original pixel dimensions (X/Y/Z)
      • Note that the depth (i.e., the number of images) will not automatically change when the X (width) and Y (height) dimensions are changed. If you wish to scale your image stack so all of your voxels remain isotropic this value will also need to be adjusted to be proportional to the change in the width and height (i.e., decrease all values by the same percentage).
    • Resizing effectively averages across pixels/voxels and will also decrease the resolution of your data

 

Thresholding data:

  1. In some instances you may wish to identify all pixels over or under a certain threshold (i.e., when selecting all bone in a specimen). This can be accomplished in ImageJ via Image > Adjust > Threshold
  2. If you wish to apply this threshold to the entire image stack, in the first options box select “stack histogram”
  3. Click “Auto” to automatically have the program separate out the material of interest (the selected material should be in red). Make sure to scroll through the slides to confirm that all of the images have segmented properly. (Note that if the quality of the scan is not great, the Auto function may not work.)
  4. Once you’re satisfied that you have adequately separated the material of interest from all other materials, click “Apply”
  5. Then in the second options box Deselect “calculate threshold for each image” and select the “black background” option (again)
  6. The resulting image stack should show your material of interest in white and all other pixels in black.