public class DicomImage extends java.lang.Object implements VolumeImage
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 |
getColSpacing() |
double |
getMaxIntensity() |
double |
getMinIntensity() |
int |
getNumChannels()
Number of channels per the voxel (e.g.
|
int |
getNumCols()
Number of columns in the image, corresponds to image x-axis
|
int |
getNumRows()
Number of rows in the image, corresponds to image y-axis
|
int |
getNumSlices()
Number of slices in the image, corresponds to image z-axis
|
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
|
double |
getRowSpacing()
Width of a row
|
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
|
double |
getSliceSpacing()
Spacing between slices, assuming constant fixed spacing
|
java.lang.String |
getTitle() |
RigidTransform3d |
getTransform()
Spatial location of the first slice
|
double |
getValue(int channel,
int col,
int row,
int slice)
Voxel raw value at a given column, row, slice
|
AffineTransform3d |
getVoxelTransform()
Transform for converting integer voxel locations into spatial locations
Assumes regular fixed slice spacing
|
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()
VolumeImage
getNumRows
in interface VolumeImage
public int getNumCols()
VolumeImage
getNumCols
in interface VolumeImage
public int getNumTimes()
public int getNumSlices()
VolumeImage
getNumSlices
in interface VolumeImage
public int size()
public double getRowSpacing()
public double getColSpacing()
public double getSliceSpacing()
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()
getVoxelTransform
in interface VolumeImage
public java.lang.String getTitle()
public double getValue(int channel, int col, int row, int slice)
VolumeImage
getValue
in interface VolumeImage
channel
- channel numbercol
- column indexrow
- row indexslice
- slice indexpublic int getNumChannels()
VolumeImage
getNumChannels
in interface VolumeImage