Conversion of .czi images to .tif with cellprofiler

Hi, I was wondering if it was possible to convert .czi images to .tif with cellprofiler. I could import a 2-channel image .czi file in cellprofiler (neural cells : nuclei labeled with dapi and their cytoplasm labeled in red), but I couldn’t find any module to perform the conversion.
Do you have any idea?
Thanks

Hi @francois,

You can use the SaveImages module to save any imported images to your desired format – you can expect to see “tiff” among the file format types. Let us know if you have any other questions!

Best,
Pearl

Hi @francois,

I would consider the following options first, before converting CZI to TIFF, because this will have many downsides.

  • Cellprofiler is using BioFormats and therefore you can read almost any CZI file directly incl the required metadata --> this avoids data duplication, issues with metadata and is convenient

  • in case you really need to move away from CZI why not converting the CZI inside ZEN directly into OME-TIFF (ZEN has OME-TIFF export) --> at least this makes sure you do not loose important metadata and CP + BioFormats can read those as well

For me the 1st option was always a good choice and this would be my recommendation, if you want to Analyze your images inside Cellprofiler. And maybe check as well, if your Image Analysis can be done in ZEN directly anyway :slight_smile:

Sebi (from ZEISS)

Hi, Francois, we regularly convert .czi to hdf5 and do automatic nuclei detection and cell segmentation with HRPPP software. it is almost automaticaly. Visit our website for all details.
for convesrion of .czi we used fiji: plugins-bioformat importer
plugin-hdf5- save as hdf5.
In this case all metadata are embedding directly in hdf5, including volumetric data.
hdf5 you can import to HRPPP and do nuclei detection or cell segmentation directly without any adjustement.
My best regards!

@pearl-ryder
Hi Pearl, thanks for your answer. Actually, I used this module with the same parameters as yours. First, one drawback is that this module acts only on one part of the image (CellWall or whatever) coming from a previous selection in a module like for instance “IdentifyPrimaryObjects”. I’d like to use the “SaveImage” module on the whole image (which is moerover a 2-channel image). Second, the resulting output .tif image is very dark, black&white, and I can barely see the cells.

@sebi06
Thanks Sebi.
I also already use ZEN blue on my laptop (3.2 version) to make the CZI to TIF conversion (“Save with options”). But I have several dozen of CZI images that I need to convert to TIF. Is ZEN able to perform a “Save with options” in batch?

@tp59
Thanks Taras, could you please give me the URL of your website?

@sebi06
I could export my CZI images to TIF by using the Processing/Batch/Image export of ZEN blue V3.2. The output is one folder per image contaning the tif image but without any .xml associated data such as the ones we got with the “save as with options” function. The size of the file is also different (in my case 4 Mo with the batch option and 1.5 Mo with the “save as with options” function).
In the Processing/Batch/Parameters/Tagged Image Formats, the “convert to 8 bits” is selected, could you explain me the utility of it ?

Hi @francois,

ZEN has Batch processing or you use a little Python script to do this (as you like). Have a look here to get started: https://github.com/zeiss-microscopy/OAD/tree/475b56a1b9dbc634d00160a0a6fad7bb13a686dd

  • There are dedicated functions for exporting OME-TIFF
  • On our cloud platform APEER you can also use the XYZ --> OME-TIFF converter if you like

Why do you need to convert to TIFF instead of OME-TIFF? and why not using CZI directly?

@sebi06
To be honest, I don’t know the difference between OME-TIFF and TIFF.
I need TIFF files because I work with people who don’t know how to handle CZI files. They use ImageJ with very basic functions and also need to insert images in powerpoint presentations.
The OAD is very impressive, it opens a lot of possibilities. But I am not sure to understand how to use it yet.
I will currently use the batch processing and if I dive into the OAD, it will take some time, for sure! thanks very much for the info and I will not miss to contact you again!

Hi @francois,

In CellProfiler, in order to have multiple channels combined into a single image to save, you can use the GrayToColor module. This allows you to create an image stack for opening in ImageJ or other image analysis programs.

The outputted tiff image is very dark because the intensity values at each pixel are likely very small relative to the potential scale of possible intensities. An 8-bit tiff image can have intensity values ranging from 0-255 at each pixel and a 16 bit tiffs can range from 0-65,535. Most microscopy images will have the vast majority of pixels in the very, very low end of these spectrums, if you try to view the image using a typical image browser like Preview on a Mac, you’ll just see a black image. When you open the image in ImageJ, CellProfiler, or another analysis software, however, you can adjust the contrast to change how the image is displayed, which will allow you to see your cells.

If you want to save images for presentation, CellProfiler also allows you to save .png images. This format is what we typically use for presentations. If you want to save a color image for presentation, you can use the “RGB” color mode in the GrayToColor module. You can also add a RescaleIntensity module prior to saving, which may help to make your cells visible. Just be sure that you don’t run any analysis on images that you’ve saved for presentation!

Helpful articles / websites related to image formats:

Good luck!