Skip to main content

Class: NVDocument

Defined in: nvdocument.ts:441

NVDocument class (main)

Constructors

Constructor

new NVDocument(): NVDocument;

Defined in: nvdocument.ts:467

Returns

NVDocument

Properties

PropertyTypeDefault valueDefined in
completedAnglesCompletedAngle[][]nvdocument.ts:462
completedMeasurementsCompletedMeasurement[][]nvdocument.ts:461
dataDocumentDataundefinednvdocument.ts:442
drawBitmapUint8Arraynullnvdocument.ts:458
imageOptionsMapMap<any, any>undefinednvdocument.ts:459
meshDataObjects?( | NVMesh | NVConnectome)[]undefinednvdocument.ts:456
meshes( | NVMesh | NVConnectome)[][]nvdocument.ts:457
meshOptionsMapMap<any, any>undefinednvdocument.ts:460
sceneSceneundefinednvdocument.ts:453
volumesNVImage[][]nvdocument.ts:455

Accessors

customData

Get Signature

get customData(): string;

Defined in: nvdocument.ts:631

Returns

string

Set Signature

set customData(data: string): void;

Defined in: nvdocument.ts:635

Parameters
ParameterType
datastring
Returns

void


encodedDrawingBlob

Get Signature

get encodedDrawingBlob(): string;

Defined in: nvdocument.ts:595

Gets the base 64 encoded blob of the associated drawing

Returns

string


encodedImageBlobs

Get Signature

get encodedImageBlobs(): string[];

Defined in: nvdocument.ts:588

Gets the base 64 encoded blobs of associated images

Returns

string[]


imageOptionsArray

Get Signature

get imageOptionsArray(): ImageFromUrlOptions[];

Defined in: nvdocument.ts:581

Returns

ImageFromUrlOptions[]


labels

Get Signature

get labels(): NVLabel3D[];

Defined in: nvdocument.ts:620

Gets the 3D labels of the Niivue instance

Returns

NVLabel3D[]

Set Signature

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

Defined in: nvdocument.ts:627

Sets the 3D labels of the Niivue instance

Parameters
ParameterType
labelsNVLabel3D[]
Returns

void


opts

Get Signature

get opts(): NVConfigOptions;

Defined in: nvdocument.ts:602

Gets the options of the Niivue instance

Returns

NVConfigOptions

Set Signature

set opts(opts: NVConfigOptions): void;

Defined in: nvdocument.ts:612

Sets the options of the Niivue instance

Parameters
ParameterType
optsNVConfigOptions
Returns

void


previewImageDataURL

Get Signature

get previewImageDataURL(): string;

Defined in: nvdocument.ts:562

Gets preview image blob

Returns

string

dataURL of preview image

Set Signature

set previewImageDataURL(dataURL: string): void;

Defined in: nvdocument.ts:570

Sets preview image blob

Parameters
ParameterTypeDescription
dataURLstringencoded preview image
Returns

void


title

Get Signature

get title(): string;

Defined in: nvdocument.ts:554

Title of the document

Returns

string

Set Signature

set title(title: string): void;

Defined in: nvdocument.ts:577

Parameters
ParameterTypeDescription
titlestringtitle of document
Returns

void

Methods

addImageOptions()

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

Defined in: nvdocument.ts:656

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:746

Parameters

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

Returns

Promise<void>


fetchLinkedData()

fetchLinkedData(): Promise<void>;

Defined in: nvdocument.ts:700

Fetch any image data that is missing from this document.

Returns

Promise<void>


getImageOptions()

getImageOptions(image: NVImage): ImageFromUrlOptions;

Defined in: nvdocument.ts:733

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:642

Checks if document has an image by id

Parameters

ParameterType
imageNVImage

Returns

boolean


hasImageFromUrl()

hasImageFromUrl(url: string): boolean;

Defined in: nvdocument.ts:649

Checks if document has an image by url

Parameters

ParameterType
urlstring

Returns

boolean


json()

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

Defined in: nvdocument.ts:740

Serialise the document by delegating to NVSerializer.

Parameters

ParameterTypeDefault value
embedImagesbooleantrue
embedDrawingbooleantrue

Returns

ExportDocumentData


removeImage()

removeImage(image: NVImage): void;

Defined in: nvdocument.ts:686

Removes image from the document as well as its options

Parameters

ParameterType
imageNVImage

Returns

void


removeOptsChangeCallback()

removeOptsChangeCallback(): void;

Defined in: nvdocument.ts:809

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:801

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:774

Parameters

ParameterType
fileBlob

Returns

Promise<NVDocument>


loadFromJSON()

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

Defined in: nvdocument.ts:794

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:758

Factory method to return an instance of NVDocument from a URL

Parameters

ParameterType
urlstring

Returns

Promise<NVDocument>