Skip to content

Commit

Permalink
updates to ome_tiff
Browse files Browse the repository at this point in the history
  • Loading branch information
bugraoezdemir authored Jan 15, 2025
1 parent 22cb252 commit 3a3d685
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions _includes/ome_tiff/convert_to_ometiff_bfconvert.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,42 @@ and it uses Fiji to inspect the content of the OME-TIFF data.
Note that bfconvert is capable of generating a variety of other formats (in addition to OME-TIFF)
such as tiff, png, jpeg, OME-XML, etc., although we will focus on the OME-TIFF in this activity.

Before starting, make sure you have downloaded the `xyz__multiple_images.czi` somewhere convenient.
We refer to this input path as `/path/to/xyz__multiple_images.czi`.
Also create an output folder for OME-TIFF. We refer to this output folder as `/path/to/OME-TIFFs`


**Basic conversion**

```bash
bfconvert \
~/ome_zarr_course/data/czi/xyz__multiple_images.czi \
~/ome_zarr_course/data/OME-TIFF/xyz__multiple_images.ome.tiff
bfconvert /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images.ome.tiff
```
This will create an OME-TIFF containing two images. Often, this is not convenient, and we would
prefer to specify a single series for conversion.

**Select one series and convert**

```bash
bfconvert \
-series 1 \
~/ome_zarr_course/data/czi/xyz__multiple_images.czi \
~/ome_zarr_course/data/OME-TIFF/xyz__multiple_images_s1.ome.tiff
bfconvert -series 1 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s1.ome.tiff
```

**Specify compression**
```bash
bfconvert \
-series 1 \
-compression "JPEG-2000 Lossy" \
~/ome_zarr_course/data/czi/xyz__multiple_images.czi \
~/ome_zarr_course/data/OME-TIFF/xyz__multiple_images_s1_compressed.ome.tiff
bfconvert -series 1 -compression "JPEG-2000 Lossy" /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s1_compressed.ome.tiff
```
**Check output size**
```bash
du -sh ~/ome_zarr_course/data/OME-TIFF/*
du -sh /path/to/OME-TIFFs/* # unix
```
**Select one series and specify z-range**
**Select one series and specify z-range** \
Use the option `-range START END`
```bash
bfconvert \
-series 0 \
-range 0 0 \
~/ome_zarr_course/data/czi/xyz__multiple_images.czi \
~/ome_zarr_course/data/OME-TIFF/xyz__multiple_images_s0_range0-1.ome.tiff
bfconvert -series 0 -range 0 0 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s0_range0-0.ome.tiff
```
**Crop in 3-D**
**Crop in 3-D** \
Use the option `-crop x,y,WIDTH,HEIGHT`
```bash
bfconvert \
-series 0 \
-range 0 0 \
-crop 20,30,100,100 \
~/ome_zarr_course/data/czi/xyz__multiple_images.czi \
~/ome_zarr_course/data/OME-TIFF/xyz__multiple_images_s0_crop3D.ome.tiff
bfconvert -series 0 -range 0 0 -crop 20,30,100,100 /path/to/xyz__multiple_images.czi /path/to/OME-TIFFs/xyz__multiple_images_s0_crop3D.ome.tiff
```

Inspect the output OME-TIFFs using Fiji:
Expand Down

0 comments on commit 3a3d685

Please sign in to comment.