Package com.pixelmed.convert
Class ConvertAmicasJPEG2000FilesetToDicom
- java.lang.Object
-
- com.pixelmed.convert.ConvertAmicasJPEG2000FilesetToDicom
-
public class ConvertAmicasJPEG2000FilesetToDicom extends java.lang.ObjectThis class provides conversion of a set of Amicas JPEG 2000 files to DICOM.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilterInstances of this class select only Files that are directories.classConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilterInstances of this class select only File names that end with the specified suffix.
-
Field Summary
Fields Modifier and Type Field Description protected static DicomDictionarydictionaryprotected java.io.PrintWriterloggerprotected java.lang.StringmediaDirectoryPathprotected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilteronlyDirectoriesFileFilterprotected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilteronlyXMLFilenameFilterprotected SpecificCharacterSetspecificCharacterSetprotected static UIDGeneratoruidGenerator
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDicomAttributeFromXmlAttribute(AttributeList list, AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValueForType1)voidchoosePathsAndConvertAmicasFiles()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.voidconvertAmicasFiles(java.lang.String pathName, java.lang.String dicomOutputFolder)Read an amicas-patients folder, and then convert any image files within.protected voidcreateDicomImageFileFromAmicasImageFile(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.StringgetNamedAttributeValue(org.w3c.dom.NamedNodeMap xmlAttributes, java.lang.String xmlAttributeName)static voidmain(java.lang.String[] arg)Convert a set of Amicas JPEG 2000 files to DICOM.protected AttributeListmakeAttributeListForImage(org.w3c.dom.NamedNodeMap xmlAttributes)protected AttributeListmakeAttributeListForPatient(org.w3c.dom.NamedNodeMap xmlAttributes)protected AttributeListmakeAttributeListForSeries(org.w3c.dom.NamedNodeMap xmlAttributes)protected AttributeListmakeAttributeListForStudy(org.w3c.dom.NamedNodeMap xmlAttributes)protected AttributemakeDicomAttributeFromXmlAttribute(AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValue)protected AttributenewAttribute(AttributeTag tag)voidsetLogger(java.io.OutputStream stream)voidsetLogger(java.io.PrintWriter logger)voidsetLogger(javax.swing.JFrame content, int width, int height)protected static SpecificCharacterSetsetSpecificCharacterSetFromDocumentEncoding(org.w3c.dom.Document document)
-
-
-
Field Detail
-
mediaDirectoryPath
protected java.lang.String mediaDirectoryPath
-
logger
protected java.io.PrintWriter logger
-
onlyDirectoriesFileFilter
protected ConvertAmicasJPEG2000FilesetToDicom.OnlyDirectoriesFileFilter onlyDirectoriesFileFilter
-
onlyXMLFilenameFilter
protected ConvertAmicasJPEG2000FilesetToDicom.OnlySuffixFilenameFilter onlyXMLFilenameFilter
-
specificCharacterSet
protected SpecificCharacterSet specificCharacterSet
-
dictionary
protected static DicomDictionary dictionary
-
uidGenerator
protected static UIDGenerator uidGenerator
-
-
Constructor Detail
-
ConvertAmicasJPEG2000FilesetToDicom
public ConvertAmicasJPEG2000FilesetToDicom()
Construct an converter that will looked for files in the system default path.
-
ConvertAmicasJPEG2000FilesetToDicom
public ConvertAmicasJPEG2000FilesetToDicom(java.lang.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 Detail
-
setLogger
public void setLogger(java.io.PrintWriter logger)
-
setLogger
public void setLogger(java.io.OutputStream stream)
-
setLogger
public void setLogger(javax.swing.JFrame content, int width, int height)
-
choosePathsAndConvertAmicasFiles
public void choosePathsAndConvertAmicasFiles() throws java.io.IOException, DicomException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXExceptionPop 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:
java.io.IOExceptionDicomExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
-
newAttribute
protected Attribute newAttribute(AttributeTag tag) throws DicomException
- Throws:
DicomException
-
getNamedAttributeValue
protected java.lang.String getNamedAttributeValue(org.w3c.dom.NamedNodeMap xmlAttributes, java.lang.String xmlAttributeName)
-
makeDicomAttributeFromXmlAttribute
protected Attribute makeDicomAttributeFromXmlAttribute(AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValue) throws DicomException
- Throws:
DicomException
-
addDicomAttributeFromXmlAttribute
protected void addDicomAttributeFromXmlAttribute(AttributeList list, AttributeTag tag, java.lang.String xmlAttributeName, org.w3c.dom.NamedNodeMap xmlAttributes, int type, java.lang.String defaultValueForType1) throws DicomException
- Throws:
DicomException
-
makeAttributeListForPatient
protected AttributeList makeAttributeListForPatient(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
- Throws:
DicomException
-
makeAttributeListForStudy
protected AttributeList makeAttributeListForStudy(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
- Throws:
DicomException
-
makeAttributeListForSeries
protected AttributeList makeAttributeListForSeries(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
- Throws:
DicomException
-
makeAttributeListForImage
protected AttributeList makeAttributeListForImage(org.w3c.dom.NamedNodeMap xmlAttributes) throws DicomException
- Throws:
DicomException
-
setSpecificCharacterSetFromDocumentEncoding
protected static SpecificCharacterSet setSpecificCharacterSetFromDocumentEncoding(org.w3c.dom.Document document)
-
createDicomImageFileFromAmicasImageFile
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- Throws:
java.io.IOExceptionDicomException
-
convertAmicasFiles
public void convertAmicasFiles(java.lang.String pathName, java.lang.String dicomOutputFolder) throws java.io.IOException, DicomException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXExceptionRead 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 folderdicomOutputFolder- the path name to where to write the DICOM files- Throws:
java.io.IOExceptionDicomExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
-
main
public static void main(java.lang.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.
-
-