public class SbImageDataAccessor extends Inventor
SoImageDataAdapter
.
Class used to retrieve data from an SoImageDataAdapter
.
To create an SbImageDataAccessor
, call the getDataAccessor() method on the SoImageDataAdaptor.
To get an SoMemoryDataAdapter
containing the data from a region, call copyRegion()
with an instance of a class implementing the Region
interface. You can use the predefined Region
class SubVolumeRegion
and the helper methods, e.g. createSliceRegion()
, for convenience. Note that the returned data are stored in CPU memory. This class does not aim to support out of core access. Make sure you have enough free memory when requesting data.
See also:
SoImageDataAdapter
, SbImageDataVoxel
Modifier and Type | Class and Description |
---|---|
static interface |
SbImageDataAccessor.Region
A region must be an ordered set with a first voxel and for each voxel a next voxel, else we cannot associate a buffer to this region.
|
static class |
SbImageDataAccessor.SubVolumeRegion
Region representing a 3D box. |
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
SoMemoryDataAdapter |
copyRegion(SbImageDataAccessor.Region region)
Returns an
SoMemoryDataAdapter corresponding to the requested region. |
SoMemoryDataAdapter |
copyRegion(SbImageDataAccessor.Region region,
SbChannelList channels)
Returns an
SoMemoryDataAdapter corresponding to the requested region. |
static SbImageDataAccessor.SubVolumeRegion |
createFullRegion(SoImageDataAdapter image)
Helper to create a
SubVolumeRegion corresponding to the whole region of the given image. |
static SbImageDataAccessor.SubVolumeRegion |
createSliceRegion(SoImageDataAdapter image,
int sliceNumber)
Helper to create a
SubVolumeRegion corresponding to one slice of the given image. |
boolean |
getColumn(SoCpuBufferObject values,
int x)
Calls getColumn(values, x, (int)0, (int)0, (int)0).
|
boolean |
getColumn(SoCpuBufferObject values,
int x,
int z)
Calls getColumn(values, x, z, (int)0, (int)0).
|
boolean |
getColumn(SoCpuBufferObject values,
int x,
int z,
int t)
Calls getColumn(values, x, z, t, (int)0).
|
boolean |
getColumn(SoCpuBufferObject values,
int x,
int z,
int t,
int c)
Get values of the full column at specified coordinates.
|
SoImageDataAdapter |
getImageAdapter()
Returns the
SoImageDataAdapter associated with this DataAccessor. |
boolean |
getRow(SoCpuBufferObject values,
int y)
Calls getRow(values, y, (int)0, (int)0, (int)0).
|
boolean |
getRow(SoCpuBufferObject values,
int y,
int z)
Calls getRow(values, y, z, (int)0, (int)0).
|
boolean |
getRow(SoCpuBufferObject values,
int y,
int z,
int t)
Calls getRow(values, y, z, t, (int)0).
|
boolean |
getRow(SoCpuBufferObject values,
int y,
int z,
int t,
int c)
Get values of the full row at specified coordinates.
|
double |
getVoxel(int x,
int y)
Calls getVoxel(x, y, (int)0, (int)0, (int)0).
|
double |
getVoxel(int x,
int y,
int z)
Calls getVoxel(x, y, z, (int)0, (int)0).
|
double |
getVoxel(int x,
int y,
int z,
int t)
Calls getVoxel(x, y, z, t, (int)0).
|
double |
getVoxel(int x,
int y,
int z,
int t,
int c)
Returns value of voxel at specified position.
|
boolean |
setColumn(java.util.Collection<java.lang.Double> values,
int x)
Calls setColumn(values, x, (int)0, (int)0, (int)0).
|
boolean |
setColumn(java.util.Collection<java.lang.Double> values,
int x,
int z)
Calls setColumn(values, x, z, (int)0, (int)0).
|
boolean |
setColumn(java.util.Collection<java.lang.Double> values,
int x,
int z,
int t)
Calls setColumn(values, x, z, t, (int)0).
|
boolean |
setColumn(java.util.Collection<java.lang.Double> values,
int x,
int z,
int t,
int c)
Alternate method to
setColumn( const SoCpuBufferObject* values, int x, int z, int t, int c ) . |
boolean |
setColumn(SoCpuBufferObject values,
int x)
Calls setColumn(values, x, (int)0, (int)0, (int)0).
|
boolean |
setColumn(SoCpuBufferObject values,
int x,
int z)
Calls setColumn(values, x, z, (int)0, (int)0).
|
boolean |
setColumn(SoCpuBufferObject values,
int x,
int z,
int t)
Calls setColumn(values, x, z, t, (int)0).
|
boolean |
setColumn(SoCpuBufferObject values,
int x,
int z,
int t,
int c)
Set values to a column at specified coordinates.
|
boolean |
setRow(java.util.Collection<java.lang.Double> values,
int y)
Calls setRow(values, y, (int)0, (int)0, (int)0).
|
boolean |
setRow(java.util.Collection<java.lang.Double> values,
int y,
int z)
Calls setRow(values, y, z, (int)0, (int)0).
|
boolean |
setRow(java.util.Collection<java.lang.Double> values,
int y,
int z,
int t)
Calls setRow(values, y, z, t, (int)0).
|
boolean |
setRow(java.util.Collection<java.lang.Double> values,
int y,
int z,
int t,
int c)
Alternate method to
setRow( const SoCpuBufferObject* values, int y, int z, int t, int c ) . |
boolean |
setRow(SoCpuBufferObject values,
int y)
Calls setRow(values, y, (int)0, (int)0, (int)0).
|
boolean |
setRow(SoCpuBufferObject values,
int y,
int z)
Calls setRow(values, y, z, (int)0, (int)0).
|
boolean |
setRow(SoCpuBufferObject values,
int y,
int z,
int t)
Calls setRow(values, y, z, t, (int)0).
|
boolean |
setRow(SoCpuBufferObject values,
int y,
int z,
int t,
int c)
Set values to a row at specified coordinates.
|
boolean |
setVoxel(double value,
int x,
int y)
Calls setVoxel(value, x, y, (int)0, (int)0, (int)0).
|
boolean |
setVoxel(double value,
int x,
int y,
int z)
Calls setVoxel(value, x, y, z, (int)0, (int)0).
|
boolean |
setVoxel(double value,
int x,
int y,
int z,
int t)
Calls setVoxel(value, x, y, z, t, (int)0).
|
boolean |
setVoxel(double value,
int x,
int y,
int z,
int t,
int c)
Set the value of voxel at specified coordinates.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public boolean setRow(SoCpuBufferObject values, int y, int z)
public boolean setRow(SoCpuBufferObject values, int y)
public boolean setRow(SoCpuBufferObject values, int y, int z, int t)
public boolean setRow(java.util.Collection<java.lang.Double> values, int y, int z)
public boolean setRow(java.util.Collection<java.lang.Double> values, int y)
public boolean setVoxel(double value, int x, int y, int z, int t)
public boolean setVoxel(double value, int x, int y, int z)
public boolean getRow(SoCpuBufferObject values, int y)
public boolean getRow(SoCpuBufferObject values, int y, int z, int t)
public boolean getRow(SoCpuBufferObject values, int y, int z)
public boolean setColumn(SoCpuBufferObject values, int x, int z, int t)
public boolean setColumn(SoCpuBufferObject values, int x, int z)
public boolean setColumn(java.util.Collection<java.lang.Double> values, int x)
public boolean setColumn(java.util.Collection<java.lang.Double> values, int x, int z, int t)
public boolean setColumn(java.util.Collection<java.lang.Double> values, int x, int z)
public boolean getColumn(SoCpuBufferObject values, int x)
public boolean setRow(java.util.Collection<java.lang.Double> values, int y, int z, int t)
public boolean getColumn(SoCpuBufferObject values, int x, int z)
public boolean setColumn(SoCpuBufferObject values, int x)
public boolean getColumn(SoCpuBufferObject values, int x, int z, int t)
public double getVoxel(int x, int y)
public boolean setVoxel(double value, int x, int y)
public double getVoxel(int x, int y, int z, int t)
public double getVoxel(int x, int y, int z)
public SoMemoryDataAdapter copyRegion(SbImageDataAccessor.Region region)
SoMemoryDataAdapter
corresponding to the requested region.
The data are copied and can be accessed in read/write. Returned buffer data are interleaved, i.e. if request for RGB buffer, data will be RGBRGBRGB... Data are then organized line by line, slice by slice, volume by volume. Ptr[0] is 1st channel of 1st voxel of 1st line of 1st slice of 1st volume. Ptr[nbChannel * regionWidth] is 1st channel of 1st voxel of 2nd line of 1st volume, and so on. The returned buffer is the requested region with all channels. There is no intersection with image extent or image available channels. Any data outside of image are considered to be zeros.public boolean setRow(java.util.Collection<java.lang.Double> values, int y, int z, int t, int c)
setRow( const SoCpuBufferObject* values, int y, int z, int t, int c )
.public SoMemoryDataAdapter copyRegion(SbImageDataAccessor.Region region, SbChannelList channels)
SoMemoryDataAdapter
corresponding to the requested region.
The data are copied and can be accessed in read/write. Returned buffer data are interleaved, i.e. if request for RGB buffer, data will be RGBRGBRGB... Data are then organized line by line, slice by slice, volume by volume. Ptr[0] is 1st channel of 1st voxel of 1st line of 1st slice of 1st volume. Ptr[nbChannel * regionWidth] is 1st channel of 1st voxel of 2nd line of 1st volume, and so on. The returned buffer is the intersection of requested region and requested channels. There is no intersection with image extent or image available channels. Any data outside of image are considered to be zeros.public boolean setColumn(SoCpuBufferObject values, int x, int z, int t, int c)
values
- to set one component of the specified column as an array of double. SoCpuBufferObject
cannot be NULL. If its size does not match the required one, false is returned.
x
- column coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.
public boolean setColumn(java.util.Collection<java.lang.Double> values, int x, int z, int t, int c)
setColumn( const SoCpuBufferObject* values, int x, int z, int t, int c )
.public boolean getColumn(SoCpuBufferObject values, int x, int z, int t, int c)
values
- a buffer to retrieve voxel values of one component at specified column position as an array of double. SoCpuBufferObject
cannot be NULL. If its size does not match the required one, it is resized.
x
- column coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.
public boolean setRow(SoCpuBufferObject values, int y, int z, int t, int c)
values
- to set one component of the specified row as an array of double. SoCpuBufferObject
cannot be NULL. If its size does not match the required one, false is returned.
y
- row coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.
public static SbImageDataAccessor.SubVolumeRegion createSliceRegion(SoImageDataAdapter image, int sliceNumber)
SubVolumeRegion
corresponding to one slice of the given image.public static SbImageDataAccessor.SubVolumeRegion createFullRegion(SoImageDataAdapter image)
SubVolumeRegion
corresponding to the whole region of the given image.public double getVoxel(int x, int y, int z, int t, int c)
x
- column coordinate
y
- row coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.public SoImageDataAdapter getImageAdapter()
SoImageDataAdapter
associated with this DataAccessor.public boolean getRow(SoCpuBufferObject values, int y, int z, int t, int c)
values
- a buffer to retrieve voxel values of one component at specified row position as an array of double. SoCpuBufferObject
cannot be NULL. If its size does not match the required one, it is resized.
y
- row coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.
public boolean setVoxel(double value, int x, int y, int z, int t, int c)
value
- to set one component at specified position
x
- column coordinate
y
- row coordinate
z
- depth coordinate. Default is 0. Useful for 2D images.
t
- time coordinate. Default is 0.
c
- component number. Default is 0.
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com