How to measure distance from cellular particles to cell membrane?

Greetings! First time post question in the forum. Really appreciate your help.

Confocal images with green fluorescence particles internalized by cells. Cell membrane can be defined by bright field image. I would like to measure all green pixels within the cell boundary, its intensity and its distance to closest cell boundary. Does anyone know some plugin or macro do this job? Thank you so much for your input.


Welcome to the Forum!

Would you be able to post an original image so we can take a look at your data? What you’ll need to do is segment your cells using that bright field channel … which approach/tool you use will depend on the image - so just post it as soon as you can, and we’ll get you started.

For now - here are some helpful links regarding Segmentation in ImageJ/Fiji:

Hope this helps!

eta :slight_smile:

1 Like

Thanks, Eta. Let me have a try to upload an image.

Could you please let me know how to share an image on the forum?

Here’s the sample image 1.



ok. First thing - did you only save your original acquisitions as .jpeg files? If you click the Principles link above you’ll see a section called: Why JPEGs should not be using in imaging. Read that section for sure. And always save your acquisitions in the original format or as .tiff files to ensure your data is not corrupted.

If you have the original acquisition files - can you post one?

But be sure to go through those links above - will be helpful to you in the long-run.


Yes, .tiff format for sure. The website won’t allow tiff file.

@szh141 You should be able to upload it directly here on the Forum… click the Upload icon and give it a try.

Found it. Sorry. sample1


You are fine! don’t worry - you can always look at this old post regarding uploading tiff files here on the forum:

So when I go to load your image - they do so as an RGB - I don’t have access to the individual channels… would you be able to split them and upload them individually?? Sorry about all this! :slight_smile:



Thanks for the help.

Sorry for the delay in response @szh141

Just a few thoughts - and perhaps others here on the forum can provide you more guidance …

I worry that the images you present cannot be used to reliably measure what you wish to. Some issues include:

  1. Using bright field to delineate your cells. Ideally you would have a membrane marker in this case, as you want info regrading distance from cell periphery - you need a membrane marker. You cannot use bright field to define the cell membrane unfortunately. Also - with the images you have, overlapping cells cannot be distinguished from each other - so this may cause issues if you want per cell measurements.
  2. Using widefield images for these measurements. Because you are also interested in distances… and need to measure those reliably within each cell - it would be better to use confocal images - so you have an optical sectioning of your cells - will also be easier to delineate individual cells and their membranes.
    (Would also recommend acquiring 12- to 16-bit images for intensity measurements…)

This is not to say all is lost. You could perhaps extract some preliminary data… but perhaps you need to approach again your experimental set-up along with refining what you need to measure accordingly. Perhaps others have better insight. But I would point you again to the Principles page of the ImageJ wiki.

If you have more questions/comments - please do post again.


1 Like

I would be inclined to agree with @etadobson - attempting to segment images from bright field images similar to those you have shown would be challenging. I think you would make life much easier for yourself by using some sort of marker to delineate the cell boundary, or even just some sort of cytosolic marker would help. The amount of effort involved in redoing the experiment would be far less than that involved in attempting to analyse your images as they are at present!

Thanks eta and Dave. Really appreciate your inputs.

  1. My bad. Poor planning. We didn’t mean to make this measurement in the beginning. Now it’s like squeeze the last bit of information from the available data.
    Since we don’t have too many images/cells. Can I do it manually to define the cell boundary for every cells we have?

  2. Maybe I didn’t make it clear in the initial post. This is confocal images taken at optimal Z-slice (calculated by software). Yes, totally agree that intensity measurement requires higher bits and full dynamic range. But again, we are tying to squeeze the last bit of information.

Thanks again for your time and the inputs. Definitely will check those out.


You are totally right… brain isn’t quite working yet today I guess. :slight_smile: but still - then the biggest issue is delineating your cells using only bright field.

You can still try… I would recommend using Trainable Weka to segment your cells - then you can auto-threshold the generated probability map - create a mask - then do a bit of binary processing (dilate [maybe a few times to be sure to cover cell volume?], fill holes, watershed, etc)… and analyze particles to produce your ROIs. Just document EXACTLY what processing steps you carry out so they can be reproduced on all images. Again - many assumptions need to be made to segment your cells based on the bright field alone… and it’s not ideal.

If you have more questions, etc. Feel free to post again.


1 Like

hi eta, I guess my question is more towards the measurement than segmenting the cells.

Please bear with me. Let’s assume a binary mask is generated. How to measure the distance of individual dots inside the cells to the closest membrane?



That’s not an easy feat. There is no built-in way that I know of to do that. So you have to segment your cells AND the ‘spots’ inside - then I suppose measure the shortest distance of each spot to the nearest point on the cell periphery… you will have to script something most likely. Perhaps someone here on the forum has done something similar to this - so you can search the forum?

But it’s moving a bit beyond my own wheelhouse & bandwidth at the moment …


Thanks so much for your time, eta. The links you gave is just amazing for beginners like me .

1 Like

Best of luck @szh141 !!!

And once you get going again - you can always post more questions, etc in a new thread - to hopefully get others’ input as well.

eta :slight_smile:

If you can generate a mask image to represent the cells, you could use that to generate a Euclidean Distance Map, which would give you the distance at any point in the image to the nearest cell boundary.