use of artisynth.core.renderables.DicomViewer in project artisynth_core by artisynth.
the class DicomLoader method load.
void load() {
String folder = fnf.getText();
String pattern = fnp.getText();
boolean subdirs = fns.getBooleanValue();
if (viewer != null) {
removeRenderable(viewer);
}
if (viewerPlanes.size() > 0) {
for (DicomPlaneViewer dpv : viewerPlanes) {
removeRenderable(dpv);
}
viewerPlanes.clear();
}
File file = new File(folder);
String name = file.getName();
viewer = new DicomViewer(name, file.getAbsolutePath(), Pattern.compile(pattern), subdirs);
DicomImage image = viewer.getImage();
System.out.println(image.toString());
addRenderable(viewer);
Main.getMain().getViewer().autoFit();
}
use of artisynth.core.renderables.DicomViewer in project artisynth_core by artisynth.
the class DicomTest method build.
public void build(String[] args) throws IOException {
// download the BRAINIX dicom data if it does not already exist
String localDir = ArtisynthPath.getSrcRelativePath(this, "data/MONO2_HEART");
FileManager fileManager = new FileManager(localDir, "gz:" + dicom_url + "!/");
fileManager.setConsoleProgressPrinting(true);
// download zip file first
fileManager.setOptions(FileManager.DOWNLOAD_ZIP);
// extract
File dicomPath = fileManager.get(dicom_file);
DicomViewer dcp = new DicomViewer("Heart", dicomPath.getAbsolutePath(), null, /*check subdirectories*/
false);
addRenderable(dcp);
}
Aggregations