Commit 61278aa7 authored by lafabregue's avatar lafabregue

clean mustic projet

parent 5a0ee226
# libgdalconstjni.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libgdalconstjni.so.20'
# Names of this library.
library_names='libgdalconstjni.so.20.3.1 libgdalconstjni.so.20 libgdalconstjni.so'
# The name of the static archive.
old_library='libgdalconstjni.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=' -pthread'
# Libraries that this one depends upon.
dependency_libs=' /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -ljson-c -lfreexl -lqhull -lgeos_c -lwebp /usr/lib/x86_64-linux-gnu/libsqlite3.la -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator /usr/lib/x86_64-linux-gnu/libexpat.la -lxerces-c -lopenjp2 -lnetcdf -lhdf5_hl -lsz -lhdf5 /usr/lib/libmfhdfalt.la /usr/lib/libdfalt.la -logdi -lgif -ljpeg -lgeotiff -ltiff -lpng -lpq -lz -lpthread -lrt -ldl -lpcre /usr/lib/x86_64-linux-gnu/libcurl.la -lxml2'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libgdalconstjni.
current=23
age=3
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
relink_command="(cd /home/baptiste/Downloads/gdal-2.2.2/swig/java; /bin/bash /home/baptiste/Downloads/gdal-2.2.2/libtool --mode=relink g++ -std=gnu++11 gdalconst_wrap.lo /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -o libgdalconstjni.la -rpath /usr/local/lib -no-undefined -version-info 23:1:3 @inst_prefix_dir@)"
# libgdaljni.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libgdaljni.so.20'
# Names of this library.
library_names='libgdaljni.so.20.3.1 libgdaljni.so.20 libgdaljni.so'
# The name of the static archive.
old_library='libgdaljni.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=' -pthread'
# Libraries that this one depends upon.
dependency_libs=' /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -ljson-c -lfreexl -lqhull -lgeos_c -lwebp /usr/lib/x86_64-linux-gnu/libsqlite3.la -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator /usr/lib/x86_64-linux-gnu/libexpat.la -lxerces-c -lopenjp2 -lnetcdf -lhdf5_hl -lsz -lhdf5 /usr/lib/libmfhdfalt.la /usr/lib/libdfalt.la -logdi -lgif -ljpeg -lgeotiff -ltiff -lpng -lpq -lz -lpthread -lrt -ldl -lpcre /usr/lib/x86_64-linux-gnu/libcurl.la -lxml2'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libgdaljni.
current=23
age=3
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
relink_command="(cd /home/baptiste/Downloads/gdal-2.2.2/swig/java; /bin/bash /home/baptiste/Downloads/gdal-2.2.2/libtool --mode=relink g++ -std=gnu++11 gdal_wrap.lo /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -o libgdaljni.la -rpath /usr/local/lib -no-undefined -version-info 23:1:3 @inst_prefix_dir@)"
# libgnmjni.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libgnmjni.so.20'
# Names of this library.
library_names='libgnmjni.so.20.3.1 libgnmjni.so.20 libgnmjni.so'
# The name of the static archive.
old_library='libgnmjni.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=' -pthread'
# Libraries that this one depends upon.
dependency_libs=' /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -ljson-c -lfreexl -lqhull -lgeos_c -lwebp /usr/lib/x86_64-linux-gnu/libsqlite3.la -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator /usr/lib/x86_64-linux-gnu/libexpat.la -lxerces-c -lopenjp2 -lnetcdf -lhdf5_hl -lsz -lhdf5 /usr/lib/libmfhdfalt.la /usr/lib/libdfalt.la -logdi -lgif -ljpeg -lgeotiff -ltiff -lpng -lpq -lz -lpthread -lrt -ldl -lpcre /usr/lib/x86_64-linux-gnu/libcurl.la -lxml2'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libgnmjni.
current=23
age=3
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
relink_command="(cd /home/baptiste/Downloads/gdal-2.2.2/swig/java; /bin/bash /home/baptiste/Downloads/gdal-2.2.2/libtool --mode=relink g++ -std=gnu++11 gnm_wrap.lo /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -o libgnmjni.la -rpath /usr/local/lib -no-undefined -version-info 23:1:3 @inst_prefix_dir@)"
# libogrjni.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libogrjni.so.20'
# Names of this library.
library_names='libogrjni.so.20.3.1 libogrjni.so.20 libogrjni.so'
# The name of the static archive.
old_library='libogrjni.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=' -pthread'
# Libraries that this one depends upon.
dependency_libs=' /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -ljson-c -lfreexl -lqhull -lgeos_c -lwebp /usr/lib/x86_64-linux-gnu/libsqlite3.la -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator /usr/lib/x86_64-linux-gnu/libexpat.la -lxerces-c -lopenjp2 -lnetcdf -lhdf5_hl -lsz -lhdf5 /usr/lib/libmfhdfalt.la /usr/lib/libdfalt.la -logdi -lgif -ljpeg -lgeotiff -ltiff -lpng -lpq -lz -lpthread -lrt -ldl -lpcre /usr/lib/x86_64-linux-gnu/libcurl.la -lxml2'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libogrjni.
current=23
age=3
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
relink_command="(cd /home/baptiste/Downloads/gdal-2.2.2/swig/java; /bin/bash /home/baptiste/Downloads/gdal-2.2.2/libtool --mode=relink g++ -std=gnu++11 ogr_wrap.lo /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -o libogrjni.la -rpath /usr/local/lib -no-undefined -version-info 23:1:3 @inst_prefix_dir@)"
# libosrjni.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libosrjni.so.20'
# Names of this library.
library_names='libosrjni.so.20.3.1 libosrjni.so.20 libosrjni.so'
# The name of the static archive.
old_library='libosrjni.a'
# Linker flags that can not go in dependency_libs.
inherited_linker_flags=' -pthread'
# Libraries that this one depends upon.
dependency_libs=' /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -ljson-c -lfreexl -lqhull -lgeos_c -lwebp /usr/lib/x86_64-linux-gnu/libsqlite3.la -lodbc -lodbcinst -lkmlbase -lkmldom -lkmlengine -lkmlxsd -lkmlregionator /usr/lib/x86_64-linux-gnu/libexpat.la -lxerces-c -lopenjp2 -lnetcdf -lhdf5_hl -lsz -lhdf5 /usr/lib/libmfhdfalt.la /usr/lib/libdfalt.la -logdi -lgif -ljpeg -lgeotiff -ltiff -lpng -lpq -lz -lpthread -lrt -ldl -lpcre /usr/lib/x86_64-linux-gnu/libcurl.la -lxml2'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libosrjni.
current=23
age=3
revision=1
# Is this an already installed library?
installed=no
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
relink_command="(cd /home/baptiste/Downloads/gdal-2.2.2/swig/java; /bin/bash /home/baptiste/Downloads/gdal-2.2.2/libtool --mode=relink g++ -std=gnu++11 osr_wrap.lo /home/baptiste/Downloads/gdal-2.2.2/libgdal.la -o libosrjni.la -rpath /usr/local/lib -no-undefined -version-info 23:1:3 @inst_prefix_dir@)"
......@@ -735,27 +735,27 @@ public class MainFrame extends JFrame {
// Preprocessing
menuPreprocessing = new JMenu(Messages.getString("MainFrame.351"));
menuItemVegetation = new JMenuItem(Messages.getString("MainFrame.352"));
menuItemVegetation.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
menuVegetation();
}
});
menuPreprocessing.add(menuItemVegetation);
menuItemWater = new JMenuItem(Messages.getString("MainFrame.353"));
menuItemWater.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
menuWater();
// menuItemVegetation = new JMenuItem(Messages.getString("MainFrame.352"));
// menuItemVegetation.addActionListener(new ActionListener() {
//
// @Override
// public void actionPerformed(ActionEvent e) {
// menuVegetation();
//
// }
// });
// menuPreprocessing.add(menuItemVegetation);
}
});
menuPreprocessing.add(menuItemWater);
// menuItemWater = new JMenuItem(Messages.getString("MainFrame.353"));
// menuItemWater.addActionListener(new ActionListener() {
//
// @Override
// public void actionPerformed(ActionEvent e) {
// menuWater();
//
// }
// });
// menuPreprocessing.add(menuItemWater);
menuItemConcatenate = new JMenuItem(Messages.getString("MainFrame.354"));
menuItemConcatenate.addActionListener(new ActionListener() {
......@@ -1344,8 +1344,8 @@ public class MainFrame extends JFrame {
menuHClustering.setEnabled(this.actionClustering);
menuItemHelp.setEnabled(this.actionHelp);
menuItemAbout.setEnabled(this.actionAbout);
menuItemVegetation.setEnabled(this.actionNDVI);
menuItemWater.setEnabled(this.actionNDWI);
// menuItemVegetation.setEnabled(this.actionNDVI);
// menuItemWater.setEnabled(this.actionNDWI);
menuItemConcatenate.setEnabled(this.actionConcatenate);
}
......@@ -2562,15 +2562,15 @@ public class MainFrame extends JFrame {
hp.setVisible(true);
}
private void menuVegetation() {
JFrame vegetation = new VegetationIndiceExtractionDialog();
vegetation.setVisible(true);
}
private void menuWater() {
JFrame water = new WaterIndiceExtractionDialog();
water.setVisible(true);
}
// private void menuVegetation() {
// JFrame vegetation = new VegetationIndiceExtractionDialog();
// vegetation.setVisible(true);
// }
//
// private void menuWater() {
// JFrame water = new WaterIndiceExtractionDialog();
// water.setVisible(true);
// }
private void menuConcatenate() {
JFrame concat = new ConcatenateImagesDialog();
......
......@@ -16,8 +16,10 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.gdal.gdal.Driver;
import org.gdal.gdal.gdal;
import mustic.utils.filters.ImageFileFilter;
import otbAppWrapping.ExecCommand;
public class ConcatenateImagesDialog extends JFrame {
......@@ -166,7 +168,10 @@ public class ConcatenateImagesDialog extends JFrame {
index++;
}
}
ExecCommand.ConcatenateImages(il, path);
gdal.AllRegister();
Driver driver = gdal.GetDriverByName("GTiff");
// gdal.Warp(dstDS, object_list_count, warpAppOptions);
JOptionPane.showMessageDialog(this, "Concatenation successful");
......
......@@ -6,13 +6,11 @@ import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.swing.*;
import mustic.gui.ImageSession;
import mustic.gui.MainFrame;
import mustic.io.Picture;
import mustic.io.RawImage;
public class CropDialog extends JInternalFrame {
......@@ -58,7 +56,6 @@ public class CropDialog extends JInternalFrame {
int band = 0;
double[][][] dataSource = img.load(rec.x, rec.y, rec.width, rec.height);
this.setReplacer(img.getReplacer());
for (int x = 0; x < rec.width; x++) {
for (int y = 0; y < rec.height; y++) {
band = 0;
......
package mustic.gui.dialog;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
import javax.swing.text.NumberFormatter;
import mustic.utils.filters.ImageFileFilter;
import otbAppWrapping.ExecCommand;
public class VegetationIndiceExtractionDialog extends JFrame {
/** */
private static final long serialVersionUID = 1L;
private JTextField textInput = new JTextField();
private JTextField textOutput = new JTextField();
private JComboBox<String> indiceComboBox;
private JSpinner spinnerRed;
private JSpinner spinnerNir;
public VegetationIndiceExtractionDialog() {
super();
JPanel mainPanel = new JPanel(new BorderLayout());
JPanel panel = new JPanel(new GridLayout(5, 2));
JPanel pInput = new JPanel(new BorderLayout());
// Input browse
panel.add(new JLabel(Messages.getString("VegetationIndiceExtractionDialog.2")), BorderLayout.WEST); //$NON-NLS-1$
pInput.add(this.textInput, BorderLayout.CENTER);
JButton buttonBrowse = new JButton("..."); //$NON-NLS-1$
buttonBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
ImageFileFilter filter = new ImageFileFilter();
fileChooser.addChoosableFileFilter(filter);
fileChooser.setFileFilter(filter);
int returnVal = fileChooser.showOpenDialog(VegetationIndiceExtractionDialog.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
if (fileChooser.getSelectedFile().getPath().endsWith(".tif")) //$NON-NLS-1$
VegetationIndiceExtractionDialog.this.textInput.setText(fileChooser.getSelectedFile().getPath());
else {
JOptionPane.showMessageDialog(VegetationIndiceExtractionDialog.this, Messages.getString("VegetationIndiceExtractionDialog.21"), Messages.getString("VegetationIndiceExtractionDialog.22"), //$NON-NLS-1$ //$NON-NLS-2$
JOptionPane.WARNING_MESSAGE);
}
}
}
});
pInput.add(buttonBrowse, BorderLayout.EAST);
panel.add(pInput);
// ComboBox
panel.add(new JLabel("Indice"));
String[] indices = new String[]{
"NDVI", "TNDVI", "RVI", "SAVI", "TSAVI", "MSAVI", "MSAVI2", "GEMI", "IPVI"
};
indiceComboBox = new JComboBox<String>(indices);
panel.add(indiceComboBox);
// Red
panel.add(new JLabel(Messages.getString("VegetationIndiceExtractionDialog.4")), BorderLayout.WEST); //$NON-NLS-1$
JPanel pRed = new JPanel(new BorderLayout());
spinnerRed = new JSpinner();
spinnerRed.setModel(new SpinnerNumberModel(1, 1, 500, 1));
spinnerRed.setEditor(new JSpinner.NumberEditor(spinnerRed, "##"));
JFormattedTextField txtRed = ((JSpinner.NumberEditor) spinnerRed.getEditor()).getTextField();
((NumberFormatter) txtRed.getFormatter()).setAllowsInvalid(false);
pRed.add(spinnerRed);
panel.add(pRed);
// NIR
panel.add(new JLabel(Messages.getString("VegetationIndiceExtractionDialog.5")), BorderLayout.WEST); //$NON-NLS-1$
JPanel pNIR = new JPanel(new BorderLayout());
spinnerNir = new JSpinner();
spinnerNir.setModel(new SpinnerNumberModel(1, 1, 500, 1));
spinnerNir.setEditor(new JSpinner.NumberEditor(spinnerNir, "##"));
JFormattedTextField txtNir = ((JSpinner.NumberEditor) spinnerNir.getEditor()).getTextField();
((NumberFormatter) txtNir.getFormatter()).setAllowsInvalid(false);
pNIR.add(spinnerNir);
panel.add(pNIR);
// Output Browse
panel.add(new JLabel(Messages.getString("VegetationIndiceExtractionDialog.3")), BorderLayout.WEST); //$NON-NLS-1$
JPanel pOutput = new JPanel(new BorderLayout());
pOutput.add(this.textOutput, BorderLayout.CENTER);
JButton buttonBrowse2 = new JButton("..."); //$NON-NLS-1$
buttonBrowse2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
if (!VegetationIndiceExtractionDialog.this.textInput.getText().isEmpty())
fileChooser.setSelectedFile(new File(VegetationIndiceExtractionDialog.this.textInput.getText().substring(0,
VegetationIndiceExtractionDialog.this.textInput.getText().indexOf(".tif"))
+"_"+indiceComboBox.getSelectedItem()+".tif"));
ImageFileFilter filter = new ImageFileFilter();
fileChooser.addChoosableFileFilter(filter);
fileChooser.setFileFilter(filter);
int returnVal = fileChooser.showSaveDialog(VegetationIndiceExtractionDialog.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
String path;
if (fileChooser.getSelectedFile().getPath().endsWith(".tif")) {
path = fileChooser.getSelectedFile().getPath();
} else {
path = fileChooser.getSelectedFile().getPath() + ".tif";
}
VegetationIndiceExtractionDialog.this.textOutput.setText(path);
}
}
});
pOutput.add(buttonBrowse2, BorderLayout.EAST);
panel.add(pOutput);
// Panel OK
this.textInput.setPreferredSize(new Dimension(200, 30));
JPanel panelButton = new JPanel();
JButton buttonOk = new JButton("Ok"); //$NON-NLS-1$
panelButton.add(buttonOk);
buttonOk.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
buttonOk_actionPerformed();
}
});
mainPanel.add(panel, BorderLayout.NORTH);
mainPanel.add(panelButton, BorderLayout.SOUTH);
this.setContentPane(mainPanel);
this.setTitle(Messages.getString("VegetationIndiceExtractionDialog.1")); //$NON-NLS-1$
this.setSize(350, 200);
this.setResizable(true);
this.setVisible(true);
}
protected void buttonOk_actionPerformed() {
try {
File temp = new File("temporary");
temp.mkdir();
String path;
if (textOutput.getText().endsWith(".tif")) {
path = textOutput.getText();
} else {
path = textOutput.getText() + ".tif";
}
ExecCommand.NdviExtraction(textInput.getText(), "temporary/vegetation.tif", (int) spinnerRed.getValue(), (int) spinnerNir.getValue(), (String) indiceComboBox.getSelectedItem());
ExecCommand.Rescale("temporary/vegetation.tif", path, 0, 255);
JOptionPane.showMessageDialog(this, "Vegetation indice extraction successful");
this.dispose();
setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
// cccccccccccccc JOptionPane.ERROR_MESSAGE);
} catch (Exception e) {
JOptionPane.showMessageDialog(this, "An error has occured", "Error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
}
}
This diff is collapsed.
......@@ -154,8 +154,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
/** the viewer that allows to reader the image */
private ClusteringImageViewer viewer = null;
/** */
protected BufferedImage zoomed = null;
/**
*
......
......@@ -187,8 +187,9 @@ public class ClassifierPanel extends JPanel {
this.container_ = container;
this.isSimpleAgent = monoApproach;
this.modele = new SelectionModel();
dataSession = MainFrame.getInstance().getCurrentDataSession();
sessionsIndexes = MainFrame.getInstance().getDesktop().getAllDataDesktopFrames();
this.dataSession = MainFrame.getInstance().getCurrentDataSession();
this.sessionsIndexes = MainFrame.getInstance().getDesktop().getAllDataDesktopFrames();
this.classifyButton.setFont(classifyButton.getFont().deriveFont(Font.BOLD));
if (!monoApproach) {
this.approachPanel = new ApproachSelectionPanel(this.modele, this, false);
......@@ -626,7 +627,7 @@ public class ClassifierPanel extends JPanel {
}
else {
dataSession = MainFrame.getInstance().getCurrentDataSession();
Data data = this.maclawParametersPanel.getData();
Data data = MainFrame.getInstance().getCurrentDataSession().getData();
classification = new SingleClassification(data, this.maclawParametersPanel.getParameters());
......@@ -849,7 +850,7 @@ public class ClassifierPanel extends JPanel {
break;
case SelectionModel.MACLAW_APPROACH: {
Data data_maclaw = this.maclawParametersPanel.getData();
Data data_maclaw = MainFrame.getInstance().getCurrentDataSession().getData();
classification = new SingleClassification(data_maclaw, this.maclawParametersPanel.getParameters());
System.out.println(Messages.getString("ClassifierPanel.89")); //$NON-NLS-1$
......
......@@ -10,14 +10,12 @@ import javax.swing.*;
import javax.swing.border.TitledBorder;
import jcl.data.Data;
import jcl.data.attribute.Attribute;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.data.distance.sequential.DistanceEuclidean;
import jcl.learning.LearningParameters;
import jcl.learning.methods.multistrategy.samarah.*;
import jcl.learning.methods.multistrategy.samarahConstrained.HybridClassificationConstrained;
import jcl.weights.GlobalWeights;
import mustic.gui.MainFrame;
import mustic.gui.dialog.classifier.AgentDialog;
......@@ -61,7 +59,7 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
JScrollPane jScrollPaneAgents = new JScrollPane();
/** La classification hybride vue par cette interface */
private HybridClassification samarah = null;
private HybridClassificationConstrained samarah = null;
private boolean selectData = true;
......@@ -80,7 +78,7 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
this.title = this.title + "." + HybridClassificationPanel.nbSamarah;
HybridClassificationPanel.nbSamarah++;
// this.samarah = new HybridClassification("TEST", data, null);
this.samarah = new HybridClassification(null, null);
this.samarah = new HybridClassificationConstrained(null, null);
if (MainFrame.DEBUG_MODE)
System.out.println(" in HybridClassificationParametersPanel() ");
this.samarah.config.printInfo();
......@@ -108,7 +106,7 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
DistanceModel model = DistanceModel.generateDefaultModel(data.getOneDataObject(),
new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] parameters = DistanceModel.generateDefaultDistanceParameters(1,model, data);
this.samarah = new HybridClassification(model, parameters);
this.samarah = new HybridClassificationConstrained(model, parameters);
}
@Override
......
......@@ -11,6 +11,8 @@ import javax.swing.*;
import jcl.Classification;
import jcl.data.Data;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.evaluation.clustering.ClusteringEvaluation;
import jcl.learning.LearningParameters;
import jcl.learning.methods.monostrategy.SingleClassification;
......@@ -101,7 +103,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
else
imgSession = desktopFrames[0].getImageSession();
Data data = this.getData();
Data data = MainFrame.getInstance().getCurrentDataSession().getData();
classification = new SingleClassification(data, this.getParameters());
System.out.println(" Classification MACLAW :");
......@@ -111,22 +113,6 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
}
}
public Data getData() {
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDesktopFrames();
int nbSessions = desktopFrames.length;
if (this.data == null) {
if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSessions) {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession()
.getImageData();
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
}
else {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox()
.getSelectedIndex()].getImageSession().getImageData();
}
}
return this.data;
}
public ClassifierDialog getInitMethodClassifierDialog() {
return initMethodClassifierDialog;
......@@ -162,19 +148,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
boolean fuzzy = this.jCheckBoxFuzzy.isSelected();
double phi = Double.parseDouble(this.jTextFieldPhi.getText());
double alpha = Double.parseDouble(this.jTextFieldAlpha.getText());
ImageSession imgSession = null;
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDesktopFrames();
int nbSession = desktopFrames.length;
if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSession) {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession()
.getImageData();
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
}
else {
imgSession = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox()
.getSelectedIndex()].getImageSession();
this.data = imgSession.getImageData();
}
this.data = MainFrame.getInstance().getCurrentDataSession().getData();
LearningParameters initParams = this.initMethodClassifierDialog.classifiersPanel.getParameters(this.data);
int clusterQualityCriterion = ClusteringEvaluation.WG;
switch (this.jComboBoxQuality.getSelectedIndex()) {
......@@ -185,11 +159,21 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
clusterQualityCriterion = ClusteringEvaluation.WG;
break;
}
ClassificationWeights weights = new GlobalWeights(new Weights(this.data.getOneDataObject().getNbAttributes()));
return new ParametersMaclaw(distributed, nbGenerations, nbIndividuals, nbClusters, nbRefs, ClassifierModular.PRODUCT, nbCpu, initParams,
initParams, fuzzy, alpha, phi, clusterQualityCriterion, ClassifierMaclaw.GENETIC, ClassifierMaclaw.WEIGHTING, 1.0, weights);
DistanceModel distanceModel = DistanceModel.generateDefaultModel(
data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
// if (this.isUseNaiveDist) {
// distanceModel = DistanceModel.generateNaiveModel(
// data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
// }