From: <bab...@us...> - 2010-10-28 14:55:59
|
Revision: 14233 http://dcm4che.svn.sourceforge.net/dcm4che/?rev=14233&view=rev Author: babuhussain Date: 2010-10-28 14:55:51 +0000 (Thu, 28 Oct 2010) Log Message: ----------- MAYAM-45 : Burning Mayam to a DICOM CD/DVD, should be able to load the DICOMDIR-Implemented. Modified Paths: -------------- oviyam/mayam/trunk/src/in/raster/mayam/context/ApplicationContext.java oviyam/mayam/trunk/src/in/raster/mayam/delegate/AnnotationDelegate.java oviyam/mayam/trunk/src/in/raster/mayam/delegate/ImportDcmDirDelegate.java oviyam/mayam/trunk/src/in/raster/mayam/form/LayeredCanvas.java oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.form oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.java oviyam/mayam/trunk/src/in/raster/mayam/util/core/DcmRcv.java oviyam/mayam/trunk/src/in/raster/mayam/util/database/DatabaseHandler.java Modified: oviyam/mayam/trunk/src/in/raster/mayam/context/ApplicationContext.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/context/ApplicationContext.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/context/ApplicationContext.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -1,41 +1,41 @@ /* ***** BEGIN LICENSE BLOCK ***** -* Version: MPL 1.1/GPL 2.0/LGPL 2.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* -* The Initial Developer of the Original Code is -* Raster Images -* Portions created by the Initial Developer are Copyright (C) 2009-2010 -* the Initial Developer. All Rights Reserved. -* -* Contributor(s): -* Babu Hussain A -* Meer Asgar Hussain B -* Prakash J -* Suresh V -* -* Alternatively, the contents of this file may be used under the terms of -* either the GNU General Public License Version 2 or later (the "GPL"), or -* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -* in which case the provisions of the GPL or the LGPL are applicable instead -* of those above. If you wish to allow use of your version of this file only -* under the terms of either the GPL or the LGPL, and not to allow others to -* use your version of this file under the terms of the MPL, indicate your -* decision by deleting the provisions above and replace them with the notice -* and other provisions required by the GPL or the LGPL. If you do not delete -* the provisions above, a recipient may use your version of this file under -* the terms of any one of the MPL, the GPL or the LGPL. -* -* ***** END LICENSE BLOCK ***** */ + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * + * The Initial Developer of the Original Code is + * Raster Images + * Portions created by the Initial Developer are Copyright (C) 2009-2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Babu Hussain A + * Meer Asgar Hussain B + * Prakash J + * Suresh V + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package in.raster.mayam.context; import in.raster.mayam.util.database.DatabaseHandler; @@ -63,7 +63,7 @@ * */ public class ApplicationContext { - + //Database Interaction Referrence object public static DatabaseHandler databaseRef = DatabaseHandler.getInstance(); //Application specific log file reference @@ -86,6 +86,7 @@ public ApplicationContext() { } + /** * This routine used to create a new image view */ @@ -93,6 +94,7 @@ imgView = new ImageView(); imgView.setVisible(true); } + /** * This routine used to init the driver and open database if it is already created, * otherwise it will create a new database @@ -100,6 +102,7 @@ public static void openOrCreateDB() { databaseRef.openOrCreateDB(); } + /** * This routine used to create log file if does not exist */ @@ -109,10 +112,18 @@ try { logFile.createNewFile(); } catch (IOException ex) { - Logger.getLogger(ApplicationContext.class.getName()).log(Level.SEVERE, null, ex); + logFile = new File(System.getProperty("java.io.tmpdir") + File.separator, "log.txt"); + if (!logFile.exists()) { + try { + logFile.createNewFile(); + } catch (IOException x) { + Logger.getLogger(ApplicationContext.class.getName()).log(Level.SEVERE, null, ex); + } + } } } } + /** * This routine used to check whether the image view exist or not * @return @@ -123,7 +134,8 @@ } else { return false; } - } + } + /** * This routine used to write a log message * @param logMsg @@ -132,12 +144,12 @@ DateFormat df = new SimpleDateFormat("kk:mm:ss"); Date d = new Date(); FileOutputStream fileOutputStream = null; - try { + try { String logMessage = df.format(d) + ", " + logMsg; fileOutputStream = new FileOutputStream(logFile, true); fileOutputStream.write(logMessage.getBytes()); } catch (Exception ex) { - ex.printStackTrace(); + ex.printStackTrace(); } finally { try { fileOutputStream.close(); @@ -145,5 +157,26 @@ ex.printStackTrace(); } } - } + } + + public static boolean canWrite(String path) { + File file = new File(path); + if (!file.canWrite()) { + return false; + } + + /* Java lies on Windows */ + String os=System.getProperty("os.name").toLowerCase(); + if(os.startsWith("windows")) + { + try { + File newFile=new File(file,"newfile"); + new FileOutputStream(newFile, true).close(); + newFile.delete(); + } catch (IOException e) { + return false; + } + } + return true; + } } Modified: oviyam/mayam/trunk/src/in/raster/mayam/delegate/AnnotationDelegate.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/delegate/AnnotationDelegate.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/delegate/AnnotationDelegate.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -174,17 +174,21 @@ private void writeToFile(String studyDir, StudyAnnotation studyAnnotation) { ObjectOutputStream oos = null; try { - FileOutputStream fos = new FileOutputStream(new File(studyDir, "info.ser")); - oos = new ObjectOutputStream(fos); - oos.writeObject(studyAnnotation); - oos.close(); + File storeFile = new File(studyDir, "info.ser"); + if (ApplicationContext.canWrite(storeFile.getAbsolutePath())) { + FileOutputStream fos = new FileOutputStream(storeFile); + oos = new ObjectOutputStream(fos); + oos.writeObject(studyAnnotation); + } } catch (IOException ex) { Logger.getLogger(AnnotationDelegate.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { Logger.getLogger(AnnotationDelegate.class.getName()).log(Level.SEVERE, null, ex); } finally { try { - oos.close(); + if (oos != null) { + oos.close(); + } } catch (IOException ex) { Logger.getLogger(AnnotationDelegate.class.getName()).log(Level.SEVERE, null, ex); } Modified: oviyam/mayam/trunk/src/in/raster/mayam/delegate/ImportDcmDirDelegate.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/delegate/ImportDcmDirDelegate.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/delegate/ImportDcmDirDelegate.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -1,43 +1,41 @@ - - /* ***** BEGIN LICENSE BLOCK ***** -* Version: MPL 1.1/GPL 2.0/LGPL 2.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* -* The Initial Developer of the Original Code is -* Raster Images -* Portions created by the Initial Developer are Copyright (C) 2009-2010 -* the Initial Developer. All Rights Reserved. -* -* Contributor(s): -* Babu Hussain A -* Meer Asgar Hussain B -* Prakash J -* Suresh V -* -* Alternatively, the contents of this file may be used under the terms of -* either the GNU General Public License Version 2 or later (the "GPL"), or -* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -* in which case the provisions of the GPL or the LGPL are applicable instead -* of those above. If you wish to allow use of your version of this file only -* under the terms of either the GPL or the LGPL, and not to allow others to -* use your version of this file under the terms of the MPL, indicate your -* decision by deleting the provisions above and replace them with the notice -* and other provisions required by the GPL or the LGPL. If you do not delete -* the provisions above, a recipient may use your version of this file under -* the terms of any one of the MPL, the GPL or the LGPL. -* -* ***** END LICENSE BLOCK ***** */ + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * + * The Initial Developer of the Original Code is + * Raster Images + * Portions created by the Initial Developer are Copyright (C) 2009-2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Babu Hussain A + * Meer Asgar Hussain B + * Prakash J + * Suresh V + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package in.raster.mayam.delegate; import in.raster.mayam.context.ApplicationContext; @@ -69,25 +67,27 @@ public ImportDcmDirDelegate() { findDcmDirInMedia(); - //this.start(); + //this.start(); } public ImportDcmDirDelegate(File dcmDirFile) { this.dcmDirFile = dcmDirFile; // this.start(); } + public void findAndRun() { findDcmDirInMedia(); run(); } + public void run() { readDcmDirFile(); - if(dicomDir!=null) - { - new DirParser().parseDir(); - MainScreen.showLocalDBStorage(); + if (dicomDir != null) { + new DirParser().parseDir(); + MainScreen.showLocalDBStorage(); } - } + } + /** * This routine used to read the dicom dir file. */ @@ -97,160 +97,165 @@ dicomDir.setShowInactiveRecords(false); } catch (NullPointerException ex) { // This Exception will be raised if cd drive is not ready for finding the file - + JOptionPane.showMessageDialog(null, "Drive reading error please try again later ", null, JOptionPane.ERROR_MESSAGE); - } - catch (IOException ex) { + } catch (IOException ex) { Logger.getLogger(ImportDcmDirDelegate.class.getName()).log(Level.SEVERE, null, ex); } - } + } + /** * Member inner class DirParser used to parse the dicom dir file */ - class DirParser - { - private void parseDir() { - try { - parsePatient(); - } catch (Exception e) { - e.printStackTrace(); + class DirParser { + + private void parseDir() { + try { + parsePatient(); + } catch (Exception e) { + e.printStackTrace(); + } } - } - /** - * - * @throws IOException - */ - private void parsePatient() throws Exception - { - DicomObject patient = dicomDir.findFirstRootRecord(); + + /** + * + * @throws IOException + */ + private void parsePatient() throws Exception { + DicomObject patient = dicomDir.findFirstRootRecord(); while (patient != null) { if (DirectoryRecordType.PATIENT.equals(patient.getString(Tag.DirectoryRecordType))) { try { new DatasetUpdator().updatePatientInfo(patient); parseStudy(patient); - } catch (Exception e) { + } catch (Exception e) { System.out.println(e.toString()); } } patient = dicomDir.findNextSiblingRecord(patient); } + } + + /** + * + * @param patient + * @throws IOException + */ + private void parseStudy(DicomObject patient) throws IOException { + DicomObject study = dicomDir.findFirstChildRecord(patient); + while (study != null) { + if (DirectoryRecordType.STUDY.equals(study.getString(Tag.DirectoryRecordType))) { + //update study level tag values + new DatasetUpdator().updateStudyInfo(study); + parseSeries(study); + } + study = dicomDir.findNextSiblingRecord(study); + }//study loop completed + } + + /** + * + * @param study + * @throws IOException + */ + private void parseSeries(DicomObject study) throws IOException { + DicomObject series = dicomDir.findFirstChildRecord(study); + while (series != null) { + if (DirectoryRecordType.SERIES.equals(series.getString(Tag.DirectoryRecordType))) { + //update series level tag values + new DatasetUpdator().updateSeriesInfo(series); + parseInstance(series); + } + series = dicomDir.findNextSiblingRecord(series); + }//series loop completed + } + + /** + * + * @param series- + * @throws IOException + */ + private void parseInstance(DicomObject series) throws IOException { + DicomObject instance = dicomDir.findFirstChildRecord(series); + while (instance != null) { + if (DirectoryRecordType.IMAGE.equals(instance.getString(Tag.DirectoryRecordType))) { + //update instance level tag values + new DatasetUpdator().updateInstanceInfo(instance); + File f = dicomDir.toReferencedFile(instance); + //import to database + ApplicationContext.databaseRef.importDataToDatabase(dataset, f); + } + instance = dicomDir.findNextSiblingRecord(instance); + }//instance loop completed + } } + /** - * - * @param patient - * @throws IOException - */ - private void parseStudy(DicomObject patient) throws IOException - { - DicomObject study = dicomDir.findFirstChildRecord(patient); - while (study != null) { - if (DirectoryRecordType.STUDY.equals(study.getString(Tag.DirectoryRecordType))) { - //update study level tag values - new DatasetUpdator().updateStudyInfo(study); - parseSeries(study); - } - study = dicomDir.findNextSiblingRecord(study); - }//study loop completed - } - /** - * - * @param study - * @throws IOException - */ - private void parseSeries(DicomObject study) throws IOException - { - DicomObject series = dicomDir.findFirstChildRecord(study); - while (series != null) { - if (DirectoryRecordType.SERIES.equals(series.getString(Tag.DirectoryRecordType))) { - //update series level tag values - new DatasetUpdator().updateSeriesInfo(series); - parseInstance(series); - } - series = dicomDir.findNextSiblingRecord(series); - }//series loop completed - } - /** - * - * @param series- - * @throws IOException - */ - private void parseInstance(DicomObject series) throws IOException - { - DicomObject instance = dicomDir.findFirstChildRecord(series); - while (instance != null) { - if (DirectoryRecordType.IMAGE.equals(instance.getString(Tag.DirectoryRecordType))) { - //update instance level tag values - new DatasetUpdator().updateInstanceInfo(instance); - File f = dicomDir.toReferencedFile(instance); - //import to database - ApplicationContext.databaseRef.importDataToDatabase(dataset, f); - } - instance = dicomDir.findNextSiblingRecord(instance); - }//instance loop completed - } - } - /** * Member inner class DatasetUpdator used to update the dicom object related information */ - class DatasetUpdator - { - /** - * - * @param next-It contains the patient related dicom tags information - */ - private void updatePatientInfo(DicomObject next) { - updateTag(dataset, Tag.PatientName, next.getString(Tag.PatientName)); - updateTag(dataset, Tag.PatientID, next.getString(Tag.PatientID)); - updateTag(dataset, Tag.PatientSex, next.getString(Tag.PatientSex)); + class DatasetUpdator { + + /** + * + * @param next-It contains the patient related dicom tags information + */ + private void updatePatientInfo(DicomObject next) { + updateTag(dataset, Tag.PatientName, next.getString(Tag.PatientName)); + updateTag(dataset, Tag.PatientID, next.getString(Tag.PatientID)); + updateTag(dataset, Tag.PatientSex, next.getString(Tag.PatientSex)); + } + + /** + * + * @param study-It contains the study related dicom tags information + */ + private void updateStudyInfo(DicomObject study) { + updateTag(dataset, Tag.StudyInstanceUID, study.getString(Tag.StudyInstanceUID)); + updateTag(dataset, Tag.StudyDate, study.getString(Tag.StudyDate)); + updateTag(dataset, Tag.AccessionNumber, study.getString(Tag.AccessionNumber)); + updateTag(dataset, Tag.ReferringPhysicianName, study.getString(Tag.ReferringPhysicianName)); + updateTag(dataset, Tag.NumberOfStudyRelatedSeries, study.getString(Tag.NumberOfStudyRelatedSeries)); + updateTag(dataset, Tag.NumberOfStudyRelatedInstances, study.getString(Tag.NumberOfStudyRelatedInstances)); + updateTag(dataset, Tag.StudyDescription, study.getString(Tag.StudyDescription)); + updateTag(dataset, Tag.Modality, study.getString(Tag.Modality)); + } + + /** + * + * @param series-It contains the series related dicom tags information + */ + private void updateSeriesInfo(DicomObject series) { + updateTag(dataset, Tag.SeriesDate, series.getString(Tag.SeriesDate)); + updateTag(dataset, Tag.NumberOfSeriesRelatedInstances, series.getString(Tag.NumberOfSeriesRelatedInstances)); + updateTag(dataset, Tag.InstitutionName, series.getString(Tag.InstitutionName)); + updateTag(dataset, Tag.SeriesNumber, series.getString(Tag.SeriesNumber)); + updateTag(dataset, Tag.Modality, series.getString(Tag.Modality)); + updateTag(dataset, Tag.SeriesDescription, series.getString(Tag.SeriesDescription)); + updateTag(dataset, Tag.SeriesInstanceUID, series.getString(Tag.SeriesInstanceUID)); + updateTag(dataset, Tag.SeriesNumber, series.getString(Tag.SeriesNumber)); + } + + /** + * + * @param instance-It contains the instance related dicom tags information + */ + private void updateInstanceInfo(DicomObject instance) { + updateTag(dataset, Tag.SOPInstanceUID, instance.getString(Tag.ReferencedSOPInstanceUIDInFile)); + } + + /** + * + * @param dObj-dicom object it will contains the dicom tag information + * @param tag-Tag constant used to specify the tag information + * @param newValue-values to be replaced + */ + private void updateTag(DicomObject dObj, int tag, String newValue) { + VR vr = dObj.vrOf(tag); + dObj.putString(tag, vr, newValue); + } } + /** - * - * @param study-It contains the study related dicom tags information - */ - private void updateStudyInfo(DicomObject study) { - updateTag(dataset, Tag.StudyInstanceUID, study.getString(Tag.StudyInstanceUID)); - updateTag(dataset, Tag.StudyDate, study.getString(Tag.StudyDate)); - updateTag(dataset, Tag.AccessionNumber, study.getString(Tag.AccessionNumber)); - updateTag(dataset, Tag.ReferringPhysicianName, study.getString(Tag.ReferringPhysicianName)); - updateTag(dataset, Tag.NumberOfStudyRelatedSeries, study.getString(Tag.NumberOfStudyRelatedSeries)); - updateTag(dataset, Tag.NumberOfStudyRelatedInstances, study.getString(Tag.NumberOfStudyRelatedInstances)); - updateTag(dataset, Tag.StudyDescription, study.getString(Tag.StudyDescription)); - updateTag(dataset, Tag.Modality, study.getString(Tag.Modality)); - } - /** - * - * @param series-It contains the series related dicom tags information - */ - private void updateSeriesInfo(DicomObject series) { - updateTag(dataset, Tag.SeriesDate, series.getString(Tag.SeriesDate)); - updateTag(dataset, Tag.NumberOfSeriesRelatedInstances, series.getString(Tag.NumberOfSeriesRelatedInstances)); - updateTag(dataset, Tag.InstitutionName, series.getString(Tag.InstitutionName)); - updateTag(dataset, Tag.SeriesNumber, series.getString(Tag.SeriesNumber)); - updateTag(dataset, Tag.Modality, series.getString(Tag.Modality)); - updateTag(dataset, Tag.SeriesDescription, series.getString(Tag.SeriesDescription)); - updateTag(dataset, Tag.SeriesInstanceUID, series.getString(Tag.SeriesInstanceUID)); - updateTag(dataset, Tag.SeriesNumber, series.getString(Tag.SeriesNumber)); - } - /** - * - * @param instance-It contains the instance related dicom tags information - */ - private void updateInstanceInfo(DicomObject instance) { - updateTag(dataset, Tag.SOPInstanceUID, instance.getString(Tag.ReferencedSOPInstanceUIDInFile)); - // updateTag(dataset, Tag.InstanceNumber, instance.getString(Tag.InstanceNumber)); - } - /** - * - * @param dObj-dicom object it will contains the dicom tag information - * @param tag-Tag constant used to specify the tag information - * @param newValue-values to be replaced - */ - private void updateTag(DicomObject dObj, int tag, String newValue) { - VR vr = dObj.vrOf(tag); - dObj.putString(tag, vr, newValue); - } - } - /** * This sub routine used to find the media location based on the platform */ public void findDcmDirInMedia() { @@ -288,4 +293,16 @@ ee.printStackTrace(); } } + + public static void findAndLoadDcmDirFiles() { + try { + ImportDcmDirDelegate importDcmDirDelegate = new ImportDcmDirDelegate(); + importDcmDirDelegate.findDcmDirInMedia(); + if (importDcmDirDelegate.dcmDirFile != null && System.getProperty("user.dir").startsWith(importDcmDirDelegate.dcmDirFile.getParent())) { + importDcmDirDelegate.run(); + } + } catch (Exception ee) { + ee.printStackTrace(); + } + } } Modified: oviyam/mayam/trunk/src/in/raster/mayam/form/LayeredCanvas.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/form/LayeredCanvas.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/form/LayeredCanvas.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -115,6 +115,7 @@ createAnnotationOverlay(); createTextOverlay(); setTextOverlayParam(); + findMultiframeStatus(); createLayers(); this.imgpanel.revalidate(); this.imgpanel.repaint(); @@ -158,17 +159,19 @@ this.focusGained = focusGained; repaint(); } - public void findMultiframeStatus() - { + + public void findMultiframeStatus() { if (imgpanel.isMulitiFrame()) { - textOverlay.multiframeStatusDisplay(true); - if(!ApplicationContext.databaseRef.getMultiframeStatus()) - textOverlay.getTextOverlayParam().setFramePosition("1/"+imgpanel.getnFrames()); + textOverlay.multiframeStatusDisplay(true); + if (!ApplicationContext.databaseRef.getMultiframeStatus()) { + textOverlay.getTextOverlayParam().setFramePosition("1/" + imgpanel.getnFrames()); + } + } else { + textOverlay.multiframeStatusDisplay(false); } - else - textOverlay.multiframeStatusDisplay(false); } + private void setTextOverlayParam() { textOverlay.setTextOverlayParam(imgpanel.getTextOverlayParam()); } @@ -199,7 +202,7 @@ /** * This routine used to set the selection coloring. */ - public void setSelectionColoring() { + public void setSelectionColoring() { this.setBorder(new LineBorder(Color.YELLOW)); ApplicationContext.imgView.getImageToolbar().disableAllTools(); } @@ -254,12 +257,11 @@ menuitem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent arg0) { - if(ApplicationContext.databaseRef.getMultiframeStatus()){ - SeriesChooserDelegate seriesChooser = new SeriesChooserDelegate(series.getStudyInstanceUID(), series.getSeriesInstanceUID(),series.isMultiframe(),series.getInstanceUID(), ref); + if (ApplicationContext.databaseRef.getMultiframeStatus()) { + SeriesChooserDelegate seriesChooser = new SeriesChooserDelegate(series.getStudyInstanceUID(), series.getSeriesInstanceUID(), series.isMultiframe(), series.getInstanceUID(), ref); + } else { + SeriesChooserDelegate seriesChooser = new SeriesChooserDelegate(series.getStudyInstanceUID(), series.getSeriesInstanceUID(), ref); } - else { - SeriesChooserDelegate seriesChooser = new SeriesChooserDelegate(series.getStudyInstanceUID(), series.getSeriesInstanceUID(), ref); - } } }); } @@ -290,14 +292,14 @@ public void componentResized(ComponentEvent e) { try { - if(canvas!=null) - { - this.canvas.resizeHandler(); - this.imgpanel.resizeHandler(); - this.textOverlay.resizeHandler(); - this.annotationPanel.resizeHandler(); + if (canvas != null) { + this.canvas.resizeHandler(); + this.imgpanel.resizeHandler(); + this.textOverlay.resizeHandler(); + this.annotationPanel.resizeHandler(); } - } catch (Exception ex) {ex.printStackTrace(); + } catch (Exception ex) { + ex.printStackTrace(); } } Modified: oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.form =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.form 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.form 2010-10-28 14:55:51 UTC (rev 14233) @@ -298,12 +298,12 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel2" pref="173" max="32767" attributes="1"/> - <Component id="thumbnailScroll" alignment="1" pref="173" max="32767" attributes="1"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="thumbnailScroll" pref="330" max="32767" attributes="1"/> + <Component id="jLabel2" alignment="1" pref="330" max="32767" attributes="1"/> </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="windowingPanelCanvas" pref="755" max="32767" attributes="0"/> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="windowingPanelCanvas" pref="598" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -333,7 +333,7 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="755" max="32767" attributes="0"/> + <EmptySpace min="0" pref="598" max="32767" attributes="0"/> </Group> </DimensionLayout> <DimensionLayout dim="1"> Modified: oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/form/MainScreen.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -55,7 +55,6 @@ import in.raster.mayam.form.dialog.SettingsDialog; import in.raster.mayam.util.DicomTags; import in.raster.mayam.util.DicomTagsReader; -import in.raster.mayam.form.display.Display; import in.raster.mayam.model.AEModel; import in.raster.mayam.model.Study; import in.raster.mayam.model.table.StudyListModel; @@ -100,6 +99,8 @@ initNetworkQueue(); initSendingProgress(); setTheme(); + ImportDcmDirDelegate.findAndLoadDcmDirFiles(); + } private void setTheme() { @@ -302,7 +303,7 @@ windowingPanelCanvas.setLayout(windowingPanelCanvasLayout); windowingPanelCanvasLayout.setHorizontalGroup( windowingPanelCanvasLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(0, 755, Short.MAX_VALUE) + .add(0, 598, Short.MAX_VALUE) ); windowingPanelCanvasLayout.setVerticalGroup( windowingPanelCanvasLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -327,11 +328,11 @@ studyAndSeriesDisplayPanelLayout.setHorizontalGroup( studyAndSeriesDisplayPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(studyAndSeriesDisplayPanelLayout.createSequentialGroup() - .add(studyAndSeriesDisplayPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, thumbnailScroll, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)) + .add(studyAndSeriesDisplayPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) + .add(thumbnailScroll, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 330, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(windowingPanelCanvas, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)) + .add(windowingPanelCanvas, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 598, Short.MAX_VALUE)) ); studyAndSeriesDisplayPanelLayout.setVerticalGroup( studyAndSeriesDisplayPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) @@ -743,7 +744,7 @@ } private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed if (studyListTable.getSelectedRow() != -1) { - ConfirmDelete confirmDelete = new ConfirmDelete(this, true); + ConfirmDelete confirmDelete = new ConfirmDelete(this, true); confirmDelete.setLocationRelativeTo(this); confirmDelete.setVisible(true); } @@ -755,7 +756,7 @@ String forwardAET = ""; String forwardHost = ""; int forwardPort; - ServerListDialog configuredServer = new ServerListDialog(this, true); + ServerListDialog configuredServer = new ServerListDialog(this, true); configuredServer.setLocationRelativeTo(this); configuredServer.setVisible(true); if (configuredServer.getAe() != null) { @@ -795,8 +796,8 @@ System.exit(2); }//GEN-LAST:event_exitMenuItemActionPerformed private void queueButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_queueButtonActionPerformed - sndRcvFrm.setLocationRelativeTo(this); - sndRcvFrm.setVisible(true); + sndRcvFrm.setLocationRelativeTo(this); + sndRcvFrm.setVisible(true); }//GEN-LAST:event_queueButtonActionPerformed private void preferenceMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_preferenceMenuItemActionPerformed showPreference(); @@ -843,7 +844,7 @@ int selection = studyListTable.convertRowIndexToModel(studyListTable.getSelectedRow()); String siuid = ((StudyListModel) studyListTable.getModel()).getValueAt(selection, 8); ArrayList<DicomTags> dcmTags = DicomTagsReader.getTags(new File(this.canvas.getFilePath())); - dicomTagsViewer.setDataModelOnTable(dcmTags); + dicomTagsViewer.setDataModelOnTable(dcmTags); dicomTagsViewer.setLocationRelativeTo(this); dicomTagsViewer.setVisible(true); } @@ -971,23 +972,21 @@ SeriesThumbUpdator thumbUpdator; public void showThumbnails() { - try - { - this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - if (studyListTable.getSelectedRow() != -1) { - if (thumbUpdator != null) { - thumbUpdator.setCanRun(false); - removeThumbnailComponents(); + try { + this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + if (studyListTable.getSelectedRow() != -1) { + if (thumbUpdator != null) { + thumbUpdator.setCanRun(false); + removeThumbnailComponents(); + } + int selection = studyListTable.convertRowIndexToModel(studyListTable.getSelectedRow()); + String studyUID = ((StudyListModel) studyListTable.getModel()).getValueAt(selection, 8); + selectedStudy = studyUID; + thumbUpdator = new SeriesThumbUpdator(studyUID); } - int selection = studyListTable.convertRowIndexToModel(studyListTable.getSelectedRow()); - String studyUID = ((StudyListModel) studyListTable.getModel()).getValueAt(selection, 8); - selectedStudy = studyUID; - thumbUpdator = new SeriesThumbUpdator(studyUID); + } finally { + this.setCursor(Cursor.getDefaultCursor()); } - }finally - { - this.setCursor(Cursor.getDefaultCursor()); - } } public void openImageView(String studyUID, ArrayList tempRef, int gridRowCount, int gridColCount) { Modified: oviyam/mayam/trunk/src/in/raster/mayam/util/core/DcmRcv.java =================================================================== --- oviyam/mayam/trunk/src/in/raster/mayam/util/core/DcmRcv.java 2010-10-28 11:20:35 UTC (rev 14232) +++ oviyam/mayam/trunk/src/in/raster/mayam/util/core/DcmRcv.java 2010-10-28 14:55:51 UTC (rev 14233) @@ -35,9 +35,9 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - package in.raster.mayam.util.core; +import in.raster.mayam.context.ApplicationContext; import in.raster.mayam.delegate.NetworkQueueUpdateDelegate; import in.raster.mayam.form.MainScreen; import java.io.BufferedOutputStream; @@ -95,13 +95,9 @@ public class DcmRcv { private static final int NO_SUCH_OBJECT_INSTANCE = 0x0112; - static Logger LOG = LoggerFactory.getLogger(DcmRcv.class); - private static final int KB = 1024; - private static final String USAGE = "dcmrcv [Options] [<aet>[@<ip>]:]<port>"; - private static final String DESCRIPTION = "DICOM Server listening on specified <port> for incoming association " + "requests. If no local IP address of the network interface is specified " + "connections on any/all local addresses are accepted. If <aet> is " @@ -109,174 +105,130 @@ + "accepted. If <aet> and a storage directory is specified by option " + "-dest <dir>, also Storage Commitment requests will be accepted and " + "processed.\n Options:"; - private static final String EXAMPLE = "\nExample: dcmrcv DCMRCV:11112 -dest /tmp \n" + "=> Starts server listening on port 11112, accepting association " + "requests with DCMRCV as called AE title. Received objects " + "are stored to /tmp."; - - private static String[] TLS1 = { "TLSv1" }; - - private static String[] SSL3 = { "SSLv3" }; - - private static String[] NO_TLS1 = { "SSLv3", "SSLv2Hello" }; - - private static String[] NO_SSL2 = { "TLSv1", "SSLv3" }; - - private static String[] NO_SSL3 = { "TLSv1", "SSLv2Hello" }; - - private static char[] SECRET = { 's', 'e', 'c', 'r', 'e', 't' }; - - private static final String[] ONLY_DEF_TS = { UID.ImplicitVRLittleEndian }; - - private static final String[] NATIVE_TS = { UID.ExplicitVRLittleEndian, - UID.ExplicitVRBigEndian, UID.ImplicitVRLittleEndian }; - - private static final String[] NATIVE_LE_TS = { UID.ExplicitVRLittleEndian, - UID.ImplicitVRLittleEndian }; - - private static final String[] NON_RETIRED_TS = { UID.JPEGLSLossless, - UID.JPEGLossless, UID.JPEGLosslessNonHierarchical14, - UID.JPEG2000LosslessOnly, UID.DeflatedExplicitVRLittleEndian, - UID.RLELossless, UID.ExplicitVRLittleEndian, - UID.ExplicitVRBigEndian, UID.ImplicitVRLittleEndian, - UID.JPEGBaseline1, UID.JPEGExtended24, UID.JPEGLSLossyNearLossless, - UID.JPEG2000, UID.MPEG2, }; - - private static final String[] NON_RETIRED_LE_TS = { UID.JPEGLSLossless, - UID.JPEGLossless, UID.JPEGLosslessNonHierarchical14, - UID.JPEG2000LosslessOnly, UID.DeflatedExplicitVRLittleEndian, - UID.RLELossless, UID.ExplicitVRLittleEndian, - UID.ImplicitVRLittleEndian, UID.JPEGBaseline1, UID.JPEGExtended24, - UID.JPEGLSLossyNearLossless, UID.JPEG2000, UID.MPEG2, }; - + private static String[] TLS1 = {"TLSv1"}; + private static String[] SSL3 = {"SSLv3"}; + private static String[] NO_TLS1 = {"SSLv3", "SSLv2Hello"}; + private static String[] NO_SSL2 = {"TLSv1", "SSLv3"}; + private static String[] NO_SSL3 = {"TLSv1", "SSLv2Hello"}; + private static char[] SECRET = {'s', 'e', 'c', 'r', 'e', 't'}; + private static final String[] ONLY_DEF_TS = {UID.ImplicitVRLittleEndian}; + private static final String[] NATIVE_TS = {UID.ExplicitVRLittleEndian, + UID.ExplicitVRBigEndian, UID.ImplicitVRLittleEndian}; + private static final String[] NATIVE_LE_TS = {UID.ExplicitVRLittleEndian, + UID.ImplicitVRLittleEndian}; + private static final String[] NON_RETIRED_TS = {UID.JPEGLSLossless, + UID.JPEGLossless, UID.JPEGLosslessNonHierarchical14, + UID.JPEG2000LosslessOnly, UID.DeflatedExplicitVRLittleEndian, + UID.RLELossless, UID.ExplicitVRLittleEndian, + UID.ExplicitVRBigEndian, UID.ImplicitVRLittleEndian, + UID.JPEGBaseline1, UID.JPEGExtended24, UID.JPEGLSLossyNearLossless, + UID.JPEG2000, UID.MPEG2,}; + private static final String[] NON_RETIRED_LE_TS = {UID.JPEGLSLossless, + UID.JPEGLossless, UID.JPEGLosslessNonHierarchical14, + UID.JPEG2000LosslessOnly, UID.DeflatedExplicitVRLittleEndian, + UID.RLELossless, UID.ExplicitVRLittleEndian, + UID.ImplicitVRLittleEndian, UID.JPEGBaseline1, UID.JPEGExtended24, + UID.JPEGLSLossyNearLossless, UID.JPEG2000, UID.MPEG2,}; private static final String[] CUIDS = { - UID.BasicStudyContentNotificationSOPClassRetired, - UID.StoredPrintStorageSOPClassRetired, - UID.HardcopyGrayscaleImageStorageSOPClassRetired, - UID.HardcopyColorImageStorageSOPClassRetired, - UID.ComputedRadiographyImageStorage, - UID.DigitalXRayImageStorageForPresentation, - UID.DigitalXRayImageStorageForProcessing, - UID.DigitalMammographyXRayImageStorageForPresentation, - UID.DigitalMammographyXRayImageStorageForProcessing, - UID.DigitalIntraoralXRayImageStorageForPresentation, - UID.DigitalIntraoralXRayImageStorageForProcessing, - UID.StandaloneModalityLUTStorageRetired, - UID.EncapsulatedPDFStorage, UID.StandaloneVOILUTStorageRetired, - UID.GrayscaleSoftcopyPresentationStateStorageSOPClass, - UID.ColorSoftcopyPresentationStateStorageSOPClass, - UID.PseudoColorSoftcopyPresentationStateStorageSOPClass, - UID.BlendingSoftcopyPresentationStateStorageSOPClass, - UID.XRayAngiographicImageStorage, UID.EnhancedXAImageStorage, - UID.XRayRadiofluoroscopicImageStorage, UID.EnhancedXRFImageStorage, - UID.XRayAngiographicBiPlaneImageStorageRetired, - UID.PositronEmissionTomographyImageStorage, - UID.StandalonePETCurveStorageRetired, UID.CTImageStorage, - UID.EnhancedCTImageStorage, UID.NuclearMedicineImageStorage, - UID.UltrasoundMultiframeImageStorageRetired, - UID.UltrasoundMultiframeImageStorage, UID.MRImageStorage, - UID.EnhancedMRImageStorage, UID.MRSpectroscopyStorage, - UID.RTImageStorage, UID.RTDoseStorage, UID.RTStructureSetStorage, - UID.RTBeamsTreatmentRecordStorage, UID.RTPlanStorage, - UID.RTBrachyTreatmentRecordStorage, - UID.RTTreatmentSummaryRecordStorage, - UID.NuclearMedicineImageStorageRetired, - UID.UltrasoundImageStorageRetired, UID.UltrasoundImageStorage, - UID.RawDataStorage, UID.SpatialRegistrationStorage, - UID.SpatialFiducialsStorage, UID.RealWorldValueMappingStorage, - UID.SecondaryCaptureImageStorage, - UID.MultiframeSingleBitSecondaryCaptureImageStorage, - UID.MultiframeGrayscaleByteSecondaryCaptureImageStorage, - UID.MultiframeGrayscaleWordSecondaryCaptureImageStorage, - UID.MultiframeTrueColorSecondaryCaptureImageStorage, - UID.VLImageStorageTrialRetired, UID.VLEndoscopicImageStorage, - UID.VideoEndoscopicImageStorage, UID.VLMicroscopicImageStorage, - UID.VideoMicroscopicImageStorage, - UID.VLSlideCoordinatesMicroscopicImageStorage, - UID.VLPhotographicImageStorage, UID.VideoPhotographicImageStorage, - UID.OphthalmicPhotography8BitImageStorage, - UID.OphthalmicPhotography16BitImageStorage, - UID.StereometricRelationshipStorage, - UID.VLMultiframeImageStorageTrialRetired, - UID.StandaloneOverlayStorageRetired, UID.BasicTextSRStorage, - UID.EnhancedSRStorage, UID.ComprehensiveSRStorage, - UID.ProcedureLogStorage, UID.MammographyCADSRStorage, - UID.KeyObjectSelectionDocumentStorage, - UID.ChestCADSRStorage, UID.XRayRadiationDoseSRStorage, - UID.EncapsulatedPDFStorage, UID.EncapsulatedCDAStorage, - UID.StandaloneCurveStorageRetired, - UID._12leadECGWaveformStorage, UID.GeneralECGWaveformStorage, - UID.AmbulatoryECGWaveformStorage, UID.HemodynamicWaveformStorage, - UID.CardiacElectrophysiologyWaveformStorage, - UID.BasicVoiceAudioWaveformStorage, UID.HangingProtocolStorage, - UID.SiemensCSANonImageStorage, - UID.Dcm4cheAttributesModificationNotificationSOPClass }; - + UID.BasicStudyContentNotificationSOPClassRetired, + UID.StoredPrintStorageSOPClassRetired, + UID.HardcopyGrayscaleImageStorageSOPClassRetired, + UID.HardcopyColorImageStorageSOPClassRetired, + UID.ComputedRadiographyImageStorage, + UID.DigitalXRayImageStorageForPresentation, + UID.DigitalXRayImageStorageForProcessing, + UID.DigitalMammographyXRayImageStorageForPresentation, + UID.DigitalMammographyXRayImageStorageForProcessing, + UID.DigitalIntraoralXRayImageStorageForPresentation, + UID.DigitalIntraoralXRayImageStorageForProcessing, + UID.StandaloneModalityLUTStorageRetired, + UID.EncapsulatedPDFStorage, UID.StandaloneVOILUTStorageRetired, + UID.GrayscaleSoftcopyPresentationStateStorageSOPClass, + UID.ColorSoftcopyPresentationStateStorageSOPClass, + UID.PseudoColorSoftcopyPresentationStateStorageSOPClass, + UID.BlendingSoftcopyPresentationStateStorageSOPClass, + UID.XRayAngiographicImageStorage, UID.EnhancedXAImageStorage, + UID.XRayRadiofluoroscopicImageStorage, UID.EnhancedXRFImageStorage, + UID.XRayAngiographicBiPlaneImageStorageRetired, + UID.PositronEmissionTomographyImageStorage, + UID.StandalonePETCurveStorageRetired, UID.CTImageStorage, + UID.EnhancedCTImageStorage, UID.NuclearMedicineImageStorage, + UID.UltrasoundMultiframeImageStorageRetired, + UID.UltrasoundMultiframeImageStorage, UID.MRImageStorage, + UID.EnhancedMRImageStorage, UID.MRSpectroscopyStorage, + UID.RTImageStorage, UID.RTDoseStorage, UID.RTStructureSetStorage, + UID.RTBeamsTreatmentRecordStorage, UID.RTPlanStorage, + UID.RTBrachyTreatmentRecordStorage, + UID.RTTreatmentSummaryRecordStorage, + UID.NuclearMedicineImageStorageRetired, + UID.UltrasoundImageStorageRetired, UID.UltrasoundImageStorage, + UID.RawDataStorage, UID.SpatialRegistrationStorage, + UID.SpatialFiducialsStorage, UID.RealWorldValueMappingStorage, + UID.SecondaryCaptureImageStorage, + UID.MultiframeSingleBitSecondaryCaptureImageStorage, + UID.MultiframeGrayscaleByteSecondaryCaptureImageStorage, + UID.MultiframeGrayscaleWordSecondaryCaptureImageStorage, + UID.MultiframeTrueColorSecondaryCaptureImageStorage, + UID.VLImageStorageTrialRetired, UID.VLEndoscopicImageStorage, + UID.VideoEndoscopicImageStorage, UID.VLMicroscopicImageStorage, + UID.VideoMicroscopicImageStorage, + UID.VLSlideCoordinatesMicroscopicImageStorage, + UID.VLPhotographicImageStorage, UID.VideoPhotographicImageStorage, + UID.OphthalmicPhotography8BitImageStorage, + UID.OphthalmicPhotography16BitImageStorage, + UID.StereometricRelationshipStorage, + UID.VLMultiframeImageStorageTrialRetired, + UID.StandaloneOverlayStorageRetired, UID.BasicTextSRStorage, + UID.EnhancedSRStorage, UID.ComprehensiveSRStorage, + UID.ProcedureLogStorage, UID.MammographyCADSRStorage, + UID.KeyObjectSelectionDocumentStorage, + UID.ChestCADSRStorage, UID.XRayRadiationDoseSRStorage, + UID.EncapsulatedPDFStorage, UID.EncapsulatedCDAStorage, + UID.StandaloneCurveStorageRetired, + UID._12leadECGWaveformStorage, UID.GeneralECGWaveformStorage, + UID.AmbulatoryECGWaveformStorage, UID.HemodynamicWaveformStorage, + UID.CardiacElectrophysiologyWaveformStorage, + UID.BasicVoiceAudioWaveformStorage, UID.HangingProtocolStorage, + UID.SiemensCSANonImageStorage, + UID.Dcm4cheAttributesModificationNotificationSOPClass}; private final Executor executor; - private final Device device; - private final NetworkApplicationEntity ae = new NetworkApplicationEntity(); - private final NetworkConnection nc = new NetworkConnection(); - private final StorageSCP storageSCP = new StorageSCP(this, CUIDS); - private final StgCmtSCP stgcmtSCP = new StgCmtSCP(this); - private String[] tsuids = NON_RETIRED_LE_TS; - private FileCache cache = new FileCache(); - private File destination; - private File devnull; - private Properties calling2dir; - private Properties called2dir; - private String callingdefdir = "OTHER"; - private String calleddefdir = "OTHER"; - private int fileBufferSize = 1024; - private int rspdelay = 0; - private String keyStoreURL = "resource:tls/test_sys_2.p12"; - private char[] keyStorePassword = SECRET; - private char[] keyPassword; - private String trustStoreURL = "resource:tls/mesa_certs.jks"; - private char[] trustStorePassword = SECRET; - private Timer stgcmtTimer; - private boolean stgcmtReuseFrom = false; - private boolean stgcmtReuseTo = false; - private int stgcmtPort = 104; - private long stgcmtDelay = 1000; - private int stgcmtRetry = 0; - private long stgcmtRetryPeriod = 60000; - private String stgcmtRetrieveAET; - private String stgcmtRetrieveAETs; + private final DimseRSPHandler nEventReportRspHandler = + new DimseRSPHandler(); - private final DimseRSPHandler nEventReportRspHandler = - new DimseRSPHandler(); - public DcmRcv() { this("DCMRCV"); } @@ -465,7 +417,6 @@ this.stgcmtRetrieveAET = aet; } - public final String getStgCmtRetrieveAETs() { return stgcmtRetrieveAETs; } @@ -507,7 +458,7 @@ opts.addOptionGroup(tlsProtocol); opts.addOption("noclientauth", false, - "disable client authentification for TLS"); + "disable client authentification for TLS"); OptionBuilder.withArgName("file|url"); OptionBuilder.hasArg(); @@ -543,7 +494,7 @@ OptionBuilder.hasArg(); OptionBuilder.withDescription( "store received objects into files in specified directory <dir>." - + " Do not store received objects by default."); + + " Do not store received objects by default."); opts.addOption(OptionBuilder.create("dest")); OptionBuilder.withArgName("file|url"); @@ -585,7 +536,7 @@ OptionBuilder.hasArg(); OptionBuilder.withDescription( "register stored objects in cache journal files in specified directory <dir>." - + " Do not register stored objects by default."); + + " Do not register stored objects by default."); opts.addOption(OptionBuilder.create("journal")); OptionBuilder.withArgName("pattern"); @@ -607,65 +558,65 @@ OptionBuilder.withArgName("aet"); OptionBuilder.hasArg(); OptionBuilder.withDescription( - "Retrieve AE Title included in Storage Commitment " + - "N-EVENT-REPORT in items of the Referenced SOP Sequence."); + "Retrieve AE Title included in Storage Commitment " + + "N-EVENT-REPORT in items of the Referenced SOP Sequence."); scRetrieveAET.addOption(OptionBuilder.create("scretraets")); OptionBuilder.withArgName("aet"); OptionBuilder.hasArg(); OptionBuilder.withDescription( - "Retrieve AE Title included in Storage Commitment " + - "N-EVENT-REPORT outside of the Referenced SOP Sequence."); + "Retrieve AE Title included in Storage Commitment " + + "N-EVENT-REPORT outside of the Referenced SOP Sequence."); scRetrieveAET.addOption(OptionBuilder.create("scretraet")); opts.addOptionGroup(scRetrieveAET); opts.addOption("screusefrom", false, - "attempt to issue the Storage Commitment N-EVENT-REPORT on " + - "the same Association on which the N-ACTION operation was " + - "performed; use different Association for N-EVENT-REPORT by " + - "default."); + "attempt to issue the Storage Commitment N-EVENT-REPORT on " + + "the same Association on which the N-ACTION operation was " + + "performed; use different Association for N-EVENT-REPORT by " + + "default."); opts.addOption("screuseto", false, - "attempt to issue the Storage Commitment N-EVENT-REPORT on " + - "previous initiated Association to the Storage Commitment SCU; " + - "initiate new Association for N-EVENT-REPORT by default."); + "attempt to issue the Storage Commitment N-EVENT-REPORT on " + + "previous initiated Association to the Storage Commitment SCU; " + + "initiate new Association for N-EVENT-REPORT by default."); OptionBuilder.withArgName("port"); OptionBuilder.hasArg(); OptionBuilder.withDescription( - "port of Storage Commitment SCU to connect to issue " + - "N-EVENT-REPORT on different Association; 104 by default."); + "port of Storage Commitment SCU to connect to issue " + + "N-EVENT-REPORT on different Association; 104 by default."); opts.addOption(OptionBuilder.create("scport")); OptionBuilder.withArgName("ms"); OptionBuilder.hasArg(); OptionBuilder.withDescription( "delay in ms for N-EVENT-REPORT-RQ to Storage Commitment SCU, " - + "1s by default"); + + "1s by default"); opts.addOption(OptionBuilder.create("scdelay")); OptionBuilder.withArgName("retry"); OptionBuilder.hasArg(); OptionBuilder.withDescription( - "number of retries to issue N-EVENT-REPORT-RQ to Storage " + - "Commitment SCU, 0 by default"); + "number of retries to issue N-EVENT-REPORT-RQ to Storage " + + "Commitment SCU, 0 by default"); opts.addOption(OptionBuilder.create("scretry")); OptionBuilder.withArgName("ms"); OptionBuilder.hasArg(); OptionBuilder.withDescription( - "interval im ms between retries to issue N-EVENT-REPORT-RQ to" + - "Storage Commitment SCU, 60s by default"); + "interval im ms between retries to issue N-EVENT-REPORT-RQ to" + + "Storage Commitment SCU, 60s by default"); opts.addOption(OptionBuilder.create("scretryperiod")); OptionBuilder.withArgName("maxops"); OptionBuilder.hasArg(); OptionBuilder.withDescription( "maximum number of outstanding operations performed " - + "asynchronously, unlimited by default."); + + "asynchronously, unlimited by default."); opts.addOption(OptionBuilder.create("async")); opts.addOption("pdv1", false, "send only one PDV in one P-Data-TF PDU, " - + "pack command and data PDV in one P-DATA-TF PDU by default."); + + "pack command and data PDV in one P-DATA-TF PDU... [truncated message content] |