com.pixelmed.display
Class ConsumerFormatImageMaker

java.lang.Object
  extended by com.pixelmed.display.ConsumerFormatImageMaker

public class ConsumerFormatImageMaker
extends Object

A class of static methods to make consumer format images from DICOM images.


Field Summary
static String ALL_ANNOTATIONS
           
static String COLOR_ANNOTATIONS
           
static String ICON_ANNOTATIONS
           
 
Constructor Summary
ConsumerFormatImageMaker()
           
 
Method Summary
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int regionX, int regionY, int regionWidth, int regionHeight, int firstFrame, int lastFrame, int imageQuality, String annotation, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int regionX, int regionY, int regionWidth, int regionHeight, int firstFrame, int lastFrame, int imageQuality, String annotation, Vector<SuperimposedImage> superimposedImages, double superimposedToleranceDistance, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int regionX, int regionY, int regionWidth, int regionHeight, int firstFrame, int lastFrame, int imageQuality, String annotation, Vector<SuperimposedImage> superimposedImages, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int imageQuality, String annotation, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int imageQuality, String annotation, Vector<SuperimposedImage> superimposedImages, double superimposedToleranceDistance, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, double windowCenter, double windowWidth, int imageWidth, int imageHeight, int imageQuality, String annotation, Vector<SuperimposedImage> superimposedImages, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static String[] convertFileToEightBitImage(String dicomFileName, String outputFileName, String outputFormat, int debugLevel)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static void main(String[] arg)
          Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.
static BufferedImage makeEightBitImage(AttributeList list, int debugLevel)
          Create a single frame 8-bit per channel image (windowed if grayscale) from the first, or only, frame.
static BufferedImage[] makeEightBitImages(AttributeList list, GeometryOfVolume imageGeometry, Vector<SuperimposedImage> superimposedImages, double superimposedToleranceDistance, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int firstFrame, int lastFrame, int debugLevel)
          Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.
static BufferedImage[] makeEightBitImages(AttributeList list, GeometryOfVolume imageGeometry, Vector<SuperimposedImage> superimposedImages, Vector<Shape>[] arrayOfPerFrameDrawingShapes, int firstFrame, int lastFrame, int debugLevel)
          Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.
static BufferedImage[] makeEightBitImages(AttributeList list, int debugLevel)
          Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.
static void writeEightBitImageForFrame(BufferedImage renderedImage, Iterator<TextAnnotationPositioned> annotations, String outputFileName, String outputFormat, int imageWidth, int imageHeight, int regionX, int regionY, int regionWidth, int regionHeight, int imageQuality, boolean useColorForAnnotations, int debugLevel)
          Write a single frame 8-bit per channel BufferedImage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_ANNOTATIONS

public static final String ALL_ANNOTATIONS
See Also:
Constant Field Values

ICON_ANNOTATIONS

public static final String ICON_ANNOTATIONS
See Also:
Constant Field Values

COLOR_ANNOTATIONS

public static final String COLOR_ANNOTATIONS
See Also:
Constant Field Values
Constructor Detail

ConsumerFormatImageMaker

public ConsumerFormatImageMaker()
Method Detail

makeEightBitImage

public static final BufferedImage makeEightBitImage(AttributeList list,
                                                    int debugLevel)
                                             throws DicomException

Create a single frame 8-bit per channel image (windowed if grayscale) from the first, or only, frame.

Uses the window center and width in the attribute list.

Parameters:
list - the DICOM attributes
debugLevel -
Returns:
an 8 bit BufferedImage
Throws:
if - attribute is not an image
DicomException

makeEightBitImages

public static final BufferedImage[] makeEightBitImages(AttributeList list,
                                                       int debugLevel)
                                                throws DicomException

Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.

Uses the window center and width in the attribute list.

Parameters:
list - the DICOM attributes
debugLevel -
Returns:
an array of 8 bit BufferedImages
Throws:
if - attribute is not an image
DicomException

makeEightBitImages

public static final BufferedImage[] makeEightBitImages(AttributeList list,
                                                       GeometryOfVolume imageGeometry,
                                                       Vector<SuperimposedImage> superimposedImages,
                                                       Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                       int firstFrame,
                                                       int lastFrame,
                                                       int debugLevel)
                                                throws DicomException

Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.

