Capítulo 617 de 859

Chapter 617: Volume

Core Idea

This class had been written to handle the output of the NRRDLoader. It contains a volume of data and information about it. For now it only handles 3 dimensional data.

Key Concepts

  • RASDimensions : Array.<number>: This array holds the dimensions of the volume in the RAS space
  • axisOrder : Array.<string>: The order of the Axis dictated by the NRRD header
  • data : TypedArray: The data of the volume.
  • inverseMatrix : Martrix3: The RAS to IJK matrix.
  • lowerThreshold : number: The voxels with values under this threshold won't appear in the slices. If changed, geometryNeedsUpdate is automatically set to true on all…
  • matrix : Martrix3: The IJK to RAS matrix.
  • offset : Array.<number>: Offset of the volume in the RAS coordinate system
  • segmentation : boolean: Whether to use segmentation mode or not. It can load 16-bits nrrds correctly.
  • sliceList : Array.<VolumeSlice>: The list of all the slices associated to this volume
  • spacing : Array.<number>: Spacing to apply to the volume from IJK to RAS coordinate system

Code Examples

import { Volume } from 'three/addons/misc/Volume.js';
  • What it demonstrates: Typical usage of Volume.

Reference Tables

Constructor

Signature
new Volume( xLength : number, yLength : number, zLength : number, type : string, arrayBuffer : ArrayBuffer )

Properties

PropertyDescription
.RASDimensions : Array.<number>This array holds the dimensions of the volume in the RAS space
.axisOrder : Array.<string>The order of the Axis dictated by the NRRD header
.data : TypedArrayThe data of the volume.
.inverseMatrix : Martrix3The RAS to IJK matrix.
.lowerThreshold : numberThe voxels with values under this threshold won't appear in the slices. If changed, geometryNeedsUpdate is automatically set to true on all the slices associated to this volume.
.matrix : Martrix3The IJK to RAS matrix.
.offset : Array.<number>Offset of the volume in the RAS coordinate system
.segmentation : booleanWhether to use segmentation mode or not. It can load 16-bits nrrds correctly.
.sliceList : Array.<VolumeSlice>The list of all the slices associated to this volume
.spacing : Array.<number>Spacing to apply to the volume from IJK to RAS coordinate system
.upperThreshold : numberThe voxels with values over this threshold won't appear in the slices. If changed, geometryNeedsUpdate is automatically set to true on all the slices associated to this volume
.xLength : numberWidth of the volume in the IJK coordinate system.
.yLength : numberHeight of the volume in the IJK coordinate system.
.zLength : numberDepth of the volume in the IJK coordinate system.

Methods

MethodDescription
.access( i : number, j : number, k : number ) : numberCompute the index in the data array corresponding to the given coordinates in IJK system.
.computeMinMax() : Array.<number>Compute the minimum and the maximum of the data in the volume.
`.extractPerpendicularPlane( axis : 'x''y'
`.extractSlice( axis : 'x''y'
.getData( i : number, j : number, k : number ) : numberShortcut for data[access(i,j,k)].
.map( functionToMap : function, context : Object ) : VolumeApply a function to all the voxels, be careful, the value will be replaced.
.repaintAllSlices() : VolumeCall repaint on all the slices extracted from this volume.
.reverseAccess( index : number ) : Array.<number>Retrieve the IJK coordinates of the voxel corresponding of the given index in the data.

Key Takeaways

  1. Most relevant properties: RASDimensions, axisOrder, data, inverseMatrix.
  2. Key methods: access, computeMinMax, extractPerpendicularPlane, extractSlice.

Connects To