Class ANZImage
- All Implemented Interfaces:
ReadableImage,WritableImage,AutoCloseable,Cloneable
- Direct Known Subclasses:
Analyze75Image,NIFTIImage
Image data for images loaded from disk remains on disk, and is accessed as required; image data loaded from streams or created afresh resides in memory. Image data loaded from compressed (gzipped) disk-files also resides in memory.
Both big-endian and little-endian byte ordering are implemented and supported. When reading existing images, the byte order is auto detected from the header file. When existing images are copied or modified, the original byte order is retained. For images newly-created from scratch by this package, the byte ordering is the native byte order.
N.B. The Analyze format requires that for BINARY images, individual slices must begin on a byte boundary. In this implementation, that restriction is removed. If you wish to maintain compatibility with Analyze and other programs that maintain this restriction, ensure that a multi-slice/multi-frame images have slices with a number of pixels that is a multiple of 8 (bits).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.xinapse.image.ReadableImage
ReadableImage.Position -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe file extension for Analyze image files in lower case form.static final StringThe file extension for Analyze image files in upper case form.static final StringThe file extension for Analyze image files in lower case form.static final StringThe file extension for Analyze image files in upper case form.Fields inherited from class com.xinapse.multisliceimage.MultiSliceImage
AUDIT_TRAIL_ACTION_TEXT, BIRTH_DATE_NAME, BODY_PART_NAME, COLOUR_MAPPING_NAME, DW_B_MATRIX_NAME, DW_B_VALUE_NAME, DW_GRADIENT_VECTOR_NAME, ECHO_TIME_NAME, ECHO_TRAIN_LENGTH_NAME, FLIP_ANGLE_NAME, FRAME_OF_REFERENCE_UID_NAME, IMAGE_ORIENTATION_PATIENT_NAME, IMAGE_POSITION_PATIENT_NAME, INTENSITY_RESCALE_INTERCEPT_NAME, INTENSITY_RESCALE_SLOPE_NAME, INTENSITY_RESCALE_UNITS_NAME, INVERSION_TIME_NAME, LATERALITY_NAME, MODALITY_NAME, mode, PATIENT_ID_NAME, PATIENT_NAME_NAME, PATIENT_POSITION_NAME, PATIENT_SEX_NAME, pixArray, PIXEL_SPACING_NAME, PIXEL_X_SIZE_NAME, PIXEL_Y_SIZE_NAME, PIXEL_Z_SIZE_NAME, PULSE_SEQUENCE_NAME, randomAccessFile, REPETITION_TIME_NAME, SAT_PULSE_FREQ_OFFSET_PPM_NAME, SCAN_DATE_NAME, SCANNING_SEQUENCE_NAME, SEQUENCE_VARIANT_NAME, SERIES_DESCRIPTION_NAME, SERIES_INSTANCE_UID_NAME, SERIES_NUMBER_NAME, SLICE_THICKNESS_NAME, STORAGE_CLASS_UID_NAME, STUDY_ID_NAME, STUDY_INSTANCE_UID_NAME, TIME_BETWEEN_FRAMES_NAME, TRIGGER_DELAY_NAME -
Method Summary
Modifier and TypeMethodDescriptionvoidanonymise(String patientName, String patientID, Date birthDate, boolean patSex, String patAddr, String patInsurancePlanID, String accessionNumber, boolean patOther, String physicianName, String physicianAddr, String institutionName, String institutionAddr, String deptName, String stationName, String telNumber, boolean removePrivateElements) Anonymise this WritableImage.voidclose()Closes anANZImageand frees up resources.voidGives this image the option to free up resources by removing access to image data.Returns the byte order for this image.getCopy()Creates an in-memory copy of an Analyze image.Returns the data type (ANZPixFormat) of this image.Returns a String description of this image.getDescription(int slice) Returns a String description of this one particular slice of this image.int[]getDims()Returns the dimensions (numbers of samples in each image dimension) of this image.intReturns the byte offset into the disk-based file format where pixel data begins.Returns the ANZHeader image header for this image.Returns a String description of this image in HTML format.getHTMLDescription(int slice) Returns a String description of a slice of this image in HTML format.org.jogamp.vecmath.Vector3f[]Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (L,P,S) coordinates.org.jogamp.vecmath.Vector3f[]getImageOrientationPatient(int slice) Returns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient coordinates.org.jogamp.vecmath.Point3fReturns the coordinates of the center of the first pixel of the image, in mm, in patient coordinates.org.jogamp.vecmath.Point3fgetImagePositionPatient(int slice) Returns the coordinates of the center of the first pixel of the specified slice of this image, in mm, in patient coordinates.getMax()Returns the maximum pixel intensity in the image.getMin()Returns the minimum pixel intensity in the image.Returns aColourMappingif this Analyze image has an associated colour mapping.Returns a String showing the 'native' header for this image.intgetNCols()Returns the number of image columns in this image.intgetNDim()Returns the dimensionality of this image.intReturns the number of frames in a multi-frame image.intgetNRows()Returns the number of image rows in this image.intReturns the number of physical slice locations in this image.floatReturns the pixel size in the x (horizontal) direction for this image.floatReturns the pixel size in the y (vertical) direction for this image.floatReturns the separation between the centres of image planes for this image.com.xinapse.dicom.RescaleUnitsReturns the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved bygetIntensityRescale().Returns aPixelDataTyperepresenting the data type of this image, as the pixel values are stored on disk.floatReturns the time between frames in a 4- or higher dimensional image.getTitle()Returns the title of this image.intReturns the total number of slices in this image.static booleanimageExists(String filename) Tests whether anANZImagewith the given name already exists on disk.booleanTests whether thisANZImageis compressed when on disk.booleanisOpen()Tests whether this image is still open.voidSets the data base name for this ANZImage.voidsetDescription(String descripstr) Sets the description for this ANZImage.voidsetImageOrientationPositionPatient(org.jogamp.vecmath.Vector3f[] dirCos, org.jogamp.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.voidsetMinMax(int min, int max) Sets the glMin and glMax fields for this ANZImage.voidsetNativeColourMapping(ColourMapping colourMapping) Sets theColourMappingfor this image.voidsetPixelSpacing(Float[] spacing) Sets the distance (in mm) between pixel centres in the row, column and slice directions of the image, and the time between movie frames (for 4-D images) in seconds.voidsetPixelXSize(float width) Sets the pixel size in the x (horizontal) direction for this image.voidsetPixelYSize(float height) Sets the pixel size in the y (vertical) direction for this image.voidsetPixelZSize(float thickness) Sets the pixel size in the z (slice) direction for this image.voidsetTimeBetweenFrames(float deltaT) Sets the time between frames in a 4- or higher dimensional image.voidSets the title for this WritableImage, if the image format can handle titles.static StringstripExtension(String filename) Strips any ".img", ".hdr", ".img.gz" or ".hdr.gz" extension (in either upper or lower case) from a file name.toString()Writes this ANZImage to disk.Methods inherited from class com.xinapse.multisliceimage.MultiSliceImage
clone, getBodyPart, getDateFormat, getFrameDim, getFrameOfReferenceUID, getLaterality, getModality, getMostLikePlane, getPix, getPix, getPix, getPix, getPix, getPresentationPixelDataType, getROIs, getScanDateFormat, getSlice, getSlice, getSliceDim, getStoredPix, getSuggestedFileName, isModified, main, parseMultiValuedString, putPix, putPix, putPix, putPix, putSlice, setBodyPart, setFrameOfReferenceUID, setImageOrientationPatient, setIntensityRescale, setLaterality, setMinMax, setModality, setModified, setSeriesInstanceUID, setStudyInstanceUID, setSuggestedFileNameMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.xinapse.image.ReadableImage
getAffineTransform, getAffineTransform, getEchoTrainLength, getFlipAngle, getFrameDWBMatrix, getFrameDWbValue, getFrameDWGradientVector, getFrameTriggerDelayMS, getIntensityRescale, getNSliceLocations, getPatientDoB, getPatientID, getPatientName, getPatientPosition, getPatientSex, getPulseSequence, getSaturationFreqOffsetPPM, getSaturationFreqOffsetPPM, getScanDate, getScanningSequence, getScanTE, getScanTE, getScanTI, getScanTR, getSequenceVariant, getSeriesDescription, getSeriesNumber, getSliceDWBMatrix, getSliceDWbValue, getSliceDWGradientVector, getSliceThickness, getSliceTriggerDelayMS, getStudyIDMethods inherited from interface com.xinapse.image.WritableImage
appendAuditInfo, appendToTitle, getImageTypeName, setEchoTrainLength, setFlipAngle, setFrameDWBMatrix, setFrameDWbValue, setFrameDWGradientVector, setFrameTriggerDelayMS, setImagePositionPatient, setIntensityRescale, setPatientDoB, setPatientID, setPatientName, setPatientPosition, setPatientSex, setPulseSequence, setRescaleUnits, setSaturationFreqOffsetPPM, setSaturationFreqOffsetPPM, setScanDate, setScanningSequence, setScanTE, setScanTE, setScanTI, setScanTR, setSequenceVariant, setSeriesDescription, setSeriesNumber, setSliceDWBMatrix, setSliceDWbValue, setSliceDWGradientVector, setSliceThickness, setSliceTriggerDelayMS, setStudyID, supportsIntensityRescaling
-
Field Details
-
EXTENSION
The file extension for Analyze image files in lower case form.- See Also:
-
UPPERCASE_EXTENSION
The file extension for Analyze image files in upper case form. -
COMPRESSED_EXTENSION
The file extension for Analyze image files in lower case form.- See Also:
-
COMPRESSED_UPPERCASE_EXTENSION
The file extension for Analyze image files in upper case form.
-
-
Method Details
-
getByteOrder
Description copied from class:MultiSliceImageReturns the byte order for this image.- Specified by:
getByteOrderin classMultiSliceImage- Returns:
- the byte oder for this image, or
nullif the byte order is not defined yet (in-memory images only).
-
imageExists
Tests whether anANZImagewith the given name already exists on disk. File extensions are handled in a smart and case-insensitive way.- Parameters:
filename- the name of the image file to test for existence.- Returns:
trueif a pair of ANZImage .img and .hdr with the specified name exist on disk;falseotherwise.
-
write
Writes this ANZImage to disk.- Specified by:
writein interfaceWritableImage- Parameters:
filename- the root of the Analyze filename. Will be appended with ".img" and ".hdr" to create the appropriate full filenames.- Returns:
- the actual file name used to write the image, including any added extension.
- Throws:
InvalidImageException- if the image cannot be written.IOException- if an I/O error occurs.
-
disposeImageData
public void disposeImageData()Description copied from interface:ReadableImageGives this image the option to free up resources by removing access to image data. After this method is called, image data may no longer be accessible, and method calls to access it may result in an Exception being thrown.- Specified by:
disposeImageDatain interfaceReadableImage
-
close
Closes anANZImageand frees up resources. For in-memoryANZImages, this merely explicity frees resources so that the garbage collector can work more efficiently. However, for disk-based images it is essential to apply the close() method. Image data is written to disk during the put methods, but header information is only written to disk by the close() method. If the close() method is not applied to a disk-basedANZImage, then any changes to the header will be lost. Any further operations to a closedANZImageare not possible, and may cause an exception to be thrown.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceReadableImage- Throws:
IOException- if an I/O error occurs.
-
isOpen
public boolean isOpen()Description copied from interface:ReadableImageTests whether this image is still open.- Specified by:
isOpenin interfaceReadableImage- Returns:
trueif the image is still open for reading and (if opened read/write) writing;falseotherwise.
-
isCompressed
public boolean isCompressed()Tests whether thisANZImageis compressed when on disk.- Returns:
trueif compressed;falseotherwise.
-
getNativeHeader
Description copied from interface:ReadableImageReturns a String showing the 'native' header for this image.- Specified by:
getNativeHeaderin interfaceReadableImage- Returns:
- a String describing the 'native' header for this image.
-
toString
-
getDataType
Returns the data type (ANZPixFormat) of this image.- Returns:
- an
ANZPixFormatrepresenting a particular pixel data type.
-
setDBName
Sets the data base name for this ANZImage.- Parameters:
name- a String representing the name data base name.- Throws:
ANZException- if the data base name cannot be set for this image.
-
setDescription
Sets the description for this ANZImage.- Parameters:
descripstr- a String representing the name description.- Throws:
ANZException- if the description cannot be set for the image header.
-
setMinMax
Sets the glMin and glMax fields for this ANZImage.- Specified by:
setMinMaxin interfaceWritableImage- Specified by:
setMinMaxin classMultiSliceImage- Parameters:
min- the minimum pixel value in the image.max- the maximum pixel value in the image.- Throws:
InvalidImageException- if the values supplied are unsuitable, or the values cannot be set.
-
getHeader
Returns the ANZHeader image header for this image. Warning! If this header is manipulated, then accessing the image pixel data may cause errors.- Returns:
- the Analyze image header for this image.
-
getNCols
public int getNCols()Description copied from interface:ReadableImageReturns the number of image columns in this image.- Specified by:
getNColsin interfaceReadableImage- Returns:
- the number of image columns.
-
getNRows
public int getNRows()Description copied from interface:ReadableImageReturns the number of image rows in this image.- Specified by:
getNRowsin interfaceReadableImage- Returns:
- the number of image rows.
-
getNSlices
public int getNSlices()Description copied from interface:ReadableImageReturns the number of physical slice locations in this image. If the image dimensionality is greater than or equal to three, then this method returns the number of samples in the third dimension. If the dimensionality is less than 3 two, it returns 1.- Specified by:
getNSlicesin interfaceReadableImage- Returns:
- the number of physical slice locations.
-
getNFrames
public int getNFrames()Description copied from interface:ReadableImageReturns the number of frames in a multi-frame image. If the image dimensionality is greater than or equal to four, then this method returns the number of samples in the fourth dimension. If the dimensionality is less than 4, it returns 1.- Specified by:
getNFramesin interfaceReadableImage- Returns:
- the number of image (movie) frames.
-
getTotalNSlices
public int getTotalNSlices()Description copied from interface:ReadableImageReturns the total number of slices in this image. If the image is less than 3-dimensional, this method returns 1; if it is 3-dimensional, it returns the number of slices; if it is 4- or more dimensional, it sums up the total number of planar slices in each dimension and returns the total. For example a 4-dimensional image with 4 slices and 10 frames, the total number of slices is 40.- Specified by:
getTotalNSlicesin interfaceReadableImage- Returns:
- the number of planar image slices.
-
getNDim
Description copied from interface:ReadableImageReturns the dimensionality of this image.- Specified by:
getNDimin interfaceReadableImage- Returns:
- the image dimensionality.
- Throws:
IllegalStateException
-
getDims
Description copied from interface:ReadableImageReturns the dimensions (numbers of samples in each image dimension) of this image.- Specified by:
getDimsin interfaceReadableImage- Returns:
- an array with length equal to the image dimensionality, containing the
numbers of pixels (samples) in each dimension of the image.
By convention, element (nDim-1) contains the number of columns,
element (nDim-2) the number of rows, etc. For example, in a 4-dimensional image,
dims[0]is the number of frames,dims[1]the number of slices,dims[2]the number of rows anddims[3]the number of columns. - Throws:
IllegalStateException
-
getStoredPixelDataType
Description copied from interface:ReadableImageReturns aPixelDataTyperepresenting the data type of this image, as the pixel values are stored on disk.- Specified by:
getStoredPixelDataTypein interfaceReadableImage- Returns:
- the
PixelDataTyperepresenting the data type of this image as stored on disk.
-
getFileDataOffset
public int getFileDataOffset()Description copied from class:MultiSliceImageReturns the byte offset into the disk-based file format where pixel data begins.- Specified by:
getFileDataOffsetin classMultiSliceImage- Returns:
- the byte offset to the start of pixel data for images that are written to disk.
-
getPixelXSize
Description copied from interface:ReadableImageReturns the pixel size in the x (horizontal) direction for this image.- Specified by:
getPixelXSizein interfaceReadableImage- Returns:
- the pixel size in the x (horizontal) direction in mm.
- Throws:
ParameterNotSetException- if the pixel size can't be found.
-
setPixelXSize
Description copied from class:MultiSliceImageSets the pixel size in the x (horizontal) direction for this image.- Specified by:
setPixelXSizein classMultiSliceImage- Parameters:
width- the width of a pixel.- Throws:
IllegalArgumentException- if the pixel width is not positive.IOException- if and I/O error occurs.
-
getPixelYSize
Description copied from interface:ReadableImageReturns the pixel size in the y (vertical) direction for this image.- Specified by:
getPixelYSizein interfaceReadableImage- Returns:
- the pixel size in the y (vertical) direction in mm.
- Throws:
ParameterNotSetException- if the pixel size can't be found.
-
setPixelYSize
Description copied from class:MultiSliceImageSets the pixel size in the y (vertical) direction for this image.- Specified by:
setPixelYSizein classMultiSliceImage- Parameters:
height- the height of a pixel.- Throws:
IllegalArgumentException- ifheightis not positive.IOException- if an I/O error occurs.
-
getPixelZSize
Description copied from interface:ReadableImageReturns the separation between the centres of image planes for this image.- Specified by:
getPixelZSizein interfaceReadableImage- Returns:
- the pixel size in the z (slice) direction in mm.
- Throws:
ParameterNotSetException- if the pixel size can't be found.
-
setPixelZSize
Description copied from class:MultiSliceImageSets the pixel size in the z (slice) direction for this image.- Specified by:
setPixelZSizein classMultiSliceImage- Parameters:
thickness- the thickness of a pixel.- Throws:
IllegalArgumentException- ifthicknessis not positive.IOException- if an I/O error occurs.
-
getTimeBetweenFrames
Description copied from interface:ReadableImageReturns the time between frames in a 4- or higher dimensional image.- Specified by:
getTimeBetweenFramesin interfaceReadableImage- Returns:
- the time between frames in seconds.
- Throws:
ParameterNotSetException- if the time between frames is not set, or if this image doesn't have a dimensionality of at least 4.
-
setTimeBetweenFrames
Description copied from class:MultiSliceImageSets the time between frames in a 4- or higher dimensional image.- Specified by:
setTimeBetweenFramesin classMultiSliceImage- Parameters:
deltaT- the time between frames (in seconds).- Throws:
IllegalArgumentException- ifdeltaTis negative.IOException- if an I/O error occurs.
-
getImageOrientationPatient
public org.jogamp.vecmath.Vector3f[] getImageOrientationPatient()Description copied from interface:ReadableImageReturns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient (L,P,S) coordinates.- Specified by:
getImageOrientationPatientin interfaceReadableImage- Returns:
- a
Vector3f[], corresponding to the direction cosines of the image row, column and slice directions in Left,Posterior,Superior (LPS) coordinates. Returnsnullif the direction cosines cannot be retrieved from this image.
-
getImageOrientationPatient
public org.jogamp.vecmath.Vector3f[] getImageOrientationPatient(int slice) throws IndexOutOfBoundsException Description copied from interface:ReadableImageReturns the direction cosines of the row, column and slice directions (for increasing row, column and slice) of the image, in patient coordinates.- Specified by:
getImageOrientationPatientin interfaceReadableImage- Parameters:
slice- the slice for which to return the image orientation.- Returns:
- a
Vector3f[], corresponding to the direction cosines of the image row, column and slice directions in Left,Posterior,Superior (LPS) coordinates. Returnsnullif the direction cosines cannot be retrieved from this image. - Throws:
IndexOutOfBoundsException- if the image does not have the right dimensionality or the slice number is inappropriate for this image.
-
getImagePositionPatient
public org.jogamp.vecmath.Point3f getImagePositionPatient()Description copied from interface:ReadableImageReturns the coordinates of the center of the first pixel of the image, in mm, in patient coordinates. This method will only return if the image pixels form a regular array of pixels with parallel image planes; otherwise a ParameterNotSetException is thrown.- Specified by:
getImagePositionPatientin interfaceReadableImage- Returns:
- the Left,Posterior,Superior (LPS) coordinates of the first pixel
in the image data matrix. Returns
nullif the position cannot be retrieved from this image.
-
getImagePositionPatient
public org.jogamp.vecmath.Point3f getImagePositionPatient(int slice) throws IndexOutOfBoundsException Description copied from interface:ReadableImageReturns the coordinates of the center of the first pixel of the specified slice of this image, in mm, in patient coordinates.- Specified by:
getImagePositionPatientin interfaceReadableImage- Parameters:
slice- the slice number (indexed from 0) for which to return the pixel coordinates.- Returns:
- the Left,Posterior,Superior (LPS) coordinates of the first pixel
in the specified slice of this image. Returns
nullif the position cannot be retrieved from this image. - Throws:
IndexOutOfBoundsException- if the slice number is bad for this image.
-
setImageOrientationPositionPatient
public void setImageOrientationPositionPatient(org.jogamp.vecmath.Vector3f[] dirCos, org.jogamp.vecmath.Point3f position, boolean force) throws IOException Description copied from class:MultiSliceImageSets 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.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
Preferencesfor whether to put pixel values in an order that is compatible with SPM. After using this method, you should use theReadableImage.getImageOrientationPatient()andReadableImage.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.
- Specified by:
setImageOrientationPositionPatientin interfaceWritableImage- Specified by:
setImageOrientationPositionPatientin classMultiSliceImage- Parameters:
dirCos- the direction cosines of the image row, column and (optionally) slice directions respectively in Left,Posterior,Superior (LPS) coordinates. If orientation isnull, 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 isnull, this method will attempt to clear any positional information, if that is supported by the image format.force- iftrue, this method will force the orientation and position to be set as requested, regardless of the userPreferences. 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.- Throws:
IOException- if an I/O error occurs.
-
setPixelSpacing
public void setPixelSpacing(Float[] spacing) throws IndexOutOfBoundsException, IOException, IllegalArgumentException Description copied from interface:WritableImageSets the distance (in mm) between pixel centres in the row, column and slice directions of the image, and the time between movie frames (for 4-D images) in seconds. The distances and time should always be positive values.- Specified by:
setPixelSpacingin interfaceWritableImage- Parameters:
spacing- a Float[] of length up to 4, corresponding to the distance between pixel centres in the row, column, slice and time directions, respectively. Spacing values will only be set for image dimensions where the spacing array is long enough and the array element is non-null. The first element of the array indicates the horizontal pixel size; the second is the vertical pixel size; the third is the pixel depth; fourth is the time between frames.- Throws:
IndexOutOfBoundsException- ifspacingdoes not have the correct dimensions.IOException- if the pixel spacing cannot be set for this image.IllegalArgumentException
-
getRescaleUnits
public com.xinapse.dicom.RescaleUnits getRescaleUnits()Description copied from interface:ReadableImageReturns the output units of Intensity Rescale Slope and Intensity Rescale Intercept, retrieved bygetIntensityRescale().- Specified by:
getRescaleUnitsin interfaceReadableImage- Returns:
- the RescaleUnits describing the physical meaning of the pixel intensity units. Returns the RescaleUnits.US if the physical meaning is unknown, or arbitrary.
-
getDescription
Description copied from interface:ReadableImageReturns a String description of this image.- Specified by:
getDescriptionin interfaceReadableImage- Returns:
- a String describing this image.
-
getDescription
Description copied from interface:ReadableImageReturns a String description of this one particular slice of this image.- Specified by:
getDescriptionin interfaceReadableImage- Parameters:
slice- the slice to describe.- Returns:
- a String describing the given slice of this image.
-
getTitle
Description copied from interface:ReadableImageReturns the title of this image.- Specified by:
getTitlein interfaceReadableImage- Returns:
- the title of this image.
-
setTitle
Description copied from interface:WritableImageSets the title for this WritableImage, if the image format can handle titles.- Specified by:
setTitlein interfaceWritableImage- Parameters:
title- the new title.- Throws:
IOException- if an error occurs writing the title.
-
anonymise
public void anonymise(String patientName, String patientID, Date birthDate, boolean patSex, String patAddr, String patInsurancePlanID, String accessionNumber, boolean patOther, String physicianName, String physicianAddr, String institutionName, String institutionAddr, String deptName, String stationName, String telNumber, boolean removePrivateElements) throws IOException Description copied from interface:WritableImageAnonymise this WritableImage.- Specified by:
anonymisein interfaceWritableImage- Parameters:
patientName- if non-null, the patient name to substitute.patientID- if non-null, the patient ID to substitute.birthDate- if non-null, the birth date to substitute.patSex- if true, set the sex to "OTHER".patAddr- if non-null, the address to substitute.patInsurancePlanID- if non-null, the insurance plan ID to substitute.accessionNumber- if non-null, the accession number to substitute.patOther- if true, other patient-related items will be anonymised.physicianName- if non-null, the physician name to substitute.physicianAddr- if non-null, the physician's address to substitute.institutionName- if non-null, the institution name to substitute.institutionAddr- if non-null, the institution address to substitute.deptName- if non-null, the department name to substitute.stationName- if non-null, the station name to substitute.telNumber- if non-null, the telephone number to substitute for all telephone numbers.removePrivateElements- if true, all private DICOM elements will be removed.- Throws:
IOException- if an I/O error occurs during anonymisation.
-
getHTMLDescription
Description copied from interface:ReadableImageReturns a String description of this image in HTML format.- Specified by:
getHTMLDescriptionin interfaceReadableImage- Returns:
- a String describing this image.
-
getHTMLDescription
Description copied from interface:ReadableImageReturns a String description of a slice of this image in HTML format.- Specified by:
getHTMLDescriptionin interfaceReadableImage- Parameters:
slice- the slice number.- Returns:
- a String describing this image slice.
-
getNativeColourMapping
Returns aColourMappingif this Analyze image has an associated colour mapping. Colour mappings are kept in a file with an extension ".lkup" and with the same name root as the Analyze image.- Specified by:
getNativeColourMappingin interfaceReadableImage- Returns:
- a
ColourMappingif this image has an associated colour mapping. Returnsnullif it does not.
-
setNativeColourMapping
Description copied from interface:WritableImageSets theColourMappingfor this image. No exception occurs if the image format does not support a colour mapping.
N.B. For disk-based images, the changes in the ColourMapping may not be reflected on disk unless the close() method is called.- Specified by:
setNativeColourMappingin interfaceWritableImage- Parameters:
colourMapping- the new ColourMapping to be assigned to this image.- Throws:
IOException- if the ColourMapping cannot be set for this image.
-
getMin
Description copied from interface:ReadableImageReturns the minimum pixel intensity in the image.- Specified by:
getMinin interfaceReadableImage- Returns:
- the maximum pixel intensity as a
Double, ornullif the intensity min hasn't been calculated for this image. - Throws:
InvalidImageException- if the intensity cannot be returned as a Double.
-
getMax
Description copied from interface:ReadableImageReturns the maximum pixel intensity in the image.- Specified by:
getMaxin interfaceReadableImage- Returns:
- the maximum pixel intensity as a
Double, ornullif the intensity max hasn't been calculated for this image. - Throws:
InvalidImageException- if the intensity cannot be returned as a Double.
-
getCopy
Creates an in-memory copy of an Analyze image.- Specified by:
getCopyin interfaceReadableImage- Specified by:
getCopyin interfaceWritableImage- Returns:
- a copy of the ANZImage Object.
-
stripExtension
Strips any ".img", ".hdr", ".img.gz" or ".hdr.gz" extension (in either upper or lower case) from a file name.- Parameters:
filename- the file name that may or may not have an extension.- Returns:
- the stripped file name.
-