com.pixelmed.dicom

## Class ImageToDicom

- java.lang.Object
- - com.pixelmed.dicom.ImageToDicom

    public class ImageToDicom
    extends java.lang.Object

A class for converting RGB consumer image input format files (anything JIIO can recognize) into images of a specified SOP Class, or single or multi frame DICOM Secondary Capture images.

### Constructor Summary

Constructors
Constructor and Description
`ImageToDicom(java.lang.String inputFile, java.lang.String outputFile, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String seriesNumber, java.lang.String instanceNumber)` Read a consumer image input format file (anything JIIO can recognize), and create a single or multi frame DICOM Secondary Capture image.

`ImageToDicom(java.lang.String inputFile, java.lang.String outputFile, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String seriesNumber, java.lang.String instanceNumber, java.lang.String modality, java.lang.String sopClass)`
Read a consumer image input format file (anything JIIO can recognize), and create an image of the specified SOP Class, or a single or multi frame DICOM Secondary Capture image.

### Method Summary

Methods
`static AttributeList` `generateDICOMPixelModuleFromConsumerImageFile(java.io.File inputFile, AttributeList list)` Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`static AttributeList` `generateDICOMPixelModuleFromConsumerImageFile(java.lang.String inputFile)` Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`static AttributeList` `generateDICOMPixelModuleFromConsumerImageFile(java.lang.String inputFile, AttributeList list)` Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`protected static short` `getBitsPerSample(org.w3c.dom.Node metadata)`
`protected static java.lang.String` `getCompressionType(org.w3c.dom.Node metadata)`
`static void` `main(java.lang.String[] arg)` Read a consumer image input format file (anything JIIO can recognize), and create an image of the specified SOP Class, or a single or multi frame DICOM Secondary Capture image.

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

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

### Constructor Detail

#### ImageToDicom

    public ImageToDicom(java.lang.String inputFile,
                java.lang.String outputFile,
                java.lang.String patientName,
                java.lang.String patientID,
                java.lang.String studyID,
                java.lang.String seriesNumber,
                java.lang.String instanceNumber)
                 throws java.io.IOException,
                        DicomException

Read a consumer image input format file (anything JIIO can recognize), and create a single or multi frame DICOM Secondary Capture image.

Parameters:
  `inputFile` -
  `outputFile` -
  `patientName` -
  `patientID` -
  `studyID` -
  `seriesNumber` -
  `instanceNumber` -
Throws:
  `DicomException`
  `java.io.IOException`

#### ImageToDicom

    public ImageToDicom(java.lang.String inputFile,
                java.lang.String outputFile,
                java.lang.String patientName,
                java.lang.String patientID,
                java.lang.String studyID,
                java.lang.String seriesNumber,
                java.lang.String instanceNumber,
                java.lang.String modality,
                java.lang.String sopClass)
                 throws java.io.IOException,
                        DicomException

Read a consumer image input format file (anything JIIO can recognize), and create an image of the specified SOP Class, or a single or multi frame DICOM Secondary Capture image.

Parameters:
  `inputFile` -
  `outputFile` -
  `patientName` -
  `patientID` -
  `studyID` -
  `seriesNumber` -
  `instanceNumber` -
  `modality` - may be null
  `sopClass` - may be null
Throws:
  `DicomException`
  `java.io.IOException`

### Method Detail

#### getCompressionType

    protected static java.lang.String getCompressionType(org.w3c.dom.Node metadata)

#### getBitsPerSample

    protected static short getBitsPerSample(org.w3c.dom.Node metadata)

#### generateDICOMPixelModuleFromConsumerImageFile

    public static AttributeList generateDICOMPixelModuleFromConsumerImageFile(java.lang.String inputFile,
                                                              AttributeList list)
                                                                       throws java.io.IOException,
                                                                              DicomException

Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.

Parameters:
  `inputFile` - a consumer format image file (e.g., 8 or > 8 bit JPEG, JPEG 2000, GIF, etc.)
  `list` - an existing (possibly empty) attribute list, if null, a new one will be created; may already include "better" image pixel module attributes to use return attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `DicomException`
  `java.io.IOException`

#### generateDICOMPixelModuleFromConsumerImageFile

    public static AttributeList generateDICOMPixelModuleFromConsumerImageFile(java.io.File inputFile,
                                                              AttributeList list)
                                                                       throws java.io.IOException,
                                                                              DicomException

Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.

Parameters:
  `inputFile` - a consumer format image file (e.g., 8 or > 8 bit JPEG, JPEG 2000, GIF, etc.)
  `list` - an existing (possibly empty) attribute list, if null, a new one will be created; may already include "better" image pixel module attributes to use return attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `DicomException`
  `java.io.IOException`

#### generateDICOMPixelModuleFromConsumerImageFile

    public static AttributeList generateDICOMPixelModuleFromConsumerImageFile(java.lang.String inputFile)
                                                                       throws java.io.IOException,
                                                                              DicomException

Read a consumer image input format file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.

Parameters:
  `inputFile` - a consumer format image file (e.g., 8 or > 8 bit JPEG, JPEG 2000, GIF, etc.) return a new attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `DicomException`
  `java.io.IOException`

#### main

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

Read a consumer image input format file (anything JIIO can recognize), and create an image of the specified SOP Class, or a single or multi frame DICOM Secondary Capture image.

Parameters:
  `arg` - seven, eight or nine parameters, the inputFile, outputFile, patientName, patientID, studyID, seriesNumber, instanceNumber, and optionally the modality, and SOP Class