Search in sources :

Example 1 with DicomNodeList

use of org.karnak.backend.model.dicom.DicomNodeList in project karnak by OsiriX-Foundation.

the class DicomWorkListSelectionDialog method init.

private void init() {
    dialog = this.getContent();
    workListNodes = new DicomNodeList("Worklists");
    buildDataProvider();
}
Also used : DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList)

Example 2 with DicomNodeList

use of org.karnak.backend.model.dicom.DicomNodeList in project karnak by OsiriX-Foundation.

the class Util method readnodes.

public static DicomNodeList readnodes(URL url, String name) {
    DicomNodeList list = new DicomNodeList(name);
    if (url != null) {
        Scanner scan = null;
        try {
            // $NON-NLS-1$
            scan = new Scanner(url.openStream(), StandardCharsets.UTF_8);
            while (scan.hasNext()) {
                String val = scan.nextLine();
                if (val.startsWith("#")) {
                    continue;
                }
                // $NON-NLS-1$
                String[] line = val.split(",(?=([^\"]*\"[^\"]*\")*+[^\"]*$)", -1);
                if (line.length >= 4) {
                    try {
                        ConfigNode node = new ConfigNode(trimSplit(line[0]), new DicomNode(trimSplit(line[1]), trimSplit(line[2]), Integer.parseInt(trimSplit(line[3]))));
                        list.add(node);
                    } catch (Exception e) {
                        System.out.println("Cannot read dicom node:  " + line[2]);
                    }
                }
            }
        } catch (Exception e) {
            System.out.println("Cannot read dicom nodes files:  " + url);
        } finally {
            if (scan != null) {
                scan.close();
            }
        }
    }
    return list;
}
Also used : Scanner(java.util.Scanner) DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) ConfigNode(org.karnak.backend.model.dicom.ConfigNode) DicomNode(org.weasis.dicom.param.DicomNode) TimeoutException(java.util.concurrent.TimeoutException) ExecutionException(java.util.concurrent.ExecutionException)

Example 3 with DicomNodeList

use of org.karnak.backend.model.dicom.DicomNodeList in project karnak by OsiriX-Foundation.

the class DicomEchoSelectionDialog method init.

private void init() {
    dialog = this.getContent();
    dicomNodeTypes = new ArrayList<>();
    dicomNodes = new DicomNodeList("DicomNodes");
    buildDataProviders();
}
Also used : DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList)

Example 4 with DicomNodeList

use of org.karnak.backend.model.dicom.DicomNodeList in project karnak by OsiriX-Foundation.

the class MonitorView method buildDicomNodeListSelector.

private void buildDicomNodeListSelector() {
    dicomEchoNodeListSelector = new Select<>();
    dicomEchoNodeListSelector.setEmptySelectionAllowed(false);
    DicomNodeList pacsProdDicomNodeList = Util.readnodes(this.getClass().getResource("/config/pacs-nodes-web.csv"), "PACS Public WEB");
    DicomNodeList newPacsProdDicomNodeList = Util.readnodes(this.getClass().getResource("/config/workstations-nodes.csv"), "Workstations");
    dicomEchoNodeListSelector.setItems(pacsProdDicomNodeList, newPacsProdDicomNodeList);
    dicomEchoNodeListSelector.addValueChangeListener((ValueChangeListener<ValueChangeEvent<DicomNodeList>>) event -> logic.dicomNodeListSelected(event.getValue()));
    if (!pacsProdDicomNodeList.isEmpty()) {
        dicomEchoNodeListSelector.setValue(pacsProdDicomNodeList);
    }
}
Also used : DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) Html(com.vaadin.flow.component.Html) Select(com.vaadin.flow.component.select.Select) Util(org.karnak.frontend.dicom.Util) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent) HorizontalLayout(com.vaadin.flow.component.orderedlayout.HorizontalLayout) VerticalLayout(com.vaadin.flow.component.orderedlayout.VerticalLayout) Div(com.vaadin.flow.component.html.Div) AbstractView(org.karnak.frontend.dicom.AbstractView) H6(com.vaadin.flow.component.html.H6) ValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener) WadoNodeList(org.karnak.backend.model.dicom.WadoNodeList) Alignment(com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment) Button(com.vaadin.flow.component.button.Button) DicomNodeList(org.karnak.backend.model.dicom.DicomNodeList) ValueChangeEvent(com.vaadin.flow.component.HasValue.ValueChangeEvent)

Aggregations

DicomNodeList (org.karnak.backend.model.dicom.DicomNodeList)4 ValueChangeEvent (com.vaadin.flow.component.HasValue.ValueChangeEvent)1 ValueChangeListener (com.vaadin.flow.component.HasValue.ValueChangeListener)1 Html (com.vaadin.flow.component.Html)1 Button (com.vaadin.flow.component.button.Button)1 Div (com.vaadin.flow.component.html.Div)1 H6 (com.vaadin.flow.component.html.H6)1 Alignment (com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 Select (com.vaadin.flow.component.select.Select)1 Scanner (java.util.Scanner)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 ConfigNode (org.karnak.backend.model.dicom.ConfigNode)1 WadoNodeList (org.karnak.backend.model.dicom.WadoNodeList)1 AbstractView (org.karnak.frontend.dicom.AbstractView)1 Util (org.karnak.frontend.dicom.Util)1 DicomNode (org.weasis.dicom.param.DicomNode)1