Quantify fluorescence within a cell within a stack

Hello,

I am trying to quantify signal of internalized protein within a stack and I’m wondering if there is an automated/semi-automated way to do it. Basically, I want to measure signal within a cell above threshold and I have a macro that will measure above that threshold and then move to the next slice and so on. The problem is that my cell bows in the middle so when I draw the area that I would like to measure within at the top of the cell when it gets to the middle where the cell is larger I miss out on area that I would like to measure. Is there a way I can get image J to recognize where the boarders of my cell are when it moves down the stack?

Thanks for drawing in the intended area you want to measure. It is helpful to know that.

However, it would also be helpful to have the corresponding original image slice without the orange lines, so that we can play around with different segmentation strategies. Could you please post it?

Absolutely! Thank you again Curtis. Here they are

(BTW, not sure if it matters but the orange lines I drew were not drawn in FIJI, I drew those in preview to illustrate the issue I was having)

1 Like

Hmm, that’s a tricky one.

I played with a few things. Trainable Weka Segmentation doesn’t seem very feasible, in my tests. The best result I could find is Auto Local Threshold. Check it out:

After converting your image to 8-bit then performing a Kuwahara Filter to smooth it out a little, the Auto Local Threshold plugin with “Try all” at a radius of 15 produces the above mosaic.

Some of them, such as Otsu, are so close to what you need. My idea was that you could then use the Analyze Particles command to prune out the small particles, leaving only the large borders, then synthesize your actual desired region from there somehow using the a priori knowledge of the region/line intersections.

It is late, and I am probably making this too complicated. I bet that @biovoxxel and/or @tibuch and/or others will have better suggestions. I know this is a crackable nut.

Thank you Curtis! I will give this a shot and let you know how it pans out. I ready appreciate your expertise and attention to my plight. This is a bit out of my comfort zone so I really appreciate the help!

Hi @scottaskinosie and @ctrueden

I tried my best with KNIME Image Processing. But I have to admit this is challenging.

I got the following results (for the provided images):
image1:


image 2:

Here is the workflow (990.8 KB).

Note:
This workflow has a lot of parameters and is “optimized” for the two example images. I don’t know how it will perform with other images. I could not get segments which fill out the cell. Maybe this workflow can be used as a starting point.

Does someone know how pixel classification performs? @iarganda

2 Likes

I’d rather go for the Morphological Segmentation plugin.

This is what I got after converting the image to 8-bit:

5 Likes

@iarganda Wow, that is awesome! I really need to learn more about Morphological Segmentation. @iarganda Do you see a place to slip in mention of Morphological Segmentation into http://imagej.net/Segmentation ? It’s probably worth explicitly linking from there, would you agree?

Thanks also to @tibuch for the KNIME workflow!

You guys rock!

You’re right, I will add some documentation there :slight_smile:

Thank you all so much! I’m very grateful and impressed with the help I have received here!

I will give this a shot and let you know how it goes/if I need help. It probably won’t be for a couple days but I’ll update the thread as soon as I can.

Thank you all again!!!

1 Like

Thank you all again for your help with this issue. I have tried @iarganda recommended but when I apply the segmentation to my stack it gives me this. I am not sure how to share my stack on the forum but I am happy to if there is a way.

Thank you all again, I really really appreciate the help!

What I did with your image was to segment it in 2D because the borders of your cells do not overlap in 3D. So I recommend you to run the plugin independently for each slide.

I see, thank you @iarganda.

I have about 100 stacks each with 100-200 images per stack. Is there a way to automate or semi automate the process of running segmentation on each image?

Hi @scottaskinosie. What type of images are these? Widefield or Confocal?? Do you have a link to the entire stack? Have you tried deconvolving them?? I am curious if deconvolving first will improve the segmentation results.

To deconvolve you need to get a PSF, either from a bead image. Or theoretical. In the second case you need to know modality (ie Widefield, Confocal, etc.), NA, Emmission wavelength, RI of lens, apr. RI of sample, pixel size, z-step.

If you can provide a link to the original image along with above meta data I could try and deconvolve and see if it improves things.

2 Likes

Thank you @bnorthan!

Here is a link to a stack.
https://missouri.box.com/s/qsadza2wbvbazix8u0vg3ul0dv2xizq7

I will respond with the metadata this afternoon. I will need to visit the microscope to get some of the information. The images are confocal taken from a spinning disc confocal setup.

However, I am not sure how to obtain the RI of my sample. Could you please advise? The images are of 3-day old etioltaed seedlings. I found an estimation of the cell wall but not sure if that will work.

Unless, is there a way for me to find a PSF?

Thank you again!

@scottaskinosie… Don’t worry about RI of sample. Samples are not usually homogeneous so it can be hard to calculate. In the past some researchers have given me a value for sample RI. However I think it is often an approximation, as in this paper.

It is common to measure the PSF using beads.

You can also calculate it theoretically. There are some plugins for ImageJ that do that, though I don’t know if they support spinning disc.

1 Like

You can run a simple macro to process a whole stack slice by slice:

// get title of current stack
title = getTitle();

// convert to 8-bit
run("8-bit");

iter = nSlices;

// iterate over the slices
for( i=1; i <= iter; i++ )
{
    selectWindow( title );
    setSlice(i);

    run("Duplicate...", "title=slice"+i);

    selectWindow( "slice"+i );
    
    run("Morphological Segmentation");
    wait(2000);
    selectWindow("Morphological Segmentation");
    call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=16", "calculateDams=true", "connectivity=6");
    wait(2000);
    call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Catchment basins");
    call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");
    selectWindow("Morphological Segmentation");
    close();

    if( i != 1 )
    {
        selectWindow("slice"+i+"-catchment-basins");
        run("Select All");
        run("Copy");
        selectWindow("slice1-catchment-basins");
        run("Add Slice");
        run("Paste");
        selectWindow("slice"+i+"-catchment-basins");
        close();
    }
    selectWindow("slice"+i);
    close();
}
selectWindow("slice1-catchment-basins");
rename("result");

If you are happy with this result, I can also make a script for you.

1 Like

Thank you again @bnorthan, sorry in the delay in getting back to you. It is spinning disc so I am not sure if this information is still useful but here it is for the deconvolving.

NA-1.3
Emmission wavelength-509
RI lens-1.404
Pixel size-0.2404 um
Z-step-0.198 um

Thank you again for the help!

1 Like

Thank you @iarganda! I was thinking I might be able to do a Macro but I have zero experience in any language so I would do it by going through slice by slice and clicking each step of the way. I actually might try that with a few slices to see how it looks.

When you say write a script what would that do? Prevent me from having to create a macro manually where I go through slice by slice?

Thank you again for your help, I really appreciate it!!!

Actually, I lied. I thought I could make a macro with the recorder but it didn’t go the way I planned. In retrospect I do not know how I would make a macro for this.