Image Registration / neuron overlap help



I am trying to overlap multiple images I have of a single neuron taken from different brains, and see the overlap of these neurons. I am trying to visualize variability in this neuron between brains. I am using the ‘Name Landmarks and Register’ plugin to achieve image registration, and the manual registration of these images works well. However, whenever I want to add another neuron to this image registration, FIJI automatically resets the color of my previous image and combines them all into one color. I have included an image below to help demonstrate what I mean.

In the image on the left, I have registered 2 images together, one neuron is in magenta, the neuron from a separate image is in green, and their overlap is in white. I save this image, and perform image registration again, using the image on the left as my template. When I add in a third neuron (image on the right), the template image is all blended into one color (magenta), and the neuron from the third brain I have added is in green. This prevents me from seeing where all of the individual neurons are, and it prevents me from seeing where there are areas of high overlap, and areas of little overlap.

Is FIJI able to overcome this issue? Ideally, I would like to threshold each image, register the images, and have ‘sum’ the overlap, so that if I have 5 images registered with one another, I would see all areas with a pixel value of 5 in magenta, areas with a pixel value of 4 in another color, and so on. I was able to accomplish this with zstack projections in MATLAB, but I cannot register these 3D images in MATLAB manually. Any help would be greatly appreciated , thank you!


Welcome @brwalter

I would see all areas with a pixel value of 5 in magenta, areas with a pixel value of 4 in another color, and so on.

You mean as in register image to the first, threshold registerd image, then binarize (0 and 255 value), then math divide by 255 (now image has 0 or 1 as value), do this for the whole stack, then zProjection with summing slice values, then throwing in a fancy lookup table to show matching quality?

(registering after binarizing will give you different values but 0 and 255, hence first register, then binarize)


Yes, I confused it with MATLAB binarization, which results in a 0 or 1 output image.

The issue I have here with FIJI is, lets say I have one image, with two images overlaying one another. Fiji will give me a [0;0;0] output if not there (since output is RGB), [255; 0; 255] for magenta, [0;255;0] for green, or [255;255;255] for white where there is an overlap. The issue I am running into is if I want to add now a 3rd brain, FIJI will set all of the values I have from the 2 brain overlaid RGB image to [255;0;255] for everything, and the third brain will be in green, and the overlap will be in white. This means as I continue to add more brains, my final output would result in 4 brains all colored as magenta, and the last brain I added would be in green. I would like to figure out a way to simply add up the pixel values (doesnt have to be binary) where they overlap as I continue to add more brains, instead of having FIJI lose my data and resetting the template image to all magenta. Hopefully this clarifies


it does, and I explained (OK, sort of explained) how you achieve this in ImageJ/Fiji. I’ll see if I can whip up a macro to demonstrate how to, and you just have to put in your (registered slices of the) neuron images. The proper working of this macro is limited to a max 255 slices stack.

run("MRI Stack (528K)");//replace with loading your registered stack
run("8-bit");//make sure input is of type 8-bit, not RGB or colour! 
setAutoThreshold("Default dark");
setOption("BlackBackground", true);
run("Convert to Mask", "method=Default background=Dark calculate black");
run("Divide...", "value=255 stack");
run("Z Project...", "projection=[Sum Slices]");
setMinAndMax(0,255); //otherwise next command will scale 0..maxmatch to 0..255
run("Enhance Contrast", "saturated=0.35");
run("Orange Hot");//apply LUT to show different number of matching slices

Identifying triple overlap between objects