Отрегулируйте окно Dicomimage - PullRequest
0 голосов
/ 18 октября 2018

Я пишу простой просмотрщик dicom.Я хотел бы, чтобы окна Dicom окон с помощью ползунка диапазона.Но когда я перемещаю область, изображение не изменяется.

Инициирование диапазона:

DICOM temp = listImages.getSelectionModel().getSelectedItem();
double minValue = temp.getWindowCenter() - (temp.getWindowWidth() / 2);
double maxValue = temp.getWindowCenter() + (temp.getWindowWidth() / 2);
windowing.setMin(temp.getMinHU());
windowing.setMax(temp.getMaxHU());
windowing.setLowValue(minValue);
windowing.setHighValue(maxValue);

Событие изменения значения:

windowing.lowValueProperty().addListener((Observable o) -> {
        try {

            if (displayImage) {
                double windowWidth = windowing.getLowValue() - windowing.getHighValue();
                double windowCenter = windowWidth / 2;
                DICOM temp = listImages.getSelectionModel().getSelectedItem();
                temp.setWindowWidth(windowWidth);
                temp.setWindowCenter(windowCenter);
                viewImage.setImage(SwingFXUtils.toFXImage(temp.getBufferedImage(), null));
            }
        } catch (IOException ex) {
            Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex);
        }
    });
    windowing.highValueProperty().addListener(o -> {
        try {
            if (displayImage) {
                double windowWidth = windowing.getLowValue() - windowing.getHighValue();
                double windowCenter = windowWidth / 2;
                DICOM temp = listImages.getSelectionModel().getSelectedItem();
                temp.setWindowWidth(windowWidth);
                temp.setWindowCenter(windowCenter);
                viewImage.setImage(SwingFXUtils.toFXImage(temp.getBufferedImage(), null));
            }
        } catch (IOException ex) {
            Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex);
        }
    });

Надеюсь, кто-нибудьможешь мне помочь.

...