Import .czi files / export as .tif

Hi,

I’ trying to import a .czi file containing two images (dapi and gfp), and I’d like to export the dapi image, the gfp image, the composite image all three as .tif (or jpeg).

here is my script written to save the dapi image :

options = ImporterOptions()
options.setOpenAllSeries(True)
options.setShowOMEXML(False)
options.setStitchTiles(False)
options.setId("pathToFilename.czi")
#fullimps now holds the 2 images contained within the czi file. 
# open the first one. 
options.setCBegin(0, 0)
options.setCEnd(0, 0)
fullimps = BF.openImagePlus(options)
fullimps
fullimps[0].show()
saveDir = "C:/Users/FPiumi/Desktop/test1/"
IJ.saveAs(fullimps[0], "Tif", os.path.join(saveDir, filename));
fullimps[0].close()

In this example, the first image contained within the czi file is saved as “.tif” but the signal is weakened, so I can’t see any cell on the image.
Could you please tell me why most of the signal is lost during this process?
Thanks
Francois

The signal is likely not lost, but your display settings might have been adjusted. Whatever software you were using previously (Zen, perhaps) likely had compressed Display settings to make it appear brighter. If you are looking at the image in FIJI, try Image->Adjust->Brightness&Contrast->Auto.

Alternatively, the bit depth may have changed in some way, but I do not have enough information or example files to determine that.

Thanks. Wouls someone have any idea on how to eport czi files to tif or jpeg (for example with a python script ?)

Have a look at the excellent family of python packages from the Allen Institute: https://github.com/AllenCellModeling/aicsimageio
And: https://github.com/AllenCellModeling/aicspylibczi

Good luck,
Damir

1 Like