Package com.pixelmed.convert

## Class EncapsulateData

- java.lang.Object
- - com.pixelmed.convert.EncapsulateData

-     public class EncapsulateData
      extends java.lang.Object

  A class to create a DICOM encapsulated data object from a data file and supplied metadata and/or composite context.

  E.g., to encapsulate a PDF, CDA or STL file.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EncapsulateData​(java.lang.String inputFileName, java.lang.String metadataFileName, java.lang.String compositeContextFileName, java.lang.String outputFileName)` | Create a DICOM encapsulated data object from a data file and supplied metadata

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static java.lang.String` | `determineMediaTypeFromFile​(java.lang.String filename)` |
    `static java.lang.String` | `determineModalityFromSOPClass​(java.lang.String sopClassUID)` |
    `static java.lang.String` | `determineSOPClassFromMediaType​(java.lang.String mediaType)` |
    `static void` | `main​(java.lang.String[] arg)` | Create a DICOM encapsulated data object from a data file and supplied metadata.

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

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EncapsulateData

          public EncapsulateData​(java.lang.String inputFileName,
                                 java.lang.String metadataFileName,
                                 java.lang.String compositeContextFileName,
                                 java.lang.String outputFileName)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException,
                                 DicomException

      Create a DICOM encapsulated data object from a data file and supplied metadata

      The SOP Class will be automatically determined from the supplied file type.

      Parameters:
        `inputFileName` - file containing data to be encapsulated
        `metadataFileName` - file containing metadata to be included, may be null or empty string
        `compositeContextFileName` - file containing DICOM patient and study composite context to reuse, may be null or empty string
        `outputFileName` - file to write the DICOM encapsulated object to
      Throws:
        `java.io.FileNotFoundException` - if a file cannot be found
        `java.io.IOException` - if there is a problem reading or writing
        `DicomException` - if there is a problem parsing or extracting required content

  - ### Method Detail

    - #### determineMediaTypeFromFile

          public static java.lang.String determineMediaTypeFromFile​(java.lang.String filename)

    - #### determineSOPClassFromMediaType

          public static java.lang.String determineSOPClassFromMediaType​(java.lang.String mediaType)

    - #### determineModalityFromSOPClass

          public static java.lang.String determineModalityFromSOPClass​(java.lang.String sopClassUID)

    - #### main

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

      Create a DICOM encapsulated data object from a data file and supplied metadata.

      The SOP Class will be automatically determined from the supplied file type.

      Parameters:
        `arg` - two to four parameters, the input data file, optionally a metadata file, optionally a patient/study composite context source DICOM file, and the output file