Commit 048cfaef authored by lafabregue's avatar lafabregue

integration of multicubetools project

parent b2b142b3
...@@ -50,6 +50,8 @@ import jcl.learning.methods.multistrategy.samarah.SamarahConfig; ...@@ -50,6 +50,8 @@ import jcl.learning.methods.multistrategy.samarah.SamarahConfig;
import jcl.weights.ClassificationWeights; import jcl.weights.ClassificationWeights;
import jcl.weights.GlobalWeights; import jcl.weights.GlobalWeights;
import jsl.Segmentation; import jsl.Segmentation;
import multiCube.tools.image.ImageHelper;
import multiCube.tools.util.gui.ProgressStatus;
import mustic.gui.dialog.*; import mustic.gui.dialog.*;
import mustic.gui.dialog.arff.ArffLoadDialog; import mustic.gui.dialog.arff.ArffLoadDialog;
import mustic.gui.dialog.arff.ArffToDataDialog; import mustic.gui.dialog.arff.ArffToDataDialog;
...@@ -72,10 +74,8 @@ import mustic.models.thread.ClassificationThread; ...@@ -72,10 +74,8 @@ import mustic.models.thread.ClassificationThread;
import mustic.utils.UnZipSub; import mustic.utils.UnZipSub;
import mustic.utils.filters.ImageFileFilter; import mustic.utils.filters.ImageFileFilter;
import mustic.utils.filters.ZipFileFilter; import mustic.utils.filters.ZipFileFilter;
import mustic.utils.image.ImageHelper;
import mustic.utils.io.CSVUtils; import mustic.utils.io.CSVUtils;
import mustic.utils.io.dataExchange.DataCsvExchange; import mustic.utils.io.dataExchange.DataCsvExchange;
import mustic.utils.tools.ProgressStatus;
import net.infonode.tabbedpanel.*; import net.infonode.tabbedpanel.*;
import net.infonode.tabbedpanel.titledtab.TitledTab; import net.infonode.tabbedpanel.titledtab.TitledTab;
import net.infonode.util.Direction; import net.infonode.util.Direction;
...@@ -1545,7 +1545,7 @@ public class MainFrame extends JFrame { ...@@ -1545,7 +1545,7 @@ public class MainFrame extends JFrame {
// =============== Creation of the Desktop ================ // =============== Creation of the Desktop ================
JPanel panel_desktop = new JPanel(new BorderLayout()); JPanel panel_desktop = new JPanel(new BorderLayout());
panel_desktop.setOpaque(false); panel_desktop.setOpaque(false);
panel_desktop.setBorder(Borders.DIALOG); panel_desktop.setBorder(Borders.DIALOG_BORDER);
panel_desktop.add(this.desktop); panel_desktop.add(this.desktop);
sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$ sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$
...@@ -1559,7 +1559,7 @@ public class MainFrame extends JFrame { ...@@ -1559,7 +1559,7 @@ public class MainFrame extends JFrame {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false); panel.setOpaque(false);
panel.setBorder(Borders.DIALOG); panel.setBorder(Borders.DIALOG_BORDER);
panel.add(pane); panel.add(pane);
// =============== Creation of the Progress Panel => South // =============== Creation of the Progress Panel => South
...@@ -1680,7 +1680,7 @@ public class MainFrame extends JFrame { ...@@ -1680,7 +1680,7 @@ public class MainFrame extends JFrame {
// =============== Creation of the Desktop ================ // =============== Creation of the Desktop ================
JPanel panel_desktop = new JPanel(new BorderLayout()); JPanel panel_desktop = new JPanel(new BorderLayout());
panel_desktop.setOpaque(false); panel_desktop.setOpaque(false);
panel_desktop.setBorder(Borders.DIALOG); panel_desktop.setBorder(Borders.DIALOG_BORDER);
panel_desktop.add(this.desktop); panel_desktop.add(this.desktop);
sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$ sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$
...@@ -1694,7 +1694,7 @@ public class MainFrame extends JFrame { ...@@ -1694,7 +1694,7 @@ public class MainFrame extends JFrame {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false); panel.setOpaque(false);
panel.setBorder(Borders.DIALOG); panel.setBorder(Borders.DIALOG_BORDER);
panel.add(pane); panel.add(pane);
// =============== Creation of the Progress Panel => South // =============== Creation of the Progress Panel => South
......
...@@ -18,11 +18,11 @@ import javax.swing.JTextField; ...@@ -18,11 +18,11 @@ import javax.swing.JTextField;
import jcl.data.mask.IntArrayMask; import jcl.data.mask.IntArrayMask;
import jcl.data.mask.Mask; import jcl.data.mask.Mask;
import jcl.data.mask.MultiIDIntArrayMask; 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.dialog.Messages;
import mustic.gui.panels.data.DataConstructPanel; import mustic.gui.panels.data.DataConstructPanel;
import mustic.io.RawImage; import mustic.io.RawImage;
import mustic.utils.image.reader.GDALImageReaderWrapper;
import mustic.utils.image.reader.ReaderWrapper;
import mustic.utils.io.CSVUtils; import mustic.utils.io.CSVUtils;
......
...@@ -29,11 +29,9 @@ import javax.swing.JScrollPane; ...@@ -29,11 +29,9 @@ import javax.swing.JScrollPane;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import loci.formats.FormatException;
import mustic.gui.ImageDesktopFrame; import mustic.gui.ImageDesktopFrame;
import mustic.gui.ImageSession; import mustic.gui.ImageSession;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.io.PictureTool;
import mustic.io.RawImage; import mustic.io.RawImage;
import mustic.utils.documentFilter.ToUpdateObject; import mustic.utils.documentFilter.ToUpdateObject;
...@@ -297,11 +295,8 @@ public class SequenceDialog extends JDialog { ...@@ -297,11 +295,8 @@ public class SequenceDialog extends JDialog {
* Return the list of image path constituting the selected sequence * Return the list of image path constituting the selected sequence
* *
* @return the list of ordered file path * @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(); int nb = this.dlmSeq.getSize();
Donnee donnee; Donnee donnee;
Vector<RawImage> paths = new Vector<RawImage>(); Vector<RawImage> paths = new Vector<RawImage>();
...@@ -325,11 +320,8 @@ public class SequenceDialog extends JDialog { ...@@ -325,11 +320,8 @@ public class SequenceDialog extends JDialog {
* Return the list of image sessions constituting the selected sequence * Return the list of image sessions constituting the selected sequence
* *
* @return the list of ordered session * @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(); int nb = this.dlmSeq.getSize();
Donnee donnee; Donnee donnee;
Vector<ImageSession> paths = new Vector<ImageSession>(); Vector<ImageSession> paths = new Vector<ImageSession>();
......
...@@ -22,9 +22,9 @@ import javax.swing.JTextField; ...@@ -22,9 +22,9 @@ import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import javax.swing.text.NumberFormatter; import javax.swing.text.NumberFormatter;
import multiCube.tools.image.ImageHelper;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.utils.filters.ImageFileFilter; import mustic.utils.filters.ImageFileFilter;
import mustic.utils.image.ImageHelper;
import otbAppWrapping.ExecCommand; import otbAppWrapping.ExecCommand;
public class WaterIndiceExtractionDialog extends JFrame { public class WaterIndiceExtractionDialog extends JFrame {
......
...@@ -24,10 +24,10 @@ import jcl.data.Data; ...@@ -24,10 +24,10 @@ import jcl.data.Data;
import jcl.data.DataObject; import jcl.data.DataObject;
import jcl.data.SimpleData; import jcl.data.SimpleData;
import jcl.data.attribute.AttributeMultiDimSequence; import jcl.data.attribute.AttributeMultiDimSequence;
import multiCube.tools.image.ImageHelper;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages; import mustic.gui.dialog.Messages;
import mustic.utils.documentFilter.ToUpdateObject; import mustic.utils.documentFilter.ToUpdateObject;
import mustic.utils.image.ImageHelper;
import mustic.utils.io.CSVUtils; import mustic.utils.io.CSVUtils;
......
...@@ -20,10 +20,10 @@ import javax.swing.JPanel; ...@@ -20,10 +20,10 @@ import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import jcl.data.Data; import jcl.data.Data;
import multiCube.tools.image.ImageHelper;
import mustic.gui.DataDesktopFrame; import mustic.gui.DataDesktopFrame;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.gui.dialog.Messages; import mustic.gui.dialog.Messages;
import mustic.utils.image.ImageHelper;
import mustic.utils.io.dataExchange.DataOGRExchange; import mustic.utils.io.dataExchange.DataOGRExchange;
/** /**
......
...@@ -30,10 +30,11 @@ import jcl.learning.methods.monostrategy.SingleClassification; ...@@ -30,10 +30,11 @@ import jcl.learning.methods.monostrategy.SingleClassification;
import jcl.learning.methods.monostrategy.ahc.LearningResultAHC; import jcl.learning.methods.monostrategy.ahc.LearningResultAHC;
import jcl.learning.methods.monostrategy.ahc.ParametersAHC; import jcl.learning.methods.monostrategy.ahc.ParametersAHC;
import jcl.utils.exceptions.JCLFormatException; import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.exceptions.MethodNotImplementedException;
import jcl.utils.io.JCLModelExchange; import jcl.utils.io.JCLModelExchange;
import jsl.Segmentation; import jsl.Segmentation;
import jsl.regionalisation.vectorisation.Filters; import jsl.regionalisation.vectorisation.Filters;
import multiCube.tools.image.tiff.TiffUtils;
import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.gui.*; import mustic.gui.*;
import mustic.gui.dialog.FilterDialog; import mustic.gui.dialog.FilterDialog;
import mustic.gui.dialog.classifier.ConstraintsSelectionFrame; import mustic.gui.dialog.classifier.ConstraintsSelectionFrame;
...@@ -54,7 +55,6 @@ import mustic.utils.image.viewer.ClusteringImageViewer; ...@@ -54,7 +55,6 @@ import mustic.utils.image.viewer.ClusteringImageViewer;
import mustic.utils.image.viewer.GDALPyramidImageViewer; import mustic.utils.image.viewer.GDALPyramidImageViewer;
import mustic.utils.image.viewer.ImageViewer; import mustic.utils.image.viewer.ImageViewer;
import mustic.utils.image.viewer.MultiResolutionClusterMap; import mustic.utils.image.viewer.MultiResolutionClusterMap;
import mustic.utils.io.tiff.TiffUtils;
import org.apache.batik.svggen.SVGGraphics2DIOException; import org.apache.batik.svggen.SVGGraphics2DIOException;
......
...@@ -18,7 +18,6 @@ import jcl.learning.methods.multistrategy.modular.ClassifierModular; ...@@ -18,7 +18,6 @@ import jcl.learning.methods.multistrategy.modular.ClassifierModular;
import jcl.learning.methods.multistrategy.modular.maclaw.ClassifierMaclaw; import jcl.learning.methods.multistrategy.modular.maclaw.ClassifierMaclaw;
import jcl.learning.methods.multistrategy.modular.maclaw.ParametersMaclaw; import jcl.learning.methods.multistrategy.modular.maclaw.ParametersMaclaw;
import jcl.weights.*; import jcl.weights.*;
import loci.formats.FormatException;
import mustic.gui.*; import mustic.gui.*;
import mustic.gui.dialog.classifier.ClassifierDialog; import mustic.gui.dialog.classifier.ClassifierDialog;
import mustic.gui.panels.classifier.SelectionModel; import mustic.gui.panels.classifier.SelectionModel;
...@@ -119,11 +118,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param ...@@ -119,11 +118,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSessions) { if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSessions) {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession() this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession()
.getImageData(); .getImageData();
try { this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
} catch (FormatException e) {
e.printStackTrace();
}
} }
else { else {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox() this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox()
...@@ -173,11 +168,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param ...@@ -173,11 +168,7 @@ public class MaclawClassificationParametersPanel extends JPanel implements Param
if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSession) { if (this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox().getSelectedIndex() == nbSession) {
this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession() this.data = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getFirstIndex()].getImageSession()
.getImageData(); .getImageData();
try { this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
this.data.setSequence(this.initMethodClassifierDialog.classifiersPanel.sequenceDialog.getSequenceData());
} catch (FormatException e) {
e.printStackTrace();
}
} }
else { else {
imgSession = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox() imgSession = desktopFrames[this.initMethodClassifierDialog.classifiersPanel.getApproachPanel().getDataComboBox()
......
...@@ -64,10 +64,10 @@ public class SegmentationPanel extends JPanel implements ActionListener, MouseLi ...@@ -64,10 +64,10 @@ public class SegmentationPanel extends JPanel implements ActionListener, MouseLi
/*** truc ImageSession */ /*** truc ImageSession */
/** zoom level */ /** zoom level */
protected float mZoomRate = 1.0f; // 1.9f; protected double mZoomRate = 1.0; // 1.9f;
/** zoom step */ /** zoom step */
protected float mZoomStep = 0.1f; // 0.2f; protected double mZoomStep = 0.1; // 0.2f;
/** brightness value */ /** brightness value */
float offset = 10; float offset = 10;
......
...@@ -264,7 +264,7 @@ public class SegmentationPanelResultatImage extends JPanel { ...@@ -264,7 +264,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* Apply the zoom factor. And display the image. When another operation is finished, this method * Apply the zoom factor. And display the image. When another operation is finished, this method
* <b>must be called<b>. * <b>must be called<b>.
*/ */
public void doZoomOp(float mZoomRate) { public void doZoomOp(double mZoomRate) {
AffineTransform trans = AffineTransform.getScaleInstance(mZoomRate, mZoomRate); AffineTransform trans = AffineTransform.getScaleInstance(mZoomRate, mZoomRate);
AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
this.zoomed = op.filter(this.imageContours, null); // this.colored this.zoomed = op.filter(this.imageContours, null); // this.colored
...@@ -459,7 +459,7 @@ public class SegmentationPanelResultatImage extends JPanel { ...@@ -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()) { if (x >= 0 && x < this.zoomed.getWidth() && y >= 0 && y < this.zoomed.getHeight()) {
this.setClicked(this.getPointWithReelCoordinates(x, y, mZoomRate)); this.setClicked(this.getPointWithReelCoordinates(x, y, mZoomRate));
this.updateInformationPanel(x, y, mZoomRate); this.updateInformationPanel(x, y, mZoomRate);
...@@ -472,7 +472,7 @@ public class SegmentationPanelResultatImage extends JPanel { ...@@ -472,7 +472,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* @param y the y co-ordinate of the point which is clicked. * @param y the y co-ordinate of the point which is clicked.
* @return the point with the reel co-ordinates. * @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; int xreel, yreel;
xreel = (int) (((double) x / mZoomRate) + this.rx); xreel = (int) (((double) x / mZoomRate) + this.rx);
yreel = (int) (((double) y / mZoomRate) + this.ry); yreel = (int) (((double) y / mZoomRate) + this.ry);
...@@ -520,7 +520,7 @@ public class SegmentationPanelResultatImage extends JPanel { ...@@ -520,7 +520,7 @@ public class SegmentationPanelResultatImage extends JPanel {
* @param x x coord. * @param x x coord.
* @param y y 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 w1 = contoursLabel.getWidth();
double w2 = contoursLabel.getIcon().getIconWidth(); double w2 = contoursLabel.getIcon().getIconWidth();
...@@ -566,7 +566,7 @@ public class SegmentationPanelResultatImage extends JPanel { ...@@ -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()) { if (x >= 0 && x < this.zoomed.getWidth() && y >= 0 && y < this.zoomed.getHeight()) {
Point clicked = this.getPointWithReelCoordinates(x, y, mZoomRate); Point clicked = this.getPointWithReelCoordinates(x, y, mZoomRate);
this.updateRegionInfos(clicked); this.updateRegionInfos(clicked);
......
...@@ -10,7 +10,7 @@ import jcl.data.attribute.AttributeMultiDimSequence; ...@@ -10,7 +10,7 @@ import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.attribute.AttributeNumerical; import jcl.data.attribute.AttributeNumerical;
import jcl.data.mask.Mask; import jcl.data.mask.Mask;
import jcl.data.sampling.Sampler; import jcl.data.sampling.Sampler;
import jcl.utils.exceptions.MethodNotImplementedException; import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.gui.ImageSession; import mustic.gui.ImageSession;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.models.thread.ProgressThreadJCL; import mustic.models.thread.ProgressThreadJCL;
......
...@@ -8,8 +8,8 @@ import java.io.IOException; ...@@ -8,8 +8,8 @@ import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import jcl.data.mask.Mask; import jcl.data.mask.Mask;
import mustic.utils.image.reader.GDALImageReaderWrapper; import multiCube.tools.image.reader.GDALImageReaderWrapper;
import mustic.utils.image.reader.ReaderWrapper; import multiCube.tools.image.reader.ReaderWrapper;
//import mustic.io.bsq.BSQImage; //import mustic.io.bsq.BSQImage;
......
...@@ -18,16 +18,16 @@ import mustic.gui.Messages; ...@@ -18,16 +18,16 @@ import mustic.gui.Messages;
import mustic.gui.dialog.MaskImportDialog; import mustic.gui.dialog.MaskImportDialog;
import mustic.io.roi.ROIImage; import mustic.io.roi.ROIImage;
import mustic.io.roi.RegionOfInterest; import mustic.io.roi.RegionOfInterest;
import mustic.utils.image.reader.GDALImageReaderWrapper;
import mustic.utils.image.reader.ReaderWrapper;
import otbAppWrapping.*; import otbAppWrapping.*;
import com.l2fprod.common.propertysheet.DefaultProperty; import com.l2fprod.common.propertysheet.DefaultProperty;
import com.l2fprod.common.propertysheet.Property; import com.l2fprod.common.propertysheet.Property;
import jcl.data.mask.Mask; import jcl.data.mask.Mask;
import jcl.utils.MemoryFlush; import multiCube.tools.image.reader.GDALImageReaderWrapper;
import jcl.utils.exceptions.MethodNotImplementedException; import multiCube.tools.image.reader.ReaderWrapper;
import multiCube.tools.util.MemoryFlush;
import multiCube.tools.util.exceptions.MethodNotImplementedException;
/** /**
* <p> * <p>
...@@ -617,8 +617,20 @@ public class RawImage extends Observable implements Serializable, MemoryFlush ...@@ -617,8 +617,20 @@ public class RawImage extends Observable implements Serializable, MemoryFlush
{ {
try try
{ {
setDataMatrice(replacer.loadImage(info.getTempPath(), info.getSizeX(), info.getSizeY(), // setDataMatrice(replacer.loadImage(info.getTempPath(), info.getSizeX(), info.getSizeY(),
info.getNumberOfBands())); // info.getNumberOfBands()));
GDALImageReaderWrapper reader = new GDALImageReaderWrapper(info.getPath());
double data[][][] = new double[reader.getChannelCount()][reader.getImageWidth()][reader.getImageHeight()];
for(int x = 0 ; x < reader.getImageWidth() ; x++) {
for (int y = 0 ; y < reader.getImageHeight() ; y++) {
double[] pixel = reader.getPixel(x, y);
for (int c = 0 ; c < pixel.length ; c++) {
data[c][x][y] = pixel[c];
}
}
}
setDataMatrice(data);
MainFrame.getProgressBar().setValue(MainFrame.getProgressBar().getValue() + 50); MainFrame.getProgressBar().setValue(MainFrame.getProgressBar().getValue() + 50);
} }
catch (Exception e) catch (Exception e)
...@@ -897,11 +909,11 @@ public class RawImage extends Observable implements Serializable, MemoryFlush ...@@ -897,11 +909,11 @@ public class RawImage extends Observable implements Serializable, MemoryFlush
} }
/** /**
* Retourne une image au format fr.unistra.pelican. TODO ne marche pas * Retourne une image au format fr.unistra.pelican. TODO old methods, that is too memory consuming and support only 4 channels images
*/ */
public image.Image getPiafImage() public image.Image getPiafImage()
{ {
image.Image image = new image.ByteImage(this.getWidth(), this.getHeight(), 1, 1, this.getNbBands()); image.Image image = new image.DoubleImage(this.getWidth(), this.getHeight(), 1, 1, this.getNbBands());
double[][][] buffer = load(0, 0, getWidth(), getHeight()); double[][][] buffer = load(0, 0, getWidth(), getHeight());
...@@ -910,24 +922,24 @@ public class RawImage extends Observable implements Serializable, MemoryFlush ...@@ -910,24 +922,24 @@ public class RawImage extends Observable implements Serializable, MemoryFlush
for (int b = 0; b < this.getNbBands(); b++) for (int b = 0; b < this.getNbBands(); b++)
{ {
int pixelValue = (int) buffer[b][x][y]; double pixelValue = (double) buffer[b][x][y];
if (b == this.r) if (b == this.r)
{ {
image.setPixelXYBByte(x, y, 0, pixelValue); image.setPixelXYBDouble(x, y, 0, pixelValue);
// System.out.println(b+" "+this.r); // System.out.println(b+" "+this.r);
} }
else if (b == this.g) else if (b == this.g)
{ {
image.setPixelXYBByte(x, y, 1, (int) buffer[b][x][y]); image.setPixelXYBDouble(x, y, 1, buffer[b][x][y]);
} }
else if (b == this.b) else if (b == this.b)
{ {
image.setPixelXYBByte(x, y, 2, (int) buffer[b][x][y]); image.setPixelXYBDouble(x, y, 2, buffer[b][x][y]);
} }
else else
{ {
image.setPixelXYBByte(x, y, 3, (int) buffer[b][x][y]); image.setPixelXYBDouble(x, y, 3, buffer[b][x][y]);
} }
} }
if (MainFrame.DEBUG_MODE) if (MainFrame.DEBUG_MODE)
......
...@@ -24,6 +24,7 @@ import jcl.Classification; ...@@ -24,6 +24,7 @@ import jcl.Classification;
import jcl.data.Data; import jcl.data.Data;
import jcl.jcld.database.SSHParameters; import jcl.jcld.database.SSHParameters;
import jcl.learning.methods.monostrategy.SingleClassification; import jcl.learning.methods.monostrategy.SingleClassification;
import multiCube.tools.util.gui.ProgressStatus;
import mustic.gui.DataSession; import mustic.gui.DataSession;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
import mustic.gui.panels.ImageResultPanel; import mustic.gui.panels.ImageResultPanel;
...@@ -33,7 +34,6 @@ import mustic.models.gui.panels.HybridClassificationMonitor; ...@@ -33,7 +34,6 @@ import mustic.models.gui.panels.HybridClassificationMonitor;
import mustic.models.gui.panels.MaclawClassificationMonitor; import mustic.models.gui.panels.MaclawClassificationMonitor;
import mustic.models.gui.panels.ResultPanel; import mustic.models.gui.panels.ResultPanel;
import mustic.models.gui.widgets.ClassificationManager; import mustic.models.gui.widgets.ClassificationManager;
import mustic.utils.tools.ProgressStatus;
import net.infonode.tabbedpanel.Tab; import net.infonode.tabbedpanel.Tab;
import net.infonode.tabbedpanel.TabDragEvent; import net.infonode.tabbedpanel.TabDragEvent;
import net.infonode.tabbedpanel.TabEvent; import net.infonode.tabbedpanel.TabEvent;
......
...@@ -15,7 +15,7 @@ import javax.swing.tree.DefaultMutableTreeNode; ...@@ -15,7 +15,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
import jcl.Classification; import jcl.Classification;
import jcl.clustering.Cluster; import jcl.clustering.Cluster;
import jcl.utils.exceptions.MethodNotImplementedException; import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.models.gui.panels.ResultPanel; import mustic.models.gui.panels.ResultPanel;
import mustic.models.gui.panels.utils.ClassTreeRenderer; import mustic.models.gui.panels.utils.ClassTreeRenderer;
......
...@@ -14,7 +14,7 @@ import javax.swing.JSpinner; ...@@ -14,7 +14,7 @@ import javax.swing.JSpinner;
import jcl.Classification; import jcl.Classification;
import jcl.clustering.Cluster; import jcl.clustering.Cluster;
import jcl.utils.exceptions.MethodNotImplementedException; import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.models.gui.panels.ResultPanel; import mustic.models.gui.panels.ResultPanel;
public class SplitDialog extends JDialog { public class SplitDialog extends JDialog {
......
...@@ -17,7 +17,7 @@ import jcl.learning.IterativeClassification; ...@@ -17,7 +17,7 @@ import jcl.learning.IterativeClassification;
import jcl.learning.methods.ClassifierUtils; import jcl.learning.methods.ClassifierUtils;
import jcl.learning.methods.multistrategy.samarah.HybridClassification; import jcl.learning.methods.multistrategy.samarah.HybridClassification;
import jcl.utils.Matrix; import jcl.utils.Matrix;
import jcl.utils.exceptions.MethodNotImplementedException; import multiCube.tools.util.exceptions.MethodNotImplementedException;
import mustic.gui.ClassificationImage; import mustic.gui.ClassificationImage;
import mustic.gui.DataDesktopFrame;