Package com.pixelmed.convert
Class ConvertAmicasJPEG2000FilesetToDicom
java.lang.Object
com.pixelmed.convert.ConvertAmicasJPEG2000FilesetToDicom
This class provides conversion of a set of Amicas JPEG 2000 files to DICOM.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Instances of this class select only Files that are directories.final class
Instances of this class select only File names that end with the specified suffix. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected PrintWriter
protected SpecificCharacterSet
protected static UIDGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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 TypeMethodDescriptionprotected void
addDicomAttributeFromXmlAttribute
(AttributeList list, AttributeTag tag, String xmlAttributeName, NamedNodeMap xmlAttributes, int type, String defaultValueForType1) void
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
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
protected static SpecificCharacterSet
-
Field Details
-
mediaDirectoryPath
-
pwlogger
-
onlyDirectoriesFileFilter
-
onlyXMLFilenameFilter
-
specificCharacterSet
-
uidGenerator
-
-
Constructor Details
-
ConvertAmicasJPEG2000FilesetToDicom
public ConvertAmicasJPEG2000FilesetToDicom()Construct an converter that will looked for files in the system default path.
-
ConvertAmicasJPEG2000FilesetToDicom
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
-
setLogger
-
setLogger
-
choosePathsAndConvertAmicasFiles
public void choosePathsAndConvertAmicasFiles() throws IOException, DicomException, ParserConfigurationException, 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.
-
newAttribute
- Throws:
DicomException
-
getNamedAttributeValue
-
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
- Throws:
DicomException
-
makeAttributeListForSeries
protected AttributeList makeAttributeListForSeries(NamedNodeMap xmlAttributes) throws DicomException - Throws:
DicomException
-
makeAttributeListForImage
- 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 folderdicomOutputFolder
- the path name to where to write the DICOM files- Throws:
IOException
DicomException
ParserConfigurationException
SAXException
-
main
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.
-