An open API service indexing awesome lists of open source software.

https://github.com/leesei/openslide-prop2json

Parse OpenSlide properties (generated by `openslide-show-properties`) to JSON
https://github.com/leesei/openslide-prop2json

json openslide

Last synced: about 1 month ago
JSON representation

Parse OpenSlide properties (generated by `openslide-show-properties`) to JSON

Awesome Lists containing this project

README

          

# openslide-prop2json

[![NPM Version][npm-image]][npm-url]
[![Linux Build][travis-image]][travis-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

[npm-image]: https://img.shields.io/npm/v/openslide-prop2json.svg
[npm-url]: https://npmjs.org/package/openslide-prop2json
[travis-image]: https://img.shields.io/travis/leesei/openslide-prop2json.svg?label=linux
[travis-url]: https://travis-ci.org/leesei/openslide-prop2json
[appveyor-image]: https://img.shields.io/appveyor/ci/leesei/openslide-prop2json/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/leesei/openslide-prop2json

Parse OpenSlide properties (generated by `openslide-show-properties`) to JSON.
It will also automatically convert number and boolean fields.

[List of Known Properties](http://openslide.org/docs/properties/)
[Virtual slide formats understood by OpenSlide](http://openslide.org/formats/)

## Install

```sh
npm install openslide-prop2json -g # CLI
npm install openslide-prop2json # as module
```

## Usage

### CLI

```sh
# load properties file
openslide-show-properties Leica-1.scn > Leica-1.prop
openslide-prop2json Leica-1.prop
# OR with a pipe
openslide-show-properties Leica-1.scn | openslide-prop2json
```

### As Module

```js
const prop2json = require('openslide-prop2json');
prop2json(inputStream, options, (err, prop) => {
console.log(JSON.stringify(prop, null, 2));
});
```

### Debug logs

Supported DEBUG tags: *osp2j:parse*, *osp2j:transform*.
See [visionmedia/debug](https://github.com/visionmedia/debug/) for details.

## TODO

- [`transform.js`] transform `openslide.level[]` as array
- [`convert.js`] add blacklist for field conversion