public class ImageLibrary extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ImageLibrary.ImageLibraryEntry |
Modifier and Type | Field and Description |
---|---|
protected CompositeInstanceContext |
compositeInstanceContext |
protected Map<String,ImageLibrary.ImageLibraryEntry> |
entriesIndexedBySOPInstanceUID |
Constructor and Description |
---|
ImageLibrary()
Construct an empty Image Library.
|
ImageLibrary(AttributeList list)
Construct an Image Library by extracting it from an existing DICOM SR instance.
|
ImageLibrary(ContentItem imageLibraryContainer,
AttributeList list)
Construct an Image Library by extracting it from an existing DICOM SR instance.
|
ImageLibrary(Set<File> files)
Create an SR Image Library from a bunch of DICOM image instances.
|
protected CompositeInstanceContext compositeInstanceContext
protected Map<String,ImageLibrary.ImageLibraryEntry> entriesIndexedBySOPInstanceUID
public ImageLibrary()
Construct an empty Image Library.
public ImageLibrary(AttributeList list) throws DicomException
Construct an Image Library by extracting it from an existing DICOM SR instance.
Searches the content tree for the Image Library CONTAINER content item.
list
- the attributes comprising the DICOM SR instance containing the Image LibraryDicomException
- if error in DICOM encodingpublic ImageLibrary(ContentItem imageLibraryContainer, AttributeList list)
Construct an Image Library by extracting it from an existing DICOM SR instance.
imageLibraryContainer
- the content item that is the Image Library CONTAINERlist
- the attributes comprising the DICOM SR instance containing the Image Librarypublic ImageLibrary(Set<File> files) throws IOException, DicomException
Create an SR Image Library from a bunch of DICOM image instances.
Adds a new series (instance UID) to the existing study (instance UID).
files
- the filenames and/or folder names of files containing the input image filesDicomException
- if error in DICOM encodingIOException
- if error reading a fileprotected void addContributingEquipmentSequence(AttributeList list) throws DicomException
DicomException
public ImageLibrary.ImageLibraryEntry addImage(AttributeList list) throws DicomException
Create and add an SR Image Library entry derived from a DICOM image instance.
Requires that a SOP Instance UID be present in the supplied image instance, to be used to index the entries.
list
- the list of attributes of the image instanceDicomException
- if error in DICOM encodingprotected void constructImageLibrary(ContentItem imageLibraryContainer, AttributeList list)
Construct an Image Library by extracting it from an existing DICOM SR instance.
imageLibraryContainer
- the content item that is the Image Library CONTAINERlist
- the attributes comprising the DICOM SR instance containing the Image Librarypublic static ContentItem findImageLibraryContainer(ContentItem node)
Find the Image Library contained within an SR content tree.
The Image Library is identified by the ("111028","DCM","Image Library") concept name for the content item.
node
- the content item to being the search at (e.g., the root node)public AttributeList getAttributeList() throws DicomException
DicomException
public SequenceAttribute getCommonInstanceReferenceModuleReferencedSeriesSequence(String studyInstanceUID) throws DicomException
DicomException
public SequenceAttribute getHierarchicalEvidenceSequence() throws DicomException
Build a hierarchical evidence sequence for the current Image Library content.
This contains the Study and Series Instance UIDs and is required for most SR IODs.
DicomException
- if error in DICOM encodingprotected Map<String,HierarchicalSOPInstanceReference> getHierarchicalSOPInstanceReferencesIndexedBySOPInstanceUID(AttributeList list)
public StructuredReport getStructuredReport() throws DicomException
DicomException
public ContentItem getStructuredReportFragment(ContentItem parent) throws DicomException
Get the Image Library as an SR fragment.
Has side effect of adding the fragment to the parent if the parent is not null.
parent
- the parent CONTAINER content item (usually the root content item)DicomException
- if error in DICOM encodingpublic static void main(String[] arg)
Create an SR Image Library from a bunch of DICOM image instances.
Adds a new series (instance UID) to the existing study (instance UID).
arg
- the path for the SR Image Library output, then the filenames and/or folder names of files containing the input image filespublic ImageLibrary.ImageLibraryEntry makeImageLibraryEntry(AttributeList list) throws DicomException
DicomException
public ImageLibrary.ImageLibraryEntry makeImageLibraryEntry(ContentItemFactory.ImageContentItem imageContentItem, Map<String,HierarchicalSOPInstanceReference> hierarchicalSOPInstanceReferencesIndexedBySOPInstanceUID)
public static ImageLibrary read(String filename) throws DicomException, IOException
Extract the Image Library from a DICOM SR instance.
filename
- the DICOM SR instance containing the Image LibraryDicomException
- if error in DICOM encodingIOException
- if error reading the filepublic void write(File file) throws DicomException, IOException
DicomException
IOException
public void write(String filename) throws DicomException, IOException
DicomException
IOException