Программа imagej руководство

This is an archive of the old MediaWiki-based ImageJ wiki. The current website can be found at imagej.net.

This part introduces some basic aspects of ImageJ so that you can use the software more efficiently. It also introduces some important terms and concepts used throughout this guide. You may skip it if you already use the program efficiently and are familiar with terms such as Virtual Stacks↓, Hyperstacks↓, Pseudocolor Images↓, Color Composite Images↓ or Composite Selections↓.

Contents

  • 1 Using Keyboard Shortcuts
  • 2 Finding Commands
  • 3 Undo and Redo
  • 4 Image Types and Formats
    • 4.1 Native Formats
    • 4.2 Non—native Formats
  • 5 Stacks, Virtual Stacks and Hyperstacks
    • 5.1 Stacks
    • 5.2 Virtual Stacks
    • 5.3 Hyperstacks
  • 6 Color Images [D]  [D] This section is partially extracted from the MBF ImageJ online manual at http://www.macbiophotonics.ca/imagej/colour_image_processi.htm.
    • 6.1 Pseudocolor Images
    • 6.2 True Color Images
      • 6.2.1 Color Spaces and Color Separation
      • 6.2.2 Conveying Color Information [F]  [F] This section is partially extracted from Masataka Okabe and Kei Ito, Color Universal Design (CUD) — How to make figures and presentations that are friendly to Colorblind people, http://jfly.iam.u-tokyo.ac.jp/color/, accessed 2009.01.15
    • 6.3 Color Composite Images
  • 7 Selections
    • 7.1 Manipulating ROIs
    • 7.2 Composite Selections
    • 7.3 Selections With Sub-pixel Coordinates↓\featureSelections with sub-pixel resolution
  • 8 Overlays[[|]]\improvementImproved handling of Overlays
  • 9 3D Volumes
  • 10 Settings and Preferences[[|]]\improvement

Using Keyboard Shortcuts

You’ll learn more and more ↓↓shortcut keys as you use ImageJ, because (almost) all shortcuts are listed throughout ImageJ menus. Similarly, in this guide each command has its shortcut key listed on its name (flanked by square brackets). Please note that the notation for these key-bindings is case sensitive, i.e., Shift-modifiers are not explicitly mentioned (a capital A means Shift—A) and assumes that Require control key for shortcuts in is unchecked (i.e., except when using the IJ Editor↓ or the Text Tool↓, you won’t have to hold down the Control key to use menu shortcuts). For example, the command can be evoked by Shift I or Ctrl Shift I if Require control key for shortcuts is checked. The full list of ImageJ shortcuts (see Keyboard Shortcuts↓) can be retrieved at any time using the command.

There are three ↓modifier keys in ImageJ:

Control (Command Key↓ on Apple keyboards) Denoted by ‘Ctrl’↓ or Ctrl in this document. Although a control key is typically present on Apple keyboards, on a Macintosh computer running ImageJ the Command key \cmd  Cmd replaces the functionality of the Control key of other operating systems. For sake of simplification, ‘Ctrl’ will always refer to both throughout this guide.

Shift Denoted by ‘Shift’↓ or Shift in this document.

Alt Denoted by ‘Alt’↓ or Alt in this document. This is also the ‘Option’ or ‘Meta’ key on many keyboards. In ImageJ, it is also used to type special unit symbols such as \micro (AltM) or \angstrom (AltShiftA).

[[|]]

float-infobox2 Frontmost Window and Window Activation

In ImageJ, all operations are performed on the active (frontmost) image (which has its title bar highlighted). If a window is already open it will activate when its opening command is re-run, e.g., if the B&C window is already opened (), pressing its keyboard shortcut ( Shift C ) will activate it.

