public class DicomImage
extends java.lang.Object
Constructor and Description |
---|
DicomImage(java.lang.String title,
DicomSlice firstSlice)
Creates a new DICOM image, extracting common header information from the
provided first slice.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addSlice(DicomSlice slice)
Appends a slice to the current DICOM image set.
|
boolean |
compatible(DicomSlice slice)
Checks whether the provided slice has compatible image dimensions with the
the current image set
|
void |
complete()
Finalize DICOM image construction
|
void |
ensureCapacity(int cap)
Ensure a minimum capacity for number of slices
|
double |
getMaxIntensity() |
double |
getMinIntensity() |
int |
getNumCols() |
int |
getNumRows() |
int |
getNumSlices() |
int |
getNumTimes() |
int |
getPixels(int x,
int y,
int z,
int dx,
int dy,
int dz,
int nx,
int ny,
int nz,
DicomPixelBuffer.PixelType type,
int scanline,
int pageline,
DicomPixelInterpolator interp,
java.nio.ByteBuffer pixels)
Fills a buffer with pixel values from the image
|
void |
getPixels(int x,
int y,
int z,
int dx,
int dy,
int dz,
int nx,
int ny,
int nz,
DicomPixelBuffer.PixelType type,
int scanline,
int pageline,
DicomPixelInterpolator interp,
int[] pixels,
int offset)
Fills a buffer with pixel values from the image
|
int |
getPixels(int x,
int y,
int z,
int dx,
int dy,
int dz,
int nx,
int ny,
int nz,
int time,
DicomPixelBuffer.PixelType type,
int scanline,
int pageline,
DicomPixelInterpolator interp,
java.nio.ByteBuffer pixels)
Fills a buffer with pixel values from the image
|
void |
getPixels(int x,
int y,
int z,
int dx,
int dy,
int dz,
int nx,
int ny,
int nz,
int time,
DicomPixelBuffer.PixelType type,
int scanline,
int pageline,
DicomPixelInterpolator interp,
int[] pixels,
int offset)
Fills a buffer with pixel values from the image
|
DicomPixelBuffer.PixelType |
getPixelType()
Determines the type of pixels stored in the image
|
DicomSlice |
getSlice(int slice)
Extracts a DICOM slice at a given index
|
DicomSlice |
getSlice(int timeIdx,
int slice)
Extracts a DICOM slice at a given time point and slice index
|
java.lang.String |
getTitle() |
RigidTransform3d |
getTransform()
Spatial location of the first slice
|
AffineTransform3d |
getVoxelTransform()
Transform for converting integer voxel locations into spatial locations
|
int |
size() |
java.lang.String |
toString() |
void |
trim()
Trims the array of slices to match the number currently contained in the image
|
public DicomImage(java.lang.String title, DicomSlice firstSlice)
title
- title to use for DICOM imagefirstSlice
- the first slice, which determines header informationpublic boolean compatible(DicomSlice slice)
slice
- new slice to verifypublic boolean addSlice(DicomSlice slice)
public void ensureCapacity(int cap)
cap
- minimum number of slices to supportpublic void trim()
public void complete()
public DicomPixelBuffer.PixelType getPixelType()
public java.lang.String toString()
toString
in class java.lang.Object
public int getPixels(int x, int y, int z, int dx, int dy, int dz, int nx, int ny, int nz, int time, DicomPixelBuffer.PixelType type, int scanline, int pageline, DicomPixelInterpolator interp, java.nio.ByteBuffer pixels)
x
- starting x voxel positiony
- starting y voxel positionz
- starting z voxel positiondx
- voxel step in xdy
- voxel step in ydz
- voxel step in znx
- number of voxels in x directionny
- number of voxels in y directionnz
- number of voxels in z directiontime
- time indextype
- pixel output typescanline
- offset between x-y rowspageline
- offset between slicesinterp
- pixel value interpolator (shifts/scales values to appropriate range)pixels
- pixel buffer to fillpublic int getPixels(int x, int y, int z, int dx, int dy, int dz, int nx, int ny, int nz, DicomPixelBuffer.PixelType type, int scanline, int pageline, DicomPixelInterpolator interp, java.nio.ByteBuffer pixels)
x
- starting x voxel positiony
- starting y voxel positionz
- starting z voxel positiondx
- voxel step in xdy
- voxel step in ydz
- voxel step in znx
- number of voxels in x directionny
- number of voxels in y directionnz
- number of voxels in z directiontype
- output pixel typescanline
- xy row offsetpageline
- offset between slicesinterp
- pixel value interpolator (shifts/scales values to appropriate range)pixels
- pixel buffer to fillpublic void getPixels(int x, int y, int z, int dx, int dy, int dz, int nx, int ny, int nz, int time, DicomPixelBuffer.PixelType type, int scanline, int pageline, DicomPixelInterpolator interp, int[] pixels, int offset)
x
- starting x voxel positiony
- starting y voxel positionz
- starting z voxel positiondx
- voxel step in xdy
- voxel step in ydz
- voxel step in znx
- number of voxels in x directionny
- number of voxels in y directionnz
- number of voxels in z directiontime
- time indextype
- pixel output typescanline
- offset between x-y rowspageline
- offset between slicesinterp
- pixel value interpolator (shifts/scales values to appropriate range)pixels
- pixel buffer to filloffset
- offset in pixel buffer to populatepublic void getPixels(int x, int y, int z, int dx, int dy, int dz, int nx, int ny, int nz, DicomPixelBuffer.PixelType type, int scanline, int pageline, DicomPixelInterpolator interp, int[] pixels, int offset)
x
- starting x voxel positiony
- starting y voxel positionz
- starting z voxel positiondx
- voxel step in xdy
- voxel step in ydz
- voxel step in znx
- number of voxels in x directionny
- number of voxels in y directionnz
- number of voxels in z directiontype
- output pixel typescanline
- xy row offsetpageline
- offset between slicesinterp
- pixel value interpolator (shifts/scales values to appropriate range)pixels
- pixel buffer to filloffset
- offset in pixel buffer to populatepublic int getNumRows()
public int getNumCols()
public int getNumTimes()
public int getNumSlices()
public int size()
public double getMaxIntensity()
public double getMinIntensity()
public DicomSlice getSlice(int slice)
slice
- index of slicepublic DicomSlice getSlice(int timeIdx, int slice)
timeIdx
- time point (identifies 3D stack)slice
- slice index (identifies z position in stack)public RigidTransform3d getTransform()
public AffineTransform3d getVoxelTransform()
public java.lang.String getTitle()