public class NiftiTextureContent extends ReferenceCountedBase implements TextureContent
Modifier and Type | Class and Description |
---|---|
static class |
NiftiTextureContent.ImagePanel
Simple class to help debug storage
|
TextureContent.ContentFormat
Modifier and Type | Field and Description |
---|---|
static int |
COL_ROW_PLANE |
static int |
COL_SLICE_PLANE |
static int |
ROW_SLICE_PLANE |
Constructor and Description |
---|
NiftiTextureContent(NiftiImage image,
NiftiPixelGenerator voxelator) |
Modifier and Type | Method and Description |
---|---|
NiftiTextureContent |
acquire()
Signal the resource that something is holding a reference to it.
|
java.awt.image.BufferedImage |
createImage() |
void |
dispose() |
int |
getColumn() |
void |
getData(java.nio.ByteBuffer out)
Get raw byte data of content, rasterized in
row-major form, with (0,0) in the bottom-left
corner.
|
void |
getData(Rectangle rect,
java.nio.ByteBuffer out)
Get raw byte data for a region, rasterized in row-major
form with (0,0) in the bottom-left corner.
|
Rectangle |
getDirty()
The portion of the texture that has been modified (marked "dirty")
|
TextureContent.ContentFormat |
getFormat()
Format of data returned by
TextureContent.getData(java.nio.ByteBuffer) |
int |
getHeight()
Number of pixels across height in content
|
java.lang.Object |
getKey()
A key for referring to this texture.
|
NiftiPixelGenerator |
getPixelGenerator() |
int |
getPixelSize()
Size of pixels in bytes
|
int |
getRow() |
int |
getSlice() |
double |
getT()
Normalized time to use
|
Point2d[] |
getTextureCoordinates(int plane)
Texture coordinates for a given plane (
COL_ROW_PLANE ,
ROW_SLICE_PLANE , or COL_SLICE_PLANE ), starting with the
bottom-left corner and working around clockwise. |
int |
getTime() |
int |
getWidth()
Number of pixels across width in content
|
double |
getX()
Normalized row-slice plane position within volume
|
double |
getY()
Normalized col-slice plane position within volume
|
double |
getZ()
Normalized col-row plane position within volume
|
boolean |
isDirty()
All or part of the texture has been marked as "dirty" (i.e.
|
void |
markClean()
Mark the entire texture as being clean
|
void |
prerender()
Prepares texture content for rendering
|
void |
setColumn(int c)
column to use for the row-slice plane
|
void |
setPixelGenerator(NiftiPixelGenerator voxelator) |
void |
setRow(int r)
Row to use for the column-slice plane
|
void |
setSlice(int s)
Slice to use on col-row plane
|
void |
setT(double t)
Normalized time to use
|
void |
setTime(int t)
For 4D DICOM images, sets the time index for all slices
|
void |
setX(double x)
Normalized row-slice plane position within volume
|
void |
setY(double y)
Normalized col-slice plane position within volume
|
void |
setZ(double z)
Normalized col-row plane position within volume
|
void |
showTexture() |
acquireAndCount, getReferenceCount, release, releaseAndCount
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquireAndCount, getReferenceCount, release, releaseAndCount
public static final int COL_ROW_PLANE
public static final int COL_SLICE_PLANE
public static final int ROW_SLICE_PLANE
public NiftiTextureContent(NiftiImage image, NiftiPixelGenerator voxelator)
public void setColumn(int c)
c
- column indexpublic int getColumn()
public void setRow(int r)
r
- row indexpublic int getRow()
public void setSlice(int s)
s
- slice indexpublic int getSlice()
public void setTime(int t)
t
- time indexpublic int getTime()
public void setX(double x)
x
- normalized column [0,1]public double getX()
public void setY(double y)
y
- normalized row [0,1]public double getY()
public void setZ(double z)
z
- normalized slice [0,1]public double getZ()
public void setT(double t)
t
- normalized time [0,1]public double getT()
public int getWidth()
TextureContent
getWidth
in interface TextureContent
public int getHeight()
TextureContent
getHeight
in interface TextureContent
public Point2d[] getTextureCoordinates(int plane)
COL_ROW_PLANE
,
ROW_SLICE_PLANE
, or COL_SLICE_PLANE
), starting with the
bottom-left corner and working around clockwise.plane
- plane index to compute coordinates ofpublic int getPixelSize()
TextureContent
getPixelSize
in interface TextureContent
public void setPixelGenerator(NiftiPixelGenerator voxelator)
public NiftiPixelGenerator getPixelGenerator()
public void prerender()
public void getData(java.nio.ByteBuffer out)
TextureContent
getData
in interface TextureContent
public void getData(Rectangle rect, java.nio.ByteBuffer out)
TextureContent
getData
in interface TextureContent
rect
- rectangular region to acquire data forout
- buffer to fillpublic void showTexture()
public java.awt.image.BufferedImage createImage()
public boolean isDirty()
TextureContent
isDirty
in interface TextureContent
public Rectangle getDirty()
TextureContent
getDirty
in interface TextureContent
public void markClean()
TextureContent
markClean
in interface TextureContent
public TextureContent.ContentFormat getFormat()
TextureContent
TextureContent.getData(java.nio.ByteBuffer)
getFormat
in interface TextureContent
TextureContent.getData(java.nio.ByteBuffer)
public java.lang.Object getKey()
TextureContent
getKey
in interface TextureContent
public NiftiTextureContent acquire()
ReferenceCounted
acquire
in interface TextureContent
acquire
in interface ReferenceCounted
acquire
in class ReferenceCountedBase
public void dispose()