Class: NVDocument
Defined in: nvdocument.ts:441
NVDocument class (main)
Constructors
Constructor
new NVDocument(): NVDocument;
Defined in: nvdocument.ts:467
Returns
NVDocument
Properties
| Property | Type | Default value | Defined in |
|---|---|---|---|
completedAngles | CompletedAngle[] | [] | nvdocument.ts:462 |
completedMeasurements | CompletedMeasurement[] | [] | nvdocument.ts:461 |
data | DocumentData | undefined | nvdocument.ts:442 |
drawBitmap | Uint8Array | null | nvdocument.ts:458 |
imageOptionsMap | Map<any, any> | undefined | nvdocument.ts:459 |
meshDataObjects? | ( | NVMesh | NVConnectome)[] | undefined | nvdocument.ts:456 |
meshes | ( | NVMesh | NVConnectome)[] | [] | nvdocument.ts:457 |
meshOptionsMap | Map<any, any> | undefined | nvdocument.ts:460 |
scene | Scene | undefined | nvdocument.ts:453 |
volumes | NVImage[] | [] | 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
| Parameter | Type |
|---|---|
data | string |
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
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
| Parameter | Type |
|---|---|
labels | NVLabel3D[] |
Returns
void
opts
Get Signature
get opts(): NVConfigOptions;
Defined in: nvdocument.ts:602
Gets the options of the Niivue instance
Returns
Set Signature
set opts(opts: NVConfigOptions): void;
Defined in: nvdocument.ts:612
Sets the options of the Niivue instance
Parameters
| Parameter | Type |
|---|---|
opts | NVConfigOptions |
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
| Parameter | Type | Description |
|---|---|---|
dataURL | string | encoded 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
| Parameter | Type | Description |
|---|---|---|
title | string | title 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
| Parameter | Type |
|---|---|
image | NVImage |
imageOptions | ImageFromUrlOptions |
Returns
void
download()
download(
fileName: string,
compress: boolean,
opts: object): Promise<void>;
Defined in: nvdocument.ts:746
Parameters
| Parameter | Type |
|---|---|
fileName | string |
compress | boolean |
opts | { embedImages: boolean; } |
opts.embedImages | boolean |
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
| Parameter | Type |
|---|---|
image | NVImage |
Returns
hasImage()
hasImage(image: NVImage): boolean;
Defined in: nvdocument.ts:642
Checks if document has an image by id
Parameters
| Parameter | Type |
|---|---|
image | NVImage |
Returns
boolean
hasImageFromUrl()
hasImageFromUrl(url: string): boolean;
Defined in: nvdocument.ts:649
Checks if document has an image by url
Parameters
| Parameter | Type |
|---|---|
url | string |
Returns
boolean
json()
json(embedImages: boolean, embedDrawing: boolean): ExportDocumentData;
Defined in: nvdocument.ts:740
Serialise the document by delegating to NVSerializer.
Parameters
| Parameter | Type | Default value |
|---|---|---|
embedImages | boolean | true |
embedDrawing | boolean | true |
Returns
removeImage()
removeImage(image: NVImage): void;
Defined in: nvdocument.ts:686
Removes image from the document as well as its options
Parameters
| Parameter | Type |
|---|---|
image | NVImage |
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
file | Blob |
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
| Parameter | Type |
|---|---|
data | DocumentData |
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
| Parameter | Type |
|---|---|
url | string |
Returns
Promise<NVDocument>