Skip to main content

Class: NVDocument

Defined in: nvdocument.ts:456

NVDocument class (main)

Constructors​

Constructor​

new NVDocument(): NVDocument;

Defined in: nvdocument.ts:482

Returns​

NVDocument

Properties​

PropertyTypeDefault valueDefined in
completedAnglesCompletedAngle[][]nvdocument.ts:477
completedMeasurementsCompletedMeasurement[][]nvdocument.ts:476
dataDocumentDataundefinednvdocument.ts:457
drawBitmapUint8Arraynullnvdocument.ts:473
imageOptionsMapMap<any, any>undefinednvdocument.ts:474
meshDataObjects?( | NVMesh | NVConnectome)[]undefinednvdocument.ts:471
meshes( | NVMesh | NVConnectome)[][]nvdocument.ts:472
meshOptionsMapMap<any, any>undefinednvdocument.ts:475
sceneSceneundefinednvdocument.ts:468
volumesNVImage[][]nvdocument.ts:470

Accessors​

customData​

Get Signature​

get customData(): string;

Defined in: nvdocument.ts:646

Returns​

string

Set Signature​

set customData(data: string): void;

Defined in: nvdocument.ts:650

Parameters​
ParameterType
datastring
Returns​

void


encodedDrawingBlob​

Get Signature​

get encodedDrawingBlob(): string;

Defined in: nvdocument.ts:610

Gets the base 64 encoded blob of the associated drawing

Returns​

string


encodedImageBlobs​

Get Signature​

get encodedImageBlobs(): string[];

Defined in: nvdocument.ts:603

Gets the base 64 encoded blobs of associated images

Returns​

string[]


imageOptionsArray​

Get Signature​

get imageOptionsArray(): ImageFromUrlOptions[];

Defined in: nvdocument.ts:596

Returns​

ImageFromUrlOptions[]


labels​

Get Signature​

get labels(): NVLabel3D[];

Defined in: nvdocument.ts:635

Gets the 3D labels of the Niivue instance

Returns​

NVLabel3D[]

Set Signature​

set labels(labels: NVLabel3D[]): void;

Defined in: nvdocument.ts:642

Sets the 3D labels of the Niivue instance

Parameters​
ParameterType
labelsNVLabel3D[]
Returns​

void


opts​

Get Signature​

get opts(): NVConfigOptions;

Defined in: nvdocument.ts:617

Gets the options of the Niivue instance

Returns​

NVConfigOptions

Set Signature​

set opts(opts: NVConfigOptions): void;

Defined in: nvdocument.ts:627

Sets the options of the Niivue instance

Parameters​
ParameterType
optsNVConfigOptions
Returns​

void


previewImageDataURL​

Get Signature​

get previewImageDataURL(): string;

Defined in: nvdocument.ts:577

Gets preview image blob

Returns​

string

dataURL of preview image

Set Signature​

set previewImageDataURL(dataURL: string): void;

Defined in: nvdocument.ts:585

Sets preview image blob

Parameters​
ParameterTypeDescription
dataURLstringencoded preview image
Returns​

void


title​

Get Signature​

get title(): string;

Defined in: nvdocument.ts:569

Title of the document

Returns​

string

Set Signature​

set title(title: string): void;

Defined in: nvdocument.ts:592

Parameters​
ParameterTypeDescription
titlestringtitle of document
Returns​

void

Methods​

addImageOptions()​

addImageOptions(image: NVImage, imageOptions: ImageFromUrlOptions): void;

Defined in: nvdocument.ts:671

Adds an image and the options an image was created with

Parameters​

ParameterType
imageNVImage
imageOptionsImageFromUrlOptions

Returns​

void


download()​

download(
fileName: string,
compress: boolean,
opts: object): Promise<void>;

Defined in: nvdocument.ts:761

Parameters​

ParameterType
fileNamestring
compressboolean
opts{ embedImages: boolean; }
opts.embedImagesboolean

Returns​

Promise<void>


fetchLinkedData()​

fetchLinkedData(): Promise<void>;

Defined in: nvdocument.ts:715

Fetch any image data that is missing from this document.

Returns​

Promise<void>


getImageOptions()​

getImageOptions(image: NVImage): ImageFromUrlOptions;

Defined in: nvdocument.ts:748

Returns the options for the image if it was added by url

Parameters​

ParameterType
imageNVImage

Returns​

ImageFromUrlOptions


hasImage()​

hasImage(image: NVImage): boolean;

Defined in: nvdocument.ts:657

Checks if document has an image by id

Parameters​

ParameterType
imageNVImage

Returns​

boolean


hasImageFromUrl()​

hasImageFromUrl(url: string): boolean;

Defined in: nvdocument.ts:664

Checks if document has an image by url

Parameters​

ParameterType
urlstring

Returns​

boolean


json()​

json(embedImages: boolean, embedDrawing: boolean): ExportDocumentData;

Defined in: nvdocument.ts:755

Serialise the document by delegating to NVSerializer.

Parameters​

ParameterTypeDefault value
embedImagesbooleantrue
embedDrawingbooleantrue

Returns​

ExportDocumentData


removeImage()​

removeImage(image: NVImage): void;

Defined in: nvdocument.ts:701

Removes image from the document as well as its options

Parameters​

ParameterType
imageNVImage

Returns​

void


removeOptsChangeCallback()​

removeOptsChangeCallback(): void;

Defined in: nvdocument.ts:824

Removes the opts change callback

Returns​

void


setOptsChangeCallback()​

setOptsChangeCallback(callback: (propertyName: keyof NVConfigOptions, newValue:
| string
| number
| boolean
| number[]
| Float32Array
| number[]
| MouseEventConfig
| TouchEventConfig
| [[number, number], [number, number]], oldValue:
| string
| number
| boolean
| number[]
| Float32Array
| number[]
| MouseEventConfig
| TouchEventConfig
| [[number, number], [number, number]]) => void): void;

Defined in: nvdocument.ts:816

Sets the callback function to be called when opts properties change

Parameters​

ParameterType
callback(propertyName: keyof NVConfigOptions, newValue: | string | number | boolean | number[] | Float32Array | number[] | MouseEventConfig | TouchEventConfig | [[number, number], [number, number]], oldValue: | string | number | boolean | number[] | Float32Array | number[] | MouseEventConfig | TouchEventConfig | [[number, number], [number, number]]) => void

Returns​

void


loadFromFile()​

static loadFromFile(file: Blob): Promise<NVDocument>;

Defined in: nvdocument.ts:789

Parameters​

ParameterType
fileBlob

Returns​

Promise<NVDocument>


loadFromJSON()​

static loadFromJSON(data: DocumentData): Promise<NVDocument>;

Defined in: nvdocument.ts:809

Factory method to return an instance of NVDocument from JSON. Delegates the main parsing to NVSerializer, then applies NVDocument-specific post-processing (opts decode, scene defaults, clone measurements/angles).

Parameters​

ParameterType
dataDocumentData

Returns​

Promise<NVDocument>


loadFromUrl()​

static loadFromUrl(url: string): Promise<NVDocument>;

Defined in: nvdocument.ts:773

Factory method to return an instance of NVDocument from a URL

Parameters​

ParameterType
urlstring

Returns​

Promise<NVDocument>