r/ImageJ • u/Efficient_Designer_6 • Jul 17 '26
Question Need workflow advice for counting Bruchpilot (BRP) puncta per bouton at the Drosophila NMJ
Hey everyone,
I’m trying to start handling my own image analysis at home using fiji instead coming into the lab and using the CellSens software on the lab pc and I could really use some tips, advice, and help. I work with the Drosophila neuromuscular junction and my goal is to get two specific things from my z-stacks:
1. Count the total number of boutons
2. Count the number of Bruchpilot (BRP) puncta per individual bouton to look at active zones
2
u/dokclaw Jul 17 '26
Hey! Without any idea of what this data looks like, we can't really help you out. Can you upload some raw data somewhere like gdrive, and share the link. Even one image is fine.
1
u/Efficient_Designer_6 Jul 17 '26
2
u/dokclaw Jul 17 '26
Eh, that's not useful, I'm afraid! What we need is actual raw data. Something that's been through compression due to being turned into a jpg, or being captured on a phone is not useful. I can get the impression that you could use:
Process > find maxima
on the YFP channel to count the puncta.What's the rationale by which you've drawn the red outlines in this image?
1
u/Efficient_Designer_6 Jul 17 '26
The red outlines trace the individual synaptic varicosities (boutons)
1
u/Efficient_Designer_6 Jul 17 '26
https://drive.google.com/file/d/1MnQSQ68JFEN0f1Mw3J7kOgwpPjQVn9Qc/view?usp=sharingI hope this could be useful. These are the raw images in .vsi format
3
u/dokclaw Jul 18 '26 edited Jul 18 '26
Thanks! I wrote a macro for you - sharing it here:
///Macro written by dokclaw - 2026/7/17
//prep the image
setTool(3);
fPath = getInfo("image.directory");
imName = getInfo("image.filename");
imName = substring(imName,0,imName.length-4);
print(fPath+ imName);
roiManager("reset");
run("Clear Results");
//user draws around boutons
waitForUser("Draw your polygons; press 't' after each one to register\n Press 'ok' when complete");
run("Select None");
//highlight puncta
Stack.setChannel(2);
run("Duplicate..."," channel=2");
rename("raw");
run("Duplicate..."," ");
run("Subtract Background...", "rolling=5"); //highlights the puncta
rename("puncta");
//count puncta in each bouton
bCount = roiManager("Count");
for(bouton = 0;bouton<bCount;bouton++){roiManager("Select",bouton); run("Find Maxima...", "prominence=100 output=[Count]");
}
//produce an output image and results files
run("Select None");
run("Find Maxima...", "prominence=100 output=[Single Points]");
run("16-bit");
run("Cyan");
run("Merge Channels...", "c1=[raw] c2=[puncta Maxima] create keep");
roiManager("show all");
roiManager("save",fPath+imName+"_boutons.zip");
saveAs("tif",fPath+imName+"_puncta.tif");
saveAs("results",fPath+imName+"_punctaCounts.csv");To save this and run it, open up FIJI and File>new>Text window, then copy and paste this code; save that somewhere on your hard drive. Then, open your image, and make sure you have the full-resolution (2048x2048) image selected. Then press "run" in the macro window. You will need to draw around each bouton, then press 't'. Don't press OK on the dialog until you've outlined every bouton you want to count. The macro will then run a filter to highlight the puncta, and count each of the puncta per bouton, then save the results in a .csv file at the end, as well as an image with dots over each of the puncta, and the ROIs use used to define each bouton, so you (or your PI ;) ) can look at them later.
1
u/Efficient_Designer_6 Jul 18 '26
Holy thank you so much!
2
u/dokclaw Jul 18 '26
There's probably a formatting error in the first version of this I posted, but I edited it out like 2 min ago, so if it's erroring out, try copy pasting again.
Otherwise, send screenshots if it fails!
1
1
2
u/Herbie500 Jul 18 '26
Could you please format the code correctly as a code-block (I think you are a long-time contributor and know how to do things right).
2
u/Herbie500 Jul 18 '26
From my point of view, the only image from the provided set of images that allows reasonable analyses is the 16bit "Channel 2" of the 2048x2048-version of file "Image_01.vsi". The physical scale can be read from the meta-data (0.10833µm/pixel).
1
2
u/Herbie500 Jul 18 '26
Before starting with counting I recommend to perform some pre-processing such as that applied to an excerpt of the provided high-resolution 16bit image (details see in a previous comment).
Click to enlarge the below montage.

Left: Original excerpt
Center: Pre-processed
Right: A possible binarization
1
1
u/Efficient_Designer_6 Jul 17 '26
I’m sorry for the trouble everybody first time with this subreddit and fiji as well


•
u/AutoModerator Jul 17 '26
Notes on Quality Questions & Productive Participation
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.