Save all marked objects (nuclei) in a FISH image as separate file

cellprofiler

#1

Dear all,

Many thanks for providing such a great tool for free!

In accordance with a previously asked question in 2012 #1498 (Cropping Object into Separate Image Files?) I would like to know whether it is now possible to crop each identified object from an original input image and save all sub-images as individual image files.

My goal is to mark all nuclei in a FISH image and then export each nuclei as separate file. The saving needs to be done in one step.

Thanks for your answer
s.


#2

Hi,

Others may have better ideas, here is my work-around:

If you are working with just a few original image, it’s relatively simple to do:

  1. It’s best to do it in 2 separate pipelines. In the first pipeline: identify the objects-of-interest, in your case it’s the “nuclei” object.

  2. Add module SaveCroppedObjects (category: “File Processing”). This will save the binary position-mask of each identified nucleus. i.e. you will have a full size image, completely black, but the location of nuclei are highlighted white, one at a time in each file.

  3. Once you finished running this first pipeline, make another simple pipeline: load the original image as single image, and all the position-mask images with their metadata set accordingly:

  4. Use a module “Crop”, where your original image will be cropped by the binary position-masks

  5. Save the resulting cropped images into individual files

If you have a lot of original images, you may have to look for solutions outside CellProfiler.

Hope that helps.


#3

Dear Minh,

many thanks for your answer! I will try your approach and let you know how it works.

Best
s.


#4

I agree with everything @Minh said but this:

If you have a lot of original images, you may have to look for solutions outside CellProfiler.

You can definitely do this relatively easily for lots of images in CellProfiler!


#5

Hi, I’m interested in that problem too, how can I do that for a lot of images?


#6

Hi,

this worked for me: https://github.com/qupath/qupath/issues/118

Best
s.


#7

(Quoting myself from another post)

In CP, you can first run a pipeline that takes all your hundreds of images and makes masks for each with SaveCroppedObjects (we strongly suggest saving each image’s masks into a folder with that image’s name, which you can do using the “DefaultOutputFolder-Subfolder” save option), then run a second pipeline to apply the masks to your images (and optionally crop them down). It can be done though, and we do it in the lab.