Class FileInfoDicom
- All Implemented Interfaces:
Serializable,Cloneable
This class contains DICOM header information. It uses a table to store all the information about the tags. The FileDicomTagTable listing all known tags with empty values is in DicomDictionary. Also stored here is the offset of the image, the image number, the resolutions, some pixel data, the bytes allocated, and the dimensions of the image.
This file also contains a table used for displaying the tag information. There is an option to display just the standard tags or both the standard and the private tags.
- Version:
- 1.0 Aug 1, 1999
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classThis class is a basic storage unit for a primitive integer variable.static enumNested classes/interfaces inherited from class gov.nih.mipav.model.file.FileInfoBase
FileInfoBase.AxisOrientation, FileInfoBase.ImageOrientation, FileInfoBase.Modality, FileInfoBase.Unit, FileInfoBase.UnitType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]these are the DICOM tag ID numbers corresponding to the tags which are anonymized.shortBits allocated per pixel.shortBits stored per pixel>shortNumber of bytes per pixel.booleanTrue if the DICOM file has the ID DICM at beginning at file pointer 128.intData type.shortintDICOM instance number.booleanWhether the tag currently being processed and read in is a sequence tag.private booleanwhether it is enhanced dicom or notprivate ModelLUTLUT for pre-processing of dicom filebooleanTrue indicates image has multiple image planes in a single file.booleanTrue is image format invalid input: '<' DICOM 3.0.Orientation - SAGITTAL, CORONAL, AXIAL.intType of image - color, monochrome etc.Pixel Padding Value (0028, 0120).shortDICOM tag (0028, 0103) -1 = undefined 0 = unsigned 1 = signedshort0 = RGB, RGB, 1 = R R R, G G G, B B B.private intprivate static final longUse serialVersionUID for interoperability.static final int(0028,0103) Pixel RepresentationsfloatDICOM slice location.private FileDicomTagTableStores all the information about the DICOM tags.static final int(0028,0103) Pixel Representationsstatic final int(0028,0103) Pixel Representationsprivate FileInfoDicom.VRtypeVR type can be IMPLICIT or EXPLICIT.floatDICOM x coordianate of the slice location.floatDICOM y coordianate of the slice location.floatDICOM z coordianate of the slice location.Fields inherited from class gov.nih.mipav.model.file.FileInfoBase
ANGSTROMS, ANGSTROMS_STRING, AXIAL, axisOrientation, axisOrientationStr, BIOMAGNETIC_IMAGING, cameraMake, cameraModel, CENTIMETERS, CENTIMETERS_STRING, COLOR_FLOW_DOPPLER, COMPRESSION_BZIP2, COMPRESSION_GZIP, COMPRESSION_NONE, COMPRESSION_ZIP, COMPUTED_RADIOGRAPHY, COMPUTED_TOMOGRAPHY, conversionSpaceTimeUnits, CORONAL, DEGREES, DEGREES_STRING, DIAPHANOGRAPHY, DIGITAL_RADIOGRAPHY, dtiParams, DUPLEX_DOPPLER, ENDOSCOPY, exposureTime, EXTERNAL_CAMERA_PHOTOGRAPHY, FA, fileName, fileSuffix, FNumber, focalLength, focalLength35, GENERAL_MICROSCOPY, HARDCOPY, HOURS, HOURS_STRING, HZ, HZ_STRING, ICG, imageOrientation, INCHES, INCHES_STRING, INTRAORAL_RADIOGRAPHY, ISOSpeedRating, KILOMETERS, KILOMETERS_STRING, LASER_SURFACE_SCAN, MAGNETIC_RESONANCE, MAGNETIC_RESONANCE_ANGIOGRAPHY, MAGNETIC_RESONANCE_SPECTROSCOPY, MAMMOGRAPHY, METERS, METERS_STRING, MICROMETERS, MICROMETERS_STRING, MICROSEC, MICROSEC_STRING, MILES, MILES_STRING, MILLIMETERS, MILLIMETERS_STRING, MILLISEC, MILLISEC_STRING, MILS, MILS_STRING, MINUTES, MINUTES_STRING, modality, NANOMETERS, NANOMETERS_STRING, NANOSEC, NANOSEC_STRING, NUCLEAR_MEDICINE, ORI_A2P_TYPE, ORI_I2S_TYPE, ORI_L2R_TYPE, ORI_P2A_TYPE, ORI_R2L_TYPE, ORI_S2I_TYPE, ORI_UNKNOWN_TYPE, origin, OTHER, PANORAMIC_XRAY, POSITRON_EMISSION_TOMOGRAPHY, PPM, PPM_STRING, RADIO_FLUOROSCOPY, RADIOGRAPHIC_IMAGING, RADIOTHERAPY_DOSE, RADIOTHERAPY_IMAGE, RADIOTHERAPY_PLAN, RADIOTHERAPY_RECORD, RADIOTHERAPY_STRUCTURE_SET, RADS, RADS_STRING, RED_FREE, SAGITTAL, SECONDS, SECONDS_STRING, SINGLE_PHOTON_EMISSION_COMPUTED_TOMOGRAPHY, SLIDE_MICROSCOPY, sUnits, tagDescription, tagName, THERMOGRAPHY, TRANSFORM_ANOTHER_DATASET, TRANSFORM_MNI_152, TRANSFORM_SCANNER_ANATOMICAL, TRANSFORM_TALAIRACH_TOURNOUX, TRANSFORM_UNKNOWN, tUnits, ULTRASOUND, unitsOfMeasure, UNKNOWN_MEASURE, UNKNOWN_MODALITY, UNKNOWN_ORIENT, UNKNOWN_STRING, XRAY_ANGIOGRAPHY -
Constructor Summary
ConstructorsConstructorDescriptionFileInfoDicom(String name, String directory, int format) DICOM file information constructor.FileInfoDicom(String name, String directory, int format, FileInfoDicom refInfo) DICOM file information constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidanonymize(boolean[] list, boolean removeValue) removes any and all personal information in the info that a doctor, patient, researcher may want to have deleted from the image, such as patient name or patient ID number--from this slice given by this fileInfoDicom.final voidanonymizePublicSequenceTags(FileDicomKey[] keys, Vector<FileDicomSQItem> seqs, boolean removeValue) Method to anonymize public tags not in the DICOM Supplement 55 that may appear in sequence tags.final voidanonymizePublicTags(FileDicomKey[] keys, boolean removeValue) Method to anonymize public tags that do not appear in the DICOM Supplement 55.voidanonymizeSequenceTags(boolean[] list, Vector<FileDicomSQItem> seqs, boolean removeValue) Method to anonymize the tags found in the DICOM supplement 55 that may appear in sequence tags.private voidappendLengthTag(FileDicomTag tag, HashMap<Integer, FileInfoDicom.LengthStorageUnit> lengthComp) final voiddisplayAboutInfo(JDialogBase dialog, TransMatrix matrix) Super requires displayAboutInfo to be defined display of this class is held by JDialogFileInfoDICOM.voidfinalize()Prepares this class for cleanup.generateNewTagValue(String key, boolean remove) Generates a new version of a particular tag that is DICOM compatiblestatic ObjectgenerateNewTagValue(String key, FileDicomTagTable tagTable, boolean remove) Generates a new version of a particular tag in the given tag table with same length that is DICOM compatiblestatic ObjectgenerateNewTagValue(String key, String strValue) Generates a new version of a particular tag in the standard DICOM tag table with same length that is DICOM compatiblestatic ObjectgenerateNewTagValue(String key, String strValue, FileDicomTagInfo.VR vr) Generates a new version of a particular tag given an arbitrary value and returns a DICOM compatible resultstatic ObjectgenerateNewTagValue(String key, String strValue, FileDicomTagInfo.VR vr, boolean remove) final ModelLUTgetLUT()returns the ModelLUT, if there, which might be specified by the0028,1201,0028,1202,0028,1203tags.protected static final intgetModalityFromDicomStr(String value) Returns the MIPAV modality constant for a given DICOM modality string.intfinal TransMatrixThis method extracts directional cosines from the DICOM image header (tag = "0020, 0037").intfinal FileDicomTagTableReturns a reference to the tag table for this dicom file info.booleanfinal booleanAccessor for the status of this dicom info.final String[]parseTagValue(String tagName) Parse the string for Objects seperated by "\".final voidremovePrivateSequenceTags(FileDicomKey[] keys, Vector<FileDicomSQItem> seqs) Method to anonymize private tags that may appear in sequence tags.final voidremovePrivateSequenceTagsWhite(FileDicomKey[] keys, Vector<FileDicomSQItem> seqs) final voidremovePrivateTags(FileDicomKey[] keys) Method to remove private tags from the file.final voidremovePrivateTagsWhite(FileDicomKey[] keys) voidIn anonymization cases it may be necessary to hide the fact that MIPAV has processed this image (to remove any NIH affiliation).protected final voidSets fields in this file info based on a given tag's key and value.final voidPublic method for populating ModelImage data fields.private final voidsetInfoFromTags(FileDicomTagTable tagTable, boolean insideSequenceTag) After the tag table is filled, check for a number of tags to set up some fields in this file info object.voidsetIsEnhancedDicom(boolean isEnhancedDicom) protected final voidsetModalityFromDicomStr(String value) Uses the DICOM tag value to set the Image modality field.final voidsetMultiFrame(boolean multiFrame) Sets whether the DICOM image is a multiFrame image.voidsetOriginalDataType(int originalDataType) voidsetRLETAMARencapsulatedOffset(int offset) voidsetSecondaryCaptureTags(boolean isMultiFrame, int dataType) Changes a few dicom tags associated with a secondary capture image (marking it as having been created with mipav).final voidsetTagTable(FileDicomTagTable tagTable) voidsetVr_type(FileInfoDicom.VRtype vr_type) private voidupdateLengthTags(HashMap<Integer, FileInfoDicom.LengthStorageUnit> lengthComp) Methods inherited from class gov.nih.mipav.model.file.FileInfoBase
copyCoreInfo, copyCoreInfo, displayAboutInfo, displayPrimaryInfo, getAboutInfo, getAllSameDimUnits, getAreaUnitsOfMeasureStr, getAxisDirection, getAxisOrientation, getAxisOrientation, getAxisOrientationFromStr, getAxisOrientationStr, getCameraMake, getCameraModel, getCompressionType, getDataType, getDataTypeFromStr, getDTIParameters, getEndianess, getEndianessFromStr, getExposureTime, getExtents, getFileDirectory, getFileFormat, getFileName, getFileSuffix, getFNumber, getFocalLength, getFocalLength35, getImageOrientation, getImageOrientationFromStr, getImageOrientationStr, getIs2_5D, getISOSpeedRating, getLPSOrigin, getMax, getMaxB, getMaxG, getMaxR, getMin, getMinB, getMinG, getMinR, getModality, getModalityFromStr, getModalityStr, getModalityStr, getMultiFile, getNumOfBytesPerPixel, getOffset, getOrigin, getOrigin, getOriginalEndianess, getOriginAtSlice, getPhotometric, getPixelPadValue, getPrimaryInfo, getRescaleIntercept, getRescaleSlope, getResolution, getResolutions, getSize, getSliceThickness, getUnitsOfMeasure, getUnitsOfMeasure, getUnitsOfMeasureAbbrevStr, getUnitsOfMeasureAbbrevStr, getUnitsOfMeasureFromStr, getUnitsOfMeasureStr, getUnitsOfMeasureStr, getVolumeUnitsOfMeasureStr, isDicomOrdered, oppositeOrient, sameAxis, setAxisOrientation, setAxisOrientation, setCameraMake, setCameraModel, setCompressionType, setDataType, setDTIParameters, setEndianess, setExposureTime, setExtents, setExtents, setFileDirectory, setFileFormat, setFileName, setFileSuffix, setFNumber, setFocalLength, setFocalLength35, setImageOrientation, setISOSpeedRating, setLUT, setMax, setMaxB, setMaxG, setMaxR, setMin, setMinB, setMinG, setMinR, setModality, setMultiFile, setOffset, setOrigin, setOrigin, setOriginalEndianess, setPhotometric, setPixelPadValue, setRescaleIntercept, setRescaleSlope, setResolutions, setResolutions, setSliceThickness, setTagDescription, setTagName, setUnitsOfMeasure, setUnitsOfMeasure, setUnitsOfMeasure, setUnitsOfMeasure, toStringMethods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
clone, nativeClone
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
UNDEFINED_PIXEL_REP
public static final int UNDEFINED_PIXEL_REP(0028,0103) Pixel Representations- See Also:
-
UNSIGNED_PIXEL_REP
public static final int UNSIGNED_PIXEL_REP(0028,0103) Pixel Representations- See Also:
-
SIGNED_PIXEL_REP
public static final int SIGNED_PIXEL_REP(0028,0103) Pixel Representations- See Also:
-
RLETAMARencapsulatedOffset
private int RLETAMARencapsulatedOffset -
anonymizeTagIDs
these are the DICOM tag ID numbers corresponding to the tags which are anonymized. They are kept here for simplicity of updating (when it is decided that other tags are must be anonymized) and to the advantage of calling objects. -
bitsAllocated
public short bitsAllocatedBits allocated per pixel. -
bitsStored
public short bitsStoredBits stored per pixel> -
highBit
public short highBit -
bytesPerPixel
public short bytesPerPixelNumber of bytes per pixel. -
originalDataType
public int originalDataType -
containsDICM
public boolean containsDICMTrue if the DICOM file has the ID DICM at beginning at file pointer 128. -
displayType
public int displayTypeData type. -
instanceNumber
public int instanceNumberDICOM instance number. -
isCurrentTagSQ
public boolean isCurrentTagSQWhether the tag currently being processed and read in is a sequence tag. -
multiFrame
public boolean multiFrameTrue indicates image has multiple image planes in a single file. -
olderVersion
public boolean olderVersionTrue is image format invalid input: '<' DICOM 3.0. -
orientation
Orientation - SAGITTAL, CORONAL, AXIAL. -
photometricInterp
Type of image - color, monochrome etc. -
pixelPaddingValue
Pixel Padding Value (0028, 0120). Value of pixels added to non-rectangular image to pad to rectangular format. -
pixelRepresentation
public short pixelRepresentationDICOM tag (0028, 0103) -1 = undefined 0 = unsigned 1 = signed -
planarConfig
public short planarConfig0 = RGB, RGB, 1 = R R R, G G G, B B B. -
sliceLocation
public float sliceLocationDICOM slice location. -
vr_type
VR type can be IMPLICIT or EXPLICIT. -
xLocation
public float xLocationDICOM x coordianate of the slice location. -
yLocation
public float yLocationDICOM y coordianate of the slice location. -
zLocation
public float zLocationDICOM z coordianate of the slice location. -
tagTable
Stores all the information about the DICOM tags. -
isEnhancedDicom
private boolean isEnhancedDicomwhether it is enhanced dicom or not -
lut
LUT for pre-processing of dicom file
-
-
Constructor Details
-
FileInfoDicom
DICOM file information constructor. Used for the file info which contains the reference tag table for an image.- Parameters:
name- file namedirectory- file directoryformat- format (in this case, DICOM)
-
FileInfoDicom
DICOM file information constructor. Used for the file info which does NOT contain the reference tag table for an image.- Parameters:
name- file namedirectory- file directoryformat- format (in this case, DICOM)refInfo- The reference file info, containing the reference tag table.
-
-
Method Details
-
setRLETAMARencapsulatedOffset
public void setRLETAMARencapsulatedOffset(int offset) -
getRLETAMARencapsulatedOffset
public int getRLETAMARencapsulatedOffset() -
anonymize
public final void anonymize(boolean[] list, boolean removeValue) removes any and all personal information in the info that a doctor, patient, researcher may want to have deleted from the image, such as patient name or patient ID number--from this slice given by this fileInfoDicom.In addition, it allows the change or removal of a whole list of information, such as: ("0010,0010") Patient name; ("0010,0020") patient ID number; ("0010,0050") patient Insurance plan code sequence; ("0010,1000") other patient IDs; ("0010,1001") other patient names; ("0010,1040") patient address; ("0010,1060") patient mother's birth name; ("0010,2154") patient telephone numbers; ("0010,2160") patient ethnic group; ("0010,21D0") patient's last menstrual date; ("0010,21F0") patient religious preference; and ("0010,4000") patient comments.
- Parameters:
list- the list of tags to remove; it MUST correspond to anonymizeTagIDs list (or spurious errors result), and it must be of the same length, or this will throw an IllegalArgumentException.- Throws:
IllegalArgumentException- DOCUMENT ME!
-
anonymizeSequenceTags
public void anonymizeSequenceTags(boolean[] list, Vector<FileDicomSQItem> seqs, boolean removeValue) Method to anonymize the tags found in the DICOM supplement 55 that may appear in sequence tags. A list of sequence tags should be passed in so that you do not have to figure out which tags are sequences every time. -
removePrivateTags
Method to remove private tags from the file. No option is given to anonymize the values. Requires an array of DICOM keys. -
removePrivateTagsWhite
-
removePrivateSequenceTags
Method to anonymize private tags that may appear in sequence tags. A list of sequence tags should be passed in so that you do not have to figure out which tags are sequences every time. -
removePrivateSequenceTagsWhite
-
anonymizePublicTags
Method to anonymize public tags that do not appear in the DICOM Supplement 55. Like in the other anonymize methods, you may instead choose to replace the value with a blank string. -
anonymizePublicSequenceTags
public final void anonymizePublicSequenceTags(FileDicomKey[] keys, Vector<FileDicomSQItem> seqs, boolean removeValue) Method to anonymize public tags not in the DICOM Supplement 55 that may appear in sequence tags. A list of sequence tags should be passed in so that you do not have to figure out which tags are sequences every time. -
generateNewTagValue
Generates a new version of a particular tag that is DICOM compatible- Parameters:
key-- Returns:
-
getLUT
returns the ModelLUT, if there, which might be specified by the0028,1201,0028,1202,0028,1203tags.- Overrides:
getLUTin classFileInfoBase- Returns:
- DOCUMENT ME!
-
generateNewTagValue
Generates a new version of a particular tag in the given tag table with same length that is DICOM compatible- Parameters:
key-- Returns:
-
generateNewTagValue
Generates a new version of a particular tag in the standard DICOM tag table with same length that is DICOM compatible- Parameters:
key-- Returns:
-
generateNewTagValue
Generates a new version of a particular tag given an arbitrary value and returns a DICOM compatible result- Parameters:
key-- Returns:
-
generateNewTagValue
public static Object generateNewTagValue(String key, String strValue, FileDicomTagInfo.VR vr, boolean remove) -
displayAboutInfo
Super requires displayAboutInfo to be defined display of this class is held by JDialogFileInfoDICOM. Should never be called.- Specified by:
displayAboutInfoin classFileInfoBase- Parameters:
dialog-matrix-- See Also:
-
finalize
public void finalize()Prepares this class for cleanup.- Overrides:
finalizein classFileInfoBase
-
setOriginalDataType
public void setOriginalDataType(int originalDataType) -
getOriginalDataType
public int getOriginalDataType() -
getPatientOrientation
This method extracts directional cosines from the DICOM image header (tag = "0020, 0037"). Since the third row of transformation matrix is not given in the tag but can be derived by taking the cross product. The result is then put into a MIPAV transformation matrix object and returned.- Returns:
- the transformation object extracted from the DICOM header. If this tag is null then the class returns null.
-
getTagTable
Returns a reference to the tag table for this dicom file info.- Returns:
- A reference to the tag table.
-
setTagTable
- Parameters:
tagTable- the tagTable to set, useful when a tag table has been populated from an enhanced DICOM series.
-
isMultiFrame
public final boolean isMultiFrame()Accessor for the status of this dicom info.- Returns:
- boolean
truefor images that think they are multi-frame.
-
setMultiFrame
public final void setMultiFrame(boolean multiFrame) Sets whether the DICOM image is a multiFrame image. -
parseTagValue
Parse the string for Objects seperated by "\". Uses the local method getValue to look at the Object held in the tag and decipher it for the user class into an array of strings.parseTagValue has not been updated for the newer versions of DicomTag
- Parameters:
tagName- The name given as the key to search the Hashtable for.- Returns:
- the array of Strings that were coded into the tag; a single string is given if the string in the tag has no "\" seporators. Each String in the array is a single value, and there are value multiplicity number of Strings in the array. NOTE: user class must convert this list to the correct type; (which does indicate user class knows what returned string is) If null then there were zero tokens in the tag
-
removeStampSecondaryCapture
public void removeStampSecondaryCapture()In anonymization cases it may be necessary to hide the fact that MIPAV has processed this image (to remove any NIH affiliation). This method removes those tags that identify any secondary capture device information contained within the image, to make it appear as if the image has not been processed.- Parameters:
fileInfo- File info structure to set.
-
setInfoFromTags
public final void setInfoFromTags()Public method for populating ModelImage data fields. -
setInfoFromTags
After the tag table is filled, check for a number of tags to set up some fields in this file info object. -
updateLengthTags
-
appendLengthTag
private void appendLengthTag(FileDicomTag tag, HashMap<Integer, FileInfoDicom.LengthStorageUnit> lengthComp) -
setSecondaryCaptureTags
public void setSecondaryCaptureTags(boolean isMultiFrame, int dataType) Changes a few dicom tags associated with a secondary capture image (marking it as having been created with mipav). This is often used after a new image is created as the result of an algorithm and the source image's file infos are copied over to the new image. -
getModalityFromDicomStr
Returns the MIPAV modality constant for a given DICOM modality string.- Parameters:
value- The DICOM modality tag value.- Returns:
- The equivalent MIPAV modality constant (or UNKNOWN_MODALITY if there is no equivalent found).
-
setInfoFromTag
Sets fields in this file info based on a given tag's key and value.- Parameters:
tag- The tag to use to update the file info fields (not all tags cause field changes).
-
isEnhancedDicom
public boolean isEnhancedDicom() -
setIsEnhancedDicom
public void setIsEnhancedDicom(boolean isEnhancedDicom) -
setModalityFromDicomStr
Uses the DICOM tag value to set the Image modality field.- Parameters:
value- Object used is the value of DICOM tag (0008,0060)
-
getVr_type
-
setVr_type
-