stack-3d/README.md

48 lines
2.1 KiB
Markdown
Raw Normal View History

2017-02-16 15:26:55 +00:00
This is a collection of tools for working with 3D image stacks of microvessel networks
### All Dependencies (individual scripts have only a subset of these dependencies)
* [bftools](http://www.openmicroscopy.org/site/support/bio-formats5.3/users/comlinetools/)
* [pyxb](https://pypi.python.org/pypi/PyXB)
* [VTK with Python Interface](http://www.vtk.org/download/)
* [Scikit Image]
* [VMTK](http://www.vmtk.org/)
* [Microvessel Chaste](https://jmsgrogan.github.io/MicrovesselChaste/)
### Working with ZEISS (IMS, LSM, CZI) Image Data
It is useful to first extract the image metadata. This requires a copy of [bftools](http://www.openmicroscopy.org/site/support/bio-formats5.3/users/comlinetools/).
Download it and set`$BFTOOLS_DIR` to the directory obtained after unzipping. Then do:
```bash
python format_conversion/extract_zeiss_metadata.py -i $IMAGE_PATH -o $OUTPUT_FILE --verbose 1
```
To proceed we need to convert the format to an OME TIFF and then a generic TIFF. It is easiest to work with
one series and one channel at a time. Since we work with large images it is best to split the images into tiles and
work in parallel.
```bash
python format_conversion/zeiss_to_tiff.py -i $IMAGE_PATH -o $OUTPUT_FOLDER
```
### Working with 3D TIFFs
After conversion we can work with the 3D TIFFs using packages like sci-kit. It is important to remember that
the generic TIFFs we have produced have all of their physical dimensions stripped. We do not trust any tools to
preserve physical dimensions. The original OME metadata XML is the only reference we use.
For easy visualization it is useful to downsample and then re-assemble the tiles.
```bash
python image/downsample_tiffs.py -i $IMAGE_PATH -x 3 -y 3 -z 1
```
### Visualizing
We can use FIJI or VTK to visualize. VTK is nicer, but struggles with full resolution datasets. We can downsample
as described previoulsy and then create VTK files for use in paraview.
```bash
python format_conversion/tiff_to_vtk.py -i $IMAGE_PATH -m $METADATA_FILE -tx 1024 -ty 1024 -dx 3 -dy 3 -dz 1
```
Even with this it is difficult to make nice volume renders as resource use is high. To launch a simple VTK window do: