Package com.xinapse.util
Class InfoList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<InfoItem>
,Collection<InfoItem>
,List<InfoItem>
,RandomAccess
Representation of a list of information to be
associated either with an image as a whole, or with a particular element
of a particular dimension of an image.
For example, a 3-D multi-slice image may have different information for each slice. Thus, the information will be different for each element (slice) of dimension 0.
Always use the appropriate methods in the image class to retrieve and manipulate the info fields for an image.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionInfoList()
Construct an empty InfoList.Creates a InfoList Object by reading it from aDataInputStream
.Creates an InfoList from an HTML description of that list. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Anonymise the items in this InfoList.void
Appends an InfoList onto the end of an existing one.clone()
Makes a copy of thisInfoList
.static InfoList
getCommonInfo
(InfoList[] info) void
Adds"name=value"
to theInfoList
.void
Adds"name=value"
to theInfoList
.void
Adds"name=value"
to theInfoList
.void
Adds"name=value"
to theInfoList
.void
Adds "name=value" to the InfoList.void
Adds"name=value"
to theInfoList
.void
removeInfo
(String name) Removes"name=value"
from theInfoList
.static void
Sort info from a slice into slice-specific info or general info.toHTML()
Creates a description of this InfoList in HTML format.toString()
Creates a description of this InfoList.void
Write anInfoList
to aDataOutputStream
.void
Write anInfoList
to aRandomAccessFile
.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
InfoList
public InfoList()Construct an empty InfoList. -
InfoList
Creates a InfoList Object by reading it from aDataInputStream
.- Parameters:
s
- theDataInputStream
that will supply theInfoList
.- Throws:
IOException
- if theInfoList
cannot be read completely from the stream.
-
InfoList
Creates an InfoList from an HTML description of that list. The HTML description will its self have been returned by InfoList.toHTML().- Parameters:
HTMLList
- a String of HTML that was its self created by InfoList.toHTML().- Throws:
InfoListException
- if there is an error in the HTML describing the InfoList.
-
-
Method Details
-
write
Write anInfoList
to aDataOutputStream
.- Parameters:
s
- theDataOutputStream
to which theInfoList
will be written.- Throws:
IOException
- if theInfoList
cannot be written.
-
write
Write anInfoList
to aRandomAccessFile
. The file pointer must be positioned at the right point in the file before this call.- Parameters:
f
- theRandomAccessFile
to which theInfoList
will be written.- Throws:
IOException
- if theInfoList
cannot be written.
-
getInfo
AnInfoList
is a list ofString
s of the form"name=value"
. This method returns the value for a given name.- Parameters:
name
- the name of the information item.- Returns:
- the value of the information item.
- Throws:
InfoNotFoundException
- if thename
isnull
, or the information item cannot be found.
-
putInfo
Adds "name=value" to the InfoList. Replaces the existing value if the name is already present. If either name or value is null, then this method does nothing.- Parameters:
name
- the name of the information item.value
- the value of the information item.
-
putInfo
Adds"name=value"
to theInfoList
. Replaces the existing value if the name is already present. If name is null, this method does nothing.- Parameters:
name
- the name of the information item.value
- the value of the information item.
-
putInfo
Adds"name=value"
to theInfoList
. Replaces the existing value if the name is already present. If name is null, this method does nothing.- Parameters:
name
- the name of the information item.value
- the value of the information item.
-
putInfo
Adds"name=value"
to theInfoList
. Replaces the existing value if the name is already present. If name is null, this method does nothing.- Parameters:
name
- the name of the information item.value
- the value of the information item.
-
putInfo
Adds"name=value"
to theInfoList
. Replaces the existing value if the name is already present. If name is null, this method does nothing.- Parameters:
name
- the name of the information item.value
- the value of the information item.
-
putInfo
Adds"name=value"
to theInfoList
. Replaces the existing value if the name is already present. If name is null, this method does nothing.- Parameters:
name
- the name of the information item.date
- the value of the information item.
-
removeInfo
Removes"name=value"
from theInfoList
.- Parameters:
name
- the name of the information item to remove.
-
append
Appends an InfoList onto the end of an existing one.- Parameters:
extraInfo
- theInfoList
of extra information items to append.
-
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) Anonymise the items in this InfoList.- 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.
-
toString
Creates a description of this InfoList.- Overrides:
toString
in classAbstractCollection<InfoItem>
- Returns:
- a String description of this InfoList.
-
toHTML
Creates a description of this InfoList in HTML format.- Returns:
- a String description of this InfoList in HTML format.
-
sortInfo
Sort info from a slice into slice-specific info or general info. The info that applies to the specified slice is sorted into:- Information that is already in the general info and has the same value as the general info. This is deleted from the slice-specific info for the specified slice.
- Information that is already in the general info and has a different value from that in the general info. This is removed from the general info and added to the slice-specific info for all the slices that currently have slice-specific info. The slice-specific info is retain for the currently-considered slice.
- Parameters:
generalInfo
- the current set of general info that applied to the image as a whole and that is not slice-specific.sliceInfo
- an array ofInfoList
containing the current sorted slice-specific info. Some of the elements of sliceInfo may be null if they haven't yet been retrieved for the slice.slice
- the index to the sliceInfo that has just been obtained.
-
getCommonInfo
-
clone
Makes a copy of thisInfoList
.
-