Uses the window center and width in the attribute list.

Parameters:
list - the DICOM attributes
imageGeometry - the geometry already extracted from the list, or null if need to extract it (only needed if have superimposedImages)
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame
firstFrame - the first frame to include, numbered from 0 (not 1)
lastFrame - the last frame to include, numbered from 0 (not 1), or -1 if all frames
debugLevel -
Returns:
an array of 8 bit BufferedImages
Throws:
if - attribute is not an image
DicomException

makeEightBitImages

public static final BufferedImage[] makeEightBitImages(AttributeList list,
                                                       GeometryOfVolume imageGeometry,
                                                       Vector<SuperimposedImage> superimposedImages,
                                                       double superimposedToleranceDistance,
                                                       Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                       int firstFrame,
                                                       int lastFrame,
                                                       int debugLevel)
                                                throws DicomException

Create an array of single frame 8-bit per channel image (windowed if grayscale) from the from the only or all frames.

Uses the window center and width in the attribute list.

Parameters:
list - the DICOM attributes
imageGeometry - the geometry already extracted from the list, or null if need to extract it (only needed if have superimposedImages)
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
superimposedToleranceDistance - difference in distance along normal to orientation for underlying and superimposed frames to be close enough to superimpose, in mm
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame
firstFrame - the first frame to include, numbered from 0 (not 1)
lastFrame - the last frame to include, numbered from 0 (not 1), or -1 if all frames
debugLevel -
Returns:
an array of 8 bit BufferedImages
Throws:
if - attribute is not an image
DicomException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

Uses the window center and width in the file.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int imageQuality,
                                                  String annotation,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int regionX,
                                                  int regionY,
                                                  int regionWidth,
                                                  int regionHeight,
                                                  int firstFrame,
                                                  int lastFrame,
                                                  int imageQuality,
                                                  String annotation,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

The aspect ratio of the sub-region width and height, if any, should be the same as that of any explicitly specified image width and height, to avoid distortion.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
regionX - the x (along row) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionY - the y (down column) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionWidth - the width (number of columns) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
regionHeight - the height (number of rows) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
firstFrame - the first frame to include, numbered from 0 (not 1)
lastFrame - the last frame to include, numbered from 0 (not 1), or -1 if all frames
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int imageQuality,
                                                  String annotation,
                                                  Vector<SuperimposedImage> superimposedImages,
                                                  double superimposedToleranceDistance,
                                                  Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
superimposedToleranceDistance - difference in distance along normal to orientation for underlying and superimposed frames to be close enough to superimpose, in mm
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame, or null if none
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int imageQuality,
                                                  String annotation,
                                                  Vector<SuperimposedImage> superimposedImages,
                                                  Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame, or null if none
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int regionX,
                                                  int regionY,
                                                  int regionWidth,
                                                  int regionHeight,
                                                  int firstFrame,
                                                  int lastFrame,
                                                  int imageQuality,
                                                  String annotation,
                                                  Vector<SuperimposedImage> superimposedImages,
                                                  Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

The aspect ratio of the sub-region width and height, if any, should be the same as that of any explicitly specified image width and height, to avoid distortion.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
regionX - the x (along row) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionY - the y (down column) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionWidth - the width (number of columns) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
regionHeight - the height (number of rows) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
firstFrame - the first frame to include, numbered from 0 (not 1)
lastFrame - the last frame to include, numbered from 0 (not 1), or -1 if all frames
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame, or null if none
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

convertFileToEightBitImage

public static String[] convertFileToEightBitImage(String dicomFileName,
                                                  String outputFileName,
                                                  String outputFormat,
                                                  double windowCenter,
                                                  double windowWidth,
                                                  int imageWidth,
                                                  int imageHeight,
                                                  int regionX,
                                                  int regionY,
                                                  int regionWidth,
                                                  int regionHeight,
                                                  int firstFrame,
                                                  int lastFrame,
                                                  int imageQuality,
                                                  String annotation,
                                                  Vector<SuperimposedImage> superimposedImages,
                                                  double superimposedToleranceDistance,
                                                  Vector<Shape>[] arrayOfPerFrameDrawingShapes,
                                                  int debugLevel)
                                           throws DicomException,
                                                  IOException

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

