From 9e65fb18f40174acc3326f0abd3d0e8a9f66fbe3 Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Fri, 26 Jul 2024 16:40:18 +0100 Subject: [PATCH] Fix for colour limits on DL prediction pane --- .../dataPlotFX/DLSymbolOptionPanel.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/rawDeepLearningClassifier/dataPlotFX/DLSymbolOptionPanel.java b/src/rawDeepLearningClassifier/dataPlotFX/DLSymbolOptionPanel.java index 3ef63655..fc0180ed 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/DLSymbolOptionPanel.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/DLSymbolOptionPanel.java @@ -206,13 +206,25 @@ public class DLSymbolOptionPanel implements PamDialogPanel, ActionListener { * @param symbolOptions - the symbol options */ private void setPredictionColParams(DLSymbolModifierParams symbolOptions) { - + + + //just incasesettings have messed up + if (symbolOptions.clims[0]==symbolOptions.clims[1]) { + symbolOptions.clims[0]=Math.max(0.,symbolOptions.clims[1]-0.1); + symbolOptions.clims[1]=Math.min(1.,symbolOptions.clims[1]+0.1); + } + //now set frequency parameters - colorRangeSlider.setValue((int) symbolOptions.clims[0]*100); - colorRangeSlider.setUpperValue((int) symbolOptions.clims[1]*100); +// System.out.println("Set colour limits: " + symbolOptions.clims[0] + " " + symbolOptions.clims[1] + " " + colorRangeSlider.getMaximum()); + + //careful of casting to int here or else end up with setting the two thumbs in the same place. + colorRangeSlider.setColourMap(PamUtilsFX.fxColArray2Swing(symbolOptions.colArray)); + + colorRangeSlider.setValue((int) (symbolOptions.clims[0]*100.)); + + colorRangeSlider.setUpperValue((int) (symbolOptions.clims[1]*100.)); // colorRangeSlider.setColourArrayType( symbolOptions.colArray); - colorRangeSlider.setColourMap(PamUtilsFX.fxColArray2Swing(symbolOptions.colArray)); int nClass = checkClassNamesBox( symbolOptions, classNameBox);