readczi
readCzi is an R package to read Carl Zeiss Image (CZI) files, convert them to tifs and store metadata
Science Score: 52.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
✓Institutional organization owner
Organization sfb-elaine has institutional domain (www.elaine.uni-rostock.de) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.2%) to scientific vocabulary
Repository
readCzi is an R package to read Carl Zeiss Image (CZI) files, convert them to tifs and store metadata
Basic Info
Statistics
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
- Releases: 6
Metadata Files
README.md
readCzi
readCzi is an R package to read CZI image files (images from ZEISS microscopes), stack them if needed (projection), convert the files to tifs (also normalized and histogram equalized), and store the metadata a CSV files.
Readable image/microscopy formats
The R package readCzi has been checked with image data from * ZEISS Apotome, * ZEISS AxioImager, * ZEISS laser scanning microscopes (1 to 3 channels, 1 to 3 tracks, 1 to n z layers). Please contact Kai for further information and sample data.
Example code for using the R package
The following example (script and results) shows the capabilities of the package.
The script is found in inst/testscript.R.
```R
Testscript for using the R package readCzi +++++++++++++++++++++++++++++++
Author: Kai Budde-Sagert
Created: 2021/04/08
Last changed: 2024/01/17
Delete everything in the environment
rm(list = ls())
close all open plots in RStudio
graphics.off()
Load packages
groundhog.day <- "2023-01-01" if(!any(grepl(pattern = "groundhog", x = installed.packages(), ignore.case = TRUE))){ install.packages("groundhog") }
Load packages
library(groundhog) pkgs <- c("BiocManager", "devtools", "reticulate", "tibble", "xml2") groundhog.library(pkgs, groundhog.day)
if(!("EBImage" %in% utils::installed.packages())){ print("Installing EBImage.") BiocManager::install("EBImage") }
require(EBImage)
Install Python package for reading data of CZI files
(Users will be asked to install miniconda when starting for the first time)
if(! "czifile" %in% reticulate::pylistpackages()$package){ reticulate::py_install("czifile") }
Install this R package for reading CZI images in R
if(!("readCzi" %in% installed.packages()[,"Package"])){ devtools::install_github("SFB-ELAINE/readCzi") } require(readCzi)
Please adapt the following parameters
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Input file
inputfile <- system.file("extdata", "LSMthreeChannels.czi", package = "readCzi", mustWork = TRUE)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1. Read czi file and store as array -------------------------------------
imagedata <- readCzi(inputfile = input_file)
2. Read metadata of czi file and save as CSV ----------------------------
(in German and English format)
dfmetadata <- readCziMetadata(inputfile = inputfile, savemetadata = TRUE)
filepathde <- file.path(dirname(inputfile), "output", paste0(gsub("\.czi", "", basename(inputfile)), "dfmetadatade.csv")) filepathen <- file.path(dirname(inputfile), "output", paste0(gsub("\.czi", "", basename(inputfile)), "dfmetadataen.csv"))
dir.create(path = file.path(dirname(inputfile), "output"), showWarnings = FALSE) readr::writecsv(x = dfmetadata, file = filepathen) readr::writecsv2(x = dfmetadata, file = filepath_de)
3. Convert czi file to tifs ---------------------------------------------
convertCziToTif(inputfile = inputfile, convertallslices = TRUE)
```
The results are the following:
1. LSM_threeChannels.czi
Original images (z-stack layers + projection (maximum intensity method)):
- Layer 1:

- Layer 2:

- ...
- Layer 15:

- Layer 16:

- Layer 17:

- Layer 18:

- Layer 19:

- Layer 20:

- Layer 21:

- Layer 22:

- Layer 23:

- Layer 24:

- Layer 25:

- Z-stack projection (maximum intensity method):

- Histogram equalized z-stack projection (using the clahe method of the EBImage R package):

- Normalized histogram equalized z-stack projection (normalizing each channel separately):

