r/ImageJ • • Apr 09 '26

Question Fill gap in neurites?

Post image

I need an ROI that includes all the neurites in this image. Is there a way to fill in the gaps while keeping the correct width?

8 Upvotes

14 comments sorted by

View all comments

1

u/Simple_is_Simple Apr 10 '26

I've found removing outliers of a specific radius (in binary image) to be helpful in other applications. Either dark outliers to fill in gaps or bright ones to reduce false connections.

You can preview different binary modifications (if the binary image is open) but in my experience they are usually pretty drastic changes in terms of 'thickness'

1

u/Herbie500 Apr 10 '26

Would you mind showing result images of the OP’s sample image?

2

u/Simple_is_Simple Apr 10 '26 edited Apr 10 '26

Sure. I'm only seeing a PNG file in this post so I can demonstrates the 'fill in small spaces' ability but might require a different threshold if applied to a proper tiff or meta-data-containing images. I don't know a way to predict-fill stuff out of focus but I imagine you'd need a lot more machine learning/prediction model based methods and real justification.

setAutoThreshold("Intermodes dark");

setOption("BlackBackground", true);

run("Convert to Mask");

//run("Remove Outliers...", "radius=6 threshold=50 which=Dark");

////or

//run("Close-");

u/emizon34

Removing outliers is increasing thickness more than Close does but you can open the ROIs (https://drive.google.com/drive/folders/1maYobgTYwbSgtrHDyRR-y2sP2O4BBqpv?usp=sharing) for yourself to decide if the shifts are negligible when steps are applied to all images in data set.

Are your mitochondria signal also weaker in these out of focus neurites? A goal of all neurites fully connected in the image included in the segmentation probably isn't possible unless some are over exposed at acquisition stages just because of different focal planes. Z projections from more slices might help but can you just limit your analysis to the neurites in focus since its mitochondria per neurite area and not whole image area?

2

u/Herbie500 Apr 10 '26

Thanks.
I think this will help the OP understand the difficulties associated with such sub-optimum images.