Modifier and Type | Field and Description |
---|---|
protected HashMap |
mapOfDirectoryRecordsToSequenceItems |
Constructor and Description |
---|
DicomDirectory()
Create an empty DicomDirectory
|
DicomDirectory(AttributeList list)
Create a DicomDirectory from a DICOMDIR instance already read as an AttributeList
|
DicomDirectory(AttributeList list,
boolean doConcatenations)
Create a DicomDirectory from a DICOMDIR instance already read as an AttributeList, optionally creating synthetic concatenation records
|
DicomDirectory(File rootDirectoryName,
String[] fileNames)
Create a new DicomDirectory from a list of existing DICOM files contained within a specified root directory.
|
DicomDirectory(String[] fileNames)
Create a new DicomDirectory from a list of existing DICOM files contained within the current working directory.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeListFromDicomFileToDirectory(AttributeList list,
String fileName) |
void |
addTreeModelListener(TreeModelListener tml) |
static Vector |
findAllContainedReferencedFileNames(DicomDirectoryRecord record,
String parentFilePath)
Get all the referenced file names at or below the specified directory record.
|
Vector |
findAllContainedReferencedFileNames(String parentFilePath)
Get all the referenced file names in the entire directory.
|
static HashMap |
findAllContainedReferencedFileNamesAndTheirRecords(DicomDirectoryRecord record,
String parentFilePath)
Get all the referenced file names at or below the specified directory record, and a map to the directory records that reference them.
|
HashMap |
findAllContainedReferencedFileNamesAndTheirRecords(String parentFilePath)
Get all the referenced file names in the entire directory, and a map to the directory records that reference them.
|
Vector |
findAllImagesForFrameOfReference(String frameOfReferenceUID)
Get the attribute lists from all the IMAGE level directory records which have a particular FrameOfReferenceUID.
|
Object |
getChild(Object node,
int index) |
int |
getChildCount(Object parent) |
int |
getIndexOfChild(Object parent,
Object child) |
Map |
getMapOfSOPInstanceUIDToReferencedFileName(String parentFilePath) |
String |
getReferencedFileNameForSOPInstanceUID(String sopInstanceUID) |
Object |
getRoot() |
boolean |
isLeaf(Object node) |
static void |
main(String[] arg)
Read DICOM files and create a DICOMDIR.
|
void |
readDicomFileAndAddToDirectory(File rootDirectoryName,
String fileName) |
void |
readDicomFileAndAddToDirectory(String fileName) |
void |
removeTreeModelListener(TreeModelListener tml) |
String |
toString() |
void |
valueForPathChanged(TreePath path,
Object newValue) |
void |
write(String name)
Write the directory to the named file.
|
protected HashMap mapOfDirectoryRecordsToSequenceItems
public DicomDirectory(String[] fileNames)
Create a new DicomDirectory from a list of existing DICOM files contained within the current working directory.
The filenames must be relative to the current working directory, and not absolute paths, since the full name will be used in the DICOMDIR records.
Filenames are NOT checked for compliance with restrictions on length and character set.
fileNames
- public DicomDirectory(File rootDirectoryName, String[] fileNames)
Create a new DicomDirectory from a list of existing DICOM files contained within a specified root directory.
The specified root directory will NOT be included in the referenced file name in the DICOMDIR records.
Filenames are NOT checked for compliance with restrictions on length and character set.
rootDirectoryName
- fileNames
- public DicomDirectory()
public DicomDirectory(AttributeList list) throws DicomException
list
- DicomException
public DicomDirectory(AttributeList list, boolean doConcatenations) throws DicomException
list
- doConcatenations
- DicomException
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
parent
- child
- public int getChildCount(Object parent)
getChildCount
in interface TreeModel
parent
- public boolean isLeaf(Object node)
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
path
- newValue
- public void addTreeModelListener(TreeModelListener tml)
addTreeModelListener
in interface TreeModel
tml
- public void removeTreeModelListener(TreeModelListener tml)
removeTreeModelListener
in interface TreeModel
tml
- public void readDicomFileAndAddToDirectory(File rootDirectoryName, String fileName) throws DicomException, IOException
rootDirectoryName
- fileName
- DicomException
IOException
public void readDicomFileAndAddToDirectory(String fileName) throws DicomException, IOException
fileName
- DicomException
IOException
public void addAttributeListFromDicomFileToDirectory(AttributeList list, String fileName) throws DicomException, IOException
list
- fileName
- DicomException
IOException
public void write(String name) throws IOException, DicomException
Write the directory to the named file.
name
- the file name to write toIOException
DicomException
public Map getMapOfSOPInstanceUIDToReferencedFileName(String parentFilePath)
parentFilePath
- public String getReferencedFileNameForSOPInstanceUID(String sopInstanceUID) throws DicomException
sopInstanceUID
- DicomException
public static HashMap findAllContainedReferencedFileNamesAndTheirRecords(DicomDirectoryRecord record, String parentFilePath)
Get all the referenced file names at or below the specified directory record, and a map to the directory records that reference them.
record
- parentFilePath
- the folder in which the DICOMDIR lives (i.e., the base for contained references)public HashMap findAllContainedReferencedFileNamesAndTheirRecords(String parentFilePath)
Get all the referenced file names in the entire directory, and a map to the directory records that reference them.
parentFilePath
- the folder in which the DICOMDIR lives (i.e., the base for contained references)public static Vector findAllContainedReferencedFileNames(DicomDirectoryRecord record, String parentFilePath)
Get all the referenced file names at or below the specified directory record.
record
- parentFilePath
- the folder in which the DICOMDIR lives (i.e., the base for contained references)public Vector findAllContainedReferencedFileNames(String parentFilePath)
Get all the referenced file names in the entire directory.
parentFilePath
- the folder in which the DICOMDIR lives (i.e., the base for contained references)public Vector findAllImagesForFrameOfReference(String frameOfReferenceUID)
Get the attribute lists from all the IMAGE level directory records which have a particular FrameOfReferenceUID.
Useful for finding potential localizers and orthogonal images.
Note that even though FrameOfReference is a series level entity, in the CT/MR profiles it is specified at the IMAGE directory record level.
frameOfReferenceUID
- public static void main(String[] arg)
Read DICOM files and create a DICOMDIR.
arg
- optionally the folder in which the files and DICOMDIR are rooted, the filename of the DICOMDIR to be created, then the filenames of the DICOM files to include