3D image capabilities: coming soon to CellProfiler!

cellprofiler
3d

#1

I am very happy to announce that our software engineers are working hard to add true 3D capabilities to CellProfiler!

As you may know, you can currently load a 3D image file into CellProfiler and analyze it slice by slice. You can thus make maximum projections (and then analyze the 2D resulting images in a separate pipeline) or treat the 3D stack as a time lapse movie to “track” objects from one slice to the next. These strategies solve a surprising number of 3D image analysis problems, but of course sometimes you genuinely need to identify objects in true 3D and make volumetric measurements.

After this work is complete, you will be able to load 3D images and process them as a volume, including identifying objects in 3D, making 3D measurements and transformations of the image.

This work is made possible primarily through a collaboration with the Allen Institute for Cell Science, who is pushing the envelope on gathering gorgeous high-throughput 3D image stacks in their ongoing work.

Bookmark this post if you’d like updates on our 3D progress, especially if you’d like to test the beta version when it’s available. You can see what is going on with the code at GIthub: https://github.com/CellProfiler/CellProfiler/projects/1


#2

Awesome!
I am very curious to test it!


#3

Hoooray! Looking forward!!!


#4

Awesome! I am excited about testing this out. The progress is looking good at the Glthub site! Great work and may your work go smoothly! :slight_smile:


#5

Hi there CellProfiler forum! I want to announce that, before the release of CellProfiler 3.0, installing the nightly version of CellProfiler from source will already give you access to 3D segmentation functionality. To test this functionality out and get an idea of how to create your own 3D pipeline I encourage everyone to download a demo here.. Check out the 3D tutorial

The demo shows how to segment nuclei within a monolayer of HeLa cells. Please keep in mind that there are still many changes being made to CellProfiler in advance of the 3.0 release and we expect the pipeline in the demo to change as well. Therefore, if you run into trouble with the pipeline be on the look out for an updated version in this thread.

Thanks!

Here’s a preview of what you’ll discover:


It is plane to Z how FIJI is a great companion for visually verifying CellProfiler’s 3D segmentation
#6

Hi Kyle,

I tried running the 3D demo pipeline from the above link. I am getting error with gaussian filter module and few other modules. So I am not able to run demo pipeline.
Since you had mentioned regarding the nightly version, I am not sure about the version of cellprofiler I am using if it is suitable for 3D.

I am currently using the ubuntu 16.04, so I installed from this link (followed the steps here),

When I look for the version of cellprofiler from “about” option in “help” tab,
Version : 2.2.0
GIT hash: ac0529e

Hope you can help me out with this,

Regards,
Lakshmi


#7

@lakshmiswami I’ve tested the pipeline again today and I did not experience the errors you described. Therefore, I believe the issue to be with your installation of CellProfiler. After reading the link you sent I believe you are using the incorrect version of CellProfiler.

There is a command in the instructions that you should change to get the latest version of CP. Instead of

git checkout stable

use the command,

git checkout master

Please let me know if this doesn’t resolve your issue. Thanks!


#8

Hi Kyle,

Thanks for your suggestion. I tried with “git checkout master” its working . The 3D demo pipeline is also working.
Now I am having two Cellprofiler version i.e. one (CellProfiler 3.0.0rc1) for this 3d pipeline and the other (CellProfiler 2.2.0).

Just want to mention another point, While I am loading CellProfiler 3.0.0rc1 I go the corresponding Cellprofiler folder i.e. X/X/CellProfiler & open the python code as, “python CellProfiler.py”.

Now I will try the 3d pipeline for my images & let you know the outcome.

Regards,
Lakshmi


#9

I have a question about capabilities of the new 3D features for quantification of pixel mean-grey-intensity (MGI).

tissue: various rat tissue
processing: cryostat or tissue clearing
imaging: number of steps per image so that X, Y, and Z and are close as possible

I want the software to create a 3D mesh from the fluorescent intensity and then use that mesh as region-of-interests (ROIs) to re-scan the image-set and collect MGI for each ROI. This should produce multiple 3D meshes (ex. one for each cell or structure) and corresponding MGI, size and area measurements for each mesh.

Does it sound like this software will have this capability?

Thanks in advance,

-Michael Anderson


