Skip to main content

Function: init()

init(configuration): boolean

Initialize the cornerstone-core. This function checks for WebGL context availability to determine if GPU rendering is possible. By default, it assumes a medium GPU tier.

It's the responsibility of the consumer application to provide accurate GPU tier information if needed. Libraries like 'detect-gpu' can be used for this purpose, and the result can be passed in the configuration object.

If a WebGL context is available, GPU rendering will be used. Otherwise, it will fall back to CPU rendering for supported operations.

Parameters

configuration: Cornerstone3DConfig = config

A configuration object, which can include GPU tier information

Returns

boolean

A promise that resolves to true if cornerstone has been initialized successfully.

Defined in

packages/core/src/init.ts:99