示例#1
0
  /**
   * Extract the plane at the different positions and concatenate the Dataset
   *
   * @param newValue
   * @return
   */
  private CallbackTask<Void, Void> createSampleImage(File newValue) {
    return new CallbackTask<Void, Void>()
        .run(
            () -> {
              try {
                File fileTarget = workflowModel.getMapImages().get(newValue);
                Dataset datasetTarget = (Dataset) iOService.open(fileTarget.getAbsolutePath());
                ImageDisplay imageDisplayTarget = new SilentImageDisplay();
                context.inject(imageDisplayTarget);
                imageDisplayTarget.display(datasetTarget);
                selectPosition(
                    imageDisplayTarget,
                    workflowModel.getPositionLeft(),
                    workflowModel.getPositionRight(),
                    imageDisplayPaneRight);

                Dataset datasetSource = (Dataset) iOService.open(newValue.getAbsolutePath());
                ImageDisplay imageDisplaySource = new SilentImageDisplay();
                context.inject(imageDisplaySource);
                imageDisplaySource.display(datasetSource);
                selectPosition(
                    imageDisplaySource,
                    workflowModel.getPositionLeft(),
                    workflowModel.getPositionRight(),
                    imageDisplayPaneLeft);

              } catch (IOException ex) {
                Logger.getLogger(ProcessWorkflow.class.getName()).log(Level.SEVERE, null, ex);
              }
            })
        .submit(loadingScreenService);
  }