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
76bfd602
Commit
76bfd602
authored
Mar 05, 2018
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch to gdal to compute overviews
parent
5dd8aa60
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
498 additions
and
174 deletions
+498
-174
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+15
-16
src/mustic/gui/dialog/classifier/ConstraintsSelectionFrame.java
...stic/gui/dialog/classifier/ConstraintsSelectionFrame.java
+56
-9
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+22
-0
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+12
-8
src/mustic/gui/panels/ImageResultPanel.java
src/mustic/gui/panels/ImageResultPanel.java
+59
-59
src/mustic/gui/panels/classifier/ClassifierPanel.java
src/mustic/gui/panels/classifier/ClassifierPanel.java
+9
-8
src/mustic/gui/panels/classifier/components/ApproachSelectionPanel.java
.../panels/classifier/components/ApproachSelectionPanel.java
+14
-23
src/mustic/gui/panels/data/DataPanel.java
src/mustic/gui/panels/data/DataPanel.java
+7
-4
src/mustic/models/gui/panels/ClassConfigPanel.java
src/mustic/models/gui/panels/ClassConfigPanel.java
+49
-7
src/mustic/models/gui/panels/ClassifierPanel.java
src/mustic/models/gui/panels/ClassifierPanel.java
+13
-12
src/mustic/models/gui/panels/HybridClassificationMonitor.java
...mustic/models/gui/panels/HybridClassificationMonitor.java
+3
-2
src/mustic/models/gui/panels/ResultPanel.java
src/mustic/models/gui/panels/ResultPanel.java
+52
-6
src/mustic/models/thread/ClassificationThread.java
src/mustic/models/thread/ClassificationThread.java
+21
-2
src/mustic/utils/image/reader/GDALImageReaderWrapper.java
src/mustic/utils/image/reader/GDALImageReaderWrapper.java
+93
-7
src/mustic/utils/image/viewer/GDALPyramidImageViewer.java
src/mustic/utils/image/viewer/GDALPyramidImageViewer.java
+66
-0
src/mustic/utils/image/viewer/PyramidImageViewer.java
src/mustic/utils/image/viewer/PyramidImageViewer.java
+7
-10
src/mustic/utils/jclAdapters/ImageSampler.java
src/mustic/utils/jclAdapters/ImageSampler.java
+0
-1
No files found.
src/mustic/gui/MainFrame.java
View file @
76bfd602
...
...
@@ -744,7 +744,7 @@ public class MainFrame extends JFrame {
customClassify();
}
});
//
CSVMenu.add(customToDelete);
//
CSVMenu.add(customToDelete);
// menuItemResultToCSV = new JMenuItem(Messages.getString("MainFrame.305")); //$NON-NLS-1$
// menuItemResultToCSV.addActionListener(new ActionListener() {
...
...
@@ -2369,7 +2369,7 @@ public class MainFrame extends JFrame {
protected void createConstraints() {
try {
ConstraintsSelectionFrame frame = new ConstraintsSelectionFrame(
this.currentImageSession.getImageDisplayer(), null);
this.currentImageSession.getImageDisplayer(), null
, null
);
frame.setVisible(true);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, Messages.getString("MainFrame.128"),
...
...
@@ -3801,8 +3801,8 @@ public class MainFrame extends JFrame {
private void customClassify() {
HybridClassification classification = new HybridClassification();
String datasetName = "
Sud
";
String datasetPath = "
Sud
";
String datasetName = "
FacesUCR
";
String datasetPath = "
FacesUCR
";
String dataPath = "/home/baptiste/A2CNES/";
String resultPath = "/home/baptiste/A2CNES/results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/";
...
...
@@ -3815,11 +3815,11 @@ public class MainFrame extends JFrame {
AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.DTW_BARYCENTRE);
DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDataDesktopFrames();
DataSession testSession = desktopFrames[desktopFrames.length-
1
].getDataSession();
DataSession testSession = desktopFrames[desktopFrames.length-
2
].getDataSession();
final DateTime startTime = DateTime.now();
int nInf = 12;
int nSup = 1
4
;
int nSup = 1
7
;
// parametre pour la precision des conflits
double minC = 0.9;
...
...
@@ -3828,7 +3828,7 @@ public class MainFrame extends JFrame {
double pcr = 0.2;
// parametre qualite/similitude
double ps = 0.
3
;
double ps = 0.
2
;
double pq = 1.0 - ps;
double constraintsWgt = 80;
double valueKExtern = 60;
...
...
@@ -3845,7 +3845,7 @@ public class MainFrame extends JFrame {
classification.setAdvancedParameters(degradation, classRatio, solutionType, kIntern,
kExtern, unificationType, criterion, constraintsWgt);
ClassificationWeights weights = new GlobalWeights(dataT
est
);
ClassificationWeights weights = new GlobalWeights(dataT
rain
);
final Vector<Thread> threadList = new Vector<Thread>();
final Vector<Classification> classifList = new Vector<Classification>();
...
...
@@ -3910,7 +3910,7 @@ public class MainFrame extends JFrame {
// }
// <<<< CONSTRAINTS
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(
Paths.get(dataPath+datasetName+"/t
est/"), "*.05_*
")) {
Paths.get(dataPath+datasetName+"/t
rain/"), "*1_10.constraints
")) {
Iterator<Path> iter = dirStream.iterator();
while(iter.hasNext()) {
Vector<Constraint> constraints = new Vector<Constraint>();
...
...
@@ -3951,15 +3951,14 @@ public class MainFrame extends JFrame {
Data currentData = (Data) dataTest.clone();
currentData.updateAndSetConstraintsToSample(constraints);
classif.addAgent(new ParametersKmeans(13, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(16, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(19, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(12, 20, weights), currentData);
classif.addAgent(new ParametersKmeans(16, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(20, 15, weights), currentData);
classif.addAgent(new ParametersKmeans(24, 15, weights), currentData);
classif.setName(resultPath+datasetName+"/"+
ImageHelper.stripExtension(filename)+"-"+i+
".clustering");
classif.setData(
dataTest
);
classif.setData(
currentData
);
Thread t = null;
...
...
@@ -3969,7 +3968,7 @@ public class MainFrame extends JFrame {
t = new ClassificationThread(classif, classificationImage.getProgressBar(),
classificationImage, null);
classificationImage, null
, false, null
);
t.start();
try {
testSession.associatedFrame.setMaximum(true);
...
...
@@ -4041,7 +4040,7 @@ public class MainFrame extends JFrame {
if (mask != null) {
maskLine = maskReader.readNext();
}
extractObjectFromLine(result, line,
3
, maskLine);
extractObjectFromLine(result, line,
1
, maskLine);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
...
...
src/mustic/gui/dialog/classifier/ConstraintsSelectionFrame.java
View file @
76bfd602
...
...
@@ -19,6 +19,8 @@ import java.awt.event.KeyEvent;
import
java.awt.event.KeyListener
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.awt.event.WindowEvent
;
import
java.awt.event.WindowListener
;
import
java.awt.image.BufferedImage
;
import
java.io.File
;
import
java.io.FileReader
;
...
...
@@ -75,7 +77,7 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
private
double
minDistance
=
0
;
private
double
maxDistance
=
100
;
private
Data
data
=
null
;
private
Vector
<
Constraint
>
constraintsContainer
=
null
;
/** Panel that contains the displayed image */
...
...
@@ -147,14 +149,18 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
* constraints
*
* @param img
*
the image on which the constraints have to be build
*
the image on which the constraints have to be build
* @param data
* (optional) the data related to the constraints
(optional) the data related to the constraints
* @param constraintsContainer
* vector that contain the constraints to view and the new one
*/
public
ConstraintsSelectionFrame
(
ImageDisplayer
imgDisplayer
,
Data
data
)
{
public
ConstraintsSelectionFrame
(
ImageDisplayer
imgDisplayer
,
Data
data
,
Vector
<
Constraint
>
constraintsContainer
)
{
super
();
mainPanel
=
new
JPanel
(
new
BorderLayout
());
this
.
imageDisplayer
=
imgDisplayer
;
this
.
constraintsContainer
=
constraintsContainer
;
if
(
data
!=
null
)
{
// case of Data provided
...
...
@@ -184,6 +190,9 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
public
void
actionPerformed
(
ActionEvent
e
)
{
if
(
ConstraintsSelectionFrame
.
this
.
data
!=
null
)
{
ConstraintsSelectionFrame
.
this
.
data
.
updateAndSetConstraintsToSample
(
getConstraints
());
updateConstraintsContainer
(
ConstraintsSelectionFrame
.
this
.
data
.
getConstraints
());
}
else
{
updateConstraintsContainer
(
getConstraints
());
}
ConstraintsSelectionFrame
.
this
.
dispose
();
}
...
...
@@ -271,10 +280,37 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
// mainPanel.add(jpane, BorderLayout.CENTER);
mainPanel
.
add
(
panelButton
,
BorderLayout
.
SOUTH
);
if
(
data
!=
null
&&
data
.
getConstraints
()
!=
null
)
{
setConstraints
(
data
.
getConstraints
()
,
false
);
if
(
constraintsContainer
!=
null
)
{
setConstraints
(
constraintsContainer
,
false
);
}
this
.
addWindowListener
(
new
WindowListener
()
{
@Override
public
void
windowOpened
(
WindowEvent
e
)
{
}
@Override
public
void
windowIconified
(
WindowEvent
e
)
{
}
@Override
public
void
windowDeiconified
(
WindowEvent
e
)
{
}
@Override
public
void
windowDeactivated
(
WindowEvent
e
)
{
}
@Override
public
void
windowClosing
(
WindowEvent
e
)
{
}
@Override
public
void
windowClosed
(
WindowEvent
e
)
{
imageDisplayer
.
unsubscribeTo
(
ConstraintsSelectionFrame
.
this
);
imageDisplayer
.
refresh
(
true
);
}
@Override
public
void
windowActivated
(
WindowEvent
e
)
{
}
});
this
.
setAlwaysOnTop
(
true
);
this
.
setContentPane
(
mainPanel
);
this
.
setTitle
(
Messages
.
getString
(
"ConstraintsSelectionDialog.8"
));
//$NON-NLS-1$
this
.
setSize
(
420
,
650
);
...
...
@@ -283,6 +319,19 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
}
/**
* Transfer a set of constraints to the constraints container
* @param constraints
* the constraints to transfer
*/
private
void
updateConstraintsContainer
(
Vector
<
Constraint
>
constraints
)
{
this
.
constraintsContainer
.
removeAllElements
();
for
(
Constraint
c
:
constraints
)
{
this
.
constraintsContainer
.
add
(
c
);
}
}
private
void
addListeners
()
{
this
.
imageDisplayer
.
getDisplayPanel
().
addMouseListener
(
new
MouseAdapter
()
{
@Override
...
...
@@ -717,8 +766,6 @@ public class ConstraintsSelectionFrame extends JFrame implements ImageAddOn {
@Override
public
void
pointClicked
(
Point
pView
,
Point
pReal
,
int
clickType
)
{
// TODO Auto-generated method stub
}
protected
void
addSecondPixel
(
int
x
,
int
y
)
{
...
...
src/mustic/gui/panels/BirdViewPanel.java
View file @
76bfd602
...
...
@@ -635,6 +635,28 @@ public class BirdViewPanel extends JPanel implements MouseListener,
}
}
}
/**
* Synchronize the other birdviews with the current one if
* LinkTOAllBirdView option is selected
*/
public
void
synchOtherBirdViews
()
{
if
(
session
instanceof
ImageSession
)
{
if
(
MainFrame
.
getInstance
().
isLinkToAllBirdView
())
{
ImageDesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
.
getAllImageDesktopFrames
();
int
nbSessions
=
desktopFrames
.
length
;
for
(
int
i
=
0
;
i
<
nbSessions
;
i
++)
{
if
(
desktopFrames
[
i
].
getImageSession
()
!=
session
)
{
syncImage
(
desktopFrames
[
i
].
getImageSession
());
}
}
}
}
}
@Override
public
void
paint
(
Graphics
g
)
{
...
...
src/mustic/gui/panels/ImagePanel.java
View file @
76bfd602
...
...
@@ -23,8 +23,8 @@ import mustic.utils.image.ImageManager;
import
mustic.utils.image.ZoomBoxPanel
;
import
mustic.utils.image.Zoomable
;
import
mustic.utils.image.viewer.BufferedImageViewer
;
import
mustic.utils.image.viewer.GDALPyramidImageViewer
;
import
mustic.utils.image.viewer.ImageViewer
;
import
mustic.utils.image.viewer.PyramidImageViewer
;
/**
* Display an image and allows the user to do some operations on it (zoom, contrast..)
...
...
@@ -145,7 +145,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
rawImage
.
addObserver
(
this
);
if
(
session
.
isDisplayEnable
())
{
this
.
viewer
=
new
PyramidImageViewer
(
aImage
,
true
);
this
.
viewer
=
new
GDAL
PyramidImageViewer
(
aImage
,
true
);
}
this
.
session
=
session
;
// this.mImageLabel = new JLabel();
...
...
@@ -215,6 +215,9 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
@Override
public
void
mouseReleased
(
MouseEvent
e
)
{
// move the image when dragg&drop
if
(
mousePressedCoordinates
==
null
)
return
;
int
translateX
=
(
int
)
((
mousePressedCoordinates
.
x
-
e
.
getX
())/
mZoomRate
);
int
translateY
=
(
int
)
((
mousePressedCoordinates
.
y
-
e
.
getY
())/
mZoomRate
);
currentTopLeft
.
x
+=
translateX
;
...
...
@@ -235,6 +238,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
viewer
.
getScreenImage
(
currentTopLeft
.
x
,
currentTopLeft
.
y
,
displayPanel
.
getWidth
(),
displayPanel
.
getHeight
(),
mZoomRate
,
true
);
updateImageView
();
session
.
getBirdViewPanel
().
synchOtherBirdViews
();
mousePressedCoordinates
=
null
;
displayPanel
.
setAddedOffset
(
null
);
...
...
@@ -381,7 +385,7 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
ConstraintsSelectionFrame
frame
=
new
ConstraintsSelectionFrame
(
ImagePanel
.
this
,
null
);
ImagePanel
.
this
,
null
,
null
);
subscribeTo
(
frame
);
}
});
...
...
@@ -554,11 +558,11 @@ public class ImagePanel extends JPanel implements Zoomable, Observer, ImageDispl
ImagePanel
.
drawingTransparency
=
nT
;
}
private
void
applyMask
()
{
Mask
mask
=
MainFrame
.
getInstance
().
getCurrentImageSession
().
getRawImage
().
getMask
();
// this.mImage.getMask();
if
(
mask
!=
null
)
applyMask
(
mask
);
}
//
private void applyMask() {
//
Mask mask = MainFrame.getInstance().getCurrentImageSession().getRawImage().getMask();// this.mImage.getMask();
//
if (mask != null)
//
applyMask(mask);
//
}
public
void
applyMask
(
Mask
mask
)
{
viewer
.
addMask
(
mask
);
...
...
src/mustic/gui/panels/ImageResultPanel.java
View file @
76bfd602
...
...
@@ -45,14 +45,13 @@ import mustic.utils.filters.*;
import
mustic.utils.image.BufferedImageHelper
;
import
mustic.utils.image.ImageAddOn
;
import
mustic.utils.image.ImageDisplayer
;
import
mustic.utils.image.ImageHelper
;
import
mustic.utils.image.ImageManager
;
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.image.viewer.PyramidImageViewer
;
import
mustic.utils.io.tiff.TiffUtils
;
import
org.apache.batik.svggen.SVGGraphics2DIOException
;
...
...
@@ -67,11 +66,17 @@ import org.apache.batik.svggen.SVGGraphics2DIOException;
public
class
ImageResultPanel
extends
ResultPanel
implements
TreeSelectionListener
,
ImageDisplayer
,
Observer
,
Zoomable
{
/** serialVersionUID */
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
float
brightnessValue
=
30
;
private
float
brightnessValue
=
30
;
private
MultiResolutionClusterMap
clusterMap
=
null
;
protected
File
currentDirectory
=
null
;
protected
File
currentDirectory
=
null
;
/** Coordinates of the current position of the top left corner
* of the screen image in the original image */
private
Point
currentTopLeft
=
new
Point
(
0
,
0
);
/** l'image contenant les donnees d'origine */
private
BufferedImage
data
;
...
...
@@ -79,85 +84,80 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
/** l'image contenant les donnees d'origine */
protected
BufferedImage
data_zoomed
;
private
ImageData
imgData
;
/** panel that displays the image */
protected
ZoomBoxPanel
displayPanel
=
null
;
/** the list of add on that the displayer has subscribed to */
private
Vector
<
ImageAddOn
>
imageAddOns
=
new
Vector
<
ImageAddOn
>();
protected
JInternalFrame
jif_saveResult
=
new
JInternalFrame
();
/** the parent session */
private
ImageManager
imageManager
=
null
;
pr
otected
JLayeredPane
lpane
=
new
JLayeredPane
()
;
pr
ivate
ImageData
imgData
;
protected
int
[]
map
=
null
;
protected
JInternalFrame
jif_saveResult
=
new
JInternalFrame
();
protected
JLayeredPane
lpane
=
new
JLayeredPane
();
/** width of the screen image */
private
int
lastWidth
=
0
;
/** height of the screen image */
private
int
lastHeight
=
0
;
protected
int
[]
map
=
null
;
/** classification */
// protected Classification classification;
/** image initiale */
/** record the position of the mouse when it has been pressed */
private
Point
mousePressedCoordinates
=
null
;
// protected RawImage mRawImage;
/** zoom level */
protected
double
mZoomRate
=
1.0f
;
protected
double
mZoomRate
=
1.0f
;
/** zoom step */
private
double
mZoomStep
=
0.7f
;
private
double
mZoomStep
=
0.7f
;
/** Coordinates of the current position of the top left corner
* of the screen image in the original image */
private
Point
currentTopLeft
=
new
Point
(
0
,
0
);
/** width of the screen image */
private
int
lastWidth
=
0
;
/** height of the screen image */
private
int
lastHeight
=
0
;
// clusters' opacity
// up to 0 - 1
private
float
opacity
=
1
;
/** offset between the panel and the actual displayed image */
private
Point
screenOffset
=
new
Point
(
0
,
0
);
private
float
opacityCluster
=
1
;
/** */
protected
JPanel
panelImage
=
new
JPanel
(
new
BorderLayout
());
protected
JPanel
panelImage
=
new
JPanel
(
new
BorderLayout
());
protected
JPanel
panelResSave
=
new
JPanel
();
protected
JPanel
panelResSave
=
new
JPanel
();
/** offset between the panel and the actual displayed image */
private
Point
screenOffset
=
new
Point
(
0
,
0
);
protected
ClusteringResult
result
;
protected
boolean
[]
resultSave
=
null
;
protected
boolean
[]
resultSave
=
null
;
private
ROIImage
roi
=
null
;
private
ROIImage
roi
=
null
;
protected
int
rx
=
0
;
protected
int
rx
=
0
;
protected
int
ry
=
0
;
protected
int
ry
=
0
;
private
float
scaleFactor
=
1.0f
;
private
float
scaleFactor
=
1.0f
;
/** */
protected
JToolBar
tools
=
new
JToolBar
();
protected
JButton
vectorise
=
new
JButton
(
"Segmentation"
);
/** */
protected
BufferedImage
zoomed
;
/** the parent session */
private
ImageManager
imageManager
=
null
;
protected
JToolBar
tools
=
new
JToolBar
();
/** panel that displays the image */
protected
ZoomBoxPanel
displayPanel
=
null
;
protected
JButton
vectorise
=
new
JButton
(
"Segmentation"
);
/** the viewer that allows to reader the image */
private
ImageViewer
viewer
=
null
;
private
MultiResolutionClusterMap
clusterMap
=
null
;
/** record the position of the mouse when it has been pressed */
private
Point
mousePressedCoordinates
=
null
;
private
ImageViewer
viewer
=
null
;
// clusters' opacity
// up to 0 - 1
private
float
opacity
=
1
;
private
float
opacityCluster
=
1
;
/** the list of add on that the displayer has subscribed to */
private
Vector
<
ImageAddOn
>
imageAddOns
=
new
Vector
<
ImageAddOn
>();
/** */
protected
BufferedImage
zoomed
;
/**
*
...
...
@@ -205,7 +205,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
if
(
imgData
.
getRawImages
()
!=
null
&&
imgData
.
getRawImages
().
size
()
>
0
)
{
this
.
viewer
=
new
ClusteringImageViewer
(
new
PyramidImageViewer
(
this
.
viewer
=
new
ClusteringImageViewer
(
new
GDAL
PyramidImageViewer
(
imgData
.
getRawImages
().
get
(
0
),
true
),
this
.
clusterMap
);
// we can't add directly the birdView because it needs the ImageManager
// to be initialize, this might be rethink because it will happen every time
...
...
@@ -335,8 +335,8 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
}
// else
// {
int
x
=
ev
.
getX
()
-
((
ImageResultPanel
.
this
.
displayPanel
.
getWidth
()
)
/
2
);
int
y
=
ev
.
getY
()
-
((
ImageResultPanel
.
this
.
displayPanel
.
getHeight
()
)
/
2
);
//
int x = ev.getX() - ((ImageResultPanel.this.displayPanel.getWidth() ) / 2);
//
int y = ev.getY() - ((ImageResultPanel.this.displayPanel.getHeight() ) / 2);
// if (x >= 0 && x < ImageResultPanel.this.zoomed.getWidth() && y >= 0 && y < ImageResultPanel.this.zoomed.getHeight()) {
// int coul = ImageResultPanel.this.zoomed.getRGB(x, y);
...
...
@@ -514,7 +514,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
ConstraintsSelectionFrame
frame
=
new
ConstraintsSelectionFrame
(
ImageResultPanel
.
this
,
null
);
ImageResultPanel
.
this
,
imgData
,
constraintsToUse
);
subscribeTo
(
frame
);
}
});
...
...
@@ -1064,7 +1064,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
.
tabbedPane
.
getTabAt
(
i
).
getContentComponent
();
}
else
{
HybridClassificationMonitor
hcm
=
(
HybridClassificationMonitor
)
this
.
classFrame
.
tabbedPane
.
getTabAt
(
0
).
getContentComponent
();
if
(
i
<
hcm
.
tabbedPane
.
getTabCount
()-
1
)
{
if
(
i
<
=
hcm
.
tabbedPane
.
getTabCount
()-
1
)
{
imgPanel
=
(
ImageResultPanel
)
hcm
.
tabbedPane
.
getTabAt
(
i
).
getContentComponent
();
}
else
{
imgPanel
=
(
ImageResultPanel
)
this
.
classFrame
...
...
src/mustic/gui/panels/classifier/ClassifierPanel.java
View file @
76bfd602
...
...
@@ -696,7 +696,8 @@ public class ClassifierPanel extends JPanel {
classification
.
setTimeExec
(
1
);
}
new
ClassificationThread
(
classification
,
classificationImage
.
getProgressBar
(),
classificationImage
,
this
.
rmiServer
).
start
();
new
ClassificationThread
(
classification
,
classificationImage
.
getProgressBar
(),
classificationImage
,
this
.
rmiServer
,
false
,
null
).
start
();
try
{
dataSession
.
associatedFrame
.
setMaximum
(
true
);
}
catch
(
PropertyVetoException
e1
)
{}
...
...
@@ -716,7 +717,7 @@ public class ClassifierPanel extends JPanel {
// On lance le thread de classif
new
ClassificationThread
(
classification
,
((
ClassificationModel
)
this
.
container_
).
getProgressBar
(),
(
ClassificationModel
)
this
.
container_
,
this
.
rmiServer
).
start
();
(
ClassificationModel
)
this
.
container_
,
this
.
rmiServer
,
false
,
null
).
start
();
}
...
...
@@ -1647,7 +1648,7 @@ public class ClassifierPanel extends JPanel {
this
.
votingDataComboBox
.
setEnabled
(
false
);
this
.
infosLabel
.
setText
(
"<html>"
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
SAMARAH
,
false
)
+
"</html>"
);
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
SAMARAH
)
+
"</html>"
);
//$NON-NLS-1$
updateUI
();
}
...
...
@@ -1666,7 +1667,7 @@ public class ClassifierPanel extends JPanel {
this
.
votingDataComboBox
.
setEnabled
(
false
);
this
.
infosLabel
.
setText
(
"<html>"
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
MACLAW
,
false
)
+
"</html>"
);
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
MACLAW
)
+
"</html>"
);
//$NON-NLS-1$
updateUI
();
}
...
...
@@ -1682,7 +1683,7 @@ public class ClassifierPanel extends JPanel {
this
.
votingDataComboBox
.
setEnabled
(
false
);
this
.
infosLabel
.
setText
(
"<html>"
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
SAMARAHV4
,
false
)
+
"</html>"
);
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
SAMARAHV4
)
+
"</html>"
);
//$NON-NLS-1$
updateUI
();
}
...
...
@@ -1892,7 +1893,7 @@ public class ClassifierPanel extends JPanel {
* @param m indice de la methode a afficher
*/
public
void
updateParams
(
final
int
m
,
final
boolean
isImport
)
{
String
[]
method
=
this
.
approachPanel
.
getMethodNames
(
isImport
)[
m
]
;
String
[]
method
=
ClassifierUtils
.
METHODS
.
get
(
new
Integer
(
m
))
;
this
.
paramsPanel
.
removeAll
();
this
.
paramsPanel
.
setLayout
(
this
.
paramsGridLayout
);
this
.
paramsGridLayout
.
setRows
(
method
.
length
/
2
);
...
...
@@ -2003,7 +2004,7 @@ public class ClassifierPanel extends JPanel {
}
this
.
paramsPanel
.
updateUI
();
this
.
infosLabel
.
setText
(
"<html>"
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
m
,
isImport
)
+
"</html>"
);
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
m
)
+
"</html>"
);
//$NON-NLS-1$
this
.
advParamsPanel
.
removeAll
();
this
.
advParamsPanel
.
add
(
this
.
noAdvParamsLabel
);
...
...
@@ -2076,7 +2077,7 @@ public class ClassifierPanel extends JPanel {
// this.infosLabel.setText("Voting infos");
this
.
infosLabel
.
setText
(
"<html>"
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
VOTING
,
false
)
+
"</html>"
);
//$NON-NLS-1$
+
ClassifierUtils
.
getMethodDescription
(
ClassifierUtils
.
VOTING
)
+
"</html>"
);
//$NON-NLS-1$
this
.
advParamsPanel
.
removeAll
();
this
.
advParamsPanel
.
add
(
this
.
noAdvParamsLabel
);
...
...
src/mustic/gui/panels/classifier/components/ApproachSelectionPanel.java
View file @
76bfd602
...
...
@@ -391,12 +391,11 @@ public class ApproachSelectionPanel extends JPanel {
private
void
buildMethodList
()
{
String
[][]
methods
=
ClassifierUtils
.
METHODS
;
/* On recupere la liste des methodes */
String
[]
classifiers
=
new
String
[
methods
.
length
];
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
classifiers
[
i
]
=
methods
[
i
][
0
]
;
String
[]
classifiers
=
new
String
[
ClassifierUtils
.
ORDERED_IDs_SINGLE
.
size
()
];
for
(
int
i
=
0
;
i
<
ClassifierUtils
.
ORDERED_IDs_SINGLE
.
size
()
;
i
++)
{
classifiers
[
i
]
=
ClassifierUtils
.
getMethodName
(
ClassifierUtils
.
ORDERED_IDs_SINGLE
.
get
(
i
))
;
}
// single panel pour les single classifier : radio + combo
...
...
@@ -406,8 +405,8 @@ public class ApproachSelectionPanel extends JPanel {
this
.
methodComboBox
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
modele
.
setSelectedMethod
(
ClassifierUtils
.
correspondanceIndiceId
[
ApproachSelectionPanel
.
this
.
methodComboBox
.
getSelectedIndex
()
]
);