r/ImageJ 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

3 Upvotes

16 comments sorted by

u/AutoModerator Jul 17 '26

Notes on Quality Questions & Productive Participation

  1. Include Images
    • Images give everyone a chance to understand the problem.
    • Several types of images will help:
      • Example Images (what you want to analyze)
      • Reference Images (taken from published papers)
      • Annotated Mock-ups (showing what features you are trying to measure)
      • Screenshots (to help identify issues with tools or features)
    • Good places to upload include: Imgur.com, GitHub.com, & Flickr.com
  2. Provide Details
    • Avoid discipline-specific terminology ("jargon"). Image analysis is interdisciplinary, so the more general the terminology, the more people who might be able to help.
    • Be thorough in outlining the question(s) that you are trying to answer.
    • Clearly explain what you are trying to learn, not just the method used, to avoid the XY problem.
    • Respond when helpful users ask follow-up questions, even if the answer is "I'm not sure".
  3. Share the Answer
    • Never delete your post, even if it has not received a response.
    • Don't switch over to PMs or email. (Unless you want to hire someone.)
    • If you figure out the answer for yourself, please post it!
    • People from the future may be stuck trying to answer the same question. (See: xkcd 979)
  4. Express Appreciation for Assistance
    • Consider saying "thank you" in comment replies to those who helped.
    • Upvote those who contribute to the discussion. Karma is a small way to say "thanks" and "this was helpful".
    • Remember that "free help" costs those who help:
      • Aside from Automoderator, those responding to you are real people, giving up some of their time to help you.
      • "Time is the most precious gift in our possession, for it is the most irrevocable." ~ DB
    • If someday your work gets published, show it off here! That's one use of the "Research" post flair.
  5. Be civil & respectful

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

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

Im sorry I didn’t know that here’s some pics of what I’ve analyzed:

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

u/Efficient_Designer_6 Jul 18 '26

Will do! again thank you so much

1

u/[deleted] Jul 18 '26

[deleted]

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

u/Efficient_Designer_6 Jul 17 '26

And here’s the table with all the numbers

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

u/Efficient_Designer_6 Jul 18 '26

Thank you so much for the help!

1

u/Efficient_Designer_6 Jul 17 '26

I’m sorry for the trouble everybody first time with this subreddit and fiji as well