...
 
Commits (24)
File deleted
This diff is collapsed.
# 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@)"
No preview for this file type
This diff is collapsed.
......@@ -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;
......
......@@ -18,11 +18,11 @@ import javax.swing.JTextField;
import jcl.data.mask.IntArrayMask;
import jcl.data.mask.Mask;
import jcl.data.mask.MultiIDIntArrayMask;
import multiCube.tools.image.reader.GDALImageReaderWrapper;
import multiCube.tools.image.reader.ReaderWrapper;
import mustic.gui.dialog.Messages;
import mustic.gui.panels.data.DataConstructPanel;
import mustic.io.RawImage;
import mustic.utils.image.reader.GDALImageReaderWrapper;
import mustic.utils.image.reader.ReaderWrapper;
import mustic.utils.io.CSVUtils;
......
......@@ -29,11 +29,9 @@ import javax.swing.JScrollPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import loci.formats.FormatException;
import mustic.gui.ImageDesktopFrame;
import mustic.gui.ImageSession;
import mustic.gui.MainFrame;
import mustic.io.PictureTool;
import mustic.io.RawImage;
import mustic.utils.documentFilter.ToUpdateObject;
......@@ -297,11 +295,8 @@ public class SequenceDialog extends JDialog {
* Return the list of image path constituting the selected sequence
*
* @return the list of ordered file path
*
* @throws FormatException
* if the images don't have the same dimensions
*/
public Vector<RawImage> getSequenceData() throws FormatException {
public Vector<RawImage> getSequenceData() {
int nb = this.dlmSeq.getSize();
Donnee donnee;
Vector<RawImage> paths = new Vector<RawImage>();
......@@ -325,11 +320,8 @@ public class SequenceDialog extends JDialog {
* Return the list of image sessions constituting the selected sequence
*
* @return the list of ordered session
*
* @throws FormatException
* if the images don't have the same dimensions
*/
public Vector<ImageSession> getSequenceSessions() throws FormatException {
public Vector<ImageSession> getSequenceSessions() {
int nb = this.dlmSeq.getSize();
Donnee donnee;
Vector<ImageSession> paths = new Vector<ImageSession>();
......
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.
......@@ -23,6 +23,9 @@ import jcl.data.Data;
import jcl.data.DataObject;
import jcl.data.SimpleData;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.weights.GlobalWeights;
import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages;
import mustic.gui.dialog.SequenceDialog;
......@@ -138,7 +141,7 @@ public class ArffToDataDialog extends JInternalFrame implements ToUpdateObject {
}
}
@SuppressWarnings({ "unchecked", "deprecation" })
@SuppressWarnings({ "unchecked" })
protected void buttonOk_actionPerformed() {
try {
Object[] result = DataArffExchange.arffToData(this.textFile.getText());
......@@ -212,17 +215,24 @@ public class ArffToDataDialog extends JInternalFrame implements ToUpdateObject {
// test if we have one or multiples images
if (sequenceFiles.size() > 1) {
data = new ImageData(new ImportedImageSampler(sequenceFilesPath,
(List<DataObject>) result[1], (List<Integer>) result[0]), sequenceFiles);
(List<DataObject>) result[1], (List<Integer>) result[0]), sequenceFiles, null, null);
} else {
data = new ImageData(new ImportedImageSampler(sequenceFilesPath.get(0),
(List<DataObject>) result[1], (List<Integer>) result[0]), sequenceFiles.get(0));
(List<DataObject>) result[1], (List<Integer>) result[0]), sequenceFiles.get(0),
null, null);
}
} else {
// if no images is associated we create a SimpleData
data = new SimpleData((List<DataObject>) result[1]);
data = new SimpleData((List<DataObject>) result[1], null, null);
}
DistanceModel distanceModel = DistanceModel.generateDefaultModel(
data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] distanceParameters = DistanceModel
.generateDefaultDistanceParameters(1, distanceModel, data);
data.setDistanceModel(distanceModel, distanceParameters);
if (this.textData.getText().length() == 0) {
this.textData.setText(DataArffExchange.getRelationName(this.textFile.getText()));
}
......
......@@ -56,6 +56,9 @@ import jcl.clustering.constraints.LabelConstraint;
import jcl.clustering.constraints.MustLinkConstraint;
import jcl.clustering.constraints.NbClusterConstraint;
import jcl.data.Data;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.weights.GlobalWeights;
import mustic.utils.image.ImageAddOn;
import mustic.utils.image.ImageDisplayer;
import mustic.utils.tools.ProgressPropertyChangeListener;
......@@ -164,8 +167,12 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
if (data != null) {
// case of Data provided
minDistance = data.getEstimatedMinDistance();
maxDistance = data.getEstimatedMaxDistance();
DistanceModel model = DistanceModel.generateDefaultModel(data.getOneDataObject(),
new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] parameters = DistanceModel.generateDefaultDistanceParameters(1,model, data);
minDistance = data.getEstimatedMinDistance(model, parameters[0]);
maxDistance = data.getEstimatedMaxDistance(model, parameters[0]);
this.data = data;
} else {
// otherwise we base our estimation on the image
......@@ -1012,7 +1019,9 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
}
public void refresh() {
if (container != null) {
container.updateUI();
}
imageDisplayer.refresh(false);
}
......
......@@ -24,10 +24,13 @@ import jcl.data.Data;
import jcl.data.DataObject;
import jcl.data.SimpleData;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.weights.GlobalWeights;
import multiCube.tools.image.ImageHelper;
import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages;
import mustic.utils.documentFilter.ToUpdateObject;
import mustic.utils.image.ImageHelper;
import mustic.utils.io.CSVUtils;
......@@ -140,7 +143,6 @@ public class CSVToDataDialog extends JInternalFrame implements ToUpdateObject {
}
}
@SuppressWarnings({"deprecation"})
protected void buttonOk_actionPerformed() {
try {
List<DataObject> result = new ArrayList<DataObject>();
......@@ -160,7 +162,11 @@ public class CSVToDataDialog extends JInternalFrame implements ToUpdateObject {
}
if(result != null) {
data = new SimpleData(result);
data = new SimpleData(result, null, null);
DistanceModel model = DistanceModel.generateDefaultModel(data.getOneDataObject(),
new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] parameters = DistanceModel.generateDefaultDistanceParameters(1,model, data);
data.setDistanceModel(model, parameters);
if (this.textData.getText().length() == 0) {
this.textData.setText(ImageHelper.extractFileName(
......
......@@ -20,10 +20,10 @@ import javax.swing.JPanel;
import javax.swing.JTextField;
import jcl.data.Data;
import multiCube.tools.image.ImageHelper;
import mustic.gui.DataDesktopFrame;
import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages;
import mustic.utils.image.ImageHelper;
import mustic.utils.io.dataExchange.DataOGRExchange;
/**
......
......@@ -21,6 +21,9 @@ import javax.swing.text.PlainDocument;
import jcl.data.Data;
import jcl.data.DataObject;
import jcl.data.SimpleData;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.weights.GlobalWeights;
import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages;
import mustic.utils.documentFilter.BasicIntDocumentFilter;
......@@ -158,7 +161,13 @@ public class OGRToDataDialog extends JInternalFrame implements ToUpdateObject {
if(result != null) {
data = new SimpleData(result);
data = new SimpleData(result, null, null);
DistanceModel distanceModel = DistanceModel.generateDefaultModel(
data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] distanceParameters = DistanceModel
.generateDefaultDistanceParameters(1, distanceModel, data);
data.setDistanceModel(distanceModel, distanceParameters);
data.setDataName(this.textData.getText());
MainFrame.getInstance().createDataSession(data);
......
This diff is collapsed.
......@@ -4,8 +4,7 @@ import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Arrays;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
......@@ -29,11 +28,14 @@ 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.learning.methods.multistrategy.samarah.HybridClassification;
import jcl.learning.methods.multistrategy.samarah.SamarahEval;
import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.exceptions.MethodNotImplementedException;
import jcl.utils.io.JCLModelExchange;
import jsl.Segmentation;
import jsl.regionalisation.vectorisation.Filters;
import multiCube.tools.image.tiff.TiffUtils;
import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.gui.*;
import mustic.gui.dialog.FilterDialog;
import mustic.gui.dialog.classifier.ConstraintsSelectionFrame;
......@@ -52,9 +54,7 @@ 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.io.tiff.TiffUtils;
import org.apache.batik.svggen.SVGGraphics2DIOException;
......@@ -154,10 +154,8 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
protected JButton vectorise = new JButton("Segmentation");
/** the viewer that allows to reader the image */
private ImageViewer viewer = null;
private ClusteringImageViewer viewer = null;
/** */
protected BufferedImage zoomed;
/**
*
......@@ -949,10 +947,11 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
*/
public void hClustering_actionPerformed(boolean newResult) {
try {
LearningParameters learningParameters = new ParametersAHC(null);
LearningParameters learningParameters = new ParametersAHC(imgData.getDistanceModel(),
imgData.getDistanceParameters());
LearningMethod learningMethod = learningParameters.getLearningMethodInstance();
@SuppressWarnings("deprecation")
Data classificationData = new SimpleData(this.result.getClusterCenters());
Data classificationData = new SimpleData(this.result.getClusterCenters(),
imgData.getDistanceModel(), imgData.getDistanceParameters());
LearningResult learningResult = learningMethod.learn(classificationData);
this.result.hierarchy = ((LearningResultAHC) learningResult).getHierarchy();
Classification classif = new SingleClassification("", classificationData, learningMethod, this.result);
......@@ -1144,6 +1143,32 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
Packager.zipFile(out, name + "/"+outputPath, outputfile);
outputfile.delete();
/** this is some stats for samarah used for a test, this might be deleted */
//<<
if (classification instanceof HybridClassification) {
FileWriter fw3 = null;
String concordenceFilePath = "concordence.log";
try {
fw3 = new FileWriter(concordenceFilePath, true);
} catch (IOException e) {
e.printStackTrace();
}
BufferedWriter bw3 = new BufferedWriter(fw3);
PrintWriter out3 = new PrintWriter(bw3);
SamarahEval eval = new SamarahEval(((HybridClassification) classification), null,
((HybridClassification) classification).getConstraintsUsed());
eval.calGamma(((HybridClassification) classification).getAgents(),
((HybridClassification) classification).getConfig(), null);
out3.println(Arrays.deepToString(eval.omega));
out3.close();
bw3.close();
fw3.close();
File concoredenceFile = new File(concordenceFilePath);
Packager.zipFile(out, name + "/"+concordenceFilePath, concoredenceFile);
}
//>>
/** Save the model file */
try {
String modelPath = "model.jclm";
......@@ -1167,48 +1192,42 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
// oos.flush();
// out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ClusterMapFull.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(imgPanel.classification.getClusteringResult().getClusterMap(false));
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "WeightsFull.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(imgPanel.result.getWeights());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "MethodFull.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(imgPanel.classification.getLearningMethod());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "DataFull.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(imgPanel.result.getData().getViewDataObjects());
oos.flush();
out.closeEntry();
if (imgPanel.qualityPanel != null && imgPanel.qualityPanel.getQualities() != null) {
out.putNextEntry(new ZipEntry(name + '/' + "QualityFull.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(imgPanel.qualityPanel.getQualities());
oos.flush();
out.closeEntry();
}
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
oos.flush();
// out.putNextEntry(new ZipEntry(name + '/' + "ClusterMapFull.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(imgPanel.classification.getClusteringResult().getClusterMap(false));
// oos.flush();
// out.closeEntry();
//
// out.putNextEntry(new ZipEntry(name + '/' + "WeightsFull.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(imgPanel.result.getWeights());
// oos.flush();
// out.closeEntry();
//
// out.putNextEntry(new ZipEntry(name + '/' + "MethodFull.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(imgPanel.classification.getLearningMethod());
// oos.flush();
// out.closeEntry();
//
// out.putNextEntry(new ZipEntry(name + '/' + "DataFull.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(imgPanel.result.getData().getViewDataObjects());
// oos.flush();
// out.closeEntry();
//
// if (imgPanel.qualityPanel != null && imgPanel.qualityPanel.getQualities() != null) {
// out.putNextEntry(new ZipEntry(name + '/' + "QualityFull.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(imgPanel.qualityPanel.getQualities());
// oos.flush();
// out.closeEntry();
// }
//
// out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
// oos = new ObjectOutputStream(out);
// oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
// oos.flush();
out.closeEntry();
}
}
......@@ -1311,12 +1330,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
out.closeEntry();
}
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
......@@ -1692,8 +1705,14 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
@Override
public BufferedImage getBirdViewImage(double zoomFactor) {
// we want the original image in the birdview so we hide every clusters
viewer.disableClustersDisplay();
BufferedImage result = viewer.getScreenImage(0, 0, (int) (viewer.getRealImageWidth()*zoomFactor),
(int) (viewer.getRealImageHeight()*zoomFactor), zoomFactor, false);
viewer.enableClustersDisplay();
return result;
}
......
......@@ -5,7 +5,10 @@ import java.awt.event.ActionEvent;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.learning.LearningParameters;
import jcl.weights.GlobalWeights;
import mustic.gui.ImageDesktopFrame;
import mustic.gui.MainFrame;
import mustic.io.ImageData;
......@@ -79,7 +82,13 @@ class RemoteSensingClassifierDialog extends ClassifierDialog {
if (this.bidouille == null) {
img = MainFrame.getInstance().getDesktop().getAllImageDesktopFrames()[this.dataBox
.getSelectedIndex()].getImageSession().getRawImage();
this.bidouille = new ImageData(img);
this.bidouille = new ImageData(img, null, null);
DistanceModel distanceModel = DistanceModel.generateDefaultModel(
this.bidouille.getOneDataObject(), new GlobalWeights(this.bidouille.getOneDataObject()));
DistanceParameter[][] distanceParameters = DistanceModel
.generateDefaultDistanceParameters(1, distanceModel, this.bidouille);
this.bidouille.setDistanceModel(distanceModel, distanceParameters);
}
LearningParameters params = this.classifiersPanel
......
......@@ -11,8 +11,12 @@ import javax.swing.border.TitledBorder;
import jcl.data.Data;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
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;
import mustic.gui.panels.classifier.*;
......@@ -55,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;
......@@ -74,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();
this.samarah = new HybridClassificationConstrained(null, null);
if (MainFrame.DEBUG_MODE)
System.out.println(" in HybridClassificationParametersPanel() ");
this.samarah.config.printInfo();
......@@ -98,7 +102,11 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
jbInit();
HybridClassificationPanel.nbSamarah++;
// this.samarah = new HybridClassification("TEST", data, null);
this.samarah = new HybridClassification();
DistanceModel model = DistanceModel.generateDefaultModel(data.getOneDataObject(),
new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] parameters = DistanceModel.generateDefaultDistanceParameters(1,model, data);
this.samarah = new HybridClassificationConstrained(model, parameters);
}
@Override
......@@ -151,12 +159,17 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
else {
file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n";
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN) {
file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
}
else {
file += "\t\t<isUseNaiveDist>false</isUseNaiveDist>\n";
}
//TODO try to match with the new distanceModel
// for (Distance<Attribute, DistanceParameter> d : agent.getParams().getModel().getDistances()) {
// if(!(d instanceof DistanceEuclidean))
//
// }
// if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN && agent.getParams().getModel()) {
// file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
// }
// else {
// file += "\t\t<isUseNaiveDist>false</isUseNaiveDist>\n";
// }
if (agent.getParams().weights != null) {
file += "\t\t<weight>";
double weights[] = agent.getParams().weights.getGlobalWeights().getWeights();
......
......@@ -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;
......@@ -18,7 +20,6 @@ import jcl.learning.methods.multistrategy.modular.ClassifierModular;
import jcl.learning.methods.multistrategy.modular.maclaw.ClassifierMaclaw;
import jcl.learning.methods.multistrategy.modular.maclaw.ParametersMaclaw;
import jcl.weights.*;
import loci.formats.FormatException;
import mustic.gui.*;
import mustic.gui.dialog.classifier.ClassifierDialog;
import mustic.gui.panels.classifier.SelectionModel;
......@@ -102,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 :");
......@@ -112,26 +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();
try {
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
} catch (FormatException e) {
e.printStackTrace();
}
}
else {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox()
.getSelectedIndex()].getImageSession().getImageData();
}
}
return this.data;
}
public ClassifierDialog getInitMethodClassifierDialog() {
return initMethodClassifierDialog;
......@@ -167,23 +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();
try {
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
} catch (FormatException e) {
e.printStackTrace();
}
}
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()) {
......@@ -194,11 +159,21 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
clusterQualityCriterion = ClusteringEvaluation.WG;
break;
}
DistanceModel distanceModel = DistanceModel.generateDefaultModel(
data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
// if (this.isUseNaiveDist) {
// distanceModel = DistanceModel.generateNaiveModel(
// data.getOneDataObject(), new GlobalWeights(data.getOneDataObject()));
// }
int nbThreads = Runtime.getRuntime().availableProcessors();
DistanceParameter[][] distanceParameters = DistanceModel.generateDefaultDistanceParameters(
nbThreads, distanceModel, data);
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);
return new ParametersMaclaw(distributed, nbGenerations, nbIndividuals, nbClusters,
nbRefs, ClassifierModular.PRODUCT, nbCpu, initParams,
initParams, fuzzy, alpha, phi, clusterQualityCriterion,
ClassifierMaclaw.GENETIC, ClassifierMaclaw.WEIGHTING, 1.0, null, null);
}
}
......@@ -220,12 +195,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
else {
file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n";
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN) {
file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
}
else {
file += "\t\t<isUseNaiveDist>false</isUseNaiveDist>\n";
}
if (parameters.weights != null) {
file += "\t\t<weight>";
......@@ -237,12 +207,10 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
file += "</weight>\n";
}
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDesktopFrames();
int nbSessions = desktopFrames.length;
DataSession session = MainFrame.getInstance().getCurrentDataSession();
file += "\t\t<data>"
+ desktopFrames[this.learningMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex()]
.getImageSession().getRawImage().getPath() + "</data>\n";
+ session.getAssociatedImageSessions().get(0).getRawImage().getPath() + "</data>\n";
file += "\t</LearningMethod>\n";
......@@ -262,12 +230,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
else {
file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n";
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN) {
file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
}
else {
file += "\t\t<isUseNaiveDist>false</isUseNaiveDist>\n";
}
if (parameters.weights != null) {
file += "\t\t<weight>";
......@@ -278,16 +241,8 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
}
file += "</weight>\n";
}
if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSessions) {
int index[] = this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceIndex();
for (int id = 0; id < index.length; id++) {
file += "\t\t<data>" + desktopFrames[index[id]].getImageSession().getRawImage().getPath() + "</data>\n";
}
}
else {
file += "\t\t<data>"
+ desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex()]
.getImageSession().getRawImage().getPath() + "</data>\n";
for (int id = 0; id < session.getAssociatedImageSessions().size(); id++) {
file += "\t\t<data>" + session.getAssociatedImageSessions().get(id).getRawImage().getPath() + "</data>\n";
}
file += "\t</InitMethod>\n";
file += "\t<nbClusters>" + this.jTextFieldNbClusters.getText() + "</nbClusters>\n";
......
......@@ -85,7 +85,7 @@ ClassifierPanel.32=<li><b>pour une machine linux : </b>
ClassifierPanel.33=lancer le script jcld.sh sur une machine distante. Par defaut le port sur lequel sera lanc&eacute; le serveur est demand&eacute; au d&eacute;marrage. Vous pouvez pr&eacute;d&eacute;finir le num&eacute;ro de port en le donnant en argument du script <br> par exemple : <em> ./jcld.sh &lt;numero_de_port&gt;</em>
ClassifierPanel.34=<br>Le num&eacute;ro de port conseill&eacute; est 10099.</li></ul></p></html>
ClassifierPanel.35=OK
ClassifierPanel.36=Installer un serveur
ClassifierPanel.36=Install a server
ClassifierPanel.37=Attributes selection and weigths configuration
ClassifierPanel.38=Sequence options
ClassifierPanel.39=Method
......
......@@ -15,8 +15,11 @@ import javax.swing.JScrollPane;
import com.l2fprod.common.swing.JTaskPane;
import com.l2fprod.common.swing.JTaskPaneGroup;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.data.mask.Mask;
import jcl.data.sampling.Sampler;
import jcl.weights.GlobalWeights;
import mustic.gui.ImageDesktopFrame;
import mustic.gui.ImageSession;
import mustic.gui.MainFrame;
......@@ -144,11 +147,18 @@ public class DataConstructPanel extends JPanel implements ToUpdateObject {
((ImageSampler) sample).setMaskSequence(maskSequence);
}
}
if (filesPaths.size() > 1) {
data = new ImageData(sample, filesPaths);
data = new ImageData(sample, filesPaths, null, null, null);
} else {
data = new ImageData(sample, filesPaths.get(0));
data = new ImageData(sample, filesPaths.get(0), null, null);
}
DistanceModel distModel = DistanceModel.generateDefaultModel(data.getOneDataObject(),
new GlobalWeights(data.getOneDataObject()));
DistanceParameter[][] distParameters = DistanceModel
.generateDefaultDistanceParameters(1, distModel, data);
data.setDistanceModel(distModel, distParameters);
MainFrame.getInstance().createDataSession(data);
DataConstructFrame.getInstance().updateDataConstructPanel();
......
......@@ -4,6 +4,7 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
......@@ -135,6 +136,7 @@ public class DataPanel extends JPanel implements ChangeListener {
/* On garde une trace des donnees */
this.data = _data;
this.classifyButton.setFont(classifyButton.getFont().deriveFont(Font.BOLD));
JPanel container = buildBody();
// JScrollPane sp = new JScrollPane(container);
......@@ -289,7 +291,7 @@ public class DataPanel extends JPanel implements ChangeListener {
this.statsTable = new JTable();
this.statsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.statsTable.setFocusable(false);
updateStatsTable(0);
//updateStatsTable(0);
JScrollPane stastScrollPane = new JScrollPane(this.statsTable);
stastScrollPane.setPreferredSize(new Dimension(200, 100));
......
......@@ -64,10 +64,10 @@ public class SegmentationPanel extends JPanel implements ActionListener, MouseLi
/*** truc ImageSession */
/** zoom level */
protected float mZoomRate = 1.0f; // 1.9f;
protected double mZoomRate = 1.0; // 1.9f;
/** zoom step */
protected float mZoomStep = 0.1f; // 0.2f;
protected double mZoomStep = 0.1; // 0.2f;
/** brightness value */
float offset = 10;
......
......@@ -264,7 +264,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* Apply the zoom factor. And display the image. When another operation is finished, this method
* <b>must be called<b>.
*/
public void doZoomOp(float mZoomRate) {
public void doZoomOp(double mZoomRate) {
AffineTransform trans = AffineTransform.getScaleInstance(mZoomRate, mZoomRate);
AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
this.zoomed = op.filter(this.imageContours, null); // this.colored
......@@ -459,7 +459,7 @@ public class SegmentationPanelResultatImage extends JPanel {
}
public void clickSurImage(int x, int y, float mZoomRate) {
public void clickSurImage(int x, int y, double mZoomRate) {
if (x >= 0 && x < this.zoomed.getWidth() && y >= 0 && y < this.zoomed.getHeight()) {
this.setClicked(this.getPointWithReelCoordinates(x, y, mZoomRate));
this.updateInformationPanel(x, y, mZoomRate);
......@@ -472,7 +472,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* @param y the y co-ordinate of the point which is clicked.
* @return the point with the reel co-ordinates.
*/
public Point getPointWithReelCoordinates(int x, int y, float mZoomRate) {
public Point getPointWithReelCoordinates(int x, int y, double mZoomRate) {
int xreel, yreel;
xreel = (int) (((double) x / mZoomRate) + this.rx);
yreel = (int) (((double) y / mZoomRate) + this.ry);
......@@ -520,7 +520,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* @param x x coord.
* @param y y coord.
*/
private void updateInformationPanel(int ex, int ey, float mZoomRate) {
private void updateInformationPanel(int ex, int ey, double mZoomRate) {
double w1 = contoursLabel.getWidth();
double w2 = contoursLabel.getIcon().getIconWidth();
......@@ -566,7 +566,7 @@ public class SegmentationPanelResultatImage extends JPanel {
}
}
public void setRegionToolTip(int x, int y, float mZoomRate) {
public void setRegionToolTip(int x, int y, double mZoomRate) {
if (x >= 0 && x < this.zoomed.getWidth() && y >= 0 && y < this.zoomed.getHeight()) {
Point clicked = this.getPointWithReelCoordinates(x, y, mZoomRate);
this.updateRegionInfos(clicked);
......@@ -977,7 +977,7 @@ public class SegmentationPanelResultatImage extends JPanel {
List<Descripteur> listDescr = s.getResultat().getObjectsImage().get(0).getListe_objetsDescripteur();
Descripteur d = null;
List<String> nomAttrib = new ArrayList<String>();
ImageData imageData = new ImageData(mRawImage);
ImageData imageData = new ImageData(mRawImage, null, null);
int nbPixels = imageData.getNbObjects();
int nbAttributues = imageData.getPixel(0).getNbAttributes();
double[] moyenne = new double[nbAttributues];
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,8 +8,8 @@ import java.io.IOException;
import java.util.Iterator;
import jcl.data.mask.Mask;
import mustic.utils.image.reader.GDALImageReaderWrapper;
import mustic.utils.image.reader.ReaderWrapper;
import multiCube.tools.image.reader.GDALImageReaderWrapper;
import multiCube.tools.image.reader.ReaderWrapper;
//import mustic.io.bsq.BSQImage;
......
This diff is collapsed.
This diff is collapsed.
......@@ -86,8 +86,12 @@ public class ClusteringResultROI extends SimpleClusteringResult {
}
}
if ((int) matrix[0][jmax] != 0 ) {
RegionOfInterest roi = rois.get((int) matrix[0][jmax]-1);
colors[(int) matrix[i][0]-1] = roi.getColor();