Beispiel #1
0
 // Process a DICOM file.
 private void process(DicomObject dicomObject) {
   try {
     dicomObject.setExtension(".dcm");
     // get the document for this study or create it if necessary
     MircDocument td = new MircDocument(dicomObject);
     // Put in the object and store the updated document.
     // Note that since all http imports should have been
     // anonymized before transmission over the internet,
     // we assume that is the case. There is no way to tell.
     td.insert(dicomObject, TrialConfig.allowOverwrite(), true, null, null);
     // export the image via DICOM if in auto mode
     dicomExportDirectories = TrialConfig.getDicomExportDirectories();
     dicomExportDirectoryFiles = TrialConfig.getDicomExportDirectoryFiles();
     if (TrialConfig.getDicomExportMode().equals("auto") && (dicomExportDirectoryFiles != null)) {
       for (int i = 0; i < dicomExportDirectoryFiles.length; i++) {
         try {
           ExportQueueElement eqe = ExportQueueElement.createEQE(dicomObject);
           eqe.queue(dicomExportDirectoryFiles[i]);
         } catch (Exception e) {
           String name = dicomObject.getFile().getName();
           Log.message(
               processorServiceName
                   + ": "
                   + dicomExportDirectories[i]
                   + " DICOM export failed:"
                   + name);
           logger.warn(dicomExportDirectories[i] + " DICOM export failed:" + name);
         }
       }
     }
     // log the object if logging is enabled
     makeTrialLogEntry("http-import", dicomObject);
   } catch (Exception notDicom) {
   }
 }