#10

@Michael1153 CellProfiler will segment objects in 3D, which is internally represented by a mesh. Measurements of CellProfiler objects include size/volume/shape, intensity measurements, and texture measurements. For instance, the mean fluorescent intensity (is this the mean grey intensity you reference?) can be calculated for each identified object. The measurements of the objects are exported into a table. A labeled volume image can also be saved as seen in the gif posted earlier.

I would encourage you to try CellProfiler with your images. If you have further questions or would like to share your success I would encourage you to start a new thread on this subject.


#11

@karhohs Thank you! I appreciate the information. It sounds like this is exactly what I need. I am busy with experiments and school at the moment but as soon as I have time I will check this out. I am relatively familiar with Cell Profiler/Analyst so I was very excited to hear for this 3D version, since I am familiar with pipelines.


#12

The link brought me to a page that had two versions of the nightly build. One is version 2.4.0 and the other is 2.3.0. Version 2.4.0 gave me the same errors that lakshmiswami had (gaussian+other errors).

I am running Windows 10 (not Linux) so I cannot run the update for the “master” version but I realize that I need the 3.0.0rc1 version. Is there a download of CP 3.0.0rc1 available for Windows 10?

Thank you very much for your great work. I hope the grants continue to roll in!

-Michael


#13

@allen_goodman is the expert on builds - they’ve been a struggle! Not sure the current status.


#14

Thanks Anne. I look forward to trying this on Windows 10.


#15

@Michael1153 the builds are forthcoming, so currently you’ll need to run CP from source to use the 3D functionality in the nightly. If you’re using Windows, I suggest following the conda installation. Thanks!


#16

Excellent! Thanks Kyle!


#17

I’m testing CP 3.0.0rc1 on Ubuntu compiled from master branch. I have a tif stack with two channels and 148 z-planes which I want to process as a 3D image.

The pipeline is very simple: IdentifyPrimaryObjects, MeasureObjectIntensity, ExportToSpreadsheet but soon after starting it produces a window with error 2519.

The command line looks as follows:

Worker 2: Running module IdentifyPrimaryObjects 5 Worker 2: /usr/local/lib/python2.7/dist-packages/skimage/filters/thresholding.py:379: RuntimeWarning: divide by zero encountered in log Worker 2: temp = (mean_back - mean_obj) / (np.log(mean_back) - np.log(mean_obj)) Worker 2: Error detected during run of module IdentifyPrimaryObjects#5 Worker 2: Traceback (most recent call last): Worker 2: File "/home/xxx/CellProfiler/cellprofiler/pipeline.py", line 1900, in run_image_set Worker 2: self.run_module(module, workspace) Worker 2: File "/home/xxx/CellProfiler/cellprofiler/pipeline.py", line 2007, in run_module Worker 2: module.run(workspace) Worker 2: File "/home/xxx/CellProfiler/cellprofiler/modules/identifyprimaryobjects.py", line 828, in run Worker 2: binary_image = centrosome.cpmorphology.fill_labeled_holes(binary_image, size_fn=size_fn) Worker 2: File "/usr/local/lib/python2.7/dist-packages/centrosome/cpmorphology.py", line 65, in fill_labeled_holes Worker 2: blabels, count = scind.label(background, four_connect) Worker 2: File "/usr/lib/python2.7/dist-packages/scipy/ndimage/measurements.py", line 152, in label Worker 2: raise RuntimeError('structure and input must have equal rank') Worker 2: RuntimeError: structure and input must have equal rank


#18

IdentifyPrimaryObjects isn’t currently 3D compatible. We’re hoping it will be soon, sorry!


IdentifyPrimaryObjects 3D
#19

Ok, fair enough. I’ll wait :slight_smile:

In the meantime I’m trying to segment 3D time lapse images following the example pipeline with GaussianFilter -> ApplyThreshold -> Watershed. I’m getting the error already in the first step:
ValueError: Expected 2D, 3D, or 4D array, got 5D.

The hyperstack is c:2, z:46, t:100, image resolution is 296x296. When I split channels, the pipeline goes through however the frames are loading with strange resolution ~250x40 (this is how they’re displayed in Test Mode).


#20

Can you post a sample movie and a pipeline? Thanks.