Package com.pixelmed.convert

# Class ConvertAmicasJPEG2000FilesetToDicom

java.lang.Object
com.pixelmed.convert.ConvertAmicasJPEG2000FilesetToDicom

public class ConvertAmicasJPEG2000FilesetToDicom extends Object

This class provides conversion of a set of Amicas JPEG 2000 files to DICOM.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`final class`
`ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter`
Instances of this class select only Files that are directories.
`final class`
`ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter`
Instances of this class select only File names that end with the specified suffix.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`mediaDirectoryPath`
`protected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter`
`onlyDirectoriesFileFilter`
`protected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter`
`onlyXMLFilenameFilter`
`protected PrintWriter`
`pwlogger`
`protected SpecificCharacterSet`
`specificCharacterSet`
`protected static UIDGenerator`
`uidGenerator`

## Constructor Summary

Constructors
Constructor
Description
`ConvertAmicasJPEG2000FilesetToDicom()`
Construct an converter that will looked for files in the system default path.
`ConvertAmicasJPEG2000FilesetToDicom(String mediaDirectoryPath)`
Construct an converter that will looked for files in the specified path.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addDicomAttributeFromXmlAttribute(AttributeList list, AttributeTag tag, String xmlAttributeName, NamedNodeMap xmlAttributes, int type, String defaultValueForType1)`
`void`
`choosePathsAndConvertAmicasFiles()`
Pop up folder chooser dialogs that allow the user to specify the location of the amicas-patients folder, or the parent folder (for example, the drive or volume) in which the amicas-patients folder is located, and the output folder to store the converted DICOM files, and then perform the conversion.
`void`
`convertAmicasFiles(String pathName, String dicomOutputFolder)`
Read an amicas-patients folder, and then convert any image files within.
`protected void`
`createDicomImageFileFromAmicasImageFile(File amicasFolder, String amicasFileName, String dicomOutputFolder, String storingAETitle, AttributeList patientList, AttributeList studyList, AttributeList seriesList, AttributeList imageList)`
`protected String`
`getNamedAttributeValue(NamedNodeMap xmlAttributes, String xmlAttributeName)`
`static void`
`main(String[] arg)`
Convert a set of Amicas JPEG 2000 files to DICOM.
`protected AttributeList`
`makeAttributeListForImage(NamedNodeMap xmlAttributes)`
`protected AttributeList`
`makeAttributeListForPatient(NamedNodeMap xmlAttributes)`
`protected AttributeList`
`makeAttributeListForSeries(NamedNodeMap xmlAttributes)`
`protected AttributeList`
`makeAttributeListForStudy(NamedNodeMap xmlAttributes)`
`protected Attribute`
`makeDicomAttributeFromXmlAttribute(AttributeTag tag, String xmlAttributeName, NamedNodeMap xmlAttributes, int type, String defaultValue)`
`protected Attribute`
`newAttribute(AttributeTag tag)`
`void`
`setLogger(OutputStream stream)`
`void`
`setLogger(PrintWriter pwlogger)`
`void`
`setLogger(JFrame content, int width, int height)`
`protected static SpecificCharacterSet`
`setSpecificCharacterSetFromDocumentEncoding(Document document)`

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

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

## Field Details

### mediaDirectoryPath

protected String mediaDirectoryPath

### pwlogger

protected PrintWriter pwlogger

### onlyDirectoriesFileFilter

protected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter onlyDirectoriesFileFilter

### onlyXMLFilenameFilter

protected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter onlyXMLFilenameFilter

### specificCharacterSet

protected SpecificCharacterSet specificCharacterSet

### uidGenerator

protected static UIDGenerator uidGenerator

## Constructor Details

### ConvertAmicasJPEG2000FilesetToDicom

public ConvertAmicasJPEG2000FilesetToDicom()

Construct an converter that will looked for files in the system default path.

### ConvertAmicasJPEG2000FilesetToDicom

public ConvertAmicasJPEG2000FilesetToDicom(String mediaDirectoryPath)

Construct an converter that will looked for files in the specified path.

Parameters:
  `mediaDirectoryPath` - where to begin looking for the amicas-patients folder

## Method Details

### setLogger

public void setLogger(PrintWriter pwlogger)

### setLogger

public void setLogger(OutputStream stream)

### setLogger

public void setLogger(JFrame content, int width, int height)

### choosePathsAndConvertAmicasFiles

public void choosePathsAndConvertAmicasFiles() throws IOException, DicomException, ParserConfigurationException, SAXException

Pop up folder chooser dialogs that allow the user to specify the location of the amicas-patients folder, or the parent folder (for example, the drive or volume) in which the amicas-patients folder is located, and the output folder to store the converted DICOM files, and then perform the conversion.

Throws:
  `IOException`
  `DicomException`
  `ParserConfigurationException`
  `SAXException`

### newAttribute

protected Attribute newAttribute(AttributeTag tag) throws DicomException

Throws:
  `DicomException`

### getNamedAttributeValue

protected String getNamedAttributeValue(NamedNodeMap xmlAttributes, String xmlAttributeName)

### makeDicomAttributeFromXmlAttribute

protected Attribute makeDicomAttributeFromXmlAttribute(AttributeTag tag, String xmlAttributeName, NamedNodeMap xmlAttributes, int type, String defaultValue) throws DicomException

Throws:
  `DicomException`

### addDicomAttributeFromXmlAttribute

protected void addDicomAttributeFromXmlAttribute(AttributeList list, AttributeTag tag, String xmlAttributeName, NamedNodeMap xmlAttributes, int type, String defaultValueForType1) throws DicomException

Throws:
  `DicomException`

### makeAttributeListForPatient

protected AttributeList makeAttributeListForPatient(NamedNodeMap xmlAttributes) throws DicomException

Throws:
  `DicomException`

### makeAttributeListForStudy

protected AttributeList makeAttributeListForStudy(NamedNodeMap xmlAttributes) throws DicomException

Throws:
  `DicomException`

### makeAttributeListForSeries

protected AttributeList makeAttributeListForSeries(NamedNodeMap xmlAttributes) throws DicomException

Throws:
  `DicomException`

### makeAttributeListForImage

protected AttributeList makeAttributeListForImage(NamedNodeMap xmlAttributes) throws DicomException

Throws:
  `DicomException`

### setSpecificCharacterSetFromDocumentEncoding

protected static SpecificCharacterSet setSpecificCharacterSetFromDocumentEncoding(Document document)

### createDicomImageFileFromAmicasImageFile

protected void createDicomImageFileFromAmicasImageFile(File amicasFolder, String amicasFileName, String dicomOutputFolder, String storingAETitle, AttributeList patientList, AttributeList studyList, AttributeList seriesList, AttributeList imageList) throws IOException, DicomException

Throws:
  `IOException`
  `DicomException`

### convertAmicasFiles

public void convertAmicasFiles(String pathName, String dicomOutputFolder) throws IOException, DicomException, ParserConfigurationException, SAXException

Read an amicas-patients folder, and then convert any image files within.

Parameters:
  `pathName` - the path name to an amicas-patients folder or folder containing an amicas-patients folder
  `dicomOutputFolder` - the path name to where to write the DICOM files
Throws:
  `IOException`
  `DicomException`
  `ParserConfigurationException`
  `SAXException`

### main

public static void main(String[] arg)

Convert a set of Amicas JPEG 2000 files to DICOM.

Parameters:
  `arg` - array of two strings - the path to the media or folder containing the files to convert, and the path to the folder to stored the converted images, or else will pop up file chooser dialogs to select these and create a frame to show the progress.