public interface ImageVolume
Modifier and Type | Field and Description |
---|---|
static String |
HEADER_FORMAT_ANALYZE |
static String |
HEADER_FORMAT_DES |
static String |
HEADER_FORMAT_DICOM_MR |
static String |
HEADER_FORMAT_DICOM_PET |
static String |
HEADER_FORMAT_DICOM_SC |
static String |
HEADER_FORMAT_NIFTI |
static int |
HEADER_TYPE_AVW
Deprecated.
|
static int |
HEADER_TYPE_NEMA
Deprecated.
|
static int |
HEADER_TYPE_NIFTI
Deprecated.
|
static int |
HEADER_TYPE_WRITABLE
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
long |
convertIndexToOffset(int xLoc,
int yLoc,
int zLoc)
Converts an XYZ index into an array offset based on image orientation.
|
Coordinate |
getCenter()
Returns the center coordinate.
|
int |
getCurrentSeriesPoint()
Returns the current series point.
|
ImageDescription |
getImageDescription()
Returns the ImageDescription.
|
ImageDimensions |
getImageDimensions()
Returns the ImageDimensions.
|
ImageRange |
getImageRange()
Returns the ImageRange.
|
ImageTransform |
getImageTransform()
Returns the ImageTransform.
|
ImageType |
getImageType()
Returns the ImageType.
|
String |
getLabel(int seriesIndex)
Returns the series label for the specified index.
|
long |
getNativeIntegerValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int seriesIndex)
Returns the native integer value at a specified image index.
|
String |
getOrientationString()
Returns a string representation of this volume's data orientation (e.g., XYZ+--).
|
Coordinate |
getOrigin()
Returns the origin voxel location relative to the left-anterior-superior edge of the image.
|
Coordinate |
getOriginNativeOffsets()
Returns the original offsets.
|
double |
getRawVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc)
Returns the raw (without data scaling) voxel value at a specified image index.
|
double |
getRawVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc)
Returns the raw (without data scaling) voxel value at a specified image index and timepoint.
|
double |
getRawVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc,
ImageTransform transform)
Returns the raw (without data scaling) voxel value at a specified image index and timepoint in transformed volume.
|
double |
getRawVoxelValueForOffset(long offset)
Returns the raw (without data scaling) voxel value at a specified offset.
|
ReadableHeader |
getReadableHeader()
Returns the ReadableHeader of this ImageVolume.
|
int |
getSeriesLength()
Returns the series length.
|
double |
getVolumeIntercept()
Returns the intercept value of the image [(0 - intercept) / scale] -- the value that should be on disk so that the screen value is 0.
|
double |
getVolumeInterceptScreen()
Returns the intercept value of the image [(intercept) / scale] -- if the value on disk is 0, this is the screen value.
|
VoxelDimensions |
getVoxelDimensions()
Returns the VoxelDimensions.
|
double |
getVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc)
Returns the voxel value at a specified coordinate in real world space.
|
double |
getVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc,
int tLoc)
Returns the voxel value at a specified coordinate and timepoint in real world space.
|
double |
getVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc,
int tLoc,
ImageTransform transform)
Returns the voxel value at a specified coordinate and timepoint in a transformed world space.
|
double |
getVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc)
Returns the voxel value at a specified image index.
|
double |
getVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc)
Returns the voxel value at a specified image index and timepoint.
|
double |
getVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc,
ImageTransform transform)
Returns the voxel value at a specified image index and timepoint in transformed volume.
|
double |
getVoxelValueForOffset(long offset)
Returns the voxel value at a specified offset.
|
ByteBuffer |
getWorkBuffer()
Deprecated.
|
ByteBuffer[] |
getWorkBuffers()
Returns the work buffer (a float buffer), for use with advanced methods.
|
int |
getXDim()
Returns x image dimension.
|
double |
getXSize()
Returns x voxel size.
|
int |
getYDim()
Returns y image dimension.
|
double |
getYSize()
Returns y voxel size.
|
int |
getZDim()
Returns z image dimension.
|
double |
getZSize()
Returns z voxel size.
|
void |
putVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc,
double value)
Deprecated.
|
void |
putVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc,
int tLoc,
double value)
Deprecated.
|
void |
putVoxelValueAtCoordinate(double xLoc,
double yLoc,
double zLoc,
int tLoc,
double value,
ImageTransform transform)
Deprecated.
|
void |
putVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
double value)
Replaces a voxel value at a specified image index.
|
void |
putVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc,
double value)
Replaces a voxel value at a specified image index and timepoint.
|
void |
putVoxelValueAtIndex(int xLoc,
int yLoc,
int zLoc,
int tLoc,
double value,
ImageTransform transform)
Deprecated.
|
void |
putVoxelValueAtOffset(int offset,
double value)
Replaces a voxel value at a specified offset.
|
File |
readFiles(File file)
Deprecated.
|
URI |
readFiles(URI file)
Reads a file into an ImageVolume.
|
URI |
readFiles(URI file,
boolean readOnly)
Reads a file into an ImageVolume.
|
void |
setCurrentSeriesPoint(int point)
Sets the current series point.
|
void |
setForceLoadInThead(boolean forceLoadInThread)
Set to true to force loading this image in the current thread, instead of a background thread.
|
void |
setImageAsDirty()
Flag the image as dirty (needs to be saved).
|
void |
setOrigin(Coordinate origin)
Sets the origin of this ImageVolume.
|
void |
setReadOnly(boolean readOnly)
Set this image as read-only.
|
String |
toString()
Returns a string representation of this ImageVolume.
|
void |
volumeOperationCompleted()
Notifies volume that an image operation has been performed.
|
void |
volumeOperationCompleted(String des)
Notifies volume that an image operation has been performed.
|
void |
writeFilesAs(File headerFile,
int headerType,
String otherFormatName,
ImageType it,
boolean applyDataScales,
boolean fitPrecision)
Deprecated.
|
void |
writeFilesAs(File headerFile,
String formatName,
ImageType it,
String orientation,
boolean applyDataScales,
boolean fitPrecision)
Write file.
|
@Deprecated static final int HEADER_TYPE_AVW
@Deprecated static final int HEADER_TYPE_NEMA
@Deprecated static final int HEADER_TYPE_NIFTI
@Deprecated static final int HEADER_TYPE_WRITABLE
static final String HEADER_FORMAT_ANALYZE
static final String HEADER_FORMAT_DES
static final String HEADER_FORMAT_DICOM_MR
static final String HEADER_FORMAT_DICOM_PET
static final String HEADER_FORMAT_DICOM_SC
static final String HEADER_FORMAT_NIFTI
long convertIndexToOffset(int xLoc, int yLoc, int zLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexCoordinate getCenter()
int getCurrentSeriesPoint()
ImageDescription getImageDescription()
ImageDimensions getImageDimensions()
ImageRange getImageRange()
ImageTransform getImageTransform()
ImageType getImageType()
String getLabel(int seriesIndex)
seriesIndex
- the series indexlong getNativeIntegerValueAtIndex(int xLoc, int yLoc, int zLoc, int seriesIndex)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexseriesIndex
- series indexString getOrientationString()
Coordinate getOrigin()
Coordinate getOriginNativeOffsets()
double getRawVoxelValueAtIndex(int xLoc, int yLoc, int zLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexdouble getRawVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointdouble getRawVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc, ImageTransform transform)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointtransform
- image transform to use.double getRawVoxelValueForOffset(long offset)
offset
- image array offsetReadableHeader getReadableHeader()
int getSeriesLength()
double getVolumeIntercept()
double getVolumeInterceptScreen()
VoxelDimensions getVoxelDimensions()
double getVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexdouble getVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc, int tLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointdouble getVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc, int tLoc, ImageTransform transform)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointtransform
- world space transform to use.double getVoxelValueAtIndex(int xLoc, int yLoc, int zLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexdouble getVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointdouble getVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc, ImageTransform transform)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointtransform
- transform to apply to the imagedouble getVoxelValueForOffset(long offset)
offset
- image array offset@Deprecated ByteBuffer getWorkBuffer()
ByteBuffer[] getWorkBuffers()
int getXDim()
double getXSize()
int getYDim()
double getYSize()
int getZDim()
double getZSize()
@Deprecated void putVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc, double value)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexvalue
- replacement value@Deprecated void putVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc, int tLoc, double value)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointvalue
- replacement value@Deprecated void putVoxelValueAtCoordinate(double xLoc, double yLoc, double zLoc, int tLoc, double value, ImageTransform transform)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointtransform
- world space transform to usevalue
- replacement valuevoid putVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, double value)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indexvalue
- replacement valuevoid putVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc, double value)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointvalue
- replacement value@Deprecated void putVoxelValueAtIndex(int xLoc, int yLoc, int zLoc, int tLoc, double value, ImageTransform transform)
xLoc
- X indexyLoc
- Y indexzLoc
- Z indextLoc
- timepointvalue
- replacement valuetransform
- image transform to usevoid putVoxelValueAtOffset(int offset, double value)
offset
- image array offsetvalue
- replacement value@Deprecated File readFiles(File file) throws InvalidHeaderException, Exception
file
- a file to readInvalidHeaderException
- invalid header exceptionException
- exceptionURI readFiles(URI file) throws InvalidHeaderException, Exception
file
- a file to readInvalidHeaderException
- invalid header exceptionException
- exceptionURI readFiles(URI file, boolean readOnly) throws InvalidHeaderException, Exception
file
- a file to readreadOnly
- true to load in read-only mode (will use less memory if datatype is byte or short)InvalidHeaderException
- invalid header exceptionException
- exceptionvoid setCurrentSeriesPoint(int point)
point
- the current series pointvoid setForceLoadInThead(boolean forceLoadInThread)
forceLoadInThread
- true to force loading this image in the current thread, false otherwisevoid setImageAsDirty()
void setOrigin(Coordinate origin)
origin
- the new originvoid setReadOnly(boolean readOnly)
readOnly
- true to set image as read-only, false otherwiseString toString()
void volumeOperationCompleted()
void volumeOperationCompleted(String des)
des
- a short description of the operation@Deprecated void writeFilesAs(File headerFile, int headerType, String otherFormatName, ImageType it, boolean applyDataScales, boolean fitPrecision) throws Exception
headerFile
- file to saveheaderType
- header type (see header type constants such as ImageVolume.HEADER_TYPE_NIFTI)otherFormatName
- if headerType is ImageVolume.HEADER_TYPE_WRITABLE, then otherFormatName must equal a loaded WritableHeader plugin nameit
- the ImageType of the output imageapplyDataScales
- true to multiply data scales into the image, false to leave data scale information in headerfitPrecision
- true to fit the image data range to the data type range, false otherwiseException
- exceptionvoid writeFilesAs(File headerFile, String formatName, ImageType it, String orientation, boolean applyDataScales, boolean fitPrecision) throws Exception
headerFile
- file to saveformatName
- string representation of header format (e.g., HEADER_FORMAT_NIFTI)it
- the ImageType of the output imageorientation
- the orientation string (e.g., "XYZ+++") or null to use currentapplyDataScales
- true to multiply data scales into the image, false to leave data scale information in headerfitPrecision
- true to fit the image data range to the data type range, false otherwiseException
- exception