|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.multisliceimage.MultiSliceImage
public abstract class MultiSliceImage
An abstract representation of a multi-dimensional image. This class cannot be instantiated, and sub-classes must implement the abstract methods defined here, and those defined in LoadableImage.
| Field Summary | |
|---|---|
static java.lang.String |
AUDIT_TRAIL_ACTION_TEXT
A String used when composing audit trail information. |
static java.lang.String |
BIRTH_DATE_NAME
The information field name that is written into image headers to indicate the patient's birth date. |
static java.lang.String |
COLOUR_MAPPING_NAME
The information field name that is written into image headers to indicate the colour mapping. |
static java.lang.Class |
DEFAULT_IMAGE_CLASS
The default image class to work with, if the user has no Preference. |
static java.lang.String |
DW_B_MATRIX_NAME
The information field name that is written into image headers to indicate the excitation diffusion-weighting B-matrix. |
static java.lang.String |
DW_B_VALUE_NAME
The information field name that is written into image headers to indicate the excitation diffusion-weighting b-value. |
static java.lang.String |
DW_GRADIENT_VECTOR_NAME
The information field name that is written into image headers to indicate the excitation diffusion-weighting gradient vector. |
static java.lang.String |
ECHO_TIME_NAME
The information field name that is written into image headers to indicate the scan echo time. |
static java.lang.String |
FLIP_ANGLE_NAME
The information field name that is written into image headers to indicate the excitation pulse flip angle. |
static java.lang.String |
FRAME_OF_REFERENCE_UID_NAME
The information field name that is written into image headers to indicate the frame of reference UID for the image position/orientation. |
static java.lang.String |
IMAGE_ORIENTATION_PATIENT_NAME
The information field name that is written into image headers to indicate the orientation (direction cosines) of the matrix of image pixels, in patient coordinates. |
static java.lang.String |
IMAGE_POSITION_PATIENT_NAME
The information field name that is written into image headers to indicate the location of the first pixel of the image, in patient coordinates. |
static java.lang.String |
INTENSITY_RESCALE_INTERCEPT_NAME
The information field name that is written into image headers to indicate the intensity rescale intercept. |
static java.lang.String |
INTENSITY_RESCALE_SLOPE_NAME
The information field name that is written into image headers to indicate the intensity rescale slope. |
static java.lang.String |
INTENSITY_RESCALE_UNITS_NAME
The information field name that is written into image headers to indicate the intensity rescale units. |
static java.lang.String |
INVERSION_TIME_NAME
The information field name that is written into image headers to indicate the scan inversion time. |
static int |
MAXDIM
The maximum dimensionality of an image. |
static java.lang.String |
MODALITY_NAME
The information field name that is written into image headers to indicate the imaging modality. |
protected java.lang.String |
mode
The "mode" with which the image was opened, if a disk-file: either "r" or "rw". |
static java.lang.String |
PATIENT_ID_NAME
The information field name that is written into image headers to indicate the patient ID. |
static java.lang.String |
PATIENT_NAME_NAME
The information field name that is written into image headers to indicate the patient name. |
static java.lang.String |
PATIENT_POSITION_NAME
The information field name that is written into image headers to indicate the way in which the patient is positioned in the scanner. |
protected PixArray |
pixArray
If non-null, pixel data held in this PixArray object. |
static java.lang.String |
PIXEL_SPACING_NAME
The information field name that is written into image headers to indicate the physical distance in the patient between the center of each pixel. |
static java.lang.String |
PIXEL_X_SIZE_NAME
The information field name that is written into image headers to indicate the width of an image pixel in mm. |
static java.lang.String |
PIXEL_Y_SIZE_NAME
The information field name that is written into image headers to indicate the height of an image pixel in mm. |
static java.lang.String |
PIXEL_Z_SIZE_NAME
The information field name that is written into image headers to indicate the thickness of an image pixel in mm. |
static java.lang.String |
PULSE_SEQUENCE_NAME
The information field name that is written into image headers to indicate the pulse sequence name. |
protected java.io.RandomAccessFile |
randomAccessFile
If non-null, pixel data kept on disk and accessed via this RandomAccessFile. |
static java.lang.String |
REPETITION_TIME_NAME
The information field name that is written into image headers to indicate the scan repetition time. |
static java.lang.String |
SCAN_DATE_NAME
The information field name that is written into image headers to indicate the scan date. |
static java.lang.String |
SCANNING_SEQUENCE_NAME
The information field name that is written into image headers to indicate the DICOM scanning sequence. |
static java.lang.String |
SEQUENCE_VARIANT_NAME
The information field name that is written into image headers to indicate the DICOM scanning sequence variant. |
static java.lang.String |
SLICE_THICKNESS_NAME
The information field name that is written into image headers to indicate the thickness of an image slice. |
static java.lang.String |
TIME_BETWEEN_FRAMES_NAME
The information field name that is written into image headers to indicate the time between frames of a multi-frame image. |
| Constructor Summary | |
|---|---|
protected |
MultiSliceImage()
Default constructor for MultiSliceImage for use by sub-classes. |
| Method Summary | |
|---|---|
MultiSliceImage |
autoResample(int maxNVoxels,
SubSampleType subSampleType,
boolean allowSliceResample,
boolean verbose)
Automatically resamples this image so that the resulting resampled image has no more than the given maximum number of voxels. |
static void |
checkMinMax(int min,
int max,
PixelDataType dataType)
Checks the integrity of the minimum and maximum pixel values taking into account the data type of the image. |
MultiSliceImage |
clone()
Returns a copy of this MultiSliceImage. |
MultiSliceImage |
crop(int[][] cropDims,
MonitorWorker worker,
boolean verbose)
Crops an existing MultiSliceImage. |
static boolean |
deleteImage(java.lang.String filename,
java.lang.Class c)
Attempts to delete an image of the given Class with the given name. |
static boolean |
exists(java.lang.String filename)
Tests whether a MultiSliceImage with the given name already exists on disk. |
java.io.InputStream |
export(java.lang.String suffix,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
Returns an InputStream from which a external format image (such as JPEG, GIF etc.) can be read, producing the external format image from this MultiSliceImage, by drawing all of the slices in a raster of slices. |
void |
export(java.lang.String suffix,
javax.imageio.stream.ImageOutputStream outputStream,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
Writes an image to an ImageOutputStream in an external format (such as JPEG, GIF etc.), creating the disk image from this MultiSliceImage, by drawing all of the slices in a raster of slices. |
void |
export(java.lang.String suffix,
java.lang.String filename,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
Writes an image to a disk file in an external format (such as JPEG, GIF etc.), creating the disk image from this MultiSliceImage, by drawing all of the slices in a raster of slices. |
protected abstract java.nio.ByteOrder |
getByteOrder()
Returns the byte order for this image. |
static java.lang.Class[] |
getClasses()
Returns an array of classes that are known to be sub-classes of MultiSliceImage. |
static java.text.DateFormat |
getDateFormat()
|
abstract int[] |
getDims()
Returns the dimensions of this image. |
protected abstract int |
getFileDataOffset()
Returns the byte offset into the disk-based file format where pixel data begins. |
com.xinapse.dicom.Uid |
getFrameOfReferenceUID()
Returns the frame of reference UID that uniquely identifies the frame of reference for an image. |
abstract MultiSliceImage |
getInstance(java.lang.Class c,
int nSlices)
Creates a new in-memory MultiSliceImage with the MultiSliceImage class given by the argument, possibly changing the number of slices in the image. |
static MultiSliceImage |
getInstance(java.awt.Component component,
MultiSliceImage templateImage)
Returns an instance of an image class using the supplied MultiSliceImage as a template for the image to be created. |
static MultiSliceImage |
getInstance(java.awt.Component component,
MultiSliceImage templateImage,
java.lang.Class outputImageClass)
Returns an instance of an image class using the supplied MultiSliceImage as a template for the image to be created. |
static MultiSliceImage |
getInstance(java.awt.Component component,
MultiSliceImage templateImage,
int nSlices)
Returns an instance of an image class using the supplied MultiSliceImage as a template for the image to be created. |
MultiSliceImage |
getInstance(int nSlices)
Creates a new in-memory MultiSliceImage, based on this MultiSliceImage, but possibly changing the number of slices in the image. |
static MultiSliceImage |
getInstance(MultiSliceImage templateImage,
java.lang.Class outputImageClass,
int nSlices)
Returns an instance of an image class using the supplied MultiSliceImage as a template for the image to be created. |
static MultiSliceImage |
getInstance(MultiSliceImage templateImage,
int nSlices)
Returns an in-memory instance of an image class using the supplied MultiSliceImage as a template for the image to be created. |
static MultiSliceImage |
getInstance(java.lang.String filename)
Returns an instance of an image class gotten from a file. |
static MultiSliceImage |
getInstance(java.lang.String filename,
java.lang.String mode)
Returns an instance of an image class gotten from a file, opened according to the mode. |
abstract Modality |
getModality()
Returns the modality with which this image was acquired. |
MostLikePlane |
getMostLikePlane()
Returns the imaging plane that this image is "most like". |
static int |
getNPixels(int nDim,
int[] dims)
Returns the total number of picture elements for a MultiSliceImage with the given dimensions. |
java.lang.Object |
getPix()
Returns all pixel values from this image. |
java.lang.Object |
getPix(boolean radiological)
Returns all pixel values from this image. |
java.lang.Object |
getPix(int[] pixIdx)
Returns a single pixel value from the image. |
java.lang.Object |
getPix(int[] lowIdx,
int[] highIdx)
Returns pixel values from this image. |
java.lang.Object |
getPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx)
Get pixel values from this image into a specified array. |
static java.lang.Class |
getPreferredImageClass()
Returns the MultiSliceImage class set in the user's Preferences. |
static PreviewIcon |
getPreview(java.io.File f)
Gets a PreviewIcon for a LoadableImage contained within the supplied File. |
java.util.List<ROI> |
getROIs()
Returns a List of ROIs that are stored with the image. |
static java.text.DateFormat |
getScanDateFormat()
Returns the java.text.DateFormat with which a scan date should be formatted. |
abstract java.lang.String |
getSimpleName()
Returns the simple name for this type of image - the String that should be seen by the users to identify this type of image. |
java.lang.Object |
getSlice(int slice)
Returns all the pixels for a two-dimensional slice of this image, as a 1-dimensional array of primitive values. |
java.lang.Object |
getSlice(java.lang.Object array,
int slice)
Returns all the pixels for a two-dimensional slice of this image, as a 1-dimensional array of primitive values. |
protected int |
getSliceDim(int slice)
|
java.lang.String |
getSuggestedFileName()
Returns the suggested file name for in-memory images that are to be saved to disk. |
static boolean |
isImage(java.io.File f)
Tests whether the supplied File refers to a MultSliceImage file. |
boolean |
isModified()
Tests whether this this MultiSliceImage has been modified since instantiation. |
static void |
main(java.lang.String[] args)
Run the self-test on the MultiSliceImage class. |
MultiSliceImage |
pad(int[] padDims,
MonitorWorker worker,
boolean verbose)
Pads an existing MultiSliceImage with zero-intensity pixels around the edge of the image. |
protected static double[] |
parseMultiValuedString(java.lang.String s,
int nValues)
Convenience method to parse Strings of the form "value1\value2\value3\ \valueN", where value1 to valueN are numerical values. |
void |
putPix(java.lang.Object array)
Put pixel values from a specified array to this image. |
void |
putPix(java.lang.Object array,
boolean radiological)
Put pixel values from a specified array to this image. |
java.lang.Object |
putPix(java.lang.Object pix,
int[] pixIdx)
Puts a single pixel value to the image. |
void |
putPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx)
Put pixel values from a specified array to this image. |
void |
putSlice(java.lang.Object array,
int slice)
Puts the pixel values to one slice of an n-dimensional image, where n > 1. |
MultiSliceImage |
reorient(MostLikePlane newOrientation,
MostLikePlane currentOrientation,
java.lang.Boolean slicesAreReversed,
MonitorWorker worker,
boolean verbose)
Reorients an existing MultiSliceImage. |
static void |
reorientRadiological(LoadableImage image,
java.lang.Object pix)
Reorients a set of pixels for an image so that they will be presented in standard radiological orientation. |
MultiSliceImage |
reSample(float[] newPixelSizes,
InterpolationType interpolationType,
SubSampleType subSampleType,
MonitorWorker worker,
boolean verbose)
Resamples an existing MultiSliceImage to have different pixel sizes. |
MultiSliceImage |
reSample(int[] newDims,
InterpolationType interpolationType,
SubSampleType subSampleType,
MonitorWorker worker,
boolean verbose)
Resamples an existing MultiSliceImage to have different numbers of pixels. |
static void |
savePreferredImageClass(java.lang.Class imageClass)
Saves the supplied class to the user's Preferences. |
void |
set3DBlockParameters()
For an image which contains multiple slices with all slices parallel and regularly-spaced, this method will modify the image position (patient coords), image orientation (patient coords) and pixel spacing (pixel sizes) according to the block. |
abstract void |
setDWBMatrix(float[] bMatrix,
int slice)
Sets the diffusion-weighting B-matrix for one slice of this image. |
abstract void |
setDWbValue(float bValue,
int slice)
Sets the diffusion-weighting b-value for one slice of this image. |
abstract void |
setDWGradientVector(javax.vecmath.Vector3f gradVec,
int slice)
Sets the diffusion-weighting gradient vector for one slice of this image. |
abstract void |
setFlipAngle(float flipAngle)
Sets the excitation pulse flip angle for this image. |
abstract void |
setImageOrientationPatient(javax.vecmath.Vector3f[] dirCos,
int slice)
Sets the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (LPS) coordinates. |
abstract void |
setImageOrientationPositionPatient(javax.vecmath.Vector3f[] dirCos,
javax.vecmath.Point3f position,
boolean force)
Sets the direction cosines of the row, column and slice directions of the image, the coordinates of the center of the first pixel of the image, in patient (LPS) coordinates. |
abstract void |
setImagePositionPatient(javax.vecmath.Point3f position,
int slice)
Sets the coordinates of the center of the first pixel of the image, in mm, in patient (LPS) coordinates, for one slice of this image. |
abstract void |
setIntensityRescale(float[] rescale)
Sets the values m and b in the relationship between pixel intensity (I) values and the output units specified in setRescaleUnits() in the expression: Output units = m*I + b. |
abstract void |
setIntensityRescale(float[] rescale,
int slice)
Sets the values m and b in the relationship between pixel intensity (I) values and the output units specified in setRescaleUnits() in the expression: Output units = m*I + b, for a particular slice. |
void |
setMinMax(int[] minmax)
Sets the min and max pixel values for this image. |
abstract void |
setMinMax(int min,
int max)
Sets the min and max pixel values for this image. |
abstract void |
setModality(Modality modality)
Sets the modality with which this image was acquired. |
void |
setModified()
Sets the "modified" flag for this MultiSliceImage to indicate that it has been modified since instantiation. |
abstract void |
setNativeColourMapping(ColourMapping colourMapping)
Sets the ColourMapping for this image. |
static void |
setOrientationPositionRadiological(javax.vecmath.Vector3f[] orientation,
javax.vecmath.Point3f position,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
Reorientates the image orientation vectors, and repositions an image position so that the positions and orientations refer to blocks of image pixels that have been gotten in an anatomical orientation. |
abstract void |
setPatientDoB(java.util.Date newDoB)
Sets the patient's date of birth for this image. |
abstract void |
setPatientID(java.lang.String newID)
Sets the patient ID for this image. |
abstract void |
setPatientName(java.lang.String newName)
Attempts to set the patient name for this image. |
abstract void |
setPatientPosition(PatientPosition position)
Sets the position in which the patient is lying in the scanning equipment for this MultiSliceImage. |
abstract void |
setPixelSpacing(float[] spacing)
Sets the distance (in mm) between pixel centres in the row, column and slice directions of the image. |
abstract void |
setPixelXSize(float width)
Sets the pixel size in the x (horizontal) direction for this image. |
abstract void |
setPixelYSize(float height)
Sets the pixel size in the y (vertical) direction for this image. |
abstract void |
setPixelZSize(float thickness)
Sets the pixel size in the z (slice) direction for this image. |
abstract void |
setPulseSequence(java.lang.String seqName)
Sets the pulse sequence name for this image. |
abstract void |
setRescaleUnits(java.lang.String unitsString)
Sets the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved by getIntensityRescale(). |
abstract void |
setScanDate(java.util.Date newDate)
Sets the scan date/time for this image. |
abstract void |
setScanningSequence(PulseSequenceType seqType)
Sets the DICOM scanning sequence for this image. |
abstract void |
setScanTE(float TE)
Sets the scan echo time for this image, for single-echo-time images. |
abstract void |
setScanTE(float TE,
int slice)
Sets the scan echo time for one slice of this image. |
abstract void |
setScanTI(float TI)
Sets the scan inversion time for this image. |
abstract void |
setScanTR(float TR)
Sets the scan repetition time for this image. |
abstract void |
setSequenceVariant(PulseSequenceVariant seqVariant)
Sets the DICOM scanning sequence variant for this image. |
abstract void |
setSliceThickness(float thickness)
Sets the slice thickness (in mm). |
void |
setSuggestedFileName(java.lang.String name)
Sets a suggested file name for in-memory images that might be saved to disk later. |
abstract void |
setTimeBetweenFrames(float deltaT)
Sets the time between frames in a 4- or higher dimensional image. |
abstract void |
setTitle(java.lang.String newTitle)
Sets the title of this image. |
java.awt.image.BufferedImage |
toBufferedImage(ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
Create a BufferedImage from this MultiSliceImage, by drawing all of the slices in a raster of slices. |
abstract java.lang.String |
write(java.lang.String filename)
Writes this image to a disk-file given by the name. |
abstract MultiSliceImage |
write(java.lang.String filename,
java.lang.Class c)
Writes this image to a disk-file given by the filename, in one of the MultiSliceImage sub-class image formats. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PATIENT_NAME_NAME
public static final java.lang.String PATIENT_ID_NAME
public static final java.lang.String BIRTH_DATE_NAME
public static final java.lang.String SCAN_DATE_NAME
public static final java.lang.String MODALITY_NAME
public static final java.lang.String PULSE_SEQUENCE_NAME
public static final java.lang.String SCANNING_SEQUENCE_NAME
public static final java.lang.String SEQUENCE_VARIANT_NAME
public static final java.lang.String REPETITION_TIME_NAME
public static final java.lang.String INVERSION_TIME_NAME
public static final java.lang.String ECHO_TIME_NAME
public static final java.lang.String FLIP_ANGLE_NAME
public static final java.lang.String DW_B_VALUE_NAME
public static final java.lang.String DW_GRADIENT_VECTOR_NAME
public static final java.lang.String DW_B_MATRIX_NAME
public static final java.lang.String COLOUR_MAPPING_NAME
public static final java.lang.String PIXEL_X_SIZE_NAME
public static final java.lang.String PIXEL_Y_SIZE_NAME
public static final java.lang.String PIXEL_Z_SIZE_NAME
public static final java.lang.String TIME_BETWEEN_FRAMES_NAME
public static final java.lang.String FRAME_OF_REFERENCE_UID_NAME
public static final java.lang.String IMAGE_POSITION_PATIENT_NAME
public static final java.lang.String IMAGE_ORIENTATION_PATIENT_NAME
public static final java.lang.String PIXEL_SPACING_NAME
public static final java.lang.String PATIENT_POSITION_NAME
public static final java.lang.String SLICE_THICKNESS_NAME
public static final java.lang.String INTENSITY_RESCALE_SLOPE_NAME
public static final java.lang.String INTENSITY_RESCALE_INTERCEPT_NAME
public static final java.lang.String INTENSITY_RESCALE_UNITS_NAME
public static final java.lang.String AUDIT_TRAIL_ACTION_TEXT
public static final int MAXDIM
protected PixArray pixArray
protected java.io.RandomAccessFile randomAccessFile
protected java.lang.String mode
public static final java.lang.Class DEFAULT_IMAGE_CLASS
| Constructor Detail |
|---|
protected MultiSliceImage()
| Method Detail |
|---|
public boolean isModified()
public void setModified()
public static java.lang.Class getPreferredImageClass()
public static void savePreferredImageClass(java.lang.Class imageClass)
imageClass - the Class that the user most often works with, and which will be
set as the default to use when this Class loads.
protected int getSliceDim(int slice)
throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsExceptionpublic void setSuggestedFileName(java.lang.String name)
name - the suggested file name.public java.lang.String getSuggestedFileName()
LoadableImage
getSuggestedFileName in interface LoadableImage
public abstract int[] getDims()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the dimensions are bad.protected abstract java.nio.ByteOrder getByteOrder()
protected abstract int getFileDataOffset()
public abstract void setPixelXSize(float width)
throws java.lang.IllegalArgumentException,
java.io.IOException
width - the width of a pixel.
java.lang.IllegalArgumentException - if the pixel width is not positive.
java.io.IOException - if and I/O error occurs.
public abstract void setPixelYSize(float height)
throws java.lang.IllegalArgumentException,
java.io.IOException
height - the height of a pixel.
java.lang.IllegalArgumentException - if height is not positive.
java.io.IOException - if an I/O error occurs.
java.lang.IndexOutOfBoundsException - if the image doesn't have a dimensionality of at least 2.
public abstract void setPixelZSize(float thickness)
throws java.lang.IllegalArgumentException,
java.io.IOException
thickness - the thickness of a pixel.
java.lang.IllegalArgumentException - if thickness is not positive.
java.io.IOException - if an I/O error occurs.
java.lang.IndexOutOfBoundsException - if the image doesn't have a dimensionality of at least 3.
public abstract void setTimeBetweenFrames(float deltaT)
throws java.lang.IllegalArgumentException,
java.io.IOException
deltaT - the time between frames (in seconds).
java.lang.IllegalArgumentException - if deltaT is negative.
java.io.IOException - if an I/O error occurs.
java.lang.IndexOutOfBoundsException - if the image doesn't have a dimensionality of at least 4.
public abstract void setTitle(java.lang.String newTitle)
throws java.io.IOException
newTitle - the new title to be assigned to this image.
java.io.IOException - if the title cannot be set.
public abstract void setPatientName(java.lang.String newName)
throws java.io.IOException
newName - the new patient name to be assigned to this image.
java.io.IOException - if the patient name cannot be set.
public abstract void setPatientID(java.lang.String newID)
throws java.io.IOException
newID - the new patient ID to be assigned to this image.
java.io.IOException - if the patient ID cannot be set.
public abstract void setPatientDoB(java.util.Date newDoB)
throws java.io.IOException
newDoB - the new patient date of birth to be assigned to this image.
java.io.IOException - if the patient date of birth cannot be set.
public abstract void setScanDate(java.util.Date newDate)
throws java.io.IOException
newDate - the new scan date/time to be assigned to this image.
java.io.IOException - if the scan date cannot be set.
public abstract void setPulseSequence(java.lang.String seqName)
throws java.io.IOException
seqName - the new name of the pulse sequence to be assigned to this image.
java.io.IOException - if the pulse sequence name cannot be set.
public abstract void setScanningSequence(PulseSequenceType seqType)
throws java.io.IOException
seqType - the new scanning sequence to be assigned to this image.
java.io.IOException - if the scanning sequence cannot be set.
public abstract void setSequenceVariant(PulseSequenceVariant seqVariant)
throws java.io.IOException
seqVariant - the new scanning sequence variant to be assigned to this image.
java.io.IOException - if the scanning sequence variant cannot be set.
public abstract void setModality(Modality modality)
throws java.io.IOException
modality - the new imaging modality to be assigned to this image.
java.io.IOException - if modality cannot be set.public abstract Modality getModality()
getModality in interface LoadableImage
public abstract void setScanTR(float TR)
throws java.io.IOException
TR - the new scan TR to be assigned to this image.
java.io.IOException - if the scan TR cannot be set.
public abstract void setScanTI(float TI)
throws java.io.IOException
TI - the new scan TI to be assigned to this image.
java.io.IOException - if the scan TI cannot be set.
public abstract void setScanTE(float TE)
throws java.io.IOException
TE - the new scan TE to be assigned to this image.
java.io.IOException - if the scan TE cannot be set.
public abstract void setScanTE(float TE,
int slice)
throws java.io.IOException
TE - the new scan TE to be assigned to this image.slice - the slice number for which to set the echo time.
java.io.IOException - if the scan TE cannot be set.
public abstract void setFlipAngle(float flipAngle)
throws java.io.IOException
flipAngle - the new scan flip angle to be assigned to this image.
java.io.IOException - if the scan flip angle cannot be set.
public abstract void setDWbValue(float bValue,
int slice)
throws java.io.IOException
bValue - the new b-value to be assigned to this image.slice - the slice number for which to set the b-value.
java.io.IOException - if the scan b-value cannot be set.
public abstract void setDWGradientVector(javax.vecmath.Vector3f gradVec,
int slice)
throws java.io.IOException
gradVec - the new gradient vector to be assigned to this image.slice - the slice number for which to set the gradient vector.
java.io.IOException - if the scan gradient vector cannot be set.
public abstract void setDWBMatrix(float[] bMatrix,
int slice)
throws java.io.IOException
bMatrix - the new B-matrix to be assigned to this image.slice - the slice number for which to set the B-matrix.
java.io.IOException - if the scan B-matrix cannot be set.
public abstract void setPatientPosition(PatientPosition position)
throws java.io.IOException
position - the position in which the patient is lying in the scanning equipment.
e.g. PatientPosition.HFS (head-first supine).
java.io.IOException - if the patient position cannot be set for this image.
public abstract void setPixelSpacing(float[] spacing)
throws java.io.IOException,
java.lang.IndexOutOfBoundsException
spacing - a float[] of length 3, corresponding to the distance between pixel centres
in the row, column and slice directions respectively. If this is a single-slice image,
then spacing may (otionally) have length 2 to indicate the in-plane distance between
pixel centres.
java.io.IOException - if the pixel spacing cannot be set for this image.
java.lang.IndexOutOfBoundsException - if spacing does not have the correct dimensions.
public abstract void setSliceThickness(float thickness)
throws java.io.IOException
thickness - the slice thickness in mm.
java.io.IOException - if the slice thickness cannot be set for this image, or
if the slice thickness is negative.
public abstract void setImagePositionPatient(javax.vecmath.Point3f position,
int slice)
throws MultiSliceImageException
position - the Left,Posterior,Superior (LPS) coordinates of the first pixel of
this specified slice in the image data matrix.slice - the slice for which to set the position.
MultiSliceImageException - if the position cannot be set for this image, if
position does not have the correct dimensions, or if the slice number
is out of range.
public abstract void setImageOrientationPositionPatient(javax.vecmath.Vector3f[] dirCos,
javax.vecmath.Point3f position,
boolean force)
throws java.io.IOException,
java.lang.IndexOutOfBoundsException
N.B. the actual position and orientation set by this method may not be those specified. For example, for NIFTI-1 images, the actual orientation and position may depend on the user Preferences for whether to put pixel values in an order that is compatible with SPM. After using this method, you should use the getImageOrientationPatient() and getImagePositionPatient() methods to obtain the real orientation and positions set.
If the orientation or position cannot be set for this image, this method does not report an error.
dirCos - the direction cosines of the image row, column and (optionally)
slice directions respectively in Left,Posterior,Superior (LPS) coordinates.
If dirCos is null, this method will attempt to clear any orientation information, if
that is supported by the image format.position - the Left,Posterior,Superior (LPS) coordinates of the centre of the
first pixel in the image data matrix. If position is null, this method will
attempt to clear any positional information, if that is supported by the image format.force - if true, this method will force the orientation and
position to be set as requested, regardless of the user Preferences. This can
be useful if you read the orientation from an existing image, and you want to set the
orientation exactly the same in a new image.
java.lang.IndexOutOfBoundsException - if the dirCos array does not have the
correct length.
java.io.IOException - if an I/O error occurs.public MostLikePlane getMostLikePlane()
LoadableImage
getMostLikePlane in interface LoadableImage
public abstract void setImageOrientationPatient(javax.vecmath.Vector3f[] dirCos,
int slice)
throws java.lang.IndexOutOfBoundsException
If the orientation cannot be set for this image, this method does nothing.
dirCos - the direction cosines of the image row, column and (optionally)
slice directions respectively in Left,Posterior,Superior (LPS) coordinates.slice - the slice for which to set the orientation.
java.lang.IndexOutOfBoundsException - if the cosines array does not have the
correct dimensions.public com.xinapse.dicom.Uid getFrameOfReferenceUID()
LoadableImage
getFrameOfReferenceUID in interface LoadableImage
public abstract void setIntensityRescale(float[] rescale)
throws MultiSliceImageException,
java.io.IOException
rescale - a float[] of length 2 where the first element is m
and the second is b.
MultiSliceImageException - if a single rescaling cannot be set for this image.
java.io.IOException - if an I/O error occurs.
public abstract void setIntensityRescale(float[] rescale,
int slice)
throws MultiSliceImageException,
java.io.IOException
rescale - a float[] of length 2 where the first element is m
and the second is b.slice - a slice number for which to set the rescaling values.
MultiSliceImageException - if a rescaling cannot be set for the specified slice of
this image.
java.io.IOException - if an I/O error occurs.
public abstract void setRescaleUnits(java.lang.String unitsString)
throws java.io.IOException
unitsString - a String describing the physical meaning of the pixel intensity units.
If the unitsString is null, future calls to getRescaleUnits() will return the
String "arbitrary units".
java.io.IOException - if the rescaling units cannot be set for this image.
public abstract java.lang.String write(java.lang.String filename)
throws java.io.IOException,
MultiSliceImageException
filename - the file name.
MultiSliceImageException - if the image cannot be written.
java.io.IOException - if an I/O error occurs.
public abstract MultiSliceImage write(java.lang.String filename,
java.lang.Class c)
throws java.io.IOException,
MultiSliceImageException
filename - the file name. If filename is null, then an in-memory MultiSliceImage
will be returned.c - the class of image to be written (e.g. com.xinapse.multisliceimage.UNC.UNCImage).
MultiSliceImageException - if the image cannot be written.
java.io.IOException - if an I/O error occurs.
public static boolean isImage(java.io.File f)
throws java.io.FileNotFoundException
f - the java.io.File to be tested.
java.io.FileNotFoundException - if the file does not exist.
public abstract MultiSliceImage getInstance(java.lang.Class c,
int nSlices)
throws java.io.IOException,
MultiSliceImageException
c - the class of image to be written (e.g.
com.xinapse.multisliceimage.UNC.UNCImage.class).nSlices - the number of slices in the image that is to be written.
MultiSliceImageException - if the image cannot be written.
java.io.IOException - if an I/O error occurs.
public MultiSliceImage getInstance(int nSlices)
throws java.io.IOException,
MultiSliceImageException
nSlices - the number of slices in the new image.
MultiSliceImageException - if the image cannot be created.
java.io.IOException - if an I/O error occurs.public abstract java.lang.String getSimpleName()
public static java.lang.Class[] getClasses()
public static boolean exists(java.lang.String filename)
filename - the name of the image file to test for existence.
public static PreviewIcon getPreview(java.io.File f)
f - the image file for which to get a preview.
public static java.text.DateFormat getDateFormat()
public static java.text.DateFormat getScanDateFormat()
public static MultiSliceImage getInstance(java.lang.String filename)
throws MultiSliceImageException,
java.io.IOException
filename - the name of the file from which the image data will be read.
MultiSliceImageException - if the file does not supply data that gives a valid
MultiSliceImage.
java.io.IOException - if the image seems valid, but the file supplies imcomplete data.
public static MultiSliceImage getInstance(java.lang.String filename,
java.lang.String mode)
throws java.io.FileNotFoundException
filename - the name of the file from which the image data will be read.mode - the access mode.
java.io.FileNotFoundException - if an image with the supplied name cannot be opened.
public static MultiSliceImage getInstance(java.awt.Component component,
MultiSliceImage templateImage)
throws java.io.IOException,
InvalidImageException,
MultiSliceImageException
component - used as the parent component for the ImageFileChooser
created to select the new image name. May be null.templateImage - the MultiSliceImage instance to be used as a template for
creating the new image.
MultiSliceImageException - if the new image cannot be created.
java.io.IOException - if an I/O error occurs.
InvalidImageException
public static MultiSliceImage getInstance(java.awt.Component component,
MultiSliceImage templateImage,
int nSlices)
throws java.io.IOException,
MultiSliceImageException
component - used as the parent component for the ImageFileChooser
created to select the new image name. May be null.templateImage - the MultiSliceImage instance to be used as a template for
creating the new image.nSlices - the number of slices in the new image.
MultiSliceImageException - if the new image cannot be created.
java.io.IOException - if an I/O error occurs.
public static MultiSliceImage getInstance(java.awt.Component component,
MultiSliceImage templateImage,
java.lang.Class outputImageClass)
throws java.io.IOException,
InvalidImageException,
MultiSliceImageException
component - used as the parent component for the ImageFileChooser
created to select the new image name. May be null.templateImage - the MultiSliceImage instance to be used as a template for
creating the new image.outputImageClass - the class of the output image, which must be one of the
MultiSliceImage sub-classes.
MultiSliceImageException - if the new image cannot be created.
java.io.IOException - if an I/O error occurs.
InvalidImageException
public static MultiSliceImage getInstance(MultiSliceImage templateImage,
java.lang.Class outputImageClass,
int nSlices)
throws java.io.IOException,
MultiSliceImageException
templateImage - the MultiSliceImage instance to be used as a template for
creating the new image.outputImageClass - the class of the output image, which must be one of the
MultiSliceImage sub-classes.nSlices - the number of slices in the new image.
MultiSliceImageException - if the new image cannot be created.
java.io.IOException - if an I/O error occurs.
public static MultiSliceImage getInstance(MultiSliceImage templateImage,
int nSlices)
throws java.io.IOException,
MultiSliceImageException
templateImage - the MultiSliceImage instance to be used as a template for
creating the new image.nSlices - the number of slices in the new image.
MultiSliceImageException - if the new image cannot be created.
java.io.IOException - if an I/O error occurs.
public static boolean deleteImage(java.lang.String filename,
java.lang.Class c)
filename - the name of the image file that is to be deleted.
public java.lang.Object getPix()
throws InvalidImageException
getPix in interface LoadableImageInvalidImageException - if the pixel values cannot be gotten.
public java.lang.Object getPix(boolean radiological)
throws InvalidImageException
getPix in interface LoadableImageradiological - true if a standard radiological orientation of the
array of pixels is required. Standard radiological orientation is:
InvalidImageException - if the pixel values cannot be gotten.
public java.lang.Object getPix(int[] lowIdx,
int[] highIdx)
throws InvalidImageException
lowIdx - an array of int specifying the low index of pixel values to get.highIdx - an array of int specifying the high index of pixel values to get.
InvalidImageException - if the indices supplied extend beyond the image,
or the pixel values cannot be gotten for other reasons.
public java.lang.Object getPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx)
throws InvalidImageException
array - a 1-dimensional array of length at least enough to
contain all the pixel values, and of the correct java primitive
data type.lowIdx - an array of int specifying the low index of pixel values to get.highIdx - an array of int specifying the high index of pixel values to get.
InvalidImageException - if the indices supplied extend beyond the image,
if the supplied array is of the wrong primitive data type, or if the pixel values
cannot be gotten for other reasons.
public void putPix(java.lang.Object array)
throws InvalidImageException
array - a 1-dimensional array of pixel values of the correct java primitive
data type to put to the image.
InvalidImageException - if the pixel values are of the wrong primitive data type,
or cannot be put for other reasons.
public void putPix(java.lang.Object array,
boolean radiological)
throws InvalidImageException
array - a 1-dimensional array of pixel values of the correct java primitive
data type to put to the image.radiological - true if the pixels have a standard radiological orientation
Standard radiological orientation is:
InvalidImageException - if the pixel values are of the wrong primitive data type,
or cannot be put for other reasons.
public void putPix(java.lang.Object array,
int[] lowIdx,
int[] highIdx)
throws InvalidImageException
array - a 1-dimensional array of pixel values of the correct java primitive
data type to put to the image.lowIdx - an array of int specifying the low index of pixel values to put.highIdx - an array of int specifying the high index of pixel values to put.
InvalidImageException - if the indices supplied extend beyond the image,
the pixel values are of the wrong primitive data type or cannot be put for other reasons.
public java.lang.Object getPix(int[] pixIdx)
throws InvalidImageException
pixIdx - an int[] of length at least equal to nDim
for this image where each element corresponds to an index to the
pixel in each dimension. The first element of pixIdx refers to the slowest-varying
dimension, and the last relevant element refers to the fastest-varuing dimension.
For example, for a 3-D image, pixIdx[0] refers to the slice dimension, and
pixIdx[2] refers to the column dimension.
InvalidImageException - if the indices are inappropriate for this
image, or if the pixel data is not available.
public java.lang.Object putPix(java.lang.Object pix,
int[] pixIdx)
throws InvalidImageException
pix - the pixel value to put, as a suitable Object.pixIdx - an int[] of length at least equal to nDim
for this image where each element corresponds to an index to the
pixel in each dimension. The first element of pixIdx refers to the slowest-varying
dimension, and the last relevant element refers to the fastest-varuing dimension.
For example, for a 3-D image, pixIdx[0] refers to the slice dimension, and
pixIdx[2] refers to the column dimension.
InvalidImageException - if the indices are inappropriate for this image,
if the supplied pixel is of the wrong Class,
or if the pixel value cannot be written to the image.
public static void reorientRadiological(LoadableImage image,
java.lang.Object pix)
image - the LoadableImage for which the pixels are to be reoriented.pix - the array of pixels to reorient. The reorientation is done in-place.
public static void setOrientationPositionRadiological(javax.vecmath.Vector3f[] orientation,
javax.vecmath.Point3f position,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
This method works out the way in which an image slice with the supplied orientation and position will be presented radiologically, and sets the orientation and position "in place" correctly for the image slice as presented radiologically.
orientation - the current orientation of the image slice.position - the current position of the image slice.nCols - the number of columns in the image.nRows - the number of rows in the image.pixelXSize - the pixel size along a row.pixelYSize - the pixel size down a column.
public static int getNPixels(int nDim,
int[] dims)
throws MultiSliceImageException
nDim - the dimensionality of the image.dims - the size of the image in each dimension.
MultiSliceImageException
public java.lang.Object getSlice(int slice)
throws InvalidImageException
getSlice in interface LoadableImageslice - the slice number. Slices numbered from zero up to the total number of
slices in this image (-1), regardless of the dimensionality of the image.
InvalidImageException - if the slice number is invalid for this image.
public java.lang.Object getSlice(java.lang.Object array,
int slice)
throws InvalidImageException
If the supplied array is null, a new array will be created and returned.
slice - the slice number. Slices numbered from zero up to the total number of
slices in this image (-1), regardless of the dimensionality of the image.array - an array of suitable length and of a suitable primitive data type for this image.
InvalidImageException - if the slice number is invalid for this image,
public void putSlice(java.lang.Object array,
int slice)
throws InvalidImageException
N.B.Whenever the radiological orientation of the image can be determined, this method sets pixel values such that when the slice is viewed on-screen, the first pixel in the array belongs at the top left of the screen, and the last pixel in the array belongs at the bottom right of the screen. This is regardless of the sub-class of image (for example., the flipping of Analyze images is taken care of by this method).
array - a 1-dimensional array of the correct primitive java
data type for this image, with dimensions [nRows * nCols]
containing the pixel values to put.slice - the slice number. Must be 0 for a 2-dimensional
image or from 0 to dims[0]-1 for a 3-dimensional image.
InvalidImageException - if the image does not have the right dimensionality,
if the slice number is inappropriate for this image,
if the array is not of the correct primitive data type for this image,
or if there is a problem accessing the pixel values.
public abstract void setNativeColourMapping(ColourMapping colourMapping)
throws java.io.IOException
colourMapping - the new ColourMapping to be assigned to this image.
java.io.IOException - if the ColourMapping cannot be set for this image.
public void setMinMax(int[] minmax)
throws MultiSliceImageException
minmax - an int array of length at least 2, where the
first element is the minimum pixel value in the image, and
second element is the maximum pixel value in the image.
MultiSliceImageException - if the array supplied is unsuitable, or the
values cannot be set.
public abstract void setMinMax(int min,
int max)
throws MultiSliceImageException
min - the minimum pixel value in the image.max - the maximum pixel value in the image.
MultiSliceImageException - if the array supplied is unsuitable, or the
values cannot be set.
public static void checkMinMax(int min,
int max,
PixelDataType dataType)
throws MultiSliceImageException
min - the putative minimum pixel value.max - the putative maximum pixel value.dataType - the PixelDataType for the image.
MultiSliceImageException - if the min/max values are unsuitable for this image.
public void set3DBlockParameters()
throws java.io.IOException,
InvalidImageException
Images that do not consist of a single block of parallel, equally-spaced slices are unaffeted by this method.
MultiSliceImageException - if the image information cannot be modified.
java.io.IOException
InvalidImageExceptionpublic java.util.List<ROI> getROIs()
LoadableImage
getROIs in interface LoadableImage
public MultiSliceImage crop(int[][] cropDims,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
cropDims - the high and low indices (referenced from zero) of samples in each of the
dimensions of the image. cropDims must have the same number of elements as there are
dimensions in this image, and each element must be an array of length 2.
The first element of each array specifies the low pixel index for that dimension, and the
second element of the array specifies the high pixel index to select for the cropped image.
The column dimension is the last array element; the row dimension is the next-to-last;
the slice dimension is the second-from-last etc.worker - if non-null, a ProgressMonitor will be created, showing the progress
of the cropping.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if any of the indices is less than
zero, or greater than the number of samples, or if the size of the cropDims array is
incorrect for this image.
CancelledException - if cropping is cancelled via the ProgressMonitor
that may pop up.
public MultiSliceImage pad(int[] padDims,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
padDims - the number of samples in each dimension of the image for the padded
image. padDims must have the same number of elements as there are
dimensions in this image. The column dimension is the last array element;
the row dimension is the next-to-last; the slice dimension is the second-from-last etc.
If any value is less than the number of samples in the current image, then the number
of samples in that dimension is unchanged in the new image.worker - if non-null, a ProgressMonitor will be created, showing the progress
of the padding.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if the size of the padDims array is incorrect for this image.
CancelledException - if padding is cancelled via the ProgressMonitor
that may pop up.
public MultiSliceImage reorient(MostLikePlane newOrientation,
MostLikePlane currentOrientation,
java.lang.Boolean slicesAreReversed,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
newOrientation - the MostLikePlane of the required new orientation.currentOrientation - the MostLikePlane of the current orientation, or
null to force an attempt to determine the orientation automatically.slicesAreReversed - if non-null, specifies whether the slices are in
reverse order compared to standard radiological order (which is:
worker - if non-null, a ProgressMonitor will be created, showing the progress
of the reorientation.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if currentOrientation is null, and the orientation of
this image cannot be determined.
CancelledException - if reorienting is cancelled via the ProgressMonitor
that may pop up.
public MultiSliceImage autoResample(int maxNVoxels,
SubSampleType subSampleType,
boolean allowSliceResample,
boolean verbose)
throws InvalidImageException,
CancelledException
The numbers of samples will be calculated to give a more isotropic resolution. The algorithm will reduce the number of samples (if necessary) in any or all dimensions so that the resulting image has no more than the specified number of voxels, but the number of samples in any direction will never be increased to try to achieve isotropic resolution.
The number of voxels may be less than the maximum because the resulting image will always have the same field of view as this image, and the number of samples in each dimension must (of course) be a whole number.
Resampling of the fourth dimension of 4-D images does not take place, only of the three spatial dimensions. Images with dimensionality greater than 4 may not ne resampled with this method.
maxNVoxels - maximum number of voxels allowed in the resampled image.subSampleType - the type of sub-sampling to be used if the pixel size is increased
in any dimension.allowSliceResample - if true, resampling of pixels in the slice direction
is allowed; if false, resampling in the slice direction is disallowed.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if the image dimensionality is greater than 4.
or equal to zero, or if the length of the newDims array is incorrect for this image.
CancelledException - if resampling is cancelled via the ProgressMonitor
that may pop up.
public MultiSliceImage reSample(int[] newDims,
InterpolationType interpolationType,
SubSampleType subSampleType,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
newDims - the number of samples in each of the dimensions of the image. newDims must
have the same number of elements as there are dimensions in this image.
The integer in each element of the array specifies the number of samples in each
dimension for the resampled image.
The column dimension is the last array element; the row dimension is the next-to-last;
the slice dimension is the second-from-last, and the time dimension is the third-from-last.
Any dimensions that are below the time dimension are ignored, and no resampling will
occur in these dimensions.interpolationType - the type of interpolation to used if the number of samples increases
in any dimension.subSampleType - the type of sub-sampling to be used if the pixel size is increased
in any dimension.worker - if non-null, a ProgressMonitor will be created, showing the progress
of the resampling.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if any of the new number of samples is less than
or equal to zero, or if the length of the newDims array is incorrect for this image.
CancelledException - if resampling is cancelled via the ProgressMonitor
that may pop up.
public MultiSliceImage reSample(float[] newPixelSizes,
InterpolationType interpolationType,
SubSampleType subSampleType,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
newPixelSizes - the physical pixel size in each of the dimensions of the image.
newPixelSizes must have the same number of elements as there are dimensions in this image.
The floating point number in each element of the array specifies the pixel size in
each dimension for the resampled image.
The column dimension is the last array element; the row dimension is the next-to-last;
the slice dimension is the second-from-last, and the time dimension is the third-from-last.
Any other dimensions are ignored.interpolationType - the type of interpolation to be used if the pixel size is reduced
in any dimension.subSampleType - the type of sub-sampling to be used if the pixel size is increased
in any dimension.worker - if non-null, a ProgressMonitor will be created, showing the progress
of the resampling.verbose - if true, progress messages will be written to System.out.
InvalidImageException - if any of the new pixel sizes is not positive, or if
the length of the newPixelSizes array is insufficient for this image.
CancelledException - if resampling is cancelled via the ProgressMonitor
that may pop up.
public void export(java.lang.String suffix,
java.lang.String filename,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
throws java.io.IOException,
InvalidImageException
suffix - the suffix describing the type of image to be created. Currently, must be one
of:
filename - the name of the disk file to which the image will be written.cm - the ColourMapping to use when converting the pixel values to colours
in the image. The cm is ignored for PixelDataTypes
that have the R.G.B components specified.displayMin - the image pixel value that maps to the first entry in the
ColourMapping. All pixel values below displayMin will also be mapped
to the first entry.displayMax - the image pixel value that maps to the last entry in the
ColourMapping. All pixel values above displayMax will also be mapped
to the last entry.complexMode - the display mode for complex images. May be null for
non-complex images.slicesPerRow - the number of image slices to put into one row of the
image raster.
java.io.IOException - an error occurs writing to the file, or if an image
of the type requested cannot be created.
InvalidImageException - if this MultiSliceImage has bad
dimensionality for this operation.
public java.io.InputStream export(java.lang.String suffix,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
throws java.io.IOException,
InvalidImageException
suffix - the suffix describing the type of image to be created. Currently, must be one
of:
cm - the ColourMapping to use when converting the pixel values to colours
in the image. The cm is ignored for PixelDataTypes
that have the R.G.B components specified.displayMin - the image pixel value that maps to the first entry in the
ColourMapping. All pixel values below displayMin will also be mapped
to the first entry.displayMax - the image pixel value that maps to the last entry in the
ColourMapping. All pixel values above displayMax will also be mapped
to the last entry.complexMode - the display mode for complex images. May be null for
non-complex images.slicesPerRow - the number of image slices to put into one row of the
image raster.
java.io.IOException - an error occurs writing the image, or if an image
of the type requested cannot be created.
InvalidImageException - if this MultiSliceImage has bad
dimensionality for this operation.
public void export(java.lang.String suffix,
javax.imageio.stream.ImageOutputStream outputStream,
ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
throws java.io.IOException,
InvalidImageException
suffix - the suffix describing the type of image to be created. Currently, must be one
of:
outputStream - the OutputStream to which the image will be written.cm - the ColourMapping to use when converting the pixel values to colours
in the image. The cm is ignored for PixelDataTypes
that have the R.G.B components specified.displayMin - the image pixel value that maps to the first entry in the
ColourMapping. All pixel values below displayMin will also be mapped
to the first entry.displayMax - the image pixel value that maps to the last entry in the
ColourMapping. All pixel values above displayMax will also be mapped
to the last entry.complexMode - the display mode for complex images. May be null for
non-complex images.slicesPerRow - the number of image slices to put into one row of the
image raster.
java.io.IOException - an error occurs writing to the ImageOutputStream, or if an image
of the type requested cannot be created.
InvalidImageException - if this MultiSliceImage has bad
dimensionality for this operation.
public java.awt.image.BufferedImage toBufferedImage(ColourMapping cm,
double displayMin,
double displayMax,
ComplexMode complexMode,
int slicesPerRow)
throws java.lang.IllegalArgumentException,
InvalidImageException
cm - the ColourMapping to use when converting the pixel values to colours
in the BufferedImage. The cm is ignored for PixelDataTypes
that have the R.G.B components specified.displayMin - the image pixel value that maps to the first entry in the
ColourMapping. All pixel values below displayMin will also be mapped
to the first entry.displayMax - the image pixel value that maps to the last entry in the
ColourMapping. All pixel values above displayMax will also be mapped
to the last entry.complexMode - the display mode for complex images. May be null for
non-complex images.slicesPerRow - the number of image slices to put into one row of the
BufferedImage raster.
java.lang.IllegalArgumentException - if this image cannot be converted to a
BufferedImage.
InvalidImageException - if this MultiSliceImage has bad
dimensionality for this operation.public MultiSliceImage clone()
clone in class java.lang.Object
protected static double[] parseMultiValuedString(java.lang.String s,
int nValues)
throws MultiSliceImageException
s - the java.lang.String to be parsed.nValues - the number of values expected in s.
MultiSliceImageException - if nValues numerical values cannot be parsed from String s.public static void main(java.lang.String[] args)
args - ignored.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||