com.pixelmed.dicom

## Class SetOfDicomFiles

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<E>
    - - java.util.HashSet<SetOfDicomFiles.DicomFile>
      - - com.pixelmed.dicom.SetOfDicomFiles

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<SetOfDicomFiles.DicomFile>, java.util.Collection<SetOfDicomFiles.DicomFile>, java.util.Set<SetOfDicomFiles.DicomFile>

      public class SetOfDicomFiles
      extends java.util.HashSet<SetOfDicomFiles.DicomFile>

  A class to describe a set of DICOM files and their features such as SOP Class, Instance and Transfer Syntax UIDs.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `SetOfDicomFiles.DicomFile`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SetOfDicomFiles()` Construct an empty set of DICOM files.
    `SetOfDicomFiles(java.util.AbstractList<java.lang.String> paths)` Construct a set of DICOM files from a list of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles(java.util.AbstractList<java.lang.String> paths, boolean keepList, boolean keepPixelData)` Construct a set of DICOM files from a list of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles(java.lang.String[] paths)` Construct a set of DICOM files from an array of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles(java.lang.String[] paths, boolean keepList, boolean keepPixelData)` Construct a set of DICOM files from an array of String path names by reading each file's metaheader, +/- entire attribute list, as necessary

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SetOfDicomFiles.DicomFile` | `add(java.io.File file)` Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles.DicomFile` | `add(java.lang.String fileName)` Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles.DicomFile` | `add(java.lang.String fileName, boolean keepList)` Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles.DicomFile` | `add(java.lang.String fileName, boolean keepList, boolean keepPixelData)` Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.
    `SetOfDicomFiles.DicomFile` | `add(java.lang.String fileName, java.lang.String sopClassUID, java.lang.String sopInstanceUID, java.lang.String transferSyntaxUID)` Add a DICOM file with the specified attributes.
    `AttributeList[]` | `getAttributeLists()` Get the attribute lists for all files, if they were kept during creation.
    `java.util.Set` | `getSetOfSOPClassUIDs()`
    `static void` | `main(java.lang.String[] arg)` For testing, read all DICOM files and build a set of them.
    `java.lang.String` | `toString()` Return a String representing this object's value.

    - ### Methods inherited from class java.util.HashSet

      `add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator`

    - ### Methods inherited from class java.util.AbstractSet

      `equals, hashCode, removeAll`

    - ### Methods inherited from class java.util.AbstractCollection

      `addAll, containsAll, retainAll, toArray, toArray`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Set

      `addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### SetOfDicomFiles

          public SetOfDicomFiles(java.util.AbstractList<java.lang.String> paths)

      Construct a set of DICOM files from a list of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.

      Parameters:
        `paths` - a list of String DICOM file names (e.g., a Vector or an ArrayList)

    - #### SetOfDicomFiles

          public SetOfDicomFiles(java.util.AbstractList<java.lang.String> paths,
                                 boolean keepList,
                                 boolean keepPixelData)

      Construct a set of DICOM files from a list of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.

      Parameters:
        `paths` - a list of String DICOM file names (e.g., a Vector or an ArrayList)
        `keepList` - whether or not to keep the entire attribute list (excluding pixel data unless requested) memory resident
        `keepPixelData` - whether or not to keep the pixel data memory resident as well

    - #### SetOfDicomFiles

          public SetOfDicomFiles(java.lang.String[] paths)

      Construct a set of DICOM files from an array of String path names by reading each file's metaheader, +/- entire attribute list, as necessary.

      Parameters:
        `paths` - an array of String DICOM file names

    - #### SetOfDicomFiles

          public SetOfDicomFiles(java.lang.String[] paths,
                                 boolean keepList,
                                 boolean keepPixelData)

      Construct a set of DICOM files from an array of String path names by reading each file's metaheader, +/- entire attribute list, as necessary

      Parameters:
        `paths` - an array of String DICOM file names
        `keepList` - whether or not to keep the entire attribute list (excluding pixel data unless requested) memory resident
        `keepPixelData` - whether or not to keep the pixel data memory resident as well

    - #### SetOfDicomFiles

          public SetOfDicomFiles()

      Construct an empty set of DICOM files.

  - ### Method Detail

    - #### getSetOfSOPClassUIDs

          public java.util.Set getSetOfSOPClassUIDs()

    - #### toString

          public java.lang.String toString()

      Return a String representing this object's value.

      Overrides:
        `toString` in class `java.util.AbstractCollection<SetOfDicomFiles.DicomFile>`
      Returns:
        a string representation of the value of this object

    - #### add

          public SetOfDicomFiles.DicomFile add(java.lang.String fileName)

      Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.

      Keeps only the minimal descriptive attributes, and not the entire attribute list (including pixel data) memory resident.

      Parameters:
        `fileName` - a DICOM file
      Returns:
        the DicomFile added

    - #### add

          public SetOfDicomFiles.DicomFile add(java.io.File file)
                                        throws java.io.IOException

      Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.

      Keeps only the minimal descriptive attributes, and not the entire attribute list (including pixel data) memory resident.

      Parameters:
        `file` - a DICOM file
      Returns:
        the DicomFile added
      Throws:
        `java.io.IOException`

    - #### add

          public SetOfDicomFiles.DicomFile add(java.lang.String fileName,
                                               boolean keepList)

      Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.

      Parameters:
        `fileName` - a DICOM file
        `keepList` - whether or not to keep the entire attribute list memory resident
      Returns:
        the DicomFile added

    - #### add

          public SetOfDicomFiles.DicomFile add(java.lang.String fileName,
                                               boolean keepList,
                                               boolean keepPixelData)

      Add a DICOM file by reading its metaheader, +/- entire attribute list, as necessary.

      Parameters:
        `fileName` - a DICOM file
        `keepList` - whether or not to keep the entire attribute list (excluding pixel data unless requested) memory resident
        `keepPixelData` - whether or not to keep the pixel data memory resident as well
      Returns:
        the DicomFile added

    - #### add

          public SetOfDicomFiles.DicomFile add(java.lang.String fileName,
                                               java.lang.String sopClassUID,
                                               java.lang.String sopInstanceUID,
                                               java.lang.String transferSyntaxUID)

      Add a DICOM file with the specified attributes.

      Parameters:
        `fileName` - a DICOM file
      Returns:
        the DicomFile added

    - #### getAttributeLists

          public AttributeList[] getAttributeLists()

      Get the attribute lists for all files, if they were kept during creation.

      Returns:
        an array of attribute lists, each of which will be null unless keeplists was true when created

    - #### main

          public static void main(java.lang.String[] arg)

      For testing, read all DICOM files and build a set of them.

      Parameters:
        `arg` - the filenames