Glencoe has released a statement regarding the conversion of complex formats to pyramidal ome.tiff
== The full post is here ==
https://www.glencoesoftware.com/blog/2019/12/09/converting-whole-slide-images-to-OME-TIFF.html
== Workflow Summary ==
The Glencoe protocol describes a two-step process.
1. Convert vendor data to 'raw' data using `bioformats2raw`
2. Convert 'raw' data to ome.tiff using `raw2ometiff`
The need for the two separate protocols seems to stem from licensing and dependencies on separate vendor-specific libraries.
== Advantages ==
All reading and writing is streamed to the disk in parallel, making this the fastest conversion tool available. On a test with one RGB dataset in .mrxs format, it went from ~4h using [[ https://github.com/BIOP/ijp-kheops | KHEOPS ]] to about 10 minutes using these two tools.
== Installation ==
NOTE: Because this protocol makes use of very modern file storage and compression systems, there is a dependency on a tool called `c-blosc`, and there is some compilation to do.
== Installing `c-blosc` ==
=== Dependencies ===
**Download **[[ https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019 | Build Tools for Visual Studio 2019 ]]
Install the packages
- `MSVC v142 - VS 2019 C++ x64/x86 build tools`
- `Windows 10 SDK (10.0.18362.0)`
**Download **[[ https://cmake.org/download/ | CMake ]] (msi installer) and install with checking `Add CMAKE Path to all users`.
NOTE: If you followed the StarDist with gpu-tools installation, you have all the prerequisites except for [[ https://cmake.org/download/ | CMake ]]. Otherwise please follow the installation of the [[ bioimaging_and_optics_platform_biop/computers-servers/software/gpu-deep-learning/#stardist-prerequisites | StarDist Prerequisites ]]
=== Installation ===
1. Clone https://github.com/Blosc/c-blosc
2. Create a folder in your `C:\` drive called `Dev Tools`
2. Open a command line and do the following
```
cd c-blosc
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="C:\Dev Tools"
cmake --build . --target install
```
=== Installing `bioformats2raw` ===
Unzip this somewhere
https://github.com/glencoesoftware/bioformats2raw/releases
=== Installing `raw2ometiff` ===
Unzip this somewhere
https://github.com/glencoesoftware/raw2ometiff/releases
=== Adding to the PATH ===
Add the two unzipped `bin` folders to your path so you can call these two functions from anywhere
== Using This workflow ==
Example: Dataset called `D:\ToConvert\Kidney.mrxs` which is RGB
```
bioformats2raw.bat --resolutions=4 D:\ToConvert\Kidney.mrxs D:\ToConvert\Kidney
```
Other arguments are available with bioformats2raw.bat --help
Converting to OME.TIFF
```
raw2ome.tiff --compression="JPEG-2000" --rgb D:\ToConvert\kidney D:\ToConvert\Kidney.ome.tiff
```
IMPORTANT: RGB images must be explictely concerted using the `--rgb` flag. Otherwise it will be a 3 channel image.