Package com.pixelmed.dicom

# Class EncapsulateImageInDicom

java.lang.Object
com.pixelmed.dicom.EncapsulateImageInDicom

public class EncapsulateImageInDicom extends Object

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

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`static AttributeList`
`generateDICOMPixelModuleFromConsumerImageFile(File inputFile, AttributeList list)`
Read a consumer image format input file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`static AttributeList`
`generateDICOMPixelModuleFromConsumerImageFile(String inputFile)`
Read a consumer image format input file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`static AttributeList`
`generateDICOMPixelModuleFromConsumerImageFile(String inputFile, AttributeList list)`
Read a consumer image format input file (anything JIIO can recognize), and create a single frame DICOM Image Pixel Module.
`protected static short`
`getBitsPerSample(Node metadata)`
`static short`
`getColumns(Node metadata)`
`protected static String`
`getCompressionType(Node metadata)`
`protected static short`
`getElementAttributeFromMetadata(Node metadata, String elementName, String attributeName)`
`protected static short`
`getJPEGProcess(Node metadata)`
`protected static String`
`getPhotometricInterpretation(Node metadata)`
`static short`
`getRows(Node metadata)`
`protected static short`
`getSamplePrecision(Node metadata)`
`protected static short`
`getSamplesPerPixel(Node metadata)`
`protected static String`
`getTransferSyntaxUIDFromJPEGProcess(short process)`
`static void`
`main(String[] arg)`
Read a compressed grayscale or RGB consumer image format input file (that JIIO can recognize), and encapsulate it in 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EncapsulateImageInDicom

public EncapsulateImageInDicom(String inputFile, String outputFile, String patientName, String patientID, String studyID, String seriesNumber, String instanceNumber, String modality, String sopClass, AttributeList sourceList) throws IOException, DicomException

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

Parameters:
  `inputFile` - consumer image format input file
  `outputFile` - DICOM output image
  `patientName` - patient name
  `patientID` - patient ID
  `studyID` - study ID
  `seriesNumber` - series number
  `instanceNumber` - instance number
  `modality` - may be null
  `sopClass` - may be null
  `sourceList` - list of attributes to use rather than supplied or generated values, may be null or empty
Throws:
  `IOException` - if an I/O error occurs
  `DicomException` - if error in DICOM encoding

## Method Details

### getCompressionType

protected static String getCompressionType(Node metadata)

### getBitsPerSample

protected static short getBitsPerSample(Node metadata)

### getPhotometricInterpretation

protected static String getPhotometricInterpretation(Node metadata)

### getElementAttributeFromMetadata

protected static short getElementAttributeFromMetadata(Node metadata, String elementName, String attributeName)

### getColumns

public static short getColumns(Node metadata)

### getRows

public static short getRows(Node metadata)

### getSamplesPerPixel

protected static short getSamplesPerPixel(Node metadata)

### getSamplePrecision

protected static short getSamplePrecision(Node metadata)

### getJPEGProcess

protected static short getJPEGProcess(Node metadata)

### getTransferSyntaxUIDFromJPEGProcess

protected static String getTransferSyntaxUIDFromJPEGProcess(short process)

### generateDICOMPixelModuleFromConsumerImageFile

public static AttributeList generateDICOMPixelModuleFromConsumerImageFile(String inputFile, AttributeList list) throws IOException, DicomException

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

Parameters:
  `inputFile` - a compressed consumer format image file (e.g., 8 or > 8 bit JPEG, JPEG 2000)
  `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
Returns:
  attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `IOException` - if an I/O error occurs
  `DicomException` - if error in DICOM encoding

### generateDICOMPixelModuleFromConsumerImageFile

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

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

Parameters:
  `inputFile` - a compressed consumer format image file (e.g., 8 or > 8 bit JPEG, JPEG 2000)
  `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
Returns:
  attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `IOException` - if an I/O error occurs
  `DicomException` - if error in DICOM encoding

### generateDICOMPixelModuleFromConsumerImageFile

public static AttributeList generateDICOMPixelModuleFromConsumerImageFile(String inputFile) throws IOException, DicomException

Read a consumer image format input 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.)
Returns:
  a new attribute list with Image Pixel Module (including Pixel Data) added
Throws:
  `IOException` - if an I/O error occurs
  `DicomException` - if error in DICOM encoding

### main

public static void main(String[] arg)

Read a compressed grayscale or RGB consumer image format input file (that JIIO can recognize), and encapsulate it in 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