ImageJ, Lineage Mapper Integrated Object Intensity

Hey All,

Apologies if this question has been posted an answered previously. I searched the forum briefly for similar posts and nothing came up.

I’m using lineage mapper to track the movement and growth of cells as observed with phase microscopy. FogBank works quite well for segmentation and labeling of the images, but I can’t find a way to use Lineage Mapper to track the integrated intensity of each cell with respect to time in addition to the cell’s movement. Based on reading the Lineage Mapper publication, it seems like this should be possible.

Do I need to use a different tool, or can Lineage Mapper do this? I tried to use CellProfiler for awhile but the segmentation was to inconsistent. I also played around with TrackMate, but that appears to only track objects as circles of a given diameter and the cells I’m tracking aren’t very circular, and their total area changes dramatically throughout the course of a single experiment.

Appreciate any responses.

Thanks.

Hello,

Lineage Mapper was created to just track the cells. When creating it we did not want to add more than the core functionality into the tool because we envisioned it being used as part of a larger analysis pipeline.

For example, you use a separate tool to perform cell segmentation (e.g. fogbank), then perform tracking with Lineage Mapper. The tracking outputs globally labeled masks with the cell id’s. From that point there are many different measurements you could make. Tracking integrated intensity is a great example, but you could also measure cell velocity. We expected that after you have the globally labeled tracked mask images, you would use another tool downstream to perform the measurements you are interested in.

When we computed integrated intensity tracked over time for the Lineage Mapper paper, a few lines of Matlab were used to combine the global cell label images with the fluorescent images to compute the integrated intensity per global label per time point.

I don’t know how programming inclined you are, nor what language you prefer, but creating a similar post processing script should be doable in Matlab, Python, and maybe even Fiji scripting/macros (though I don’t spend much time writing macros).

Here is an untested (there are no interpreter errors, but I never ran it) python script I threw together which might get you pointed in the correct direction.

Thanks,
Michael Majurski

import os
import skimage.io
import numpy as np

# Assumption: fluorescent images are held in one folder, tracked in another
# Assumption: image names are the same between the tracked and fluorescent image folders

input_tracked_folder = './tracked/'
input_fluorescent_folder = './fluorescent/'
output_csv_file = './integrated_intensity_per_global_id.csv'

# this builds a list of image filenames for each tiff in the input tracked folder
image_filenames = [fn for fn in os.listdir(input_tracked_folder) if fn.endswith('.tif')]

# create output csv file
with open(output_csv_file, 'w') as fh:
    # Assumption: this relies on the idea that you can convert the filename into a timepoint number via the filename
    # I don't know how your data is arranged/named, so this is general
    fh.write('Global ID, Filename, Integrated Intensity\n')

    # loop over the image filenames
    for fn in image_filenames:
        labeled_image_filepath = os.path.join(input_tracked_folder, fn)
        fluorescent_image_filepath = os.path.join(input_fluorescent_folder, fn)
    
        F = skimage.io.imread(fluorescent_image_filepath, as_gray=True)
        L = skimage.io.imread(labeled_image_filepath, as_gray=True)
    
        # loop over the global labels present in the labeled image
        uniuqe_ids = np.unique(np.flatnonzero(L))
        
        for id in uniuqe_ids:
            integrated_intensity = np.sum(F[L == id])
            fh.write("{},{},{}\n".format(id, fn, integrated_intensity))

Michael,

Thank you for your prompt response and for clarifying that additional steps are necessary to arrive at the integrated intensities. The python code you provided is very helpful as well.

Best,

Andy