Color Images 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 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 Image b Color b Merge Channels., or using the Image J macro language(see IV Replacing Red with Magenta in RGB Images) IV REPLACING RED WITH MAGENTA IN RGB IMAGES When building RGB images, magenta can be obtained using the Imageb Color b Merge Channels Previously created RGB images can be converted to"MGB'using Image Color b Channels Tool Z]. Alternatively, the ProcessD Image Calculator . 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(2)and (1). Once saved in the aImageJ/plugins/ folder these Macros treated as regular ImageJ commands In Fiji, as expected, the procedure of modifying RGB images is simpler: one just needs to run mage b Color b Replace Red with Magenta. 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, or in Fiji, using the Image b Color b Simulate Color Blindness command Color Composite images In a composite image colors are handled through channels. The advantages with this type of image over plain RGB images are One advantage of Dichromacy over the vischeck plugin is that it can be recorded and called from scripts and Last updated: 2012/10/02
Color Images 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. 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 Image . Color . Merge Channels. . . , or using the ImageJ macro language (see IV Replacing Red with Magenta in RGB Images). IV Replacing Red with Magenta in RGB Images When building RGB images, magenta can be obtained using the Image . Color . Merge Channels. . . Previously created RGB images can be converted to ‘MGB’ using Image . Color . Channels Tool. . . [Z]. Alternatively, the Process . Image Calculator. . . 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 (2) and (1). 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 Image . Color . Replace Red with Magenta. 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 plugins1 , or in Fiji, using the Image . Color . Simulate Color Blindness command. Color Composite Images In a composite image colors are handled through channels. The advantages with this type of image over plain RGB images are: 1One advantage of Dichromacy over the Vischeck plugin is that it can be recorded and called from scripts and macros, without user interaction. 16 Last updated: 2012/10/02
(1) Replace Red with Magenta ijm(Using Process D Image Calculator.) / This macro replaces Red with Magenta in RGB images using Process>Image t if (bitDepth!=24) exit("This macro requires an RGB image"); BatchMode (true) title= getTitleo) r= title+" (red)" title+"( green)"; b= title+"(blue) run("Split Channels") image Calculator("Add",b, r); run("Merge Channels.","red=&r green=&g blue=&b"); rename(title +"(MGB)") setBatchMode(false) 1. Each channel is kept separate from the others and can be turned on and off using the Channels'tool(ImageD Color b Channels Tool..[Z). 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 (2) Replace Red with Magenta ijm(Using ImageD Color> Channels / This macro replaces Red with Magenta in RGB images using the t Image >Color >Channels tool. * if (bitDepth!=24) / Ignore non-RGB ima exit("This macro requires an RGB image") setBatchMode(true); / Enter Batch. mode title getTitleo 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 10 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(Analyze b Measure..[m), drawn (Edit b Draw [d), filled(Edit b Fill [f)or filtered(Process Filters D 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 Edit b Selection b Properties..ly. Selection Color can be changed in Edit b Options b Colors., by double clicking on the Point Tool, or using hot keys(see (7) Using a Keyboard Shortcut to Change Selection Color). It is highlighted in the center of the Point Tool and Multi-point Tool Last updated: 2012/10/02
Selections (1) Replace Red with Magenta.ijm (Using Process . Image Calculator. . . ) /* This macro replaces Red with Magenta in RGB images using Process > Image ←- Calculator ... command . */ i f ( 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 ( f a l s e ) ; 1. Each channel is kept separate from the others and can be turned on and off using the ‘Channels’ tool (Image . Color . Channels Tool. . . [Z]). 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 (2) Replace Red with Magenta.ijm (Using Image . Color . Channels. . . ) /* This macro replaces Red with Magenta in RGB images using the ←- Image >Color > Channels ... tool . */ i f ( 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 ( f a l s e ) ; // Restore `GUI ' mode 10 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 (Analyze . Measure. . . [m]), drawn (Edit . Draw [d]), filled (Edit . Fill [f]) or filtered (Process . Filters . 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 Edit . Selection . Properties. . . [y]. Selection Color can be changed in Edit . Options . Colors. . . , by double clicking on the Point Tool, or using hot keys (see (7) Using a Keyboard Shortcut to Change Selection Color). It is highlighted in the center of the Point Tool and Multi-point Tool. 17 Last updated: 2012/10/02
Selections Manipulating ROls Rectangular Composite Cursor outside selection t Selection can be moved Selection can be resized t edge can be moved 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 10.1 Manipulating ROIs Iost of commands that can be useful in defining or drawing selections are available in the edit Selection b submenu and summarized in ROI manipulations. Listed below are the most frequent manipulations involving selections Adjusting Area selections can be adjusted with the Brush Selection Tool. In addition, vertexes of selections created with the Polygon Selection Tool and Segmented Line Selection Tool can be adjusted by Alt/Shift-clicking. Deleting Choose any of the selection tools and click outside the selection, or use Edit Selection b Select None [A]. Use Edit D Selection b Restore Selection E] to restore 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 Edit D Selection b Restore Selection [E]. Alternatively, Analyzed Tools b Synchronize Windows to create ROIs across multiple images. Mul- tiple selections can be stored as Overlays or in the ROI Manager list(AnalyzeD Tools ROI Ma Moving Selections can be moved by clicking and dragging as long as the cursor is within the selection and has changed to an. 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, Edit b Copy c], Editb Paste[ v, and then click within the selection 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. SEE ALSO: Key Modifiers Last updated: 2012/10/02
Selections Manipulating ROIs Rectangular Polygon Composite Selection can be moved Cursor outside selection Selection can be resized Edge can be moved, deleted or added 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. 10.1 Manipulating ROIs Most of commands that can be useful in defining or drawing selections are available in the Edit . Selection . submenu and summarized in ROI manipulations. Listed below are the most frequent manipulations involving selections: Adjusting Area selections can be adjusted with the Brush Selection Tool. In addition, vertexes of selections created with the Polygon Selection Tool and Segmented Line Selection Tool can be adjusted by Alt/Shift-clicking. Deleting Choose any of the selection tools and click outside the selection, or use Edit . Selection . Select None [A]. Use Edit . Selection . Restore Selection [E] 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 Edit . Selection . Restore Selection [E]. Alternatively, Analyze .Tools . Synchronize Windows to create ROIs across multiple images. Multiple selections can be stored as Overlays or in the ROI Manager list (Analyze . Tools . ROI Manager. . .). Moving Selections can be moved by clicking and dragging as long as the cursor is within the selection and has changed to an . 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, Edit . Copy [c], Edit . Paste [v], 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. See also: Key Modifiers 18 Last updated: 2012/10/02
10.2 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 RO 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 Edit b Selection b Enlarge command as explained in XIII Converting Composite Selections SEE ALSO: Wand Tool, ROI2PolylineROI macro neW 10.3 Selections With Sub-pixel Coordinate 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-pitel resolution checkbox is active in Edit b Options b Profile Plot Options .. Sub-pixel coordinates of pre-existing selections can be interpolated using the Edit b Selection b Interpolate command. Interpolated points are easily noticeable on small selections created on images zoomed 1200%or greater With sub-pixel resolution Without 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 Edit D Options b Profile Plot Options by activating the sub-pitel resolution che Pixel coordinates of area selections(see Area Selection Tools ), can be interpolated using EditD Selection D Interpolate. The the right is the output of ESubPixelSelections. js, a script that demonstrates how to create selections at sub-pixel resolution ithout the need of setting any option in Image J SEE ALSO: Zoom b, Magnifying Glass IMPROVED 11 Overlays Overlays are non-active selections displayed overthe 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 Last updated: 2012/10/02
Overlays Composite Selections 10.2 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 Edit . Selection . Enlarge. . . command as explained in XIII Converting Composite Selections. See also: Wand Tool, ROI2PolylineROI macro New in 10.3 Selections With Sub-pixel Coordinates IJ 1.46r 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 Edit . Options . Profile Plot Options. . . Sub-pixel coordinates of pre-existing selections can be interpolated using the Edit . Selection . Interpolate command. Interpolated points are easily noticeable on small selections created on images zoomed 1200% or greater. 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 Edit . Options . Profile Plot Options. . . by activating the Sub-pixel resolution checkbox. Pixel coordinates of area selections (see Area Selection Tools), can be interpolated using Edit . Selection . Interpolate. 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. See also: Zoom . , Magnifying Glass Improved 11 Overlays in IJ 1.46r 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 19 Last updated: 2012/10/02
a This is an overlay piasa Overlay.tif The cell outlines were reated by the Non-destructive operations using the image overlay. Overlays can be used to annotate images, store ROIs and blend images(ImageROIs)at multiple opacity levels. Refer to the Image b Overlay D documentation for further examples. You can download the frontmost image to practice overlay editing 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 ImageD Overlay b, and in the ROI Manager window(Analyze D Tools ROI Manager.). Appearance of overlay selections can be adjusted using Image b Overlay D Overlay Options../Labels As mentioned in II Image Types: Lossy Compression and Metadata, overlays are saved in the format of ImageJ. The major advantages of overlays are summarized g TIFF, the default file header of tif images, and do not need to be saved externally when us Storage of ROIs In ImageJ it is only possible to have a single ROi at a time. However, it possible to add selections to the image overlay using B(mage b Overlay b Add Selection [bp). Once added to the image overlay, ROIs can be re-activated by Alt-clicking, Control- NiWGR theBackspace key. Selections can also be added and recovered in bulk, using the ImageD Overlay b From ROI Manager/To Rol Manager 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 XVIII Working with Zoomed Canvases)and can be displayed at different opacity values(see XIX Hexadecimal Color Values). RGB snapshots of the image with embedded overlays can be created by holding Shi)F),the shortcut for ImageD Overlay b Flatten F]. 'Flattened' images with the overlay rendered pixel data are also created when saving the image as PNG or JPEG(Fileb Save AsD). when printing the image canvas(FileD Print .. [pl). The Flatten command is also listed the ROI Manager. Image ROIs An imageROI (image selection) is a ROI that displays an image as an overlay. As described in Edit b Selection b Image to Selection.. and Image b Overlay b Add Image., this allows multiple images to be blended on a single image canvas. Last updated: 2012/10/02
Overlays Non-destructive operations using the image overlay. Overlays can be used to annotate images, store ROIs and blend images (ImageROIs) at multiple opacity levels. Refer to the Image . Overlay . documentation for further examples. You can download the frontmost image to practice overlay editing. 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 Image . Overlay . , and in the ROI Manager window (Analyze .Tools . ROI Manager. . .). Appearance of overlay selections can be adjusted using Image . Overlay . Overlay Options. . . /Labels. . . As mentioned in II 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 (Image . Overlay . Add Selection. . . [b]). Once added to the image overlay, ROIs can be re-activated by Alt-clicking, Control- New in IJ 1.46r clicking or long-pressing (1/4 second or longer). Activated ROIs can be deleted by pressing the Backspace key. Selections can also be added and recovered in bulk, using the Image . Overlay . From ROI Manager/To ROI Manager 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 XVIII Working with Zoomed Canvases) and can be displayed at different opacity values (see XIX Hexadecimal Color Values). RGB snapshots of the image with embedded overlays can be created by holding Shif F , the shortcut for Image . Overlay . Flatten [F]. ‘Flattened’ images with the overlay rendered as pixel data are also created when saving the image as PNG or JPEG (File . Save As . ), or when printing the image canvas (File . Print. . . [p]). The Flatten 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 Edit . Selection . Image to Selection. . . and Image . Overlay . Add Image. . . , this allows multiple images to be blended on a single image canvas. 20 Last updated: 2012/10/02