Class ConvertAmicasJPEG2000FilesetToDicom


  • public class ConvertAmicasJPEG2000FilesetToDicom
    extends java.lang.Object

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

    • 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.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:
        java.io.IOException
        DicomException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
      • 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
      • 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.IOException
        DicomException
      • convertAmicasFiles

        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.

        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:
        java.io.IOException
        DicomException
        javax.xml.parsers.ParserConfigurationException
        org.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.