Cell Magic Wand


Click on a cell. Get an ROI around the cell.


Download and Install

Download: Cell_Magic_Wand_Tool.jar

Version Required: ImageJ version 1.46d (January 2012) or later.

Install: Put Cell_Magic_Wand_Tool.jar into the directory “Tools” inside the “plugins” directory of your ImageJ installation. You may need to create the “Tools” directory.

Example: C:\Program Files\ImageJ\plugins\Tools\Cell_Magic_Wand_Tool.jar.

Restart ImageJ and select Cell Magic Wand Tool from the “>>” menu on the right side of the toolbar. (see picture)

Cell Magic Wand will appear in your ImageJ toolbar:


Double click on the tool to bring up this box.

Image Type: Are your cells brighter or darker than the background color?

Minimum Diameter: What’s the smallest your cell could be (in pixels)?

Maximum Diameter: What’s the largest your cell could be (in pixels)?

If you like, you can set the minimum diameter to 1 and the maximum diameter to something huge (like 1000). Cell Magic Wand will still work. But it’ll work better the more information you give it.

In particular, setting the maximum diameter lower is a nice way to prevent Cell Magic Wand from encircling multiple cells at once. Setting the minimum diameter higher helps Cell Magic Wand to ignore high-contrast elements inside your cell, such as nucleoli. And having a smaller range of diameters to search through makes Cell Magic Wand run faster, too.

Roughness: This is a shape parameter that controls how rough the edge of your cell ROI will be.
Lower it for a smooth ROI that follows the general shape of your cell. Raise it for a rough ROI that delves into every nook and cranny on the outside of your cell. Reasonable values are 0 to 10. A value of 0 will give you a circle — the smoothest ROI of all.

Tips and Tricks

Shift-clicking: Hold down SHIFT to select multiple cells. The ROI manager will appear and keep track of your selections. Shift-clicking on a cell you’ve already selected will deselect it.

Hide ROIs from other slices: If you’re working with an image stack, you may want to make it so that ROIs only show up on the slice they came from. From the ROI manager window, choose More->Options->Associate “Show All” ROIs with slices.

Quickly measure cell diameter: Use the Line ROI tool to draw a line across your cell. Length will be shown in the ImageJ main window, or you can press Ctrl+M to bring up a measurement. If your units aren’t in pixels, you must change the units to pixels first: do Analyze->Set Scale->Click to remove scale, and click OK.

Median Filtering: If there is significant contrast variability inside of your cells, try using a median filter to blur out those elements first. Process->Filters->Median.


From left to right: Original image, Median-filtered image, ROI drawn on median filtered image, ROI on original image.

Multichannel and RGB Images: The first channel, or the red color, will be what Cell Magic Wand sees. Convert images to grayscale or split channels if you want to detect cells in a different channel.


Plugin created by Theo Walker

Image Credits

GCaMP images thanks to William Bosking and Sharon Huang.

Confocal microscopy images thanks to Amanda Jacob and Dominick Casciato.

Cell Magic Wand v1.0 released Jan. 23, 2014.