Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MultiCube
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lafabregue
MultiCube
Commits
704cea5d
Commit
704cea5d
authored
Sep 12, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow channel index modification for rgb color
parent
1e2ec39f
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
590 additions
and
252 deletions
+590
-252
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+127
-118
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
+105
-63
src/mustic/gui/dialog/classifier/ConstraintsSelectionDialog.java
...tic/gui/dialog/classifier/ConstraintsSelectionDialog.java
+1
-1
src/mustic/gui/dialog/messages_en.properties
src/mustic/gui/dialog/messages_en.properties
+4
-4
src/mustic/gui/dialog/messages_fr.properties
src/mustic/gui/dialog/messages_fr.properties
+3
-3
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+5
-5
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+20
-1
src/mustic/gui/panels/ImageResultPanel.java
src/mustic/gui/panels/ImageResultPanel.java
+6
-2
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+121
-7
src/mustic/utils/image/BufferedImageHelper.java
src/mustic/utils/image/BufferedImageHelper.java
+59
-3
src/mustic/utils/image/BufferedImageViewer.java
src/mustic/utils/image/BufferedImageViewer.java
+20
-34
src/mustic/utils/image/ImageHelper.java
src/mustic/utils/image/ImageHelper.java
+0
-4
src/mustic/utils/image/ImageViewer.java
src/mustic/utils/image/ImageViewer.java
+35
-1
src/mustic/utils/image/PyramidImageViewer.java
src/mustic/utils/image/PyramidImageViewer.java
+5
-3
src/mustic/utils/io/tiff/TiffUtils.java
src/mustic/utils/io/tiff/TiffUtils.java
+79
-3
No files found.
src/mustic/gui/MainFrame.java
View file @
704cea5d
...
...
@@ -27,6 +27,10 @@ import javax.swing.border.EmptyBorder;
import javax.swing.event.*;
import javax.swing.tree.*;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import jcl.Classification;
import jcl.clustering.Cluster;
import jcl.clustering.ClusteringResult;
...
...
@@ -343,7 +347,8 @@ public class MainFrame extends JFrame {
if (this.currentImageSession == null)
return;
RgbBandChooserInternalFrame rgbBandChooserInternalFrame = new RgbBandChooserInternalFrame(currentImageSession);
RgbBandChooserInternalFrame rgbBandChooserInternalFrame = new RgbBandChooserInternalFrame
(currentImageSession.getRawImage());
this.desktop.add(rgbBandChooserInternalFrame);
this.desktop.setSelectedFrame(rgbBandChooserInternalFrame);
rgbBandChooserInternalFrame.toFront();
...
...
@@ -3713,7 +3718,7 @@ public class MainFrame extends JFrame {
private void customClassify() {
HybridClassification classification = new HybridClassification();
String datasetName = "
StarLightCurves
";
String datasetName = "
ECML
";
String dataPath = "/home/baptiste/A2CNES/";
String resultPath = "/home/baptiste/A2CNES/results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/";
...
...
@@ -3723,6 +3728,7 @@ public class MainFrame extends JFrame {
DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDataDesktopFrames();
DataSession testSession = desktopFrames[desktopFrames.length-1].getDataSession();
final DateTime startTime = DateTime.now();
int nInf = 3;
int nSup = 5;
...
...
@@ -3736,7 +3742,7 @@ public class MainFrame extends JFrame {
// parametre qualite/similitude
double ps = 0.2;
double pq = 1.0 - ps;
double constraintsWgt =
85
;
double constraintsWgt =
0
;
double valueKExtern = 60;
double kExtern = valueKExtern * ((100-constraintsWgt)/100);
double kIntern = (100 - valueKExtern) * ((100-constraintsWgt)/100);
...
...
@@ -3757,14 +3763,14 @@ public class MainFrame extends JFrame {
final Vector<Classification> classifList = new Vector<Classification>();
// we search for all constraints files
//
//
<<<< START FOR PARAM config
// <<<< START FOR PARAM config
// for (int i = 0 ; i < 6 ; i++) {
// HybridClassification classif = (HybridClassification) classification.clone();
// if (i % 2 == 1 ) {
// classification.setParameters(nInf, nSup, minC, 0.4, 0.6, pcr);
// }
// if (i <= 4)
// classif.addAgent(new ParametersKmeans(1
1
, 10, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(1
0
, 10, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(13, 10, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(16, 10, weights), dataTrain);
// if (i >= 2)
...
...
@@ -3776,120 +3782,121 @@ public class MainFrame extends JFrame {
// 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(4, 15, weights), dataTest);
// classif.addAgent(new ParametersKmeans(6, 15, weights), dataTest);
// classif.addAgent(new ParametersKmeans(8, 15, weights), dataTest);
//
// classif.setName(resultPath+datasetName+"/clustering"+i);
// classif.setData(dataTest);
for (int i = 0 ; i < 5 ; i++) {
HybridClassification classif = (HybridClassification) classification.clone();
classif.addAgent(new ParametersKmeans(10, 15, weights), dataTest);
classif.addAgent(new ParametersKmeans(13, 15, weights), dataTest);
classif.addAgent(new ParametersKmeans(16, 15, weights), dataTest);
classif.addAgent(new ParametersKmeans(19, 15, weights), dataTest);
classif.setName(resultPath+datasetName+"/clustering"+i);
classif.setData(dataTest);
//// >>>> REPLACE PARAM
// Thread t = null;
//
// ClassificationImage classificationImage = new ClassificationImage(dataTest,
// Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
// true);
//
//
// t = new ClassificationThread(classif, classificationImage.getProgressBar(),
// classificationImage, null);
// t.start();
// try {
// testSession.associatedFrame.setMaximum(true);
// } catch (PropertyVetoException e1) {}
// testSession.addClassifier(classificationImage);
// try {
// testSession.associatedFrame.setSelected(true);
// testSession.associatedFrame.toFront();
// } catch (PropertyVetoException e) {
// e.printStackTrace();
// }
// classificationImage.toFront();
// classificationImage.setVisible(true);
//
// threadList.add(t);
// classifList.add(classif);
// }
// <<<< CONSTRAINTS
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(
Paths.get(dataPath+datasetName+"/test/"), "*constraints")) {
Iterator<Path> iter = dirStream.iterator();
while(iter.hasNext()) {
Vector<Constraint> constraints = new Vector<Constraint>();
String filename = iter.next().getFileName().toString();
System.out.println(filename);
CSVUtils reader = null;
try {
reader = new CSVUtils(new File(dataPath+datasetName+"/test/"+filename), '\t');
List<String> line;
while((line = reader.readNext()) != null) {
switch (Integer.parseInt(line.get(line.size()-1))) {
case Constraint.MUST_LINK_TYPE :
try {
int index1 = Integer.parseInt(line.get(0))-1;
int index2 = Integer.parseInt(line.get(1))-1;
constraints.add(new MustLinkConstraint(index1, index2));
} catch(Exception e) {
e.printStackTrace();
}
break;
case Constraint.CANNOT_LINK_TYPE :
try {
int index1 = Integer.parseInt(line.get(0))-1;
int index2 = Integer.parseInt(line.get(1))-1;
constraints.add(new CannotLinkConstraint(index1, index2));
} catch(Exception e) {
e.printStackTrace();
}
break;
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
HybridClassification classif = (HybridClassification) classification.clone();
Data currentData = (Data) dataTest.clone();
currentData.updateAndSetConstraintsToSample(constraints);
classif.addAgent(new ParametersKmeans(4, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(6, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(8, 15, weights), currentData);
classif.setName(resultPath+datasetName+"/"+
ImageHelper.stripExtension(filename)+
".clustering");
classif.setData(dataTest);
Thread t = null;
ClassificationImage classificationImage = new ClassificationImage(currentData,
Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
true);
t = new ClassificationThread(classif, classificationImage.getProgressBar(),
classificationImage, null);
t.start();
try {
testSession.associatedFrame.setMaximum(true);
} catch (PropertyVetoException e1) {}
testSession.addClassifier(classificationImage);
try {
testSession.associatedFrame.setSelected(true);
testSession.associatedFrame.toFront();
} catch (PropertyVetoException e) {
e.printStackTrace();
}
classificationImage.toFront();
classificationImage.setVisible(true);
threadList.add(t);
classifList.add(classif);
}
} catch (IOException e2) {
e2.printStackTrace();
Thread t = null;
ClassificationImage classificationImage = new ClassificationImage(dataTest,
Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
true);
t = new ClassificationThread(classif, classificationImage.getProgressBar(),
classificationImage, null);
t.start();
try {
testSession.associatedFrame.setMaximum(true);
} catch (PropertyVetoException e1) {}
testSession.addClassifier(classificationImage);
try {
testSession.associatedFrame.setSelected(true);
testSession.associatedFrame.toFront();
} catch (PropertyVetoException e) {
e.printStackTrace();
}
classificationImage.toFront();
classificationImage.setVisible(true);
threadList.add(t);
classifList.add(classif);
}
// <<<< CONSTRAINTS
// try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(
// Paths.get(dataPath+datasetName+"/test/"), "*constraints")) {
// Iterator<Path> iter = dirStream.iterator();
// while(iter.hasNext()) {
// Vector<Constraint> constraints = new Vector<Constraint>();
// String filename = iter.next().getFileName().toString();
// System.out.println(filename);
// CSVUtils reader = null;
// try {
// reader = new CSVUtils(new File(dataPath+datasetName+"/test/"+filename), '\t');
// List<String> line;
// while((line = reader.readNext()) != null) {
// switch (Integer.parseInt(line.get(line.size()-1))) {
// case Constraint.MUST_LINK_TYPE :
// try {
// int index1 = Integer.parseInt(line.get(0))-1;
// int index2 = Integer.parseInt(line.get(1))-1;
// constraints.add(new MustLinkConstraint(index1, index2));
// } catch(Exception e) {
// e.printStackTrace();
// }
// break;
// case Constraint.CANNOT_LINK_TYPE :
// try {
// int index1 = Integer.parseInt(line.get(0))-1;
// int index2 = Integer.parseInt(line.get(1))-1;
// constraints.add(new CannotLinkConstraint(index1, index2));
// } catch(Exception e) {
// e.printStackTrace();
// }
// break;
// }
// }
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
// HybridClassification classif = (HybridClassification) classification.clone();
// Data currentData = (Data) dataTest.clone();
// currentData.updateAndSetConstraintsToSample(constraints);
//
// classif.addAgent(new ParametersKmeans(4, 15, weights), currentData);
// classif.addAgent(new ParametersKmeans(6, 15, weights), currentData);
// classif.addAgent(new ParametersKmeans(8, 15, weights), currentData);
//
// classif.setName(resultPath+datasetName+"/"+
// ImageHelper.stripExtension(filename)+
// ".clustering");
// classif.setData(dataTest);
//
// Thread t = null;
//
// ClassificationImage classificationImage = new ClassificationImage(currentData,
// Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
// true);
//
//
// t = new ClassificationThread(classif, classificationImage.getProgressBar(),
// classificationImage, null);
// t.start();
// try {
// testSession.associatedFrame.setMaximum(true);
// } catch (PropertyVetoException e1) {}
// testSession.addClassifier(classificationImage);
// try {
// testSession.associatedFrame.setSelected(true);
// testSession.associatedFrame.toFront();
// } catch (PropertyVetoException e) {
// e.printStackTrace();
// }
// classificationImage.toFront();
// classificationImage.setVisible(true);
//
// threadList.add(t);
// classifList.add(classif);
// }
// } catch (IOException e2) {
// e2.printStackTrace();
// }
// >>>> CONSTRAINTS
new Thread() {
...
...
@@ -3909,7 +3916,9 @@ public class MainFrame extends JFrame {
e.printStackTrace();
}
}
System.out.println("wrote final results");
DateTimeFormatter formatter = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm:ss");
System.out.println("Start at "+ formatter.print(startTime));
System.out.println("wrote final results at "+ formatter.print(DateTime.now()));
}
}.start();
...
...
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
View file @
704cea5d
...
...
@@ -12,62 +12,89 @@ import javax.swing.JComboBox;
import
javax.swing.JInternalFrame
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
import
javax.swing.JTextArea
;
import
javax.swing.SwingConstants
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.io.RawImage
;
public
class
RgbBandChooserInternalFrame
extends
JInternalFrame
{
/** liste de choix pour la bande bleu */
private
JComboBox
blueComboBox
;
/** liste de choix pour la bande verte */
private
JComboBox
greenComboBox
;
/** */
private
static
final
long
serialVersionUID
=
1L
;
/** liste de choix pour la bande rouge */
private
JComboBox
rougeComboBoxr
;
private
JComboBox
<
String
>
redComboBox
;
private
JTextArea
redMin
;
private
JTextArea
redMax
;
/** liste de choix si noir et blanc */
private
JComboBox
whiteBlackComboBox
;
/** liste de choix pour la bande verte */
private
JComboBox
<
String
>
greenComboBox
;
private
JTextArea
greenMin
;
private
JTextArea
greenMax
;
/** liste de choix pour la bande bleu */
private
JComboBox
<
String
>
blueComboBox
;
private
JTextArea
blueMin
;
private
JTextArea
blueMax
;
public
RgbBandChooserInternalFrame
(
ImageSession
currentImageSession
)
{
/** liste de choix si noir et blanc */
private
JComboBox
<
String
>
whiteBlackComboBox
;
/** min/max used for scale image colors */
private
double
[]
scaledMax
;
private
double
[]
scaledMin
;
public
RgbBandChooserInternalFrame
(
final
RawImage
rawImage
)
{
super
();
this
.
rougeComboBoxr
=
new
JComboBox
();
this
.
greenComboBox
=
new
JComboBox
();
this
.
blueComboBox
=
new
JComboBox
();
this
.
whiteBlackComboBox
=
new
JComboBox
();
this
.
scaledMax
=
rawImage
.
getScaledMaxValues
();
this
.
scaledMin
=
rawImage
.
getScaledMinValues
();
this
.
redComboBox
=
new
JComboBox
<
String
>();
this
.
redMin
=
new
JTextArea
();
this
.
redMax
=
new
JTextArea
();
this
.
greenComboBox
=
new
JComboBox
<
String
>();
this
.
greenMin
=
new
JTextArea
();
this
.
greenMax
=
new
JTextArea
();
this
.
blueComboBox
=
new
JComboBox
<
String
>();
this
.
blueMin
=
new
JTextArea
();
this
.
blueMax
=
new
JTextArea
();
this
.
whiteBlackComboBox
=
new
JComboBox
<
String
>();
this
.
setTitle
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.0"
));
//$NON-NLS-1$
this
.
whiteBlackComboBox
.
addItem
(
""
);
//$NON-NLS-1$
int
nb_band
=
currentImageSession
.
getRawImage
()
.
getNbBands
();
int
nb_band
=
rawImage
.
getNbBands
();
for
(
int
i
=
1
;
i
<=
nb_band
;
i
++)
{
this
.
r
ougeComboBoxr
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.2"
)
+
i
);
//$NON-NLS-1$
this
.
greenComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
3
"
)
+
i
);
//$NON-NLS-1$
this
.
blueComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
4
"
)
+
i
);
//$NON-NLS-1$
this
.
whiteBlackComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
5
"
)
+
i
);
//$NON-NLS-1$
this
.
r
edComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.2"
)
+
i
);
//$NON-NLS-1$
this
.
greenComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
2
"
)
+
i
);
//$NON-NLS-1$
this
.
blueComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
2
"
)
+
i
);
//$NON-NLS-1$
this
.
whiteBlackComboBox
.
addItem
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.
2
"
)
+
i
);
//$NON-NLS-1$
}
this
.
rougeComboBoxr
.
setSelectedIndex
(
currentImageSession
.
getBirdViewPanel
().
getR
());
this
.
greenComboBox
.
setSelectedIndex
(
currentImageSession
.
getBirdViewPanel
().
getG
());
this
.
blueComboBox
.
setSelectedIndex
(
currentImageSession
.
getBirdViewPanel
().
getB
());
this
.
redComboBox
.
setSelectedIndex
(
rawImage
.
getR
());
this
.
redMin
.
setText
(
""
+
scaledMin
[
rawImage
.
getR
()]);
this
.
redMax
.
setText
(
""
+
scaledMax
[
rawImage
.
getR
()]);
this
.
greenComboBox
.
setSelectedIndex
(
rawImage
.
getG
());
this
.
greenMin
.
setText
(
""
+
scaledMin
[
rawImage
.
getG
()]);
this
.
greenMax
.
setText
(
""
+
scaledMax
[
rawImage
.
getG
()]);
this
.
blueComboBox
.
setSelectedIndex
(
rawImage
.
getB
());
this
.
blueMin
.
setText
(
""
+
scaledMin
[
rawImage
.
getB
()]);
this
.
blueMax
.
setText
(
""
+
scaledMax
[
rawImage
.
getB
()]);
this
.
whiteBlackComboBox
.
setSelectedIndex
(
0
);
JPanel
centerPanel
=
new
JPanel
(
new
BorderLayout
());
JPanel
panelColor
=
new
JPanel
(
new
GridLayout
(
3
,
2
));
JPanel
panelColor
=
new
JPanel
(
new
GridLayout
(
3
,
1
));
panelColor
.
setBorder
(
BorderFactory
.
createTitledBorder
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.6"
)));
//$NON-NLS-1$
panelColor
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.7"
),
SwingConstants
.
CENTER
));
//$NON-NLS-1$
panelColor
.
add
(
this
.
rougeComboBoxr
);
panelColor
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.8"
),
SwingConstants
.
CENTER
));
//$NON-NLS-1$
panelColor
.
add
(
this
.
greenComboBox
);
panelColor
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.9"
),
SwingConstants
.
CENTER
));
//$NON-NLS-1$
panelColor
.
add
(
this
.
blueComboBox
);
panelColor
.
add
(
createChannelPanel
(
redComboBox
,
redMin
,
redMax
,
Messages
.
getString
(
"RgbBandChooserInternalFrame.7"
)));
//$NON-NLS-1$
panelColor
.
add
(
createChannelPanel
(
greenComboBox
,
greenMin
,
greenMax
,
Messages
.
getString
(
"RgbBandChooserInternalFrame.8"
)));
//$NON-NLS-1$
panelColor
.
add
(
createChannelPanel
(
blueComboBox
,
blueMin
,
blueMax
,
Messages
.
getString
(
"RgbBandChooserInternalFrame.9"
)));
//$NON-NLS-1$
centerPanel
.
add
(
panelColor
,
BorderLayout
.
NORTH
);
JPanel
panelNG
=
new
JPanel
(
new
GridLayout
(
1
,
2
));
panelNG
.
setBorder
(
BorderFactory
...
...
@@ -99,44 +126,40 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
int
green
;
int
blue
;
// avec la methode .getParent() on parcurir la hierarchie des
// elements graphiques pour ariver a la component
// RgbBandChooserInternalFrame
RgbBandChooserInternalFrame
rgbBandChooserInternalFrame
=
(
RgbBandChooserInternalFrame
)
(((
JButton
)
e
.
getSource
()).
getParent
().
getParent
().
getParent
()
.
getParent
().
getParent
());
if
(!
rgbBandChooserInternalFrame
.
whiteBlackComboBox
if
(!
whiteBlackComboBox
.
getSelectedItem
().
equals
(
""
))
{
//$NON-NLS-1$
red
=
rgbBandChooserInternalFrame
.
whiteBlackComboBox
red
=
whiteBlackComboBox
.
getSelectedIndex
()
-
1
;
green
=
rgbBandChooserInternalFrame
.
whiteBlackComboBox
green
=
whiteBlackComboBox
.
getSelectedIndex
()
-
1
;
blue
=
rgbBandChooserInternalFrame
.
whiteBlackComboBox
blue
=
whiteBlackComboBox
.
getSelectedIndex
()
-
1
;
}
else
{
red
=
rgbBandChooserInternalFrame
.
rougeComboBoxr
.
getSelectedIndex
();
green
=
rgbBandChooserInternalFrame
.
greenComboBox
.
getSelectedIndex
();
blue
=
rgbBandChooserInternalFrame
.
blueComboBox
.
getSelectedIndex
();
red
=
redComboBox
.
getSelectedIndex
();
green
=
greenComboBox
.
getSelectedIndex
();
blue
=
blueComboBox
.
getSelectedIndex
();
}
System
.
out
.
println
(
red
+
" "
+
green
+
" "
+
blue
);
ImageSession
currentImageSession
=
MainFrame
.
getInstance
()
.
getCurrentImageSession
();
currentImageSession
.
getBirdViewPanel
().
setR
(
red
);
currentImageSession
.
getBirdViewPanel
().
setG
(
green
);
currentImageSession
.
getBirdViewPanel
().
setB
(
blue
);
currentImageSession
.
getBirdViewPanel
().
syncImage
();
MainFrame
.
getInstance
().
getCurrentImageSession
().
getBirdViewPanel
()
.
refresh
();
rgbBandChooserInternalFrame
.
setVisible
(
false
);
MainFrame
.
getInstance
().
getDesktop
()
.
setSelectedFrame
(
currentImageSession
.
associatedFrame
);
scaledMin
[
red
]
=
Double
.
parseDouble
(
redMin
.
getText
());
scaledMax
[
red
]
=
Double
.
parseDouble
(
redMax
.
getText
());
scaledMin
[
green
]
=
Double
.
parseDouble
(
greenMin
.
getText
());
scaledMax
[
green
]
=
Double
.
parseDouble
(
greenMax
.
getText
());
scaledMin
[
blue
]
=
Double
.
parseDouble
(
blueMin
.
getText
());
scaledMax
[
blue
]
=
Double
.
parseDouble
(
blueMax
.
getText
());
rawImage
.
setR
(
red
);
rawImage
.
setG
(
green
);
rawImage
.
setB
(
blue
);
rawImage
.
setScaledMinValues
(
scaledMin
);
rawImage
.
setScaledMaxValues
(
scaledMax
);
rawImage
.
notifyObservers
();
RgbBandChooserInternalFrame
.
this
.
setVisible
(
false
);
MainFrame
.
getInstance
().
getDesktop
().
setSelectedFrame
(
MainFrame
.
getInstance
().
getCurrentImageSession
().
associatedFrame
);
}
});
...
...
@@ -181,7 +204,7 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
}
});*/
this
.
setSize
(
180
,
195
);
this
.
setSize
(
400
,
500
);
this
.
setResizable
(
false
);
this
.
setMaximizable
(
true
);
this
.
setIconifiable
(
true
);
...
...
@@ -189,5 +212,24 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
this
.
setLocation
(
90
,
90
);
this
.
setVisible
(
true
);
}
private
JPanel
createChannelPanel
(
JComboBox
<
String
>
cb
,
JTextArea
taMin
,
JTextArea
taMax
,
String
title
)
{
JPanel
result
=
new
JPanel
(
new
GridLayout
(
2
,
2
));
result
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.22"
)));
result
.
add
(
cb
);
JPanel
minPanel
=
new
JPanel
(
new
GridLayout
(
1
,
2
));
minPanel
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.20"
)));
minPanel
.
add
(
taMin
);
result
.
add
(
minPanel
);
JPanel
maxPanel
=
new
JPanel
(
new
GridLayout
(
1
,
2
));
maxPanel
.
add
(
new
JLabel
(
Messages
.
getString
(
"RgbBandChooserInternalFrame.21"
)));
maxPanel
.
add
(
taMax
);
result
.
add
(
maxPanel
);
result
.
setBorder
(
BorderFactory
.
createTitledBorder
(
title
));
return
result
;
}
}
src/mustic/gui/dialog/classifier/ConstraintsSelectionDialog.java
View file @
704cea5d
...
...
@@ -572,7 +572,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame implements mustic
return true;
}
private
void
addConstraint
(
List
<
String
>
line
,
boolean
isImageRelated
)
{
void addConstraint(List<String> line, boolean isImageRelated) {
switch (Integer.parseInt(line.get(line.size() - 1))) {
case Constraint.MUST_LINK_TYPE:
try {
...
...
src/mustic/gui/dialog/messages_en.properties
View file @
704cea5d
...
...
@@ -245,14 +245,14 @@ RgbBandChooserInternalFrame.12=Ok
RgbBandChooserInternalFrame.15
=
To delete some channels look at
RgbBandChooserInternalFrame.16
=
"Clustering"
menu or
RgbBandChooserInternalFrame.17
=
"Crop"
menu.
RgbBandChooserInternalFrame.2
=
channel
RgbBandChooserInternalFrame.3
=
channel
RgbBandChooserInternalFrame.4
=
channel
RgbBandChooserInternalFrame.5
=
channel
RgbBandChooserInternalFrame.2
=
Channel
RgbBandChooserInternalFrame.6
=
Color display
RgbBandChooserInternalFrame.7
=
R
RgbBandChooserInternalFrame.8
=
G
RgbBandChooserInternalFrame.9
=
B
RgbBandChooserInternalFrame.20
=
Min
RgbBandChooserInternalFrame.21
=
Max
RgbBandChooserInternalFrame.22
=
Channel index :
SegmentationDialog.0
=
Browse
SegmentationDialog.1
=
<html>Apply the algorithm of Region Merging.</html>
SegmentationDialog.14
=
Segmentation
\:
...
...
src/mustic/gui/dialog/messages_fr.properties
View file @
704cea5d
...
...
@@ -210,13 +210,13 @@ RgbBandChooserInternalFrame.15=Pour supprimer des bandes voir le
RgbBandChooserInternalFrame.16
=
menu "Clustering" ou le menu
RgbBandChooserInternalFrame.17
=
"Crop".
RgbBandChooserInternalFrame.2
=
bande
RgbBandChooserInternalFrame.3
=
bande
RgbBandChooserInternalFrame.4
=
bande
RgbBandChooserInternalFrame.5
=
bande
RgbBandChooserInternalFrame.6
=
Coleur d'affichage
RgbBandChooserInternalFrame.7
=
R
RgbBandChooserInternalFrame.8
=
G
RgbBandChooserInternalFrame.9
=
B
RgbBandChooserInternalFrame.20
=
Min
RgbBandChooserInternalFrame.21
=
Max
RgbBandChooserInternalFrame.22
=
Index de bande :
SegmentationDialog.0
=
Parcourir...
SegmentationDialog.1
=
<html>Appliquez l'algorithme de Fusion de Rgion.</html>
SegmentationDialog.14
=
Segmentation
\:
...
...
src/mustic/gui/panels/BirdViewPanel.java
View file @
704cea5d
...
...
@@ -171,6 +171,11 @@ public class BirdViewPanel extends JPanel implements MouseListener,
}
/** Get the red value */
public
int
getR
()
{
return
this
.
r
;
}
/** Get the blue value */
public
int
getB
()
{
return
this
.
b
;
...
...
@@ -189,11 +194,6 @@ public class BirdViewPanel extends JPanel implements MouseListener,
return
this
.
mImage
.
getNbBands
();
}
/** Get the red value */
public
int
getR
()
{
return
this
.
r
;
}
public
BufferedImage
getSaveImage
()
{
return
this
.
bImage
;
}
...
...
src/mustic/gui/panels/ImagePanel.java
View file @
704cea5d
...
...
@@ -3,6 +3,8 @@ package mustic.gui.panels;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.awt.image.*
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.Vector
;