- Layer 1:
(The jpgs were created with the R package 'magick'. Please see ´inst/testscript.R´ for details.)
Owner
- Name: SFB ELAINE - ELectrically Active ImplaNts
- Login: SFB-ELAINE
- Kind: organization
- Location: Rostock, Germany
- Website: https://www.elaine.uni-rostock.de/
- Repositories: 6
- Profile: https://github.com/SFB-ELAINE
Repository of the SFB 1270 ELAINE
Citation (CITATION.cff)
# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
cff-version: 1.2.0
message: 'To cite package "readCzi" in publications use:'
type: software
license: GPL-3.0-only
title: 'readCzi: Read CZI image files, convert them to tifs, and save metadata'
version: 0.4.2
doi: 10.5281/zenodo.10231885
abstract: The package reads (z-stack) CZI microscopy files, edits them, and stores
the results in the tif format. The metadata is also read, transformed into a tibble,
and saved as a CSV file.
authors:
- family-names: Budde-Sagert
given-names: Kai
email: kai.budde-sagert@uni-rostock.de
orcid: https://orcid.org/0000-0001-6836-9865
preferred-citation:
type: manual
title: 'readCzi: R package to read CZI image files, convert them to tifs, and save
metadata'
authors:
- family-names: Budde-Sagert
given-names: Kai
email: kai.budde-sagert@uni-rostock.de
orcid: https://orcid.org/0000-0001-6836-9865
year: '2024'
notes: R package version 0.4.1
doi: 10.5281/zenodo.10231885
url: https://github.com/SFB-ELAINE/readCzi
repository-code: https://github.com/SFB-ELAINE/readCzi
url: https://github.com/SFB-ELAINE/readCzi
contact:
- family-names: Budde-Sagert
given-names: Kai
email: kai.budde-sagert@uni-rostock.de
orcid: https://orcid.org/0000-0001-6836-9865
references:
- type: software
title: 'R: A Language and Environment for Statistical Computing'
notes: Depends
url: https://www.R-project.org/
authors:
- name: R Core Team
institution:
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2025'
version: '>= 4.0.0'
- type: software
title: BiocManager
abstract: 'BiocManager: Access the Bioconductor Project Package Repository'
notes: Imports
url: https://bioconductor.github.io/BiocManager/
repository: https://CRAN.R-project.org/package=BiocManager
authors:
- family-names: Morgan
given-names: Martin
email: martin.morgan@roswellpark.org
orcid: https://orcid.org/0000-0002-5874-8148
- family-names: Ramos
given-names: Marcel
email: marcel.ramos@sph.cuny.edu
orcid: https://orcid.org/0000-0002-3242-0582
year: '2025'
doi: 10.32614/CRAN.package.BiocManager
version: '>= 1.30.19'
- type: software
title: EBImage
abstract: 'EBImage: Image processing and analysis toolbox for R'
notes: Imports
url: https://github.com/aoles/EBImage
repository: https://bioconductor.org/
authors:
- family-names: Oleś
given-names: Andrzej
- family-names: Pau
given-names: Gregoire
- family-names: Smith
given-names: Mike
- family-names: Sklyar
given-names: Oleg
- family-names: Huber
given-names: Wolfgang
- family-names: Barry
given-names: with contributions from Joseph
- family-names: Marais
given-names: Philip A.
year: '2025'
doi: 10.18129/B9.bioc.EBImage
version: '>= 4.40.0'
- type: software
title: reticulate
abstract: 'reticulate: Interface to ''Python'''
notes: Imports
url: https://rstudio.github.io/reticulate/
repository: https://CRAN.R-project.org/package=reticulate
authors:
- family-names: Ushey
given-names: Kevin
email: kevin@posit.co
- family-names: Allaire
given-names: JJ
email: jj@posit.co
- family-names: Tang
given-names: Yuan
email: terrytangyuan@gmail.com
orcid: https://orcid.org/0000-0001-5243-233X
year: '2025'
doi: 10.32614/CRAN.package.reticulate
version: '>= 1.26'
- type: software
title: tibble
abstract: 'tibble: Simple Data Frames'
notes: Imports
url: https://tibble.tidyverse.org/
repository: https://CRAN.R-project.org/package=tibble
authors:
- family-names: Müller
given-names: Kirill
email: kirill@cynkra.com
orcid: https://orcid.org/0000-0002-1416-3412
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
year: '2025'
doi: 10.32614/CRAN.package.tibble
version: '>= 3.1.8'
- type: software
title: xml2
abstract: 'xml2: Parse XML'
notes: Imports
url: https://xml2.r-lib.org
repository: https://CRAN.R-project.org/package=xml2
authors:
- family-names: Wickham
given-names: Hadley
- family-names: Hester
given-names: Jim
- family-names: Ooms
given-names: Jeroen
email: jeroenooms@gmail.com
year: '2025'
doi: 10.32614/CRAN.package.xml2
version: '>= 1.3.3'
GitHub Events
Total
- Watch event: 1
- Push event: 2
Last Year
- Watch event: 1
- Push event: 2
Dependencies
- BiocManager * imports
- EBImage * imports
- reticulate * imports
- xml2 * imports
- actions/checkout v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite