Commit 5dd8aa60 authored by lafabregue's avatar lafabregue

proper implmentation of Model exportation

parent a4f994f2
......@@ -27,6 +27,9 @@ import jcl.learning.*;
import jcl.learning.methods.monostrategy.SingleClassification;
import jcl.learning.methods.monostrategy.ahc.LearningResultAHC;
import jcl.learning.methods.monostrategy.ahc.ParametersAHC;
import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.exceptions.MethodNotImplementedException;
import jcl.utils.io.JCLModelExchange;
import jsl.Segmentation;
import jsl.regionalisation.vectorisation.Filters;
import mustic.gui.*;
......@@ -1092,8 +1095,20 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
} else {
TiffUtils.writeRGBTiff(bi, outputPath);
}
Packager.zipFile(out, name + "/imageColor.tif", outputfile);
Packager.zipFile(out, name + "/"+outputPath, outputfile);
outputfile.delete();
/** Save the model file */
try {
String modelPath = "model.jclm";
File modelFile = new File(modelPath);
JCLModelExchange.modelToFile(modelPath, ""+classification.getType(), classification);
Packager.zipFile(out, name + "/"+modelPath, modelFile);
modelFile.delete();
} catch (MethodNotImplementedException | JCLFormatException e) {
e.printStackTrace();
}
out.closeEntry();
ObjectOutputStream oos;
/**
......
......@@ -30,10 +30,10 @@ import jcl.learning.methods.monostrategy.evidence.ParametersEvidence;
import jcl.learning.methods.monostrategy.gng.ParametersGNG;
import jcl.learning.methods.monostrategy.kmeans.ClassifierKmeans;
import jcl.learning.methods.monostrategy.kmeans.ParametersKmeans;
import jcl.learning.methods.monostrategy.kmeans.otb.ParametersOTBKmeans;
import jcl.learning.methods.monostrategy.perceptron.ParametersPerceptron;
import jcl.learning.methods.monostrategy.random.ParametersRandom;
import jcl.learning.methods.monostrategy.som.ParametersSOM;
import jcl.utils.io.JCLModelExchange;
import jcl.weights.ClassificationWeights;
import jcl.weights.GlobalWeights;
import mustic.gui.*;
......@@ -84,7 +84,7 @@ public class ClassifierPanel extends JPanel {
private JButton buttonSeed = new JButton(Messages.getString("ClassifierPanel.0")); //$NON-NLS-1$
private JButton buttonVisu = new JButton(Messages.getString("ClassifierPanel.1")); //$NON-NLS-1$
// private JButton buttonVisu = new JButton(Messages.getString("ClassifierPanel.1")); //$NON-NLS-1$
public JCheckBox checkboxSeeds = new JCheckBox(Messages.getString("ClassifierPanel.2")); //$NON-NLS-1$
......@@ -105,6 +105,8 @@ public class ClassifierPanel extends JPanel {
/** Reference vers l'eventuel container ou mettre le resultat */
private JPanel container_ = null;
private DataSession dataSession = null;
public JDialog dial = new JDialog();
......@@ -115,6 +117,9 @@ public class ClassifierPanel extends JPanel {
/** Panel contenant les parametres pour une classification hybride */
public HybridClassificationPanel hybridParametersPanel = null;
/** the classification loaded if the model import have been used */
private Classification importedClassification = null;
/** Le jtextpane pour l'affichage des infos */
private JLabel infosLabel = new JLabel();
......@@ -157,6 +162,8 @@ public class ClassifierPanel extends JPanel {
public KMeansSeedSelectionDialog seedPanel = new KMeansSeedSelectionDialog(this);
private DataDesktopFrame[] sessionsIndexes = null;
/** Les menus deroulants */
public JTaskPane taskPane = new JTaskPane();
......@@ -166,11 +173,6 @@ public class ClassifierPanel extends JPanel {
private boolean useNaiveDist = false;
public JComboBox<String> votingDataComboBox = null;
private DataSession dataSession = null;
private DataDesktopFrame[] sessionsIndexes = null;
/***************************************************************************
* CONSTRUCTEUR le paramètre monostrategy indique qu'il n'y a pas le choix de l'approche de
......@@ -231,40 +233,40 @@ public class ClassifierPanel extends JPanel {
this.attributeSelectionPanel = new AttributeSelectionPanel(dataSession.getData());
JPanel panelAttributs = new JPanel(new FlowLayout());
panelAttributs.add(this.attributeSelectionPanel);
JPanel panelVisu = new JPanel(new FlowLayout());
panelVisu.add(this.buttonVisu);
panelVisu.add(this.labelAide);
// JPanel panelVisu = new JPanel(new FlowLayout());
// panelVisu.add(this.buttonVisu);
// panelVisu.add(this.labelAide);
try {
this.attributeSelectionDialog = new AttributeSelectionDialog(this, dataSession.getData(),
this.approachPanel.getDataComboBox().getSelectedIndex());
} catch (Exception e) {}
attributsGroup.add(panelVisu);
// attributsGroup.add(panelVisu);
attributsGroup.add(panelAttributs);
this.taskPane.add(attributsGroup);
}
buttonVisu.setPreferredSize(new Dimension(150, 30));
labelAide.setPreferredSize(new Dimension(30, 30));
labelAide.setToolTipText("<html>" + Messages.getString("ClassifierPanel.13") + "<br>" + Messages.getString("ClassifierPanel.14") + "<br>"
+ Messages.getString("ClassifierPanel.15"));
this.buttonVisu.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
attributeSelectionDialog.SetSelectedAttributes(attributeSelectionPanel.getSelectedAttributes());
if (!isSimpleAgent) {
MainFrame.getInstance().getDesktop().addFrame(attributeSelectionDialog);
}
else {
dial.setTitle(Messages.getString("ClassifierPanel.16")); //$NON-NLS-1$
dial.setSize(700, 500);
dial.setLocation(100, 100);
dial.setAlwaysOnTop(true);
dial.setContentPane(attributeSelectionDialog.mainPanel);
dial.setVisible(true);
}
}
});
// buttonVisu.setPreferredSize(new Dimension(150, 30));
// labelAide.setPreferredSize(new Dimension(30, 30));
// labelAide.setToolTipText("<html>" + Messages.getString("ClassifierPanel.13") + "<br>" + Messages.getString("ClassifierPanel.14") + "<br>"
// + Messages.getString("ClassifierPanel.15"));
// this.buttonVisu.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// attributeSelectionDialog.SetSelectedAttributes(attributeSelectionPanel.getSelectedAttributes());
// if (!isSimpleAgent) {
// MainFrame.getInstance().getDesktop().addFrame(attributeSelectionDialog);
// }
// else {
// dial.setTitle(Messages.getString("ClassifierPanel.16")); //$NON-NLS-1$
// dial.setSize(700, 500);
// dial.setLocation(100, 100);
// dial.setAlwaysOnTop(true);
// dial.setContentPane(attributeSelectionDialog.mainPanel);
// dial.setVisible(true);
// }
// }
// });
buttonSeed.addActionListener(new ActionListener() {
@Override
......@@ -658,11 +660,15 @@ public class ClassifierPanel extends JPanel {
JOptionPane.showMessageDialog(this, Messages.getString("ClassifierPanel.63"), //$NON-NLS-1$
Messages.getString("ClassifierPanel.64"), JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$
} else {
LearningParameters lp = getParameters(dataSession.getData());
classification = new SingleClassification(lp, dataSession.getData(),
lp.getSamples());
classification = importedClassification;
classification.setData(dataSession.getData());
if (classification instanceof SingleClassification) {
ClassificationWeights weights = new GlobalWeights(dataSession.getData());
if (this.attributeSelectionPanel != null)
weights = this.attributeSelectionPanel.getWeights();
((SingleClassification) classification).setWeights(weights);
}
}
break;
}
......@@ -786,9 +792,9 @@ public class ClassifierPanel extends JPanel {
// return nameData;
// }
public JButton getButtonVisu() {
return this.buttonVisu;
}
// public JButton getButtonVisu() {
// return this.buttonVisu;
// }
/**
* @return classification
......@@ -964,19 +970,8 @@ public class ClassifierPanel extends JPanel {
if (choice == SelectionModel.IMPORT_APPROACH) {
switch (selectedMethod) {
case ClassifierUtils.IMPORT_KMEANS : {
String filePath = ((JTextField) ((JPanel) comp[1]).getComponent(0)).getText();
if (filePath.endsWith(".arff")) { //$NON-NLS-1$
List<DataObject> result = DataArffExchange.arffToDataObjects(filePath);
params = new ParametersKmeans(result.size(), 0, weights);
params.setSamples(new Vector<DataObject>(result));
} else {
JOptionPane.showMessageDialog(this,
Messages.getString("ClassifierPanel.1041"), //$NON-NLS-1$
Messages.getString("ClassifierPanel.1042"), //$NON-NLS-1$
JOptionPane.WARNING_MESSAGE);
}
break;
case ClassifierUtils.IMPORT_MODEL : {
}
case ClassifierUtils.IMPORT_CLUSTERING_TO_KMEANS : {
......@@ -1099,14 +1094,6 @@ public class ClassifierPanel extends JPanel {
System.out.println(Messages.getString("ClassifierPanel.106")); //$NON-NLS-1$
break;
}
case ClassifierUtils.OTB_KMEANS : {
int nbClusters = Integer.valueOf(((JTextField) comp[1]).getText()).intValue();
int nbIters = Integer.valueOf(((JTextField) comp[3]).getText()).intValue();
float convergThreshold = Float.valueOf(((JTextField) comp[5]).getText()).floatValue();
params = new ParametersOTBKmeans(weights, data.getNbObjects(), nbClusters, nbIters, convergThreshold);
break;
}
default:
......@@ -1548,24 +1535,6 @@ public class ClassifierPanel extends JPanel {
} catch (Exception e) {}
}
/**
* Permet de supprimer ou pas les anciennes actions du bouton classify du Panel, avant d'ajouter
* celui que l'on desire
* @param al la nouvelle action
* @param removeOthers true pour supprimer les anciennes actions
* @TODO il semble que ca ne ca marche pas
*/
// TODO il semble que ca ne ca marche pas. Cette methode n'est pas utilise.
public void setActionOnClassifyButton(ActionListener al, boolean removeOthers) {
if (removeOthers) {
for (int i = 0; i < this.classifyButton.getActionListeners().length; i++) {
this.classifyButton.removeActionListener(this.classifyButton.getActionListeners()[i]);
}
}
this.classifyButton.addActionListener(al);
}
public void setAdvancedOption(boolean mdateClustering, boolean simplifySequence, boolean useNaiveDist, boolean showTime) {
this.mdateClustering = mdateClustering;
if (mdateClustering) {
......@@ -1603,7 +1572,7 @@ public class ClassifierPanel extends JPanel {
for (int i = 2; i < comp.length; i++) {
comp[i].setEnabled(b);
}
this.buttonVisu.setEnabled(b);
// this.buttonVisu.setEnabled(b);
}
this.approachPanel.setEditable(b);
if (this.approachPanel.getSelectedButton() == ApproachSelectionPanel.SINGLE_STRATEGY) {
......@@ -1815,7 +1784,7 @@ public class ClassifierPanel extends JPanel {
this.maclawParametersPanel.getLearningMethodClassifierDialog().classifiersPanel.setTabbed();
}
this.buttonVisu.setEnabled(false);
// this.buttonVisu.setEnabled(false);
this.checkboxSeeds.setEnabled(false);
this.buttonSeed.setEnabled(false);
}
......@@ -1922,7 +1891,7 @@ public class ClassifierPanel extends JPanel {
* </p>
* @param m indice de la methode a afficher
*/
public void updateParams(int m, boolean isImport) {
public void updateParams(final int m, final boolean isImport) {
String[] method = this.approachPanel.getMethodNames(isImport)[m];
this.paramsPanel.removeAll();
this.paramsPanel.setLayout(this.paramsGridLayout);
......@@ -1931,7 +1900,7 @@ public class ClassifierPanel extends JPanel {
for (int i = 1; i < method.length; i += 2) {
this.paramsPanel.add(new JLabel(" ... " + method[i])); //$NON-NLS-1$
if (method[i] == ClassifierUtils.FILE_PARAMETER) {
JTextField txtField = new JTextField(method[i + 1]);
final JTextField txtField = new JTextField(method[i + 1]);
JButton browseButton = new JButton(Messages.getString("ClassifierPanel.113")); //$NON-NLS-1$
browseButton.addActionListener(new BrowseButtonActionListener(txtField) {
@Override
......@@ -1939,11 +1908,16 @@ public class ClassifierPanel extends JPanel {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle(Messages.getString("ClassifierPanel.112")); //$NON-NLS-1$
fileChooser.setMultiSelectionEnabled(true);
if (isImport && m+1000 == ClassifierUtils.IMPORT_MODEL) {
fileChooser.setMultiSelectionEnabled(false);
}
int returnVal = fileChooser.showOpenDialog(ClassifierPanel.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
this.textField.setText(fileChooser.getSelectedFile().getPath());
}
loadModel(txtField.getText());
}
});
JPanel innerPane = new JPanel();
......@@ -1951,6 +1925,16 @@ public class ClassifierPanel extends JPanel {
innerPane.add(txtField, BorderLayout.CENTER);
innerPane.add(browseButton, BorderLayout.EAST);
this.paramsPanel.add(innerPane);
// Special case for model import. We load the model when we select the file
if (isImport && m+1000 == ClassifierUtils.IMPORT_MODEL) {
txtField.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadModel(txtField.getText());
}
});
}
} else {
this.paramsPanel.add(new JTextField(method[i + 1]));
}
......@@ -2099,6 +2083,23 @@ public class ClassifierPanel extends JPanel {
this.advParamsPanel.updateUI();
}
private void loadModel(String path) {
try {
this.importedClassification = JCLModelExchange.fileToModel(path);
if (this.importedClassification instanceof SingleClassification) {
attributeSelectionPanel.setWeights(((SingleClassification) this.importedClassification)
.getLearningResult().getWeights().getGlobalWeights());
}
} catch (Exception e) {
JOptionPane.showMessageDialog(this, Messages.getString("ClassifierPanel.501") + //$NON-NLS-1$
e.getClass().getName() + e.getMessage(),
Messages.getString("ClassifierPanel.50"), //$NON-NLS-1$
JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
}
private abstract class BrowseButtonActionListener implements ActionListener {
protected JTextField textField;
public BrowseButtonActionListener(JTextField textField){
......
......@@ -20,6 +20,7 @@ import mustic.gui.DataDesktopFrame;
import mustic.gui.MainFrame;
import mustic.gui.dialog.classifier.AttributeSelectionDialog;
import mustic.gui.panels.classifier.ClassifierPanel;
import mustic.gui.panels.classifier.Messages;
import mustic.gui.panels.classifier.SelectionModel;
import mustic.models.gui.panels.AttributeSelectionPanel;
......@@ -38,24 +39,25 @@ public class ApproachSelectionPanel extends JPanel {
private static final String METHOD_LABEL = "- method";
private static final String METHOD_LABEL = Messages.getString("ApproachSelectionPanel.1"); //$NON-NLS-1$
public static final int SINGLE_STRATEGY = 0;
private static final String MONO_STRATEGY_ALABEL = " Single strategy ";
private static final String MONO_STRATEGY_ALABEL = Messages.getString("ApproachSelectionPanel.2"); //$NON-NLS-1$
public static final int MULTI_STRATEGY = 1;
private static final String MULTI_STRATEGY_ALABEL = " Multi strategy (Samarah method) ";
private static final String MULTI_STRATEGY_ALABEL = Messages.getString("ApproachSelectionPanel.3"); //$NON-NLS-1$
public static final int MULTI_STRATEGY_ETC = 2;
private static final String MULTI_STRATEGY_ETC_ALABEL = " Multi strategy & multi source (work in progress) ";
private static final String MULTI_STRATEGY_ETC_ALABEL = Messages.getString("ApproachSelectionPanel.4"); //$NON-NLS-1$
public static final int MACLAW = 3;
private static final String MACLAW_ALABEL = " Attribute weighting (MACLAW method) ";
private static final String MACLAW_ALABEL = Messages.getString("ApproachSelectionPanel.5"); //$NON-NLS-1$
public static final int VOTING = 4;
private static final String VOTING_ALABEL = " Voting approach ";
private static final String VOTING_ALABEL = Messages.getString("ApproachSelectionPanel.6"); //$NON-NLS-1$
public static final int IMPORT_STRATEGY = 5;
private static final String IMPORT_STRATEGY_ALABEL = " Import from file";
private static final String IMPORT_STRATEGY_ALABEL = Messages.getString("ApproachSelectionPanel.7"); //$NON-NLS-1$
/*
* groupe de boutons type radiobox pour sélectionner le mode de
......@@ -69,6 +71,7 @@ public class ApproachSelectionPanel extends JPanel {
private SelectionModel modele;
//TODO remove data combo boxes, it should always be launched on the currently selected data
private JComboBox<String> dataComboBox = null;
private JComboBox<String> importDataComboBox = null;
......@@ -154,8 +157,8 @@ public class ApproachSelectionPanel extends JPanel {
currentPanel.add(new JLabel(METHOD_LABEL));
currentPanel.add(methodComboBox);
//currentPanel.add(new JLabel(DATA_LABEL));
currentPanel.add(new JLabel(" - "));
currentPanel.add(dataComboBox);
// currentPanel.add(new JLabel(" - "));
// currentPanel.add(dataComboBox);
break;
}
case 5: {
......@@ -165,7 +168,7 @@ public class ApproachSelectionPanel extends JPanel {
this.fatherContenair.votingDataComboBox.setEnabled(false);
currentPanel.add(fatherContenair.votingDataComboBox);
// currentPanel.add(fatherContenair.votingDataComboBox);
break;
}
// Multires TEST 25mai commentaire le code pour CLASSIFICATION MULTI-RESOLUTION
......@@ -217,8 +220,8 @@ public class ApproachSelectionPanel extends JPanel {
currentPanel.add(button);
currentPanel.add(new JLabel(METHOD_LABEL));
currentPanel.add(importMethodComboBox);
currentPanel.add(new JLabel(" - "));
currentPanel.add(importDataComboBox);
// currentPanel.add(new JLabel(" - "));
// currentPanel.add(importDataComboBox);
break;
}
......@@ -281,10 +284,10 @@ public class ApproachSelectionPanel extends JPanel {
JTaskPaneGroup attributsGroup = new JTaskPaneGroup();
attributsGroup.setTitle("Attributes selection and weigths configuration");
JPanel panelAttributs = new JPanel(new FlowLayout());
JPanel panelVisu = new JPanel(new FlowLayout());
panelVisu.add(fatherContenair.getButtonVisu());
panelVisu.add(fatherContenair.getLabelAide());
attributsGroup.add(panelVisu);
// JPanel panelVisu = new JPanel(new FlowLayout());
// panelVisu.add(fatherContenair.getButtonVisu());
// panelVisu.add(fatherContenair.getLabelAide());
// attributsGroup.add(panelVisu);
panelAttributs
.add(fatherContenair.attributeSelectionPanel);
attributsGroup.add(panelAttributs);
......@@ -348,10 +351,10 @@ public class ApproachSelectionPanel extends JPanel {
JTaskPaneGroup attributsGroup = new JTaskPaneGroup();
attributsGroup.setTitle("Attributes selection and weigths configuration");
JPanel panelAttributs = new JPanel(new FlowLayout());
JPanel panelVisu = new JPanel(new FlowLayout());
panelVisu.add(fatherContenair.getButtonVisu());
panelVisu.add(fatherContenair.getLabelAide());
attributsGroup.add(panelVisu);
// JPanel panelVisu = new JPanel(new FlowLayout());
// panelVisu.add(fatherContenair.getButtonVisu());
// panelVisu.add(fatherContenair.getLabelAide());
// attributsGroup.add(panelVisu);
panelAttributs
.add(fatherContenair.attributeSelectionPanel);
attributsGroup.add(panelAttributs);
......@@ -498,16 +501,14 @@ public class ApproachSelectionPanel extends JPanel {
/*
* construction de la liste contenante, c.a.d le résultat
*/
ButtonGroup res = new ButtonGroup();
res.add(singleStrategyButton);
res.add(multiStrategyButton);
res.add(multiStrategyEtcButton);
res.add(maclawStrategyButton);
res.add(votingStrategyButton);
res.add(importStrategyButton);
this.clusteringModeSelector = res;
clusteringModeSelector = new ButtonGroup();
clusteringModeSelector.add(singleStrategyButton);
clusteringModeSelector.add(multiStrategyButton);
clusteringModeSelector.add(multiStrategyEtcButton);
clusteringModeSelector.add(maclawStrategyButton);
clusteringModeSelector.add(votingStrategyButton);
clusteringModeSelector.add(importStrategyButton);
}
......
ApproachSelectionPanel.1=- method
ApproachSelectionPanel.2= Single strategy
ApproachSelectionPanel.3= Multi strategy (Samarah method)
ApproachSelectionPanel.4= Multi strategy & multi source (work in progress)
ApproachSelectionPanel.5= Attribute weighting (MACLAW method)
ApproachSelectionPanel.6= Voting approach
ApproachSelectionPanel.7= Import from file
ClassifierHandler.0=parametres ouverts
ClassifierHandler.1=parameters
ClassifierHandler.121=Balise
......@@ -23,7 +30,7 @@ ClassifierPanel.105=error\! class:ClassifierPanel, method:getParameters
ClassifierPanel.106=INFO: AHC Selected
ClassifierPanel.107=ERROR: Vous avez selectionne une methode qui n'est pas dans jComboBoxMethods
ClassifierPanel.108=error\! class:ClassifierPanel, method:getParameters
ClassifierPanel.1041=You must select an ARFF file.
ClassifierPanel.1041=You must select a jcl model file (.jclm).
ClassifierPanel.1042=Warning
ClassifierPanel.11=Classifier parameters
ClassifierPanel.110=Select a data
......@@ -91,6 +98,7 @@ ClassifierPanel.48=Error
ClassifierPanel.49=Select a data
ClassifierPanel.5=Parameters
ClassifierPanel.50=Error
ClassifierPanel.501=An error occurred while loading the model file :
ClassifierPanel.51=K-means
ClassifierPanel.52=tout est ok pr classif multi-d
ClassifierPanel.53=Select agents
......
ApproachSelectionPanel.1=- methode
ApproachSelectionPanel.2= Stratgie unique
ApproachSelectionPanel.3= Multi stratgie (mthode SAMARAH)
ApproachSelectionPanel.4= Multi stratgie & multi source (en cours)
ApproachSelectionPanel.5= Par poids des attributs (mthode MACLAW)
ApproachSelectionPanel.6= Approche par vote
ApproachSelectionPanel.7= Import de fichier
ClassifierHandler.0=parametres ouverts
ClassifierHandler.1=parameters
ClassifierHandler.121=Balise
ClassifierHandler.122=\ inconnue.
ClassifierHandler.2=\ not found
ClassifierHandler.3=Warning
ClassifierHandler.3=Attention
ClassifierHandler.4=\ not found
ClassifierHandler.5=Warning
ClassifierHandler.5=Attention
ClassifierHandler.6=\ not found
ClassifierHandler.65=Warning
ClassifierHandler.65=Attention
ClassifierHandler.85=Balise
ClassifierHandler.86=\ inconnue.
ClassifierHandler.87=Ouverture des parametres
ClassifierHandler.94=seed
ClassifierPanel.0=Select seeds
ClassifierPanel.1=Visualize bandes
ClassifierPanel.10=Method
ClassifierPanel.0=Selectionner les centres initiaux
ClassifierPanel.1=Visualisers les bandes
ClassifierPanel.10=Methode
ClassifierPanel.100=Learning agents ne doit pas etre vide
ClassifierPanel.101=sequence...
ClassifierPanel.102=other...
ClassifierPanel.102=autre...
ClassifierPanel.103=Erreur
ClassifierPanel.1041=Vous devez choisir un fichier ARFF.
ClassifierPanel.1042=Attention
......@@ -25,6 +32,8 @@ ClassifierPanel.105=error\! class:ClassifierPanel, method:getParameters
ClassifierPanel.106=INFO: AHC Selected
ClassifierPanel.107=ERROR: Vous avez selectionne une methode qui n'est pas dans jComboBoxMethods
ClassifierPanel.108=error\! class:ClassifierPanel, method:getParameters
ClassifierPanel.1041=Vous devez slectionner un fichier de model jcl (.jclm).
ClassifierPanel.1042=Attention
ClassifierPanel.11=Parametres de classification
ClassifierPanel.110=Selectionner une donne
ClassifierPanel.111=Erreur
......@@ -90,7 +99,8 @@ ClassifierPanel.47=Select a data
ClassifierPanel.48=Error
ClassifierPanel.49=Select a data
ClassifierPanel.5=Parameters
ClassifierPanel.50=Error
ClassifierPanel.50=Erreur
ClassifierPanel.501=Une erreur est survenue en chargant le fichier du model :
ClassifierPanel.51=K-means
ClassifierPanel.52=tout est ok pr classif multi-d
ClassifierPanel.53=Select agents
......
......@@ -36,7 +36,7 @@ public class ClusteringResultROI extends SimpleClusteringResult {
*/
public ClusteringResultROI(ROIImage image, ClassificationWeights weights,
int nbClusters, Data data, int[] clusterMap) {
super(null, clusterMap, null, weights, nbClusters, null, data, null);
super(null, clusterMap, null, weights, nbClusters, null, data, null, null);
this.image = image;
......
......@@ -46,11 +46,12 @@ public class GDALImageReaderWrapper extends ReaderWrapper {
public GDALImageReaderWrapper(String Path) throws Exception {
this.filePath = Path;
gdal.AllRegister();
dataSet = gdal.Open(Path, gdalconst.GA_ReadOnly);
dataSet = gdal.Open(this.filePath, gdalconst.GA_ReadOnly);
if (dataSet == null) {
throw new Exception("GDAL : Error when opening the file");
} else {
this.tile = null;
this.tileLoaded = false;
this.imageWidth = dataSet.GetRasterXSize();
this.imageHeight = dataSet.GetRasterYSize();
this.channelCount = dataSet.GetRasterCount();
......@@ -75,6 +76,7 @@ public class GDALImageReaderWrapper extends ReaderWrapper {
throw new Exception("GDAL : Error when opening the file");
} else {
this.tile = null;
this.tileLoaded = false;
this.imageWidth = dataSet.GetRasterXSize();
this.imageHeight = dataSet.GetRasterYSize();
this.channelCount = dataSet.GetRasterCount();
......@@ -169,6 +171,10 @@ public class GDALImageReaderWrapper extends ReaderWrapper {
currentTileWidth = imageWidth - tileX;
}
// it means that the memory might have been flushed
if (tile == null) {