The aspect ratio of the sub-region width and height, if any, should be the same as that of any explicitly specified image width and height, to avoid distortion.

Parameters:
dicomFileName - the input file name
outputFileName - the output file name (or basis of names for multiple frames)
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
windowCenter - the window center to use
windowWidth - the window width to use, or 0 if to use the width and center in the DICOM file
imageWidth - the width (number of columns) to make, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to make, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
regionX - the x (along row) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionY - the y (down column) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionWidth - the width (number of columns) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
regionHeight - the height (number of rows) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
firstFrame - the first frame to include, numbered from 0 (not 1)
lastFrame - the last frame to include, numbered from 0 (not 1), or -1 if all frames
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
annotation - the type of annotation to apply (choice is "all"; anything else means no annotation), or null if absent
superimposedImages - images to to be displayed superimposed on the appropriate frames, or null if none
superimposedToleranceDistance - difference in distance along normal to orientation for underlying and superimposed frames to be close enough to superimpose, in mm
arrayOfPerFrameDrawingShapes - per-frame shapes to be displayed on the respective frame, or null if none
debugLevel -
Returns:
a String[] of the output filenames ordered by the frame order of the input image
Throws:
DicomException
IOException

writeEightBitImageForFrame

public static void writeEightBitImageForFrame(BufferedImage renderedImage,
                                              Iterator<TextAnnotationPositioned> annotations,
                                              String outputFileName,
                                              String outputFormat,
                                              int imageWidth,
                                              int imageHeight,
                                              int regionX,
                                              int regionY,
                                              int regionWidth,
                                              int regionHeight,
                                              int imageQuality,
                                              boolean useColorForAnnotations,
                                              int debugLevel)
                                       throws DicomException,
                                              IOException

Write a single frame 8-bit per channel BufferedImage.

The aspect ratio of the sub-region width and height, if any, should be the same as that of any explicitly specified image width and height, to avoid distortion.

Parameters:
renderedImage - the 8 bit image (already windowed if grayscale)
annotations - an Iterator of annotations to apply, or null if none
outputFileName - the output file name
outputFormat - the output file format name that a JIIO SPI will recognize (e.g. "jpeg")
imageWidth - the width (number of columns) to write, or <= 0 if default (the width in the DICOM file, or scaled by height with pixel aspect ratio preserved)
imageHeight - the height (number of rows) to weite, or <= 0 if default (the height in the DICOM file, or scaled by width with pixel aspect ratio preserved)
regionX - the x (along row) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionY - the y (down column) integer offset (from 0 being the TLHC pixel) of the sub-region to write
regionWidth - the width (number of columns) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
regionHeight - the height (number of rows) to write, or <= 0 if no sub-region selected (i.e., write the whole image)
imageQuality - the image quality from 1 to 100 (best), or -1 if absent
useColorForAnnotations - use color for annotations (i.e., produce color output image even if input is grayscale)
debugLevel -
Throws:
DicomException
IOException

main

public static void main(String[] arg)

Read a DICOM image input file, and create single frame 8-bit per channel images (windowed if grayscale) from the only or all frames.

If the input file has multiple frames, the output file name will be postfixed with the frame number before the format extension, e.g., "output.jpg" will become "output_001.jpg", etc.

The aspect ratio of the sub-region width and height, if any, should be the same as that of any explicitly specified image width and height, to avoid distortion.

Parameters:
arg - two required parameters, the input file name, output file name (or basis of names for multiple frames), optionally the format (defaults to jpeg), then optionally the window center and width, then optionally the desired width and height (or 0 if to use the width and center in the DICOM file and more arguments), then optionally the image quality from 0 to 100, then optionally whether or not to include annotation (choice is "all" or "icon" +/- "color", e.g., "all_color"; anything else means no annotation; default is "all_color") then optionally the debug level then optionally the sub region x, y, width and height then optionally the first and last frame (-1 if all frames)