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();
}
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;
}
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();
}
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);
}
}
Aggregations