Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
lafabregue
MultiCube
Commits
4242aa62
Commit
4242aa62
authored
Nov 03, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched from Constraints window to ImageAddon
parent
7e1071e6
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
932 additions
and
481 deletions
+932
-481
src/mustic/gui/DataSession.java
src/mustic/gui/DataSession.java
+1
-0
src/mustic/gui/ImageSession.java
src/mustic/gui/ImageSession.java
+2
-1
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+108
-91
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
+2
-2
src/mustic/gui/dialog/SequenceDialog.java
src/mustic/gui/dialog/SequenceDialog.java
+3
-3
src/mustic/gui/dialog/classifier/ConstraintsColor.java
src/mustic/gui/dialog/classifier/ConstraintsColor.java
+9
-9
src/mustic/gui/dialog/classifier/ConstraintsSelectionFrame.java
...stic/gui/dialog/classifier/ConstraintsSelectionFrame.java
+139
-166
src/mustic/gui/dialog/classifier/ExportConstraintsTask.java
src/mustic/gui/dialog/classifier/ExportConstraintsTask.java
+2
-2
src/mustic/gui/dialog/classifier/ImportConstraintsTask.java
src/mustic/gui/dialog/classifier/ImportConstraintsTask.java
+3
-4
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+63
-46
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+127
-80
src/mustic/gui/panels/ImageResultPanel.java
src/mustic/gui/panels/ImageResultPanel.java
+171
-25
src/mustic/gui/panels/data/DataConstructPanel.java
src/mustic/gui/panels/data/DataConstructPanel.java
+4
-3
src/mustic/gui/panels/data/DataPanel.java
src/mustic/gui/panels/data/DataPanel.java
+8
-4
src/mustic/gui/panels/data/components/SourceSelectionPanel.java
...stic/gui/panels/data/components/SourceSelectionPanel.java
+14
-16
src/mustic/io/ImageData.java
src/mustic/io/ImageData.java
+13
-12
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+1
-1
src/mustic/utils/image/ImageAddOn.java
src/mustic/utils/image/ImageAddOn.java
+32
-0
src/mustic/utils/image/ImageDisplayer.java
src/mustic/utils/image/ImageDisplayer.java
+102
-0
src/mustic/utils/image/ImageManager.java
src/mustic/utils/image/ImageManager.java
+1
-1
src/mustic/utils/image/Zoomable.java
src/mustic/utils/image/Zoomable.java
+7
-0
src/mustic/utils/image/viewer/BufferedImageViewer.java
src/mustic/utils/image/viewer/BufferedImageViewer.java
+2
-1
src/mustic/utils/image/viewer/ClusteringImageViewer.java
src/mustic/utils/image/viewer/ClusteringImageViewer.java
+75
-1
src/mustic/utils/image/viewer/ImageViewer.java
src/mustic/utils/image/viewer/ImageViewer.java
+26
-1
src/mustic/utils/image/viewer/MultiResolutionClusterMap.java
src/mustic/utils/image/viewer/MultiResolutionClusterMap.java
+1
-1
src/mustic/utils/image/viewer/PyramidImageViewer.java
src/mustic/utils/image/viewer/PyramidImageViewer.java
+16
-11
No files found.
src/mustic/gui/DataSession.java
View file @
4242aa62
...
@@ -19,6 +19,7 @@ import mustic.gui.panels.data.DataPanel;
...
@@ -19,6 +19,7 @@ import mustic.gui.panels.data.DataPanel;
import
mustic.io.ImageData
;
import
mustic.io.ImageData
;
import
mustic.models.gui.ClassificationModel
;
import
mustic.models.gui.ClassificationModel
;
import
mustic.models.gui.panels.ResultPanel
;
import
mustic.models.gui.panels.ResultPanel
;
import
mustic.utils.image.ImageDisplayer
;
import
net.infonode.tabbedpanel.TabDragEvent
;
import
net.infonode.tabbedpanel.TabDragEvent
;
import
net.infonode.tabbedpanel.TabEvent
;
import
net.infonode.tabbedpanel.TabEvent
;
import
net.infonode.tabbedpanel.TabListener
;
import
net.infonode.tabbedpanel.TabListener
;
...
...
src/mustic/gui/ImageSession.java
View file @
4242aa62
...
@@ -15,6 +15,7 @@ import mustic.gui.panels.ImageInformationPanel;
...
@@ -15,6 +15,7 @@ import mustic.gui.panels.ImageInformationPanel;
import
mustic.gui.panels.ImagePanel
;
import
mustic.gui.panels.ImagePanel
;
import
mustic.gui.segmentation.SegmentationPanel
;
import
mustic.gui.segmentation.SegmentationPanel
;
import
mustic.io.RawImage
;
import
mustic.io.RawImage
;
import
mustic.utils.image.ImageManager
;
import
net.infonode.tabbedpanel.TabFactory
;
import
net.infonode.tabbedpanel.TabFactory
;
import
net.infonode.tabbedpanel.TabbedPanel
;
import
net.infonode.tabbedpanel.TabbedPanel
;
import
net.infonode.tabbedpanel.titledtab.TitledTab
;
import
net.infonode.tabbedpanel.titledtab.TitledTab
;
...
@@ -245,7 +246,7 @@ public class ImageSession extends ImageManager {
...
@@ -245,7 +246,7 @@ public class ImageSession extends ImageManager {
if
(
displayEnable
)
{
if
(
displayEnable
)
{
((
ImagePanel
)
this
.
displayer
).
applyMask
(
this
.
rawImage
.
getMask
());
((
ImagePanel
)
this
.
displayer
).
applyMask
(
this
.
rawImage
.
getMask
());
((
ImagePanel
)
this
.
displayer
).
refresh
();
((
ImagePanel
)
this
.
displayer
).
refresh
(
true
);
}
}
}
}
...
...
src/mustic/gui/MainFrame.java
View file @
4242aa62
...
@@ -131,7 +131,7 @@ public class MainFrame extends JFrame {
...
@@ -131,7 +131,7 @@ public class MainFrame extends JFrame {
private JPanel infosPanel;
private JPanel infosPanel;
/** boolean pour lier le birdview avec l'image active */
/** boolean pour lier le birdview avec l'image active */
private boolean linkToAllImages =
tru
e;
private boolean linkToAllImages =
fals
e;
/** the project root for datas */
/** the project root for datas */
private DefaultMutableTreeNode mDataProjectNode;
private DefaultMutableTreeNode mDataProjectNode;
...
@@ -429,7 +429,8 @@ public class MainFrame extends JFrame {
...
@@ -429,7 +429,8 @@ public class MainFrame extends JFrame {
openZip();
openZip();
}
}
});
});
fileMenu.add(menuItemOpenZip);
//TODO regenerate the result import same as imageResultPanel
//fileMenu.add(menuItemOpenZip);
menuItemSave = new JMenuItem(Messages.getString("MainFrame.10")); //$NON-NLS-1$
menuItemSave = new JMenuItem(Messages.getString("MainFrame.10")); //$NON-NLS-1$
menuItemSave.addActionListener(new ActionListener() {
menuItemSave.addActionListener(new ActionListener() {
...
@@ -493,7 +494,7 @@ public class MainFrame extends JFrame {
...
@@ -493,7 +494,7 @@ public class MainFrame extends JFrame {
}
}
}
}
});
});
toolsMenu.add(menuItemClustering);
//
toolsMenu.add(menuItemClustering);
menuItemSegmentation = new JMenuItem(Messages.getString("MainFrame.17")); //$NON-NLS-1$
menuItemSegmentation = new JMenuItem(Messages.getString("MainFrame.17")); //$NON-NLS-1$
menuItemSegmentation.addActionListener(new ActionListener() {
menuItemSegmentation.addActionListener(new ActionListener() {
...
@@ -625,7 +626,7 @@ public class MainFrame extends JFrame {
...
@@ -625,7 +626,7 @@ public class MainFrame extends JFrame {
createDistanceMatrix();
createDistanceMatrix();
}
}
});
});
toolsMenu.add(menuDistanceMatrix);
//
toolsMenu.add(menuDistanceMatrix);
/** Menu to generate constraints from current image session */
/** Menu to generate constraints from current image session */
menuConstraints = new JMenuItem(Messages.getString("MainFrame.301"));
menuConstraints = new JMenuItem(Messages.getString("MainFrame.301"));
...
@@ -635,7 +636,7 @@ public class MainFrame extends JFrame {
...
@@ -635,7 +636,7 @@ public class MainFrame extends JFrame {
createConstraints();
createConstraints();
}
}
});
});
toolsMenu.add(menuConstraints);
//
toolsMenu.add(menuConstraints);
menuBar.add(toolsMenu);
menuBar.add(toolsMenu);
...
@@ -914,7 +915,8 @@ public class MainFrame extends JFrame {
...
@@ -914,7 +915,8 @@ public class MainFrame extends JFrame {
}
}
});
});
menuResult.add(menuOpenRes);
//TODO regenerate the result import same as imageResultPanel
//menuResult.add(menuOpenRes);
menuResult.add(menuSaveRes);
menuResult.add(menuSaveRes);
menuRoiEval = new JMenuItem(Messages.getString("MainFrame.52")); //$NON-NLS-1$
menuRoiEval = new JMenuItem(Messages.getString("MainFrame.52")); //$NON-NLS-1$
...
@@ -1490,7 +1492,7 @@ public class MainFrame extends JFrame {
...
@@ -1490,7 +1492,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
_BORDER
);
panel_desktop.setBorder(Borders.DIALOG);
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$
...
@@ -1504,7 +1506,7 @@ public class MainFrame extends JFrame {
...
@@ -1504,7 +1506,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
_BORDER
);
panel.setBorder(Borders.DIALOG);
panel.add(pane);
panel.add(pane);
// =============== Creation of the Progress Panel => South
// =============== Creation of the Progress Panel => South
...
@@ -1625,7 +1627,7 @@ public class MainFrame extends JFrame {
...
@@ -1625,7 +1627,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
_BORDER
);
panel_desktop.setBorder(Borders.DIALOG);
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$
...
@@ -1639,7 +1641,7 @@ public class MainFrame extends JFrame {
...
@@ -1639,7 +1641,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
_BORDER
);
panel.setBorder(Borders.DIALOG);
panel.add(pane);
panel.add(pane);
// =============== Creation of the Progress Panel => South
// =============== Creation of the Progress Panel => South
...
@@ -2167,7 +2169,8 @@ public class MainFrame extends JFrame {
...
@@ -2167,7 +2169,8 @@ public class MainFrame extends JFrame {
}
}
});
});
toolBar.add(jbOpen);
//TODO regenerate the result import same as imageResultPanel
//toolBar.add(jbOpen);
toolBar.add(jbSave);
toolBar.add(jbSave);
JButton jbRoiEval = new JButton(new ImageIcon(getClass().getResource("/icons/icon_roi_eval.png"))); //$NON-NLS-1$
JButton jbRoiEval = new JButton(new ImageIcon(getClass().getResource("/icons/icon_roi_eval.png"))); //$NON-NLS-1$
...
@@ -3007,44 +3010,44 @@ public class MainFrame extends JFrame {
...
@@ -3007,44 +3010,44 @@ public class MainFrame extends JFrame {
// seg = segThread.getS();
// seg = segThread.getS();
// setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
// setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
Data data = MainFrame.this.currentImageSession.getImageData();
//
Data data = MainFrame.this.currentImageSession.getImageData();
//
MainFrame.this.currentImageSession.setData(data);
//
MainFrame.this.currentImageSession.setData(data);
ClassificationImage ci = new ClassificationImage(data, Messages.getString("MainFrame.190") //$NON-NLS-1$
//
ClassificationImage ci = new ClassificationImage(data, Messages.getString("MainFrame.190") //$NON-NLS-1$
+
Image
Session.nbClustering, true);
//
+
Data
Session.nbClustering, true);
//
SegmentationResultPanel srp = new SegmentationResultPanel(classif, ci, MainFrame.this.currentImageSession.getRawImage(),
//
SegmentationResultPanel srp = new SegmentationResultPanel(classif, ci, MainFrame.this.currentImageSession.getRawImage(),
seg, imageLabelisee, -1); // ImageSession.getSession(0).getImage(),ImageSession.getSession(0),
//
seg, imageLabelisee, -1); // ImageSession.getSession(0).getImage(),ImageSession.getSession(0),
// scene);
//
// scene);
//
Tab tabResult = ClassificationModel.createTab(Messages.getString("MainFrame.191") + ResultPanel.nbResult, //$NON-NLS-1$
//
Tab tabResult = ClassificationModel.createTab(Messages.getString("MainFrame.191") + ResultPanel.nbResult, //$NON-NLS-1$
new ImageIcon(getClass()
//
new ImageIcon(getClass()
.getResource("/icons/actions/document-open-result.png")), //$NON-NLS-1$
//
.getResource("/icons/actions/document-open-result.png")), //$NON-NLS-1$
srp, true);
//
srp, true);
ci.tabbedPane.addTab(tabResult);
//
ci.tabbedPane.addTab(tabResult);
tabResult.setSelected(true);
//
tabResult.setSelected(true);
//
SegmentationResultPanel irp = (SegmentationResultPanel) ci.tabbedPane.getTabAt(ci.tabbedPane.getTabCount() - 1)
//
SegmentationResultPanel irp = (SegmentationResultPanel) ci.tabbedPane.getTabAt(ci.tabbedPane.getTabCount() - 1)
.getContentComponent();
//
.getContentComponent();
irp.historique.addInfosln("******** Classification apres segmentation *********"); //$NON-NLS-1$
//
irp.historique.addInfosln("******** Classification apres segmentation *********"); //$NON-NLS-1$
//
irp.historique.addInfosln(Messages.getString("MainFrame.0") //$NON-NLS-1$
//
irp.historique.addInfosln(Messages.getString("MainFrame.0") //$NON-NLS-1$
+ classif.getData().getDataName() + "\n"); //$NON-NLS-1$
//
+ classif.getData().getDataName() + "\n"); //$NON-NLS-1$
//
// irp.historique.addInfosln(ci.().getParameters().toString());
//
// irp.historique.addInfosln(ci.().getParameters().toString());
//
final TitledTab tab = new TitledTab(Messages.getString("MainFrame.196") //$NON-NLS-1$
//
final TitledTab tab = new TitledTab(Messages.getString("MainFrame.196") //$NON-NLS-1$
+ ImageSession.nbClustering++, null, ci.tabbedPane, new JPanel());
//
+ ImageSession.nbClustering++, null, ci.tabbedPane, new JPanel());
tab.setFocusableComponent(null);
//
tab.setFocusableComponent(null);
//
MainFrame.this.currentImageSession.getWorkSpace().addTab(tab);
//
MainFrame.this.currentImageSession.getWorkSpace().addTab(tab);
MainFrame.this.currentImageSession.getWorkSpace().setSelectedTab(tab);
//
MainFrame.this.currentImageSession.getWorkSpace().setSelectedTab(tab);
//
try {
//
try {
MainFrame.this.currentImageSession.associatedFrame.setMaximum(true);
//
MainFrame.this.currentImageSession.associatedFrame.setMaximum(true);
} catch (PropertyVetoException e1) {}
//
} catch (PropertyVetoException e1) {}
//
irp.updateImageColors();
//
irp.updateImageColors();
}
}
else {
else {
...
@@ -3736,8 +3739,8 @@ public class MainFrame extends JFrame {
...
@@ -3736,8 +3739,8 @@ public class MainFrame extends JFrame {
String resultPath = "/home/baptiste/A2CNES/results/";
String resultPath = "/home/baptiste/A2CNES/results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/";
Data dataTrain = getDataFromFile(dataPath+datasetPath+"/train/"+datasetName+".data", '\t', "train");
Data dataTrain = getDataFromFile(dataPath+datasetPath+"/train/"+datasetName+".data", '\t', "train"
, null
);
Data dataTest = getDataFromFile(dataPath+datasetPath+"/test/"+datasetName+".data", '\t', "test");
Data dataTest = getDataFromFile(dataPath+datasetPath+"/test/"+datasetName+".data", '\t', "test"
, null
);
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
...
@@ -3781,38 +3784,39 @@ public class MainFrame extends JFrame {
...
@@ -3781,38 +3784,39 @@ public class MainFrame extends JFrame {
// we search for all constraints files
// we search for all constraints files
// <<<< START FOR PARAM config
// <<<< START FOR PARAM config
for (int i = 0 ; i < 10 ; i++) {
HybridClassification classif = (HybridClassification) classification.clone();
if (i % 2 == 1 ) {
classification.setParameters(nInf, nSup, minC, 0.4, 0.6, pcr);
}
if (i <= 5)
classif.addAgent(new ParametersKmeans(8, 10, weights), dataTrain);
if (i <= 7)
classif.addAgent(new ParametersKmeans(10, 10, weights), dataTrain);
classif.addAgent(new ParametersKmeans(13, 10, weights), dataTrain);
classif.addAgent(new ParametersKmeans(16, 10, weights), dataTrain);
if (i >= 2)
classif.addAgent(new ParametersKmeans(19, 10, weights), dataTrain);
if (i >= 4)
classif.addAgent(new ParametersKmeans(22, 10, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(3, 10, weights), dataTest);
// classif.addAgent(new ParametersKmeans(4, 10, weights), dataTest);
// classif.addAgent(new ParametersKmeans(6, 10, weights), dataTest);
classif.setName(testResultPath+datasetName+"/clusteing"+i);
classif.setData(dataTrain);
//// >>>> END FOR PARAM config1
// for (int i = 0 ; i < 10 ; i++) {
// for (int i = 0 ; i < 10 ; i++) {
// HybridClassification classif = (HybridClassification) classification.clone();
// HybridClassification classif = (HybridClassification) classification.clone();
//// classif.addAgent(new ParametersKmeans(10, 15, weights), dataTest);
// if (i % 2 == 1 ) {
// classif.addAgent(new ParametersKmeans(13, 10, weights), dataTest);
// classification.setParameters(nInf, nSup, minC, 0.4, 0.6, pcr);
// classif.addAgent(new ParametersKmeans(16, 10, weights), dataTest);
// }
// classif.addAgent(new ParametersKmeans(19, 10, weights), dataTest);
// if (i <= 5)
//
// classif.addAgent(new ParametersKmeans(8, 25, weights), dataTrain);
// classif.setName(resultPath+datasetPath+"/clustering"+i);
// if (i <= 7)
// classif.setData(dataTest);
// classif.addAgent(new ParametersKmeans(10, 25, weights), dataTrain);
//// >>>> REPLACE PARAM
// classif.addAgent(new ParametersKmeans(13, 25, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(16, 25, weights), dataTrain);
// if (i >= 2)
// classif.addAgent(new ParametersKmeans(19, 25, weights), dataTrain);
// if (i >= 4)
// classif.addAgent(new ParametersKmeans(22, 25, weights), dataTrain);
//// classif.addAgent(new ParametersKmeans(3, 10, weights), dataTest);
//// classif.addAgent(new ParametersKmeans(4, 10, weights), dataTest);
//// classif.addAgent(new ParametersKmeans(6, 10, weights), dataTest);
//
// classif.setName(testResultPath+datasetName+"/clusteing"+i);
// classif.setData(dataTrain);
// >>>> END FOR PARAM config1
for (int i = 0 ; i < 10 ; i++) {
HybridClassification classif = (HybridClassification) classification.clone();
// classif.addAgent(new ParametersKmeans(10, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(13, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(16, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(19, 25, weights), dataTest);
// classif.addAgent(new ParametersKmeans(22, 25, weights), dataTest);
classif.setName(resultPath+datasetPath+"/clustering"+i);
classif.setData(dataTest);
// >>>> REPLACE PARAM
Thread t = null;
Thread t = null;
ClassificationImage classificationImage = new ClassificationImage(testSession,
ClassificationImage classificationImage = new ClassificationImage(testSession,
...
@@ -3879,9 +3883,11 @@ public class MainFrame extends JFrame {
...
@@ -3879,9 +3883,11 @@ public class MainFrame extends JFrame {
// Data currentData = (Data) dataTest.clone();
// Data currentData = (Data) dataTest.clone();
// currentData.updateAndSetConstraintsToSample(constraints);
// currentData.updateAndSetConstraintsToSample(constraints);
//
//
// classif.addAgent(new ParametersKmeans(4, 15, weights), currentData);
// classif.addAgent(new ParametersKmeans(10, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(6, 15, weights), currentData);
// classif.addAgent(new ParametersKmeans(13, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(8, 15, weights), currentData);
// classif.addAgent(new ParametersKmeans(16, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(19, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(22, 25, weights), currentData);
//
//
// classif.setName(resultPath+datasetName+"/"+
// classif.setName(resultPath+datasetName+"/"+
// ImageHelper.stripExtension(filename)+
// ImageHelper.stripExtension(filename)+
...
@@ -3890,9 +3896,9 @@ public class MainFrame extends JFrame {
...
@@ -3890,9 +3896,9 @@ public class MainFrame extends JFrame {
//
//
// Thread t = null;
// Thread t = null;
//
//
// ClassificationImage classificationImage = new ClassificationImage(
currentData
,
// ClassificationImage classificationImage = new ClassificationImage(
testSession
,
//
Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
// Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
//
true);
// true);
//
//
//
//
// t = new ClassificationThread(classif, classificationImage.getProgressBar(),
// t = new ClassificationThread(classif, classificationImage.getProgressBar(),
...
@@ -3908,7 +3914,6 @@ public class MainFrame extends JFrame {
...
@@ -3908,7 +3914,6 @@ public class MainFrame extends JFrame {
// } catch (PropertyVetoException e) {
// } catch (PropertyVetoException e) {
// e.printStackTrace();
// e.printStackTrace();
// }
// }
// classificationImage.toFront();
// classificationImage.setVisible(true);
// classificationImage.setVisible(true);
//
//
// threadList.add(t);
// threadList.add(t);
...
@@ -3946,7 +3951,7 @@ public class MainFrame extends JFrame {
...
@@ -3946,7 +3951,7 @@ public class MainFrame extends JFrame {
ClassificationFrame.getInstance().dispose();
ClassificationFrame.getInstance().dispose();
}
}
private Data getDataFromFile(String path, char separator, String name) {
private Data getDataFromFile(String path, char separator, String name
, String mask
) {
Data data = null;
Data data = null;
// we create the two data session
// we create the two data session
...
@@ -3955,12 +3960,20 @@ public class MainFrame extends JFrame {
...
@@ -3955,12 +3960,20 @@ public class MainFrame extends JFrame {
List<DataObject> result = new ArrayList<DataObject>();
List<DataObject> result = new ArrayList<DataObject>();
CSVUtils reader = null;
CSVUtils reader = null;
CSVUtils maskReader = null;
try {
try {
File file = new File(path);
File file = new File(path);
reader = new CSVUtils(file, separator);
reader = new CSVUtils(file, separator);
List<String> line;
List<String> line;
if (mask != null) {
maskReader = new CSVUtils(new File(mask), separator);
}
List<String> maskLine = null;
while((line = reader.readNext()) != null) {
while((line = reader.readNext()) != null) {
extractObjectFromLine(result, line, 1);
if (mask != null) {
maskLine = maskReader.readNext();
}
extractObjectFromLine(result, line, 3, maskLine);
}
}
} catch (FileNotFoundException e) {
} catch (FileNotFoundException e) {
e.printStackTrace();
e.printStackTrace();
...
@@ -3985,10 +3998,14 @@ public class MainFrame extends JFrame {
...
@@ -3985,10 +3998,14 @@ public class MainFrame extends JFrame {
* @param line
* @param line
* the line to interpret
* the line to interpret
*/
*/
private void extractObjectFromLine(List<DataObject> list, List<String> line, int featureNb) {
private void extractObjectFromLine(List<DataObject> list, List<String> line, int featureNb
, List<String> maskLine
) {
DataObject obj = new DataObject(1);
DataObject obj = new DataObject(1);
double[][] seq = new double[line.size()/featureNb][];
double[][] seq = new double[line.size()/featureNb][];
for (int i = 0 ; i < line.size()/featureNb ; i++) {
for (int i = 0 ; i < line.size()/featureNb ; i++) {
if (maskLine != null) {
if(Integer.parseInt(maskLine.get(i)) == 0)
continue;
}
seq[i] = new double[featureNb];
seq[i] = new double[featureNb];
for (int j = 0 ; j < featureNb ; j++) {
for (int j = 0 ; j < featureNb ; j++) {
seq[i][j] = Double.parseDouble(line.get(i*featureNb + j));
seq[i][j] = Double.parseDouble(line.get(i*featureNb + j));
...
...
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
View file @
4242aa62
...
@@ -50,8 +50,8 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
...
@@ -50,8 +50,8 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
public
RgbBandChooserInternalFrame
(
final
RawImage
rawImage
)
{
public
RgbBandChooserInternalFrame
(
final
RawImage
rawImage
)
{
super
();
super
();
this
.
scaledMax
=
rawImage
.
getScaledMaxValues
();
this
.
scaledMax
=
rawImage
.
getScaledMaxValues
()
.
clone
()
;
this
.
scaledMin
=
rawImage
.
getScaledMinValues
();
this
.
scaledMin
=
rawImage
.
getScaledMinValues
()
.
clone
()
;
this
.
redComboBox
=
new
JComboBox
<
String
>();
this
.
redComboBox
=
new
JComboBox
<
String
>();
this
.
redMin
=
new
JTextArea
();
this
.
redMin
=
new
JTextArea
();
this
.
redMax
=
new
JTextArea
();
this
.
redMax
=
new
JTextArea
();
...
...
src/mustic/gui/dialog/SequenceDialog.java
View file @
4242aa62
...
@@ -301,10 +301,10 @@ public class SequenceDialog extends JDialog {
...
@@ -301,10 +301,10 @@ public class SequenceDialog extends JDialog {
* @throws FormatException
* @throws FormatException
* if the images don't have the same dimensions
* if the images don't have the same dimensions
*/
*/
public
Vector
<
String
>
getSequenceData
()
throws
FormatException
{
public
Vector
<
RawImage
>
getSequenceData
()
throws
FormatException
{
int
nb
=
this
.
dlmSeq
.
getSize
();
int
nb
=
this
.
dlmSeq
.
getSize
();
Donnee
donnee
;
Donnee
donnee
;
Vector
<
String
>
paths
=
new
Vector
<
String
>();
Vector
<
RawImage
>
paths
=
new
Vector
<
RawImage
>();
if
(
nb
>
0
)
{
if
(
nb
>
0
)
{
ImageDesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
ImageDesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
...
@@ -314,7 +314,7 @@ public class SequenceDialog extends JDialog {
...
@@ -314,7 +314,7 @@ public class SequenceDialog extends JDialog {
for
(
int
i
=
0
;
i
<
nb
;
i
++)
{
for
(
int
i
=
0
;
i
<
nb
;
i
++)
{
donnee
=
(
Donnee
)
this
.
dlmSeq
.
getElementAt
(
i
);
donnee
=
(
Donnee
)
this
.
dlmSeq
.
getElementAt
(
i
);
paths
.
add
(
desktopFrames
[
donnee
.
index
].
getImageSession
()
paths
.
add
(
desktopFrames
[
donnee
.
index
].
getImageSession
()
.
getRawImage
()
.
getPath
()
);
.
getRawImage
());
}
}
}
}
...
...
src/mustic/gui/dialog/classifier/ConstraintsColor.java
View file @
4242aa62
...
@@ -26,19 +26,19 @@ public class ConstraintsColor extends JDialog {
...
@@ -26,19 +26,19 @@ public class ConstraintsColor extends JDialog {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** constraints colors */
/** constraints colors */
private
Color
mustLinkColor
=
new
Color
(
124
,
252
,
0
);
private
Color
mustLinkColor
=
new
Color
(
124
,
252
,
0
);
private
Color
cannotLinkColor
=
new
Color
(
255
,
0
,
255
);
private
Color
cannotLinkColor
=
new
Color
(
255
,
0
,
255
);
private
Vector
<
Color
>
labelConstraintColor
=
new
Vector
<
Color
>();
private
Vector
<
Color
>
labelConstraintColor
=
new
Vector
<
Color
>();
/** constraints buttons */
/** constraints buttons */
private
JButton
jb_mustLinkChooseColor
=
new
JButton
();
private
JButton
jb_mustLinkChooseColor
=
new
JButton
();
private
JButton
jb_cannotLinkChooseColor
=
new
JButton
();
private
JButton
jb_cannotLinkChooseColor
=
new
JButton
();
private
Vector
<
JButton
>
jb_labelConstraintClassChooseColor
=
new
Vector
<
JButton
>();
private
Vector
<
JButton
>
jb_labelConstraintClassChooseColor
=
new
Vector
<
JButton
>();
/** dynamic JPanel Colors of Label Constraints Classes*/
/** dynamic JPanel Colors of Label Constraints Classes*/
JPanel
labelColorConstraintPanel
=
new
JPanel
(
new
GridLayout
(
0
,
1
));
private
JPanel
labelColorConstraintPanel
=
new
JPanel
(
new
GridLayout
(
0
,
1
));
private
ConstraintsSelection
Dialog
dialog
=
null
;
private
ConstraintsSelection
Frame
dialog
=
null
;
/**
/**
* @brief Constructor dialog window that allows the user to change the color of the constraints
* @brief Constructor dialog window that allows the user to change the color of the constraints
...
@@ -47,7 +47,7 @@ public class ConstraintsColor extends JDialog {
...
@@ -47,7 +47,7 @@ public class ConstraintsColor extends JDialog {
* @param colorCL
* @param colorCL
* @param colorVectorLabel
* @param colorVectorLabel
*/
*/
public
ConstraintsColor
(
ConstraintsSelection
Dialog
d
,
Color
colorML
,
Color
colorCL
,
Vector
<
Color
>
colorVectorLabel
)
{
public
ConstraintsColor
(
ConstraintsSelection
Frame
d
,
Color
colorML
,
Color
colorCL
,
Vector
<
Color
>
colorVectorLabel
)
{
this
.
dialog
=
d
;
this
.
dialog
=
d
;
this
.
mustLinkColor
=
colorML
;
this
.
mustLinkColor
=
colorML
;
this
.
cannotLinkColor
=
colorCL
;
this
.
cannotLinkColor
=
colorCL
;
...
...
src/mustic/gui/dialog/classifier/ConstraintsSelection
Internal
Frame.java
→
src/mustic/gui/dialog/classifier/ConstraintsSelectionFrame.java
View file @
4242aa62
This diff is collapsed.
Click to expand it.
src/mustic/gui/dialog/classifier/ExportConstraintsTask.java
View file @
4242aa62
...
@@ -24,12 +24,12 @@ import mustic.utils.filters.CSVFileFilter;
...
@@ -24,12 +24,12 @@ import mustic.utils.filters.CSVFileFilter;
*/
*/
public
class
ExportConstraintsTask
extends
SwingWorker
<
Void
,
Void
>
public
class
ExportConstraintsTask
extends
SwingWorker
<
Void
,
Void
>
{
{
ConstraintsSelection
Dialog
dialog
=
null
;
ConstraintsSelection
Frame
dialog
=
null
;
static
final
private
int
incrementation
=
10
;
static
final
private
int
incrementation
=
10
;
static
int
progress
=
0
;
static
int
progress
=
0
;
static
int
jalon
=
incrementation
;
// avoid too many progress update
static
int
jalon
=
incrementation
;
// avoid too many progress update
public
ExportConstraintsTask
(
ConstraintsSelection
Dialog
dialog
)
public
ExportConstraintsTask
(
ConstraintsSelection
Frame
dialog
)
{
{
this
.
dialog
=
dialog
;
this
.
dialog
=
dialog
;
}
}
...
...
src/mustic/gui/dialog/classifier/ImportConstraintsTask.java
View file @
4242aa62
...
@@ -21,12 +21,12 @@ import mustic.utils.io.CSVUtils;
...
@@ -21,12 +21,12 @@ import mustic.utils.io.CSVUtils;
*/
*/
public
class
ImportConstraintsTask
extends
SwingWorker
<
Void
,
Void
>
public
class
ImportConstraintsTask
extends
SwingWorker
<
Void
,
Void
>
{
{
ConstraintsSelection
Dialog
dialog
=
null
;
ConstraintsSelection
Frame
dialog
=
null
;
static
final
private
int
incrementation
=
10
;
static
final
private
int
incrementation
=
10
;
static
int
progress
=
0
;
static
int
progress
=
0
;
static
int
jalon
=
incrementation
;
// avoid too many progress update
static
int
jalon
=
incrementation
;
// avoid too many progress update
public
ImportConstraintsTask
(
ConstraintsSelection
Dialog
dialog
)
public
ImportConstraintsTask
(
ConstraintsSelection
Frame
dialog
)
{
{
this
.
dialog
=
dialog
;
this
.
dialog
=
dialog
;
}
}
...
@@ -108,8 +108,7 @@ public class ImportConstraintsTask extends SwingWorker<Void, Void>
...
@@ -108,8 +108,7 @@ public class ImportConstraintsTask extends SwingWorker<Void, Void>
}