Pressing Enter on any image will bring the [[#fig:The-ImageJ-window|]]

Main ImageJ window

↓ to the foreground. In addition, it is also possible to permanently place the main window above all other windows (see Floating Behavior of Main Window↓).

Finding Commands

Navigating through the extensive list of ImageJ commands, macros and plugins may be quite cumbersome. Through its built-in Command Finder / Launcher[[[#biblio-48|48]]], ImageJ offers an expedite alternative that allows you to retrieve commands extremely fast: .

In addition, ImageJ features a find function that locates macros, scripts and plugins source (.java) files on your computer: the command. Because most of IJ source files contain circumstanced comments, you can use this utility to retrieve files related not only to a image processing routine (e.g., background or co-localization) but also to a practical context such as radiogram, cell or histology. Indeed, ImageJ source files contain detailed annotations useful to both developers and regular users that want to know more about ImageJ routines and algorithms.

and are described in detail in .

Undo and Redo

Probably the first thing you will notice is that ImageJ does not have a large ↓undo/redo buffer. Undo () is currently limited to the most recent image editing / filtering operation. With time you will appreciate that this is necessary to minimize memory overhead. Nevertheless, with IJ 1.45 and later, is, in most cases, undoable and can be applied to multiple images if Keep multiple undo buffers is checked in

If you cannot recover from a mistake, you can always use to reset the image lo its last saved state. For selections, can be used to recover any misdealt selection.

In ImageJ the equivalent to ↓‘Redo’ is the , that re-runs the previous used command (skipping and commands).

Image Types and Formats

↓Digital Images are two-dimensional grids of pixel↓ intensities values with the width and height of the image being defined by the number of pixels in x (rows) and y (columns) direction. Thus, pixels (picture elements) are the smallest single components of images, holding numeric values — pixel intensities — that range between black and white. The characteristics of this range, i.e., the number of unique intensity (brightness) values that can exist in the image is defined as the bit↓—depth of the image and specifies the level of precision in which intensities are coded, e.g.: A 2—bit image has 22 = 4 tones: 00 (black), 01 (gray), 10 (gray), and 11 (white). A 4—bit image has 24 = 16 tones ranging from 0000 (0) to 1111 (16), etc. In terms of bits per pixel (bpp↓), the most frequent types of images () that ImageJ deals with are (↓ImageJ2↑ supports many more types of image data):

8—bit Images that can display 256 (28) gray levels (integers only).

16—bit Images that can display 65, 536 (216) gray levels (integers only).

32—bit Images that can display 4, 294, 967, 296 (232) gray levels (real numbers). In 32—bit images, pixels are described by floating point values and can have any intensity value including NaN↓ (Not a Number).

RGB Color Color Images↓ that can display 256 values in the Red, Green and Blue channel. These are 24—bit (23 × 8) images. RGB↓ color images can also be 32—bit color images (24—bit color images with additional eight bits coding alpha blending values, i.e., transparency).

Native Formats

Natively (i.e. without the need of third-party plugins) ImageJ opens the following formats: TIFF↓, GIF↓, JPEG↓, PNG↓, DICOM↓, BMP↓, PGM↓ and FITS↓. ↓Many more formats are supported with the aid of plugins. These are discussed in Non—native Formats ↓.

TIFF (Tagged Image File Format) is the ‘default’ format of ImageJ (cf. ). Images can be 1—bit, 8—bit, 16—bit (unsigned [C]  [C] A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent positive numbers.), 32—bit (real) or RGB color. ↓TIFF files with multiple images of the same type and size open as Stacks↓ or Hyperstacks↓. ImageJ opens ↓lossless compressed TIFF files (see 3↓ Image Types: Lossy Compression and Metadata↓) by the LZW↓↓, ↓PackBits and ↓ZIP (↓Deflate/Inflate) [[[#biblio-2|2]]] compression schemes. In addition, TIFF files can be opened and saved as ↓ZIP archives.
Tiff tags and information needed to import the file (number of images, offset to first images, gap between images) are printed to the Log Window↓ when ImageJ is running in Debug Mode (, see Settings and Preferences↓).

DICOM (Digital Imaging and Communications in Medicine) is a standard popular in the medical imaging community. Support in ImageJ is limited to uncompressed ↓DICOM files. DICOM files containing multiple images open as Stacks↓.
Use

↓ to display the DICOM header information. A DICOM sequence can be opened using or by dragging and dropping the folder on the ‘ImageJ’ window. Imported sequences are sorted by image number instead of filename and the tags are preserved when DICOM images are saved in TIFF format. ImageJ supports custom DICOM dictionaries, such as the one at http://imagej.nih.gov/ij/download/docs/DICOM_Dictionary.txt. More information can be found at the Center for Advanced Brain Imaging.

FITS (Flexible Image Transport System) image is the format adopted by the astronomical community for data interchange and archival storage. Use

↓ to display the ↓FITS header. More information here.

PGM (↓Portable GrayMap), PBM↓ (Portable BitMap) and PPM↓ (Portable PixMap) are simple image formats that use an ASCII↓ header. More information here.

AVI (Audio Video Interleave) is a container format which can contain data encoded in many different ways. ImageJ only supports uncompressed ↓AVIs, various ↓YUV 4:2:2 compressed formats, and ↓PNG or ↓JPEG-encoded individual frames. Note that most ↓MJPG↓ (motion-JPEG) formats are not read correctly. Attempts to open AVIs in other formats will fail.

Non—native Formats

When opening a file, ImageJ first checks whether it can natively handle the format. ↓If ImageJ does not recognize the type of file it calls for the appropriate reader plugin using HandleExtraFileTypes, a plugin bundled with ImageJ. If that fails, it tries to open the file using the ↓↓↓OME Bio-Formats library (if present), a remarkable plugin that supports more than one hundred of the most common file formats used in microscopy. If nevertheless the file cannot be opened, an error message is displayed.

Because both these plugins are under active development, it is important that you keep them updated. The OME Bio-Formats library can be updated using its self-updating plugin () or Fiji↑’s built-in updater (). The following websites provide more information on the OME Bio-Formats:

  • http://loci.wisc.edu/bio-formats/imagej
  • https://fiji.sc/Bio-Formats
  • http://loci.wisc.edu/bio-formats/using-bio-formats

In addition, the ImageJ web site lists more than sixty plugins that recognize more ‘exotic’ file formats. The ImageJ Documentation Portal also maintains a (somewhat outdated) list of file formats that are supported by ImageJ.

[[|]]

float-infobox3 Image Types: Lossy Compression and Metadata

Two critical aspects to keep in mind when converting images:

[[|]] [[|]]Lossy compression Transcoding an image into a format that uses ↓lossy compression will alter the original data, introducing artifacts (see 11↓ Warning on JPEG Compression↓). This is the case, e.g., for JPEG formats (with the exception of some ↓JPEG2000 images that use lossless compression). As such, these types of data are intended for human interpretation only and are not suitable for quantitative analyses

[[|]] [[|]]Metadata In ImageJ, ↓metadata associated with the image, such as scale, gray value calibration and user comments is only supported in tiff and zip (compressed tiff) images. In addition, selections and Overlays↓ are also saved in the TIFF header (cf. ). None of the above is saved in other formats (cf. Native Formats↑).

Stacks, Virtual Stacks and Hyperstacks

Stacks

ImageJ can display multiple spatially or temporally related images in a single window. These image sets are called stacks. The images that make up a stack are called slices. In ↓stacks, a pixel (which represents 2D image data in a bitmap image) becomes a voxel↓ (volumetric pixel), i.e., an intensity value on a regular grid in a three dimensional space.

All the slices in a stack must be the same size and bit depth. A scrollbar provides the ability to move through the slices and the slider is preceded by a play/pause icon that can be used to start/stop stack animation. Right-clicking on this icon runs the dialog box.

Most ImageJ filters will, as an option, process all the slices in a stack. ImageJ opens multi-image TIFF files as a stack, and saves stacks as multi-image TIFFs. The command opens other multi-image, uncompressed files. A folder of images can be opened as a stack either by dragging and dropping the folder onto the ‘ImageJ’ window or or by choosing To create a new stack, simply choose and set the Slices field to a value greater than one. The submenu contains commands for common stack operations.

Virtual Stacks

↓↓Virtual stacks are disk resident (as opposed to RAM↓ resident) and are the only way to load image sequences that do not fit in RAM. There are several things to keep in mind when working with virtual stacks:

  • Virtual stacks are read-only, so changes made to the pixel data are not saved when you switch to a different slice. You can work around this by using macros (e.g., Process Virtual Stack) or the command
  • You can easily run out of memory using commands like

    ↓ because any stack generated from commands that do not generate virtual stacks will be RAM resident.

  • TIFF virtual stacks can usually be accessed faster than ↓JPEG virtual stacks. A JPEG sequence can be converted to TIFF by opening the JPEG images as a virtual stack and using to save in TIFF format

ImageJ appends a ‘(V)’ to the window title of virtual stacks and hyperstacks (see Hyperstacks↓). Several built-in ImageJ commands in the submenu have the ability to open virtual stacks, namely: , , , , (cf. Virtual Stack Opener). In addition, TIFF stacks can be open as virtual stacks by drag and drop (cf. 4↓ Opening Virtual Stacks by Drag & Drop↓).

[[|]]

float-infobox4 Opening Virtual Stacks by Drag & Drop

TIFF stacks with a .tif extension open as virtual stacks when dragged and dropped on the figure images/tools/Switcher-small.png  toolbar icon.

Hyperstacks

↓Hyperstacks are multidimensional images, extending image stacks to four (4D) or five (5D) dimensions: x (width), y (height), z (slices), c (channels or wavelengths) and t (time frames). Hyperstacks are displayed in a window with three labelled scrollbars (see Stacks and Hyperstacks↑). Similarly to the scrollbar in Stacks↑, the frame slider (t) has a play/pause icon.

↓ImageJ deals with color mainly in three ways: pseudocolor images, RGB images, RGB/ HSB↓ stacks, and composite images.↓

Pseudocolor Images

A pseudocolor (or indexed color) image is a single channel gray image (8, 16 or 32—bit) that has color assigned to it via a lookup table or LUT↓↓. A LUT is literally a predefined table of gray values with matching red, green and blue values so that shadows of gray are displayed as colorized pixels. Thus, differences in color in the pseudo-colored image reflect differences in intensity of the object rather than differences in color of the specimen that has been imaged.

8-bit indexed color images (such as GIFs) are a special case of pseudocolor images as their lookup table is stored in the file with the image. These images are limited to 256 colors (24—bit RGB images allow 16.7 million of colors, see Image Types and Formats↑) and concomitantly smaller file sizes. Reduction of true color values to a 256 ↓color palette is performed by color quantization algorithms. ImageJ uses the ↓↓↓Heckbert’s median-cut color quantization algorithm (see menu), which, in most cases, allows indexed color images to look nearly identical to their 24-bit originals.

True Color Images

As described in Image Types and Formats↑, true color images such as RGB images reflect genuine colors, i.e., the green in an RGB image reflects green color in the specimen. Color images are typically produced by color CCD↓ cameras, in which ↓color filter arrays (Bayer masks) are placed over the image sensor.↓

Color Spaces and Color Separation

Color spaces ↓describe the gamut of colors that image-handling devices deal with. Because human vision is trichromatic, most color models represent colors by three values. Mathematically, these values (color components) form a three-dimensional space such as the RGB↓, ↓HSB, ↓CIE Lab or ↓YUV color space.

[[|]]

figure images/RGB-HSBcolorModels.png

Figure 3 Representation of an eight pixel color image in the RGB and HSB color spaces. The RGB color space maps the RGB color model to a cube with Red (R) values increasing along the x-axis, Green (G) along the y-axis and Blue (B) along the z-axis. In the HSB cylindrical coordinate system, the angle around the central vertical axis corresponds to Hue (H), the distance from the axis corresponds to Saturation (S), and the distance along the axis corresponds to Brightness (B). In both cases the origin holds the black color. The right panel shows the same image after brightness reduction, easily noted by the vertical displacement along the HSB cylinder. Images produced using Kai Uwe Barthel’s 3D Color Inspector plugin.

RGB (Red, Green, Blue) is the most commonly-used color space. However, other alternatives such as HSB (Hue, Saturation, Brightness) provide significant advantages when processing color information. In the HSB color space, Hue describes the attribute of pure color, and therefore distinguishes between colors. Saturation (sometimes called “purity” or “vibrancy”) characterizes the shade of color, i.e., how much white is added to the pure color. Brightness (also know as Value — HSV system) describes the overall brightness of the color (see e.g., the color palette of Color Picker window↓). In terms of digital imaging processing, using the HSB system over the traditional RGB is often advantageous: e.g., since the Brightness component of an HSB image corresponds to the grayscale version of that image, processing only the brightness channel in routines that require grayscale images is a significant computational gain [E]  [E] See Wootton R, Springall DR, Polak JM. Image Analysis in Histology: Conventional and Confocal Microscopy. Cambridge University Press, 1995, ISBN 0521434823. You can read more about the HSB color model here.

In ImageJ, conversions between image types are performed using the submenu. Segmentation on the HSB, RGB, CIE Lab and YUV color spaces can be performed by the command [[[#biblio-20|20]]]. Segregation of color components (specially useful for quantification of ↓↓↓histochemical staining) is also possible using Gabriel Landini’s Colour Deconvolution plugin. In addition, several other plugins related to color processing can be obtained from the ImageJ website.

Conveying Color Information [F]  [F] This section is partially extracted from Masataka Okabe and Kei Ito, Color Universal Design (CUD) — How to make figures and presentations that are friendly to Colorblind people, http://jfly.iam.u-tokyo.ac.jp/color/, accessed 2009.01.15

People see color with significant variations. Indeed, the popular phrase “One picture is worth ten thousand words” may not apply to certain color images, specially those that do not follow the basic principles of Color Universal Design. Citing Masataka Okabe and Kei Ito:

↓Colorblind people can recognize a wide ranges of colors. But certain ranges of colors are hard to distinguish. The frequency of colorblindness is fairly high. One in 12 Caucasian (8%), one in 20 Asian (5%), and one in 25 African (4%) males are so-called ‘red—green’ colorblind.

There are always colorblind people among the audience and readers. There should be more than ten colorblind in a room with 250 people (assuming 50% male and 50% female).

[ …] There is a good chance that the paper you submit may go to colorblind reviewers. Supposing that your paper will be reviewed by three white males (which is not unlikely considering the current population in science), the probability that at least one of them is colorblind is whopping 22%!

[[|]]

figure images/Dichromacy.png

Figure 4 Red—green images and partial color blindness. Deuteranopia (second panel), protanopia (third panel) are the most common types of partial color blindness (red / green confusion). Tritanopia (blue / orange confusion, fourth panel) is quite rare. Replacing Red with Magenta in RGB Images↓ (bottom row) is a simple way to compensate for color vision deficiencies.

One practical point defined by the Color Universal Design is the use of magenta in red—green overlays (see also [[[#biblio-97|47]]]). Magenta is the equal mixture of red and blue. Colorblind people that have difficulties recognizing the red component can easily recognize the blue hue. The region of double positive becomes white, which is easily distinguishable for colorblind. In ImageJ this is easily accomplished using the , or using the ImageJ macro language (see 5↓ Replacing Red with Magenta in RGB Images↓).

[[|]]

float-infobox5 Replacing Red with Magenta in RGB Images

When building RGB images, magenta can be obtained using the Previously created RGB images can be converted to ↓‘MGB’ using . Alternatively, the command can be used to add the red channel to the blue channel. Both these approaches can be automated using the ImageJ macro language as exemplified by Macros (11↓) and (7↓). Once saved in the ImageJ/plugins/ folder these Macros↓ are treated as regular ImageJ commands.

In Fiji↑, as expected, the procedure of modifying RGB images is simpler: one just needs to run . For even more convenience, Fiji provides an analogous command that replaces the system clipboard’s image with a magenta-green one.

It is also possible to simulate color blindness using the Vischeck or Dichromacy plugins [G]  [G] One advantage of Dichromacy over the Vischeck plugin is that it can be recorded and called from scripts and macros, without user interaction., or in ↓Fiji↑, using the command.

[[|]]Replace Red with Magenta.ijm (Using )

 /* This macro replaces Red with Magenta in RGB images using Process>Image Calculator...  command. */
   if (bitDepth!=24)
       exit("This macro requires an RGB image");
 setBatchMode(true);
   title= getTitle();
   r= title+" (red)"; g= title+" (green)"; b= title+" (blue)";
   run("Split Channels");
   imageCalculator("Add", b, r);
   run("Merge Channels...", "red=&r green=&g blue=&b");
   rename(title + " (MGB)");
 setBatchMode(false);

Color Composite Images

In a ↓composite image colors are handled through channels. The advantages with this type of image over plain RGB images are:

  1. Each channel is kept separate from the others and can be turned on and off using the ‘Channels’ tool (). This feature allows, e.g., to perform measurements on a specific channel while visualizing multiple.
  2. Channels can be 8, 16 or 32—bit and can be displayed with any lookup table
  3. More than 3 channels can be merged or kept separate

[[|]]Replace Red with Magenta.ijm (Using )

 /* This macro replaces Red with Magenta in RGB images using the Image>Color>Channels... tool. */
   if (bitDepth!=24)         // Ignore non-RGB images
       exit("This macro requires an RGB image");
 setBatchMode(true);         // Enter ‘Batch’ mode
   title = getTitle();       // Retrieve the image title
   run("Make Composite");    // Run Image>Color>Make Composite
   run("Magenta");           // Run Image>Lookup Tables>Magenta on channel 1
   run("RGB Color");         // Run Image>Type>RGB Color
   rename(title + " (MGB)"); // Rename the image
 setBatchMode(false);        // Restore ‘GUI’ mode

Selections

Selections (regions of interest, ROIs↓), are typically created using the Toolbar↓ Tools↓. Although ImageJ can display simultaneously several ↓↓ROIs (see Overlays↓ and ROI Manager↓) only one selection can be active at a time. Selections can be measured (

↓), drawn (), filled () or filtered ( submenu), in the case of area selections. In addition it is also possible to hold multiple ROIs as non-destructive Overlays↓.

Selections can be initially outlined in one of the nine ImageJ default colors (Red, Green, Blue, Magenta, Cyan, Yellow, Orange, Black and White). Once created, selections can be contoured or painted with any other color using

↓. Selection Color can be changed in , by double clicking on the Point Tool↓, or using hot keys (see (27.13.9↓) Colors…↓). It is highlighted in the center of the Point Tool↓ and Multi-point Tool↓.

[[|]]

figure images/Selections.png

Figure 5 Three types of area selections In ImageJ. Notice the cursor changes: to an arrow when it is within the selection, to a cross-hair when outside the selection, to a hand when over a selection vertex or ‘handler’. Notice also the filled handler in the polygon selection and the absence of point handlers in Composite Selections↓. Overlays↓, i.e., non-active selections displayed in the non-destructive image overlay, are also displayed without handlers.

Manipulating ROIs

Most of commands that can be useful in defining or drawing selections are available in the submenu and summarized in ROI manipulations↓. Listed below are the most frequent manipulations involving ↓selections:

Deleting Choose any of the selection tools and click outside the selection, or use . Use to restore a selection back after having deleted it. With Overlays↓, an activated ROI can be deleted by pressing the Backspace (Delete on Mac) key.

Managing A selection can be transferred from one image window to another by activating the destination window and runnig . Alternatively, to create ROIs across multiple images. Multiple selections can be stored as Overlays↓ or in the ROI Manager↓ list ().

Moving Selections can be moved by clicking and dragging as long as the cursor is within the selection and has changed to an figure images/pointers/Pointer-Arrow.png . The status bar displays the coordinates of the upper left corner of the selection (or the bounding rectangle for non-rectangular selections) as it is being moved. To move the contents of a selection, rather than the selection itself, , , and then click within the selection and drag.

Nudging Selections can be ‘nudged’ one pixel at a time in any direction using the arrow keys. Note that the up and down keys zoom the image in and out in the absence of selections (see Arrow Keys↓ shortcuts).

Resizing The Brush Selection Tool↓ can be used to perform fine adjustments of ROI contours. Most ROIs can be resized one pixel at a time by holding Alt while using the arrow keys. In general (see Area Selection Tools↓ and Line Selection Tools↓ for details), selections are resized by dragging one of the selection handlers. While dragging, holding Ctrl resizes the selection around its center, holding Alt imposes a fixed aspect ratio and holding Shift forces a 1:1 aspect ratio.

Composite Selections

Composite selections are non-contiguous ROIs containing more than one cluster of pixels and/or ROIs containing internal holes. Composite ROIs are typically originated with the Brush Selection Tool↓ but they can be defined with any other selection tool using key modifiers.

The following modifier keys can be use to create composite selections:↓

Shift Drawing outside current selection while pressing Shift creates new content. To add a non-square rectangle or ellipse, the Shift key must be released after adding the selection

Alt Drawing inside current selection while pressing Alt creates a hole removing content from the ROI

Note that some operations may not be performed properly on complex ROIs. In these cases, it may be useful to convert a composite ROI into a polygon using the command as explained in 14↓ Converting Composite Selections↓.

Selections With Sub-pixel Coordinates↓\featureSelections with sub-pixel resolution

Since ImageJ 1.46, selections can be defined with subpixel accuracy, beyond the nominal pixel resolution of the image: Floating point selections↓. Line Selections (see Line Selection Tools↓) are created with floating-point coordinates if the Sub-pixel resolution checkbox is active in Sub-pixel coordinates of pre-existing selections can be interpolated using the command. Interpolated points are easily noticeable on small selections created on images zoomed 1200% or greater.

[[|]]

figure images/SubPixel.png

Figure 7 ’Interpolated selections. ROIs drawn with (left) or without (middle) sub-pixel accuracy. For line selections (see Line Selection Tools↓), this option can be enabled in ‘ by activating the Sub-pixel resolution checkbox. Pixel coordinates of area selections (see Area Selection Tools↓), can be interpolated using . The image on the right is the output of SubPixelSelections.js, a script that demonstrates how to create selections at sub-pixel resolution without the need of setting any option in ImageJ.

Overlays[[|]]\improvementImproved handling of Overlays

↓↓↓Overlays are non-active selections displayed ‘over’ the pixel data, on the image overlay, and are the core of non-destructive image processing in ImageJ. In a way you can think of the image overlay as an invisible ROI Manager↓ in which selections are being added, allowing ROIs to be on ‘hold’. This concept of multiple distinct selections has been dramatically improved in ImageJ2↑ so we urge you to download IJ2 if multiple ROIs are important in your workflows.

Importantly, overlay selections are vector graphics composed of mathematically-defined paths (as opposed to raster graphics in which objects are defined by pixels) and are not affected by scaling, i.e., do not become pixelated. Most of overlay-related commands are listed in the , and in the ROI Manager window (). Appearance of overlay selections can be adjusted using /

As mentioned in 3↑ Image Types: Lossy Compression and Metadata↑, overlays are saved in the header of tif images, and do not need to be saved externally when using TIFF, the default file format of ImageJ. The major advantages of overlays are summarized below:

Storage of ROIs In ImageJ it is only possible to have a single ROI at a time. However, it is possible to add selections to the image overlay using B (

↓).\feature Once added to the image overlay, ROIs can be re-activated by Alt-clicking, Control-clicking or long-pressing (14 second or longer). Activated ROIs can be deleted by pressing the Backspace key. Selections can also be added and recovered in bulk, using the / commands.

Non-destructive annotations Overlays are the best way of annotating images in ImageJ (examples↓). As vector graphics, overlays do not change pixel values, can be scaled without loss of quality even at high zoom levels (see 19↓ Working with Zoomed Canvases↓) and can be displayed at different opacity values (see 20↓ Hexadecimal Color Values↓). RGB snapshots of the image with embedded overlays can be created by holding Shif F, the shortcut for . ‘Flattened’ images with the overlay rendered as pixel data are also created when saving the image as PNG or JPEG (), or when printing the image canvas (). The command is also listed in the ROI Manager↓.

Image ROIs An ↓↓imageROI (image selection) is a ROI that displays an image as an overlay. As described in and , this allows multiple images to be ↓blended on a single image canvas.

3D Volumes

Currently, the support for ↓↓3D ROIs (selections containing contiguous cluster of voxels) is somewhat limited in ImageJ. This limitation has been addressed by ImageJ2↑ and several IJ1 plugins. The list below summarizes some of the ImageJ plugins that deal effectively with multi-dimensional objects. Note that a manual installation of these tools as standalone ImageJ plugins is a challenging task given their special dependencies, reason why they are all bundled as part of ↓Fiji↑.

[[|]]

figure images/3Dviewer.png

Figure 9 3D Viewer (Fiji 1.46o), bringing hardware-accelerated 3D visualization to ImageJ. As explained in 3D Volumes↑, most of plugins that truly extend ImageJ functionally to multi-dimentional data are bundled as part of Fiji.

3D Filters Specialized ↓↓3D filters such as can be installed to perform 3D operations. Examples are the 3D processing package by Thomas Boudier [[[#biblio-84|34]]] and the 3D binary filters by Benjamin Schmid.

3D Object Counter 3D Object Counter (3D-OC) ↓↓counts and qualifies 3D objects in a stack [[[#biblio-147|97]]], similarly to the 2D analysis performed by It is complemented by 3D Roi Manager [[[#biblio-84|34]]], a companion plugin that adds a 3D ROI Manager↓ to ImageJ

3D Viewer 3D Viewer ↓↓brings powerful hardware-accelerated 3D visualization to ImageJ [[[#biblio-65|15]]], extending the limited functionality of In the ImageJ 3D Viewer↑ stacks can be displayed as texture-based volume renderings, surfaces or orthoslices. It is macro-recordable and can be used by other plugins as a high-level programming library for 3D visualization

Simple Neurite Tracer Simple Neurite Tracer ↓allows semi-automated segmentation of tubular structures in 3D [[[#biblio-128|78]]]

Settings and Preferences[[|]]\improvement

↓↓↓ImageJ preferences are automatically saved in a preferences file, the IJ_prefs.txt text file. This file is stored in  ~ /Library/Preferences/ on Mac OS X, in  ~ /.imagej/ on Linux and Windows (with  ~  referring to the user’s home directory). Several macros and plugins also write parameters to this file. If the IJ_prefs.txt is erased using , ImageJ will create a new one the next time it is opened resetting all parameters to their default values.

Sometimes, it may be useful to override (or restore) certain settings that may have been changed during a working session. For example, the Limit to threshold option () will affect most measurements performed on thresholded images. Thus, it may be wise to check the status of this parameter before each analysis, specially when working on multiple computers.

[[|]]Ensuring Specific Settings at Launch

 macro "AutoRun" {
   setOption("DebugMode", true);
   setOption("Bicubic", true);
   setOption("Display Label", true);
   setOption("Limit to Threshold", false);
   setOption("BlackBackground", true);
   run("Colors...", "foreground=white background=black"); //this line could be substituted by: setBackgroundColor(0,0,0); setForegroundColor(255,255,255);
   run("Profile Plot Options...", "width=350 height=200 draw");
   run("Brightness/Contrast...");
 }

The setOption() macro function can be used to set this and several other ImageJ options. Calling this function from the ↓↓“AutoRun” macro in the StartupMacros.txt file ensures preferences are set each time ImageJ starts. The macro (13↑) Settings and Preferences↑ exemplifies this approach ensuring that the following settings are enforced at startup:

  1. TIFF tag values are displayed by ImageJ (Debug Mode in )
  2. Bicubic interpolation is preferred over bilinear (e.g., )
  3. The name of the measured image name is recorded in the first column of the Results Table↓ (Display Label in )
  4. Measurements are not restricted to thresholded pixels (Limit to Threshold in )
  5. Binary images are processed assuming white objects on a black background (Black background in , see 23↓ Interpreting Binary Images↓)
  6. Background color is black and foreground color is white ()
  7. ImageJ plots contain grid lines and are always 350 × 200 pixels in size ()
  8. Open the B&C widget at its last saved screen position ()

imagej

Во многих отраслях науки, таких как материаловедение, география, астрономия, биология и медицина необходимо обрабатывать и анализировать большое количество фотографий.

Платформа ImageJ для работы с изображениями бесплатна и имеет обширный функционал, который можно подстроить под самые разнообразные запросы. В этой статье мы расскажем о возможностях, которые программа предоставляет ученым.

Содержание статьи

  • 1. Что такое ImageJ?
  • 2. Что умеет делать ImageJ?
  • 3. Другие программные пакеты ImageJ.
  • 4. Как расширить базовый функционал ImageJ?
  • 5. Как работает и как пользоваться ImageJ?
  • 6. Где скачать программу ImageJ?
  • Заключение

1. Что такое ImageJ?

Программа ImageJ предназначена для анализа и редактирования изображений. Имеет открытый исходный код. Работает как онлайн-программа или приложение, устанавливаемое на персональный компьютер. Интерфейс англоязычный.

Приложение работает на платформах Windows XP/Vista/7/8/8.1/10 (32 и 64 бит), Mac OS, Mac OS X и Linux.

ImageJ работает с 8-, 16- и 32-битными файлами в форматах JPEG, PNG, BMP, TIFF, GIF, DICOM (Digital Imaging and Communications in Medicine — отраслевой стандарт для медицинских снимков) или FITS (Flexible Image Transport System используется в науке, сохраняет метаданные изображений). Также программа может обрабатывать RAW-файлы, содержащие все данные с матрицы фотоаппарата или смартфона.

Программа поддерживает установку дополнительных плагинов, что значительно расширяет ее функциональные возможности. Например, если базовая версия не работает с нужным вам форматом, плагин поможет решить эту проблему.

ImageJ может обрабатывать одновременно несколько изображений, каждое из которых открывается в новом окне. Количество файлов, с которыми программа работает параллельно, лимитируется объемом оперативной памяти вашего компьютера. В начале работы рекомендуется увеличить объем памяти доступной приложению. Для этого перейдите в раздел Edit-Options-Memory.

Важно! Не устанавливайте значение, превышающее 75% оперативной памяти вашего компьютера. Объем оперативной памяти можно проверить через: Пуск — Панель управления — Система и безопасность — Система.

2. Что умеет делать ImageJ?

Исходный функционал ImageJ направлен на обработку изображений, их редактирование и анализ. Кроме того, программа выполняет специальные задачи:

  • Рассчитывает площади плоских фигур нерегулярной формы.
  • Определяет значения пикселей в выделенной области изображения.
  • Создает гистограммы распределения и графики профиля.
  • Масштабирует, вращает и переворачивает изображения.
  • Уменьшает шум с помощью медианной фильтрации.
  • Оценивает углы и расстояния.
  • Обнаруживает края.

Анализ микроструктур с помощью программы ImageJ позволяет проанализировать механические свойства сплавов; определить размер и объемную долю частиц армирующей фазы; оценить сложные размерно-топографические параметры, которые не поддаются стандартным методам цифровой микроскопии (например, неравномерность распределения включений, определение размера пор и распределение их диаметра в зависимости от количества в нанопористых материалах).

Программа используется для подсчета размеров колоний и площадей биопленок в микробиологии, для оценки усадки альгинатных оттисков в ортопедической стоматологии и т.д.

ImageJ может приблизить или уменьшить изображение до 32 раз. При этом сохраняется возможность проводить все операции по его обработке и анализу.

Программа построена по принципу конструктора: базовый функционал расширяется за счет установки дополнительных надстроек в соответствии с запросами пользователя. Достоинство такой структуры состоит в том, что интерфейс программы не перегружен бесконечным количеством инструментов, большинство из которых вы не используете никогда.

Определенные преимущества имеет открытый исходный код: если нужного вам инструмента пока что нет, написать соответствующий плагин или макрос можно самостоятельно.

3. Другие программные пакеты ImageJ.

Для тех, кто не хочет заморачиваться с программированием, существует готовая версия Fiji для работы с научными изображениями. Она нацелена на регистрацию изображений, сшивание, сегментацию, извлечение объектов и

3D-визуализацию. Достоинства Fiji с точки зрения пользователей:

  • простая установка и обновление;
  • встроенное меню плагинов;
  • встроенное программное обеспечение для корректной работы программ на Java (Java runtime);
  • интерфейс для работы с 3D-файлами (Java 3D);
  • исчерпывающая документация для поддержки пользователя.

µManager — программный пакет для управления автоматизированными микроскопами. Имеет функционал:

  • замедленной съемки;
  • формирования многоканального изображения;
  • создания стопок снимков.

Возможна комбинация этих элементов.

Salsa — ПО, направленное на обработку изображений и их анализ, адаптированное для профессиональных астрономических снимков.

Bio7 — среда для разработки экологических моделей с основным акцентом на индивидуальное моделирование и пространственно-эксплицитные модели.

4. Как расширить базовый функционал ImageJ?

Макросы позволяют автоматизировать сложные действия, требующие многократного повторения. ImageJ имеет инструментарий для записи макрокоманд, который позволяет оптимизировать операции рисования, выделения-копирования-вставки элементов картинки, вызова команд, использования функций.

Функциональные возможности программы расширяются за счет плагинов. Скачать их можно с официальной страницы ImageJ или со сторонних сайтов. Если у вас есть навыки программирования, встроенный редактор плагинов и компилятор Java позволяют разработать собственные программные модули на все случаи жизни.

С помощью плагинов вы сможете:

  • использовать разнообразные фильтры для обработки изображений (размытие по Гауссу, фильтр Калмана и др.);
  • получить инструменты для создания и редактирования изображений (рисование фигур, выделение, работа с кистью, анимация);
  • создавать трехмерные модели объектов от микроскопических образований до рентгеновских снимков;
  • построить графики и диаграммы на базе 2D и 3D-изображений;
  • проанализировать снимки (корреляция изображений, анализатор текстур, измерение фрактальной поверхности и т.д.);
  • предоставить ImageJ прямой доступ к устройствам (например, камерам и сканерам) и создаваемым с их помощью снимкам;
  • манипулировать цветом (цветовой анализ изображений, извлечение цветов, подсчет пикселей определенного цвета, изменение цветовой модели и работа с цветовыми моделями);
  • преобразовать данные из таблиц или текстовых файлов в графический контент;
  • конвертировать изображение в другой формат;
  • изменять интерфейс ImageJ, например объединять открытые изображения в группы.

Также с помощью плагинов можно открывать, редактировать и анализировать изображения специальных форматов. Это далеко не полный перечень дополнительных возможностей для расширения функций ImageJ с помощью программных модулей.

5. Как работает и как пользоваться ImageJ?

Инструменты и команды, которые часто используются, вынесены на главную панель ImageJ:

imagej

Открыть нужный файл можно через меню File-Open (открывает стандартные форматы), File-Import (открывает изображения с помощью плагинов) или простым перетаскиванием файла на панель ImageJ.

Важно! Плагин Bioformats открывает практически все известные типы файлов.

После скачивания плагина его нужно поместить в папку ImageJ — plugins и затем перезапустить программу. Если вы пользуетесь большим количеством плагинов, внутри папки можно создавать вложенные папки. В программе Fiji плагины для решения множества разнообразных задач уже установлены.

Если вам нужно показать масштаб, измерить объект или создать проекцию, файл нужно откалибровать (задать значение пикселя). Информация о размере пикселя находится в Image — Show Info:

imagej

Источник

Важно! При конвертации файла информация о размере пикселя может теряться или искажаться. Всегда сохраняйте исходные неконвертированные изображения.

Размер пикселя в ImageJ задается через Image — Properties. Чтобы применить заданную калибровку ко всем открытым файлам, поставьте галочку на Global:

imagej

Источник

Если вам нужно выбрать на разных файлах область с определенными параметрами, задайте размер и положение выделенной области через Edit-Selection-Specify.

imagej

Источник

Добавьте зону в ROI Manager через Analyse-Tools-ROI Manager с помощью команды Add. Чтобы выделить ту же зону на другом файле, кликните по изображению и выбирайте в ROI Manager нужное название или номер:

imagej

Источник

С помощью ROI Manager фрагмент изображения можно сохранить и открыть в другом окне командой Ctrl-Shift-D. Также он может сохранять линии, стрелки, зоны любой формы.

Стандартное положение масштабной шкалы на откалиброванном изображении в ImageJ вызывается командой Analyze – Tools – Scale Bar. Ее можно отредактировать и сохранить в ROI Manager, чтобы на всех картинках положение и параметры калибровочного отрезка были стандартными:

imagej

Источник

Изменить цвет канала, отобразить несколько каналов в наложении, слить цветные слои можно через Image-Color-Channels Tool. Яркость и контрастность изображений регулируется с помощью Brightness&Contrast.

imagej

Источник

Важно: если вы хотите собрать изображения в стопку (стек), то манипуляции по регулированию яркости-контраста нужно делать предварительно, так как в стеке нельзя настроить параметры только одного отдельного изображения.

Виртуальные срезы выполняются с помощью Image-Stacks-Orthogonal Views. Проекции появятся в новых окнах. Они связаны с основным изображением, поэтому перемещение креста-мишени на исходной картинке вызывает соответствующие виртуальные срезы:

imagej

Источник

6. Где скачать программу ImageJ?

Программа и все приложения бесплатны и находятся в свободном доступе. Скачать программу можно на платформе https://imagej.net/ij/download.html. Плагины Fiji доступны по адресу https://imagej.net/software/fiji/downloads.

Заключение

Программа ImageJ — прекрасный инструмент для ученых. Она обладает исключительной гибкостью и может быть адаптирована для любых научных исследований, связанных с анализом изображений.

Основные аргументы в пользу ImageJ:

  • обрабатывает снимки с любых устройств от микроскопа до телескопа;
  • работает со всеми известными форматами изображений;
  • сохраняет, редактирует и анализирует изображения, строит модели, диаграммы и графики;
  • макросы и плагины расширяют базовый функционал программы практически до бесконечности;
  • открытый исходный код позволяет адаптировать программу к новым задачам;
  • существуют программные пакеты для специальных задач, например для работы с электронными микроскопами или астрономическими снимками.

Присоединяйтесь, чтобы моментально узнавать о новых статьях в нашем научном блоге, акциях и получать только полезные материалы!

ImageJ это мощная программа для научного анализа изображений. Созданная Национальным институтом здравоохранения США, ImageJ является общественным достоянием (лицензия Public domain), может быть запущена на различных операционных системах, для которых есть виртуальная машина Java. Название ImageJ происходит от изображение (Image) и Java — язык, на котором написана программа. Скачать ImageJ можно по адресу http://imagej.nih.gov/ij/download.html
Подробно по установке


Окно ImageJ

 содержит строку меню, панель инструментов и строку состояния.
Изменение количества оперативной памяти, используемой ImageJ.
Для настройки используйте команду Edit → Options → Memory & Threads. Не рекомендуется устанавливать в поле Maximum memory значение большее 75% от общей оперативной памяти компьютера.
Открыть изображение для обработки можно с помощью команды File → Open или перетащив значки интересующих изображений на окно ImageJ.
Панель инструментов. кнопки на панели инструментов позволяют измерять различные объекты, наносить метки и другие элементы на изображение и др. Клик правой клавишей мыши по некоторым кнопкам (с маленьким красным треугольником в правом нижнем углу) позволяет открыть меню с дополнительными инструментами.

Инструменты выделения областей на изображении (Area Selection Tools): первые четыре кнопки панели инструментов позволяют выделить на изображении прямоугольную, овальную, многоугольную или произвольную область. Используя команды строки меню, выделенные области можно изменять, анализировать, копировать и др. При выделении области на изображении в строке состояния отображаются параметры данной операции, например, координаты (xx, yy) области выделения на изображении.

Инструмент линия (Line Selection Tools): данная кнопка позволяет создать прямую, состоящую из сегментов или произвольную линию (клик правой клавишей мыши позволяет выбрать необходимую операцию). Информация о линии при ее создании изображается в строке состояния. Двойной клик левой клавишей мыши по кнопке линии на панели инструментов позволяет вызвать меню для изменения толщины линии. Измерить длину линии на изображении можно Analyse → Measure (или Ctrl+M). Чтобы сделать линию частью изображения, нарисуйте линию и используйте Edit → Draw (или Ctrl+D).

Инструмент угол (Angle Tool): позволяет создать на изображении две пересекающиеся линии и измеряет угол между ними.

Инструмент точка (Point Tool): при установленном флажке «Auto-Measure» (двойной клик левой клавишей мыши по кнопке точка вызывает окно с чек-боксом «Auto-Measure») во время кликов по изображению ImageJ будет в окне Results (Analyze→ Measure или Ctrl+M) записывать координаты (X и Y) и цифровое значение яркости в диапазоне 0-255 в данной точке. Для цветных изображений будет указано среднее значение яркости красного, зеленого и синего каналов (Mean).

Инструмент волшебная палочка (Wand Tool): при клике по какой-либо точке на изображении выделяет прилегающие области, значение цвета в которых совпадает с цветом точки или незначительно отличается от цвета точки. Изменить чувствительность можно в окне Tolerance, (двойной клик по кнопке волшебная палочка). Пункт Mode имеет следующие варианты

Legacy — в этом случае волшебная палочка выбирает только одну точку (пиксель), в который вы кликнули и далее ищет пиксели с похожим цветом вокруг.

4-connected — в этом случае ImageJ ищет учитывает кроме пикселя, в который вы кликнули также цвет четырех прилегающих с разных сторон пикселей, и ищет пиксели с цветом, совпадающим с одним из рассматриваемых пяти пикселей.

8-connected — аналогично с 4-connected, но учитывается цвет не четырех, а восьми прилегающих пикселей.

Инструмент текст (Text Tool): двойной клик по кнопке Текст откроет дополнительное окно, в котором можно установить тип, размер, написание шрифта. После клика по кнопке текст, кликните по изображению в необходимой для размещения текста точке, далее, удерживая левую клавишу мыши нажатой, создайте окно для ввода текста. Вводите только английские буквы, чтобы ввести греческую букву μ нажмите Alt+M, чтобы ввести значок ангстрема Å нажмите Alt+Shift+A. Для изменения цвета шрифта используйте инструмент Пипетка. Вы можете свободно перетаскивать мышью поле с введенным текстом в необходимую точку изображения. Чтобы нанести текст в поле на изображение, воспользуйтесь Edit → Draw (или Ctrl+D).

Инструмент лупа (Magnifying Glass) позволяет увеличивать масштаб изображения при клике по нему левой клавишей, и уменьшать масштаб при клике по изображению правой клавишей мыши.

Инструмент перемещения (Scrolling Tool) позволяет в случае когда изображение превышает размера окна, в котором оно открыто, перемещать поле зрения на необходимый участок изображения. Инструмент можно активировать при выполнении любой операции, зажав клавишу пробел.

Инструмент пипетка (Color Picker): позволяет установить основной цвет (Foreground color), в котором ImageJ будет наносить текст и другие элементы на изображении. Цвет можно выбрать либо, при активированном инструменте пипетка, кликнув на изображении по точке с интересующим цветом, в этом случае основным цветом будет цвет точки, либо после двойного клика по кнопке Пипетка (или Image → Color → Color Picker) выбрать цвет из открывшейся палитры. Чтобы сменить цвет фона (Background color) на цвет точки изображения, при активном инструменте пипетка, кликните по необходимой точке на изображении с зажатой клавишей Alt.

Редактирование и анализ изображений с помощью ImageJ.

Отмена предыдущего действия (Undo)Edit → Undo отменяет предыдущее действие. Возможна отмена только одного действия.

Вернуть (Revert)File → Revert отменяет все выполненные манипуляции и переводит изображение в исходный после открытия вид.

Обрезка (Cropping): Выделив часть изображения с помощью прямоугольного выделения командой Image → Crop можно обрезать не входящие в выделение участки.

Очистить снаружи: После выделения участка на изображении команда Edit → Clear Outside очистит все участки, не попавшие в зону выделения. Команда «Очистить» Edit → Clear очистит участки внутри выделенной области.

Понравилась статья? Поделить с друзьями:
  • Перьета инструкция по применению цена отзывы
  • Энтеросгель для чего применяется взрослым инструкция по применению
  • Алмазная мозаика как правильно собирать инструкция по применению для начинающих
  • От чего таблетки каптоприл 50мг инструкция по применению
  • Диклофенак в таблетках 100 миллиграмм инструкция