Commit 76bfd602 authored by lafabregue's avatar lafabregue

switch to gdal to compute overviews

parent 5dd8aa60
......@@ -744,7 +744,7 @@ public class MainFrame extends JFrame {
customClassify();
}
});
//CSVMenu.add(customToDelete);
// CSVMenu.add(customToDelete);
// menuItemResultToCSV = new JMenuItem(Messages.getString("MainFrame.305")); //$NON-NLS-1$
// menuItemResultToCSV.addActionListener(new ActionListener() {
......@@ -2369,7 +2369,7 @@ public class MainFrame extends JFrame {
protected void createConstraints() {
try {
ConstraintsSelectionFrame frame = new ConstraintsSelectionFrame(
this.currentImageSession.getImageDisplayer(), null);
this.currentImageSession.getImageDisplayer(), null, null);
frame.setVisible(true);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, Messages.getString("MainFrame.128"),
......@@ -3801,8 +3801,8 @@ public class MainFrame extends JFrame {
private void customClassify() {
HybridClassification classification = new HybridClassification();
String datasetName = "Sud";
String datasetPath = "Sud";
String datasetName = "FacesUCR";
String datasetPath = "FacesUCR";
String dataPath = "/home/baptiste/A2CNES/";
String resultPath = "/home/baptiste/A2CNES/results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/";
......@@ -3815,11 +3815,11 @@ public class MainFrame extends JFrame {
AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.DTW_BARYCENTRE);
DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDataDesktopFrames();
DataSession testSession = desktopFrames[desktopFrames.length-1].getDataSession();
DataSession testSession = desktopFrames[desktopFrames.length-2].getDataSession();
final DateTime startTime = DateTime.now();
int nInf = 12;
int nSup = 14;
int nSup = 17;
// parametre pour la precision des conflits
double minC = 0.9;
......@@ -3828,7 +3828,7 @@ public class MainFrame extends JFrame {
double pcr = 0.2;
// parametre qualite/similitude
double ps = 0.3;
double ps = 0.2;
double pq = 1.0 - ps;
double constraintsWgt = 80;
double valueKExtern = 60;
......@@ -3845,7 +3845,7 @@ public class MainFrame extends JFrame {
classification.setAdvancedParameters(degradation, classRatio, solutionType, kIntern,
kExtern, unificationType, criterion, constraintsWgt);
ClassificationWeights weights = new GlobalWeights(dataTest);
ClassificationWeights weights = new GlobalWeights(dataTrain);
final Vector<Thread> threadList = new Vector<Thread>();
final Vector<Classification> classifList = new Vector<Classification>();
......@@ -3910,7 +3910,7 @@ public class MainFrame extends JFrame {
// }
// <<<< CONSTRAINTS
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(
Paths.get(dataPath+datasetName+"/test/"), "*.05_*")) {
Paths.get(dataPath+datasetName+"/train/"), "*1_10.constraints")) {
Iterator<Path> iter = dirStream.iterator();
while(iter.hasNext()) {
Vector<Constraint> constraints = new Vector<Constraint>();
......@@ -3951,15 +3951,14 @@ public class MainFrame extends JFrame {
Data currentData = (Data) dataTest.clone();
currentData.updateAndSetConstraintsToSample(constraints);
classif.addAgent(new ParametersKmeans(13, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(16, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(19, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(12, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(16, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(20, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(24, 15, weights), currentData);
classif.setName(resultPath+datasetName+"/"+
ImageHelper.stripExtension(filename)+"-"+i+
".clustering");
classif.setData(dataTest);
classif.setData(currentData);
Thread t = null;
......@@ -3969,7 +3968,7 @@ public class MainFrame extends JFrame {
t = new ClassificationThread(classif, classificationImage.getProgressBar(),
classificationImage, null);
classificationImage, null, false, null);
t.start();
try {
testSession.associatedFrame.setMaximum(true);
......@@ -4041,7 +4040,7 @@ public class MainFrame extends JFrame {
if (mask != null) {
maskLine = maskReader.readNext();
}
extractObjectFromLine(result, line, 3, maskLine);
extractObjectFromLine(result, line, 1, maskLine);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
......
......@@ -19,6 +19,8 @@ import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileReader;
......@@ -75,7 +77,7 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
private double minDistance = 0;
private double maxDistance = 100;
private Data data = null;
private Vector<Constraint> constraintsContainer = null;
/** Panel that contains the displayed image */
......@@ -147,14 +149,18 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
* constraints
*
* @param img
* the image on which the constraints have to be build
* the image on which the constraints have to be build
* @param data
* (optional) the data related to the constraints
(optional) the data related to the constraints
* @param constraintsContainer
* vector that contain the constraints to view and the new one
*/
public ConstraintsSelectionFrame(ImageDisplayer imgDisplayer, Data data) {
public ConstraintsSelectionFrame(ImageDisplayer imgDisplayer, Data data, Vector<Constraint> constraintsContainer) {
super();
mainPanel = new JPanel(new BorderLayout());
this.imageDisplayer = imgDisplayer;
this.constraintsContainer = constraintsContainer;
if (data != null) {
// case of Data provided
......@@ -184,6 +190,9 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
public void actionPerformed(ActionEvent e) {
if (ConstraintsSelectionFrame.this.data != null) {
ConstraintsSelectionFrame.this.data.updateAndSetConstraintsToSample(getConstraints());
updateConstraintsContainer(ConstraintsSelectionFrame.this.data.getConstraints());
} else {
updateConstraintsContainer(getConstraints());
}
ConstraintsSelectionFrame.this.dispose();
}
......@@ -271,10 +280,37 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
// mainPanel.add(jpane, BorderLayout.CENTER);
mainPanel.add(panelButton, BorderLayout.SOUTH);
if (data != null && data.getConstraints() != null) {
setConstraints(data.getConstraints(), false);
if (constraintsContainer != null ) {
setConstraints(constraintsContainer, false);
}
this.addWindowListener(new WindowListener() {
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
}
@Override
public void windowClosed(WindowEvent e) {
imageDisplayer.unsubscribeTo(ConstraintsSelectionFrame.this);
imageDisplayer.refresh(true);
}
@Override
public void windowActivated(WindowEvent e) {
}
});
this.setAlwaysOnTop(true);
this.setContentPane(mainPanel);
this.setTitle(Messages.getString("ConstraintsSelectionDialog.8")); //$NON-NLS-1$
this.setSize(420, 650);
......@@ -283,6 +319,19 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
}
/**
* Transfer a set of constraints to the constraints container
* @param constraints
* the constraints to transfer
*/
private void updateConstraintsContainer(Vector<Constraint> constraints) {
this.constraintsContainer.removeAllElements();
for(Constraint c : constraints) {
this.constraintsContainer.add(c);
}
}
private void addListeners() {
this.imageDisplayer.getDisplayPanel().addMouseListener(new MouseAdapter() {
@Override
......@@ -717,8 +766,6 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
@Override
public void pointClicked(Point pView, Point pReal, int clickType) {
// TODO Auto-generated method stub
}
protected void addSecondPixel(int x, int y) {
......
......@@ -635,6 +635,28 @@ public class BirdViewPanel extends JPanel implements MouseListener,
}
}
}
/**
* Synchronize the other birdviews with the current one if
* LinkTOAllBirdView option is selected
*/
public void synchOtherBirdViews() {
if(session instanceof ImageSession) {
if (MainFrame.getInstance().isLinkToAllBirdView()) {
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllImageDesktopFrames();
int nbSessions = desktopFrames.length;
for (int i = 0; i < nbSessions; i++) {
if (desktopFrames[i].getImageSession() != session) {
syncImage(desktopFrames[i].getImageSession());
}
}
}
}
}
@Override
public void paint(Graphics g) {
......
......@@ -23,8 +23,8 @@ import mustic.utils.image.ImageManager;
import mustic.utils.image.ZoomBoxPanel;
import mustic.utils.image.Zoomable;
import mustic.utils.image.viewer.BufferedImageViewer;
import mustic.utils.image.viewer.GDALPyramidImageViewer;
import mustic.utils.image.viewer.ImageViewer;
import mustic.utils.image.viewer.PyramidImageViewer;
/**
* Display an image and allows the user to do some operations on it (zoom, contrast..)
......@@ -145,7 +145,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
rawImage.addObserver(this);
if (session.isDisplayEnable()) {
this.viewer = new PyramidImageViewer(aImage, true);
this.viewer = new GDALPyramidImageViewer(aImage, true);
}
this.session = session;
// this.mImageLabel = new JLabel();
......@@ -215,6 +215,9 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
@Override
public void mouseReleased(MouseEvent e) {
// move the image when dragg&drop
if (mousePressedCoordinates == null)
return;
int translateX = (int) ((mousePressedCoordinates.x - e.getX())/mZoomRate);
int translateY = (int) ((mousePressedCoordinates.y - e.getY())/mZoomRate);
currentTopLeft.x += translateX;
......@@ -235,6 +238,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
viewer.getScreenImage(currentTopLeft.x, currentTopLeft.y, displayPanel.getWidth(),
displayPanel.getHeight(), mZoomRate, true);
updateImageView();
session.getBirdViewPanel().synchOtherBirdViews();
mousePressedCoordinates = null;
displayPanel.setAddedOffset(null);
......@@ -381,7 +385,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
@Override
public void actionPerformed(ActionEvent e) {
ConstraintsSelectionFrame frame = new ConstraintsSelectionFrame(
ImagePanel.this, null);
ImagePanel.this, null, null);
subscribeTo(frame);
}
});
......@@ -554,11 +558,11 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
ImagePanel.drawingTransparency = nT;
}
private void applyMask() {
Mask mask = MainFrame.getInstance().getCurrentImageSession().getRawImage().getMask();// this.mImage.getMask();
if (mask != null)
applyMask(mask);
}
// private void applyMask() {
// Mask mask = MainFrame.getInstance().getCurrentImageSession().getRawImage().getMask();// this.mImage.getMask();
// if (mask != null)
// applyMask(mask);
// }
public void applyMask(Mask mask) {
viewer.addMask(mask);
......
......@@ -45,14 +45,13 @@ import mustic.utils.filters.*;
import mustic.utils.image.BufferedImageHelper;
import mustic.utils.image.ImageAddOn;
import mustic.utils.image.ImageDisplayer;
import mustic.utils.image.ImageHelper;
import mustic.utils.image.ImageManager;
import mustic.utils.image.ZoomBoxPanel;
import mustic.utils.image.Zoomable;
import mustic.utils.image.viewer.ClusteringImageViewer;
import mustic.utils.image.viewer.GDALPyramidImageViewer;
import mustic.utils.image.viewer.ImageViewer;
import mustic.utils.image.viewer.MultiResolutionClusterMap;
import mustic.utils.image.viewer.PyramidImageViewer;
import mustic.utils.io.tiff.TiffUtils;
import org.apache.batik.svggen.SVGGraphics2DIOException;
......@@ -67,11 +66,17 @@ import org.apache.batik.svggen.SVGGraphics2DIOException;
public class ImageResultPanel extends ResultPanel implements TreeSelectionListener, ImageDisplayer, Observer, Zoomable {
/** serialVersionUID */
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private float brightnessValue = 30;
private float brightnessValue = 30;
private MultiResolutionClusterMap clusterMap = null;
protected File currentDirectory = null;
protected File currentDirectory = null;
/** Coordinates of the current position of the top left corner
* of the screen image in the original image */
private Point currentTopLeft = new Point(0,0);
/** l'image contenant les donnees d'origine */
private BufferedImage data;
......@@ -79,85 +84,80 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
/** l'image contenant les donnees d'origine */
protected BufferedImage data_zoomed;
private ImageData imgData;
/** panel that displays the image */
protected ZoomBoxPanel displayPanel = null;
/** the list of add on that the displayer has subscribed to */
private Vector<ImageAddOn> imageAddOns = new Vector<ImageAddOn>();
protected JInternalFrame jif_saveResult = new JInternalFrame();
/** the parent session */
private ImageManager imageManager = null;
protected JLayeredPane lpane = new JLayeredPane();
private ImageData imgData;
protected int[] map = null;
protected JInternalFrame jif_saveResult = new JInternalFrame();
protected JLayeredPane lpane = new JLayeredPane();
/** width of the screen image */
private int lastWidth = 0;
/** height of the screen image */
private int lastHeight = 0;
protected int[] map = null;
/** classification */
// protected Classification classification;
/** image initiale */
/** record the position of the mouse when it has been pressed */
private Point mousePressedCoordinates = null;
// protected RawImage mRawImage;
/** zoom level */
protected double mZoomRate = 1.0f;
protected double mZoomRate = 1.0f;
/** zoom step */
private double mZoomStep = 0.7f;
private double mZoomStep = 0.7f;
/** Coordinates of the current position of the top left corner
* of the screen image in the original image */
private Point currentTopLeft = new Point(0,0);
/** width of the screen image */
private int lastWidth = 0;
/** height of the screen image */
private int lastHeight = 0;
// clusters' opacity
// up to 0 - 1
private float opacity = 1;
/** offset between the panel and the actual displayed image */
private Point screenOffset = new Point(0,0);
private float opacityCluster = 1;
/** */
protected JPanel panelImage = new JPanel(new BorderLayout());
protected JPanel panelImage = new JPanel(new BorderLayout());
protected JPanel panelResSave = new JPanel();
protected JPanel panelResSave = new JPanel();
/** offset between the panel and the actual displayed image */
private Point screenOffset = new Point(0,0);
protected ClusteringResult result;
protected boolean[] resultSave = null;
protected boolean[] resultSave = null;
private ROIImage roi = null;
private ROIImage roi = null;
protected int rx = 0;
protected int rx = 0;
protected int ry = 0;
protected int ry = 0;
private float scaleFactor = 1.0f;
private float scaleFactor = 1.0f;
/** */
protected JToolBar tools = new JToolBar();
protected JButton vectorise = new JButton("Segmentation");
/** */
protected BufferedImage zoomed;
/** the parent session */
private ImageManager imageManager = null;
protected JToolBar tools = new JToolBar();
/** panel that displays the image */
protected ZoomBoxPanel displayPanel = null;
protected JButton vectorise = new JButton("Segmentation");
/** the viewer that allows to reader the image */
private ImageViewer viewer = null;
private MultiResolutionClusterMap clusterMap = null;
/** record the position of the mouse when it has been pressed */
private Point mousePressedCoordinates = null;
private ImageViewer viewer = null;
// clusters' opacity
// up to 0 - 1
private float opacity = 1;
private float opacityCluster = 1;
/** the list of add on that the displayer has subscribed to */
private Vector<ImageAddOn> imageAddOns = new Vector<ImageAddOn>();
/** */
protected BufferedImage zoomed;
/**
*
......@@ -205,7 +205,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
if (imgData.getRawImages() != null && imgData.getRawImages().size() > 0) {
this.viewer = new ClusteringImageViewer(new PyramidImageViewer(
this.viewer = new ClusteringImageViewer(new GDALPyramidImageViewer(
imgData.getRawImages().get(0), true), this.clusterMap);
// we can't add directly the birdView because it needs the ImageManager
// to be initialize, this might be rethink because it will happen every time
......@@ -335,8 +335,8 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
}
// else
// {
int x = ev.getX() - ((ImageResultPanel.this.displayPanel.getWidth() ) / 2);
int y = ev.getY() - ((ImageResultPanel.this.displayPanel.getHeight() ) / 2);
// int x = ev.getX() - ((ImageResultPanel.this.displayPanel.getWidth() ) / 2);
// int y = ev.getY() - ((ImageResultPanel.this.displayPanel.getHeight() ) / 2);
// if (x >= 0 && x < ImageResultPanel.this.zoomed.getWidth() && y >= 0 && y < ImageResultPanel.this.zoomed.getHeight()) {
// int coul = ImageResultPanel.this.zoomed.getRGB(x, y);
......@@ -514,7 +514,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
@Override
public void actionPerformed(ActionEvent e) {
ConstraintsSelectionFrame frame = new ConstraintsSelectionFrame(
ImageResultPanel.this, null);
ImageResultPanel.this, imgData, constraintsToUse);
subscribeTo(frame);
}
});
......@@ -1064,7 +1064,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
.tabbedPane.getTabAt(i).getContentComponent();
} else {
HybridClassificationMonitor hcm = (HybridClassificationMonitor) this.classFrame.tabbedPane.getTabAt(0).getContentComponent();
if (i < hcm.tabbedPane.getTabCount()-1) {
if (i <= hcm.tabbedPane.getTabCount()-1) {
imgPanel = (ImageResultPanel) hcm.tabbedPane.getTabAt(i).getContentComponent();
} else {
imgPanel = (ImageResultPanel) this.classFrame
......
......@@ -696,7 +696,8 @@ public class ClassifierPanel extends JPanel {
classification.setTimeExec(1);
}
new ClassificationThread(classification, classificationImage.getProgressBar(), classificationImage, this.rmiServer).start();
new ClassificationThread(classification, classificationImage.getProgressBar(),
classificationImage, this.rmiServer, false, null).start();
try {
dataSession.associatedFrame.setMaximum(true);
} catch (PropertyVetoException e1) {}
......@@ -716,7 +717,7 @@ public class ClassifierPanel extends JPanel {
// On lance le thread de classif
new ClassificationThread(classification, ((ClassificationModel) this.container_).getProgressBar(),
(ClassificationModel) this.container_, this.rmiServer).start();
(ClassificationModel) this.container_, this.rmiServer, false, null).start();
}
......@@ -1647,7 +1648,7 @@ public class ClassifierPanel extends JPanel {
this.votingDataComboBox.setEnabled(false);
this.infosLabel.setText("<html>" //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.SAMARAH, false) + "</html>"); //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.SAMARAH) + "</html>"); //$NON-NLS-1$
updateUI();
}
......@@ -1666,7 +1667,7 @@ public class ClassifierPanel extends JPanel {
this.votingDataComboBox.setEnabled(false);
this.infosLabel.setText("<html>" //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.MACLAW, false) + "</html>"); //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.MACLAW) + "</html>"); //$NON-NLS-1$
updateUI();
}
......@@ -1682,7 +1683,7 @@ public class ClassifierPanel extends JPanel {
this.votingDataComboBox.setEnabled(false);
this.infosLabel.setText("<html>" //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.SAMARAHV4, false) + "</html>"); //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.SAMARAHV4) + "</html>"); //$NON-NLS-1$
updateUI();
}
......@@ -1892,7 +1893,7 @@ public class ClassifierPanel extends JPanel {
* @param m indice de la methode a afficher
*/
public void updateParams(final int m, final boolean isImport) {
String[] method = this.approachPanel.getMethodNames(isImport)[m];
String[] method = ClassifierUtils.METHODS.get(new Integer(m));
this.paramsPanel.removeAll();
this.paramsPanel.setLayout(this.paramsGridLayout);
this.paramsGridLayout.setRows(method.length / 2);
......@@ -2003,7 +2004,7 @@ public class ClassifierPanel extends JPanel {
}
this.paramsPanel.updateUI();
this.infosLabel.setText("<html>" //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(m, isImport) + "</html>"); //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(m) + "</html>"); //$NON-NLS-1$
this.advParamsPanel.removeAll();
this.advParamsPanel.add(this.noAdvParamsLabel);
......@@ -2076,7 +2077,7 @@ public class ClassifierPanel extends JPanel {
// this.infosLabel.setText("Voting infos");
this.infosLabel.setText("<html>" //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.VOTING, false) + "</html>"); //$NON-NLS-1$
+ ClassifierUtils.getMethodDescription(ClassifierUtils.VOTING) + "</html>"); //$NON-NLS-1$
this.advParamsPanel.removeAll();
this.advParamsPanel.add(this.noAdvParamsLabel);
......
......@@ -391,12 +391,11 @@ public class ApproachSelectionPanel extends JPanel {
private void buildMethodList() {
String[][] methods = ClassifierUtils.METHODS;
/* On recupere la liste des methodes */
String[] classifiers = new String[methods.length];
for (int i = 0; i < methods.length; i++) {
classifiers[i] = methods[i][0];
String[] classifiers = new String[ClassifierUtils.ORDERED_IDs_SINGLE.size()];
for (int i = 0; i < ClassifierUtils.ORDERED_IDs_SINGLE.size(); i++) {
classifiers[i] = ClassifierUtils.getMethodName(ClassifierUtils.ORDERED_IDs_SINGLE.get(i));
}
// single panel pour les single classifier : radio + combo
......@@ -406,8 +405,8 @@ public class ApproachSelectionPanel extends JPanel {
this.methodComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
modele.setSelectedMethod(ClassifierUtils.correspondanceIndiceId[
ApproachSelectionPanel.this.methodComboBox.getSelectedIndex()]);
modele.setSelectedMethod(ClassifierUtils.ORDERED_IDs_SINGLE.get(
ApproachSelectionPanel.this.methodComboBox.getSelectedIndex()));
fatherContenair.updateParams(ApproachSelectionPanel.this.methodComboBox
.getSelectedIndex(), false);
......@@ -415,12 +414,10 @@ public class ApproachSelectionPanel extends JPanel {
});
String[][] importMethods = ClassifierUtils.IMPORT_METHODS;
/* On recupere la liste des methodes */
String[] importClassifiers = new String[importMethods.length];
for (int i = 0; i < importMethods.length; i++) {
importClassifiers[i] = importMethods[i][0];
String[] importClassifiers = new String[ClassifierUtils.ORDERED_IDs_IMPORTED.size()];
for (int i = 0; i < ClassifierUtils.ORDERED_IDs_IMPORTED.size(); i++) {
importClassifiers[i] = ClassifierUtils.getMethodName(ClassifierUtils.ORDERED_IDs_IMPORTED.get(i));
}
this.importMethodComboBox = new JComboBox<>(importClassifiers);
......@@ -429,8 +426,8 @@ public class ApproachSelectionPanel extends JPanel {
this.importMethodComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
modele.setSelectedMethod(ClassifierUtils.IMPORT_corresIndiceId[
ApproachSelectionPanel.this.importMethodComboBox.getSelectedIndex()]);
modele.setSelectedMethod(ClassifierUtils.ORDERED_IDs_IMPORTED.get(
ApproachSelectionPanel.this.importMethodComboBox.getSelectedIndex()));
fatherContenair.updateParams(ApproachSelectionPanel.this.importMethodComboBox
.getSelectedIndex(), true);
......@@ -451,8 +448,8 @@ public class ApproachSelectionPanel extends JPanel {
public void actionPerformed(ActionEvent e) {
modele.setSelectedApproach(SelectionModel.MONO_STRATEGY_APPROACH);
fatherContenair.setSingleClassificationPanel();
modele.setSelectedMethod(ClassifierUtils.correspondanceIndiceId[
methodComboBox.getSelectedIndex()]);
modele.setSelectedMethod(ClassifierUtils.ORDERED_IDs_SINGLE.get(
methodComboBox.getSelectedIndex()));
}
});
......@@ -493,8 +490,8 @@ public class ApproachSelectionPanel extends JPanel {
public void actionPerformed(ActionEvent e) {
modele.setSelectedApproach(SelectionModel.IMPORT_APPROACH);
fatherContenair.setImportClassificationPanel();
modele.setSelectedMethod(ClassifierUtils.IMPORT_corresIndiceId[
importMethodComboBox.getSelectedIndex()]);
modele.setSelectedMethod(ClassifierUtils.ORDERED_IDs_IMPORTED.get(
importMethodComboBox.getSelectedIndex()));
}
});
......@@ -521,12 +518,6 @@ public class ApproachSelectionPanel extends JPanel {
return this.importMethodComboBox;
}
public String[][] getMethodNames(boolean isImport) {
if (isImport)
return ClassifierUtils.IMPORT_METHODS;
return ClassifierUtils.METHODS;
}
public int getSelectedButton() {
int selection = 0;
if (this.singleStrategyButton.isSelected())
......
......@@ -29,6 +29,7 @@ import jcl.data.Data;
import jcl.utils.Histogram;
import mustic.gui.ClassificationFrame;
import mustic.gui.ImageDesktopFrame;
import mustic.gui.ImageSession;
import mustic.gui.MainFrame;
import mustic.gui.dialog.classifier.ConstraintsSelectionFrame;
import mustic.io.ImageData;
......@@ -38,7 +39,6 @@ import mustic.models.gui.panels.DataViewPanel;
import mustic.models.gui.panels.ScatterPlotPanel;
import mustic.models.gui.widgets.ClarffxDialog;
import mustic.models.gui.widgets.ClarffxTableModel;
import mustic.utils.image.ImageDisplayer;
import net.infonode.tabbedpanel.TabFactory;
import net.infonode.tabbedpanel.titledtab.TitledTab;
......@@ -437,13 +437,13 @@ public class DataPanel extends JPanel implements ChangeListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
ImageDisplayer img = null;
ImageSession img = null;
if(data instanceof ImageData) {
for(ImageDesktopFrame idf : MainFrame.getInstance()
.getDesktop().getAllImageDesktopFrames()) {
for(RawImage rimg : ((ImageData)data).getRawImages()) {
if (rimg.equals(idf.getImageSession().getRawImage())) {
img = idf.getImageSession().getImageDisplayer();
img = idf.getImageSession();
break;
}