Click or drag to resize
SoVolumeDataGetHistogram Method
Returns the histogram of the volume data. Returns null reference if the requested data is not available.

Namespace: OIV.VolumeViz.Nodes
Assembly: OIV.VolumeViz (in OIV.VolumeViz.dll) Version: 2024.2.2.0 (10.16.2.0)
Syntax
public long[] GetHistogram()

Return Value

Type: Int64
Remarks

It has the same behavior as for VolumeViz 4.0 except if VolumeViz is using a reader that has implemented the getHistogram method of SoVolumeReader. If the histogram is stored in the file, this method will be very fast.

Notes:

  • For byte data, VolumeViz computes a histogram with 256 bins, spanning the range of byte values (0..255 or -128..127).
  • For integer data types larger than 1 byte, VolumeViz computes a histogram with 65536 bins, spanning the range of the data type. For example, if the volume contains signed_short data, the histogram has 65536 bins spanning the range -32768..32767.
  • For float data, VolumeViz computes a histogram with 65536 bins, spanning the specified data range or -20000 to 20000 if no range was specified. The data range can be specified when converting to LDM format, using the converter's "-r" option. Otherwise it is not currently possible to specify the data range for the histogram without using SoVolumeHistogram directly.
  • For all data types larger than one byte, only the bins that are inside the actual range of the data are interesting. For example a signed_short data set might range from -2048 to 5000. In this case the first non-empty bin is number 30720 (out of 65536 total bins) and the last non-empty bin is number 37827.
  • To compute a histogram (for example with different parameters or for a subvolume) use the SoVolumeHistogram class.

Warnings:

This method returns a reference to VolumeViz internal storage. Do not modify this memory.This method might force VolumeViz to load the entire data set if the volume reader does not respond to the getHistogram query. Normally for an LDM format data set, the histogram values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, VolumeViz will load the entire data set to compute these values. For a large data set this may take a long time.
See Also