public class ConvertAmicasJPEG2000FilesetToDicom
extends java.lang.Object
This class provides conversion of a set of Amicas JPEG 2000 files to DICOM.
Modifier and Type | Class and Description |
---|---|
class |
ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter
Instances of this class select only Files that are directories.
|
class |
ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter
Instances of this class select only File names that end with the specified suffix.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
mediaDirectoryPath |
protected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter |
onlyDirectoriesFileFilter |
protected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter |
onlyXMLFilenameFilter |
protected java.io.PrintWriter |
pwlogger |
protected SpecificCharacterSet |
specificCharacterSet |
protected static UIDGenerator |
uidGenerator |
Constructor and Description |
---|
ConvertAmicasJPEG2000FilesetToDicom()
Construct an converter that will looked for files in the system default path.
|
ConvertAmicasJPEG2000FilesetToDicom(java.lang.String mediaDirectoryPath)
Construct an converter that will looked for files in the specified path.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDicomAttributeFromXmlAttribute(AttributeList list,
AttributeTag tag,
java.lang.String xmlAttributeName,
org.w3c.dom.NamedNodeMap xmlAttributes,
int type,
java.lang.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(java.lang.String pathName,
java.lang.String dicomOutputFolder)
Read an amicas-patients folder, and then convert any image files within.
|
protected void |
createDicomImageFileFromAmicasImageFile(java.io.File amicasFolder,
java.lang.String amicasFileName,
java.lang.String dicomOutputFolder,
java.lang.String storingAETitle,
AttributeList patientList,
AttributeList studyList,
AttributeList seriesList,
AttributeList imageList) |
protected java.lang.String |
getNamedAttributeValue(org.w3c.dom.NamedNodeMap xmlAttributes,
java.lang.String xmlAttributeName) |
static void |
main(java.lang.String[] arg)
Convert a set of Amicas JPEG 2000 files to DICOM.
|
protected AttributeList |
makeAttributeListForImage(org.w3c.dom.NamedNodeMap xmlAttributes) |
protected AttributeList |
makeAttributeListForPatient(org.w3c.dom.NamedNodeMap xmlAttributes) |
protected AttributeList |
makeAttributeListForSeries(org.w3c.dom.NamedNodeMap xmlAttributes) |
protected AttributeList |
makeAttributeListForStudy(org.w3c.dom.NamedNodeMap xmlAttributes) |
protected Attribute |
makeDicomAttributeFromXmlAttribute(AttributeTag tag,
java.lang.String xmlAttributeName,
org.w3c.dom.NamedNodeMap xmlAttributes,
int type,
java.lang.String defaultValue) |
protected Attribute |
newAttribute(AttributeTag tag) |
void |
setLogger(javax.swing.JFrame content,
int width,
int height) |
void |
setLogger(java.io.OutputStream stream) |
void |
setLogger(java.io.PrintWriter pwlogger) |
protected static SpecificCharacterSet |
setSpecificCharacterSetFromDocumentEncoding(org.w3c.dom.Document document) |
protected java.lang.String mediaDirectoryPath
protected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter onlyDirectoriesFileFilter
protected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter onlyXMLFilenameFilter
protected java.io.PrintWriter pwlogger
protected SpecificCharacterSet specificCharacterSet
protected static UIDGenerator uidGenerator
public ConvertAmicasJPEG2000FilesetToDicom()
Construct an converter that will looked for files in the system default path.
public ConvertAmicasJPEG2000FilesetToDicom(java.lang.String mediaDirectoryPath)
Construct an converter that will looked for files in the specified path.
mediaDirectoryPath
- where to begin looking for the amicas-patients folderprotected void addDicomAttributeFromXmlAttribute(AttributeList list, AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValueForType1) throws DicomException
DicomException
public void choosePathsAndConvertAmicasFiles() throws java.io.IOException, DicomException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.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.
java.io.IOException
DicomException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public void convertAmicasFiles(java.lang.String pathName, java.lang.String dicomOutputFolder) throws java.io.IOException, DicomException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
Read an amicas-patients folder, and then convert any image files within.
pathName
- the path name to an amicas-patients folder or folder containing an amicas-patients folderdicomOutputFolder
- the path name to where to write the DICOM filesjava.io.IOException
DicomException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
protected void createDicomImageFileFromAmicasImageFile(java.io.File amicasFolder, java.lang.String amicasFileName, java.lang.String dicomOutputFolder, java.lang.String storingAETitle, AttributeList patientList, AttributeList studyList, AttributeList seriesList, AttributeList imageList) throws java.io.IOException, DicomException
java.io.IOException
DicomException
protected java.lang.String getNamedAttributeValue(org.w3c.dom.NamedNodeMap xmlAttributes, java.lang.String xmlAttributeName)
public static void main(java.lang.String[] arg)
Convert a set of Amicas JPEG 2000 files to DICOM.
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.protected AttributeList makeAttributeListForImage(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
DicomException
protected AttributeList makeAttributeListForPatient(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
DicomException
protected AttributeList makeAttributeListForSeries(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
DicomException
protected AttributeList makeAttributeListForStudy(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
DicomException
protected Attribute makeDicomAttributeFromXmlAttribute(AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValue) throws DicomException
DicomException
protected Attribute newAttribute(AttributeTag tag) throws DicomException
DicomException
public void setLogger(javax.swing.JFrame content, int width, int height)
public void setLogger(java.io.OutputStream stream)
public void setLogger(java.io.PrintWriter pwlogger)
protected static SpecificCharacterSet setSpecificCharacterSetFromDocumentEncoding(org.w3c.dom.Document document)