https://github.com/allencellmodeling/czi-to-ome-xslt
A repository of XSL transform sheets to map CZI metadata to OME.
https://github.com/allencellmodeling/czi-to-ome-xslt
Last synced: 4 months ago
JSON representation
A repository of XSL transform sheets to map CZI metadata to OME.
- Host: GitHub
- URL: https://github.com/allencellmodeling/czi-to-ome-xslt
- Owner: AllenCellModeling
- License: other
- Created: 2020-04-29T06:19:16.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-13T23:54:44.000Z (6 months ago)
- Last Synced: 2025-01-02T23:14:20.090Z (5 months ago)
- Language: XSLT
- Size: 542 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# czi-to-ome-xslt
[](https://github.com/AllenCellModeling/czi-to-ome-xslt/actions/test-main.yml)
XSLT files to convert from CZI (Zeiss) microscopy image metadata
to OME image metadata schema.---
## Usage
If you want to use this work in a standalone fashion we recommend submoduling
this repository into your own repo:```bash
git submodule add https://github.com/AllenCellModeling/czi-to-ome-xslt.git
```You can then run the transformation in any language of your choosing.
### Python
_**Requires `lxml`** (`pip install lxml`)_
```python
import lxml.etree as ET# Parse template and generate transform function
template = ET.parse("czi-to-ome-xslt/xslt/czi-to-ome.xsl")
transformer = ET.XSLT(template)# Parse CZI XML
czixml = ET.parse("your-czi-metadata.xml")# Transform
omexml = transformer(czixml)# Write to file
with open("your-converted-czi-metadata.ome.xml", "w") as open_f:
open_f.write(str(omexml))
```This work has already been incorporated into
[`aicsimageio`](https://github.com/AllenCellModeling/aicsimageio).```python
from aicsimageio import AICSImageimg = AICSImage("your-file.czi")
img.ome_metadata
```## EXSLT
This work utilizes the EXSLT extensions for XSLT 1.0 (for example, the `str:tokenize` function). Popular XML libraries
such as `lxml` have built in support for EXSLT. To use these extensions, include the necessary attributes on `` in the
file you are working on:
```...
```
You can then use an EXSLT function like so:
``````
For more information on using EXSLT and the functions avaialbe, see the [EXSLT docs](http://exslt.org/howto.html).
## Comparison with Bioformats
For full metadata comparison between XSLT and Bioformats, see
[comparison](./docs/comparison).## Contributing
Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.Please feel free to contribute documentation, new additions to the XSLT itself,
and/or tests!**We especially encourage contributing examples of using this work in languages other
than Python**.For instructions on how to contribute new additions to the XSLT and/or tests, see
[CONTRIBUTING](./docs/CONTRIBUTING.md).---
***Free software: BSD license***