Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 2.24 KB

CONTRIBUTING.md

File metadata and controls

37 lines (26 loc) · 2.24 KB

Contributing to DICOM Microscopy Viewer

Design considerations and implementation details

The library is intended to provide a lightweight and standard-compliant viewer for microscopy images in DICOM format.

The viewer relies on Openlayers for rendering pyramid images and dynamically retrieves pyramid tiles (image frames) via DICOMweb WADO-RS using dicomweb-client. However, the viewer API fully abstracts the underlying rendering library and doesn't expose the lower level Openlayers API directly, such that another rendering library could in principle be used in the future if this would be of advantage.

A central design choice was to not expose any Openlayers objects or functions via the public API, but always provide an abstraction layer. Any functions or methods that receive arguments with Openlayers types as input or return values with Openlayers types as output shall be kept private and shall not be exposed at the package level, i.e., not exported in the main dicom-microscopy-viewer.js file. Private functions shall be named with a leading underscore (e.g., _myPrivateFunction) and include the @private JSDoc tag in their docstrings.

Coding style

The library is implemented in JavaScript using the 6th Edition of the ECMAScript Language Specification (ES6) or later. Source code is linted using standard (based on eslint).

Use the following command to identify potential coding style and type annotation violations:

$ npm run lint

Docstrings are written in JSDoc format:

/**
 * Check values.
 *
 * @param options - Options
 * @param {string} options.foo - One option
 * @param {number} options.bar - Another option
 * @returns {boolean} The return value
 */
const checkValues = (options) => {}

Each function or method docstring shall include the @param tag and @returns tag and they shall specify the type of parameters and return values, respectively.