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
dd622006
Commit
dd622006
authored
Apr 13, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update arff import to data to integrate as ImageData
parent
6b29f503
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
474 additions
and
143 deletions
+474
-143
lib/slf4j-nop-1.6.4.jar
lib/slf4j-nop-1.6.4.jar
+0
-0
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+2
-2
src/mustic/gui/dialog/ArffToDataDialog.java
src/mustic/gui/dialog/ArffToDataDialog.java
+137
-19
src/mustic/gui/dialog/DataToArffDialog.java
src/mustic/gui/dialog/DataToArffDialog.java
+3
-1
src/mustic/gui/dialog/SequenceDialog.java
src/mustic/gui/dialog/SequenceDialog.java
+70
-53
src/mustic/gui/dialog/classifier/AgentDialog.java
src/mustic/gui/dialog/classifier/AgentDialog.java
+0
-4
src/mustic/gui/dialog/messages_en.properties
src/mustic/gui/dialog/messages_en.properties
+10
-1
src/mustic/gui/dialog/messages_fr.properties
src/mustic/gui/dialog/messages_fr.properties
+10
-1
src/mustic/gui/messages_en.properties
src/mustic/gui/messages_en.properties
+1
-1
src/mustic/gui/panels/classifier/ClassifierPanel.java
src/mustic/gui/panels/classifier/ClassifierPanel.java
+21
-1
src/mustic/gui/panels/classifier/SelectionModel.java
src/mustic/gui/panels/classifier/SelectionModel.java
+17
-24
src/mustic/gui/panels/classifier/components/ApproachSelectionPanel.java
.../panels/classifier/components/ApproachSelectionPanel.java
+46
-23
src/mustic/gui/panels/data/DataConstructPanel.java
src/mustic/gui/panels/data/DataConstructPanel.java
+8
-1
src/mustic/io/ImageData.java
src/mustic/io/ImageData.java
+1
-1
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+1
-2
src/mustic/utils/io/dataExchange/DataArffExchange.java
src/mustic/utils/io/dataExchange/DataArffExchange.java
+147
-9
No files found.
lib/slf4j-nop-1.6.4.jar
0 → 100644
View file @
dd622006
File added
src/mustic/gui/MainFrame.java
View file @
dd622006
...
...
@@ -159,7 +159,7 @@ public class MainFrame extends JFrame {
*/
public MainFrame() {
super();
this.setTitle("Mu
stic 6
"); //$NON-NLS-1$
this.setTitle("Mu
ltiCube 0.8
"); //$NON-NLS-1$
this.setIconImage(new ImageIcon(this.getClass().getResource("/icons/musticFond.png")).getImage());
this.setSize(1040, 768);
this.setLocationRelativeTo(null);
...
...
@@ -2367,7 +2367,7 @@ public class MainFrame extends JFrame {
jif.setLocation(100, 100);
JPanel pane = new JPanel();
pane.setBorder(BorderFactory.createLineBorder(Color.gray));
JLabel labelText = new JLabel("<html><h2><center>Mu
stic 6 - Mai 2015
</center></h2>" //$NON-NLS-1$
JLabel labelText = new JLabel("<html><h2><center>Mu
ltiCube 0.8 - Avril 2017
</center></h2>" //$NON-NLS-1$
+ "<p><center>(avec OTB-Wrapping)</center></p><br>" //$NON-NLS-1$
+ Messages.getString("MainFrame.135") //$NON-NLS-1$
+ Messages.getString("MainFrame.136") //$NON-NLS-1$
...
...
src/mustic/gui/dialog/ArffToDataDialog.java
View file @
dd622006
package
mustic.gui.dialog
;
import
java.awt.BorderLayout
;
import
java.awt.Dialog
;
import
java.awt.Dimension
;
import
java.awt.GridLayout
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.image.BufferedImage
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.awt.event.FocusEvent
;
import
java.awt.event.FocusListener
;
import
java.util.List
;
import
java.util.Vector
;
import
javax.imageio.ImageIO
;
import
javax.swing.JButton
;
import
javax.swing.JFileChooser
;
import
javax.swing.JInternalFrame
;
...
...
@@ -23,21 +22,30 @@ import javax.swing.JTextField;
import
jcl.data.Data
;
import
jcl.data.DataObject
;
import
jcl.data.SimpleData
;
import
jcl.data.attribute.AttributeMultiDimSequence
;
import
jcl.data.sampling.ImportedImageSampler
;
import
mustic.gui.MainFrame
;
import
mustic.io.ImageData
;
import
mustic.io.RawImage
;
import
mustic.utils.documentFilter.ToUpdateObject
;
import
mustic.utils.io.dataExchange.DataArffExchange
;
//import mustic.io.geotiff.GEOTiffImage;
/**
*
Fenetre permettant de creer une image a partir d'un fichier .arff
*
Dialog that allow the user to generate a Data from an arff file
*
* @author Baptiste LAFABREGUE
*
*/
public
class
ArffToDataDialog
extends
JInternalFrame
{
public
class
ArffToDataDialog
extends
JInternalFrame
implements
ToUpdateObject
{
private
static
final
long
serialVersionUID
=
1L
;
private
JTextField
textFile
=
new
JTextField
();
private
JTextField
textFile
=
new
JTextField
();
private
JTextField
textData
=
new
JTextField
();
private
JTextField
textData
=
new
JTextField
();
private
SequenceDialog
sequenceDialog
=
new
SequenceDialog
(
this
);
public
ArffToDataDialog
()
{
super
();
...
...
@@ -48,8 +56,18 @@ public class ArffToDataDialog extends JInternalFrame {
JPanel
pInpout
=
new
JPanel
(
new
BorderLayout
());
panel
.
add
(
new
JLabel
(
Messages
.
getString
(
"ArffToDataDialog.0"
)),
BorderLayout
.
WEST
);
//$NON-NLS-1$
pInpout
.
add
(
this
.
textFile
,
BorderLayout
.
CENTER
);
JButton
buttonBrowse
=
new
JButton
(
"..."
);
//$NON-NLS-1$
this
.
textFile
.
addFocusListener
(
new
FocusListener
()
{
@Override
public
void
focusLost
(
FocusEvent
e
)
{
updateOutputName
();
}
@Override
public
void
focusGained
(
FocusEvent
e
)
{
}
});
JButton
buttonBrowse
=
new
JButton
(
"..."
);
//$NON-NLS-1$
buttonBrowse
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
...
...
@@ -57,13 +75,15 @@ public class ArffToDataDialog extends JInternalFrame {
int
returnVal
=
fileChooser
.
showOpenDialog
(
ArffToDataDialog
.
this
);
if
(
returnVal
==
JFileChooser
.
APPROVE_OPTION
)
{
if
(
fileChooser
.
getSelectedFile
().
getPath
()
.
endsWith
(
".arff"
))
//$NON-NLS-1$
if
(
fileChooser
.
getSelectedFile
().
getPath
()
.
endsWith
(
".arff"
))
{
//$NON-NLS-1$
ArffToDataDialog
.
this
.
textFile
.
setText
(
fileChooser
.
getSelectedFile
().
getPath
());
else
{
updateOutputName
();
}
else
{
JOptionPane
.
showMessageDialog
(
ArffToDataDialog
.
this
,
Messages
.
getString
(
"ArffToDataDialog.3"
),
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$ //$NON-NLS-2$
Messages
.
getString
(
"ArffToDataDialog.3"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$
JOptionPane
.
WARNING_MESSAGE
);
}
}
...
...
@@ -101,30 +121,128 @@ public class ArffToDataDialog extends JInternalFrame {
this
.
setClosable
(
true
);
this
.
setVisible
(
true
);
}
private
void
updateOutputName
()
{
if
(
this
.
textData
.
getText
()
!=
null
&&
this
.
textData
.
getText
()
!=
""
)
{
//$NON-NLS-1$
// we don't update if there is already a value
return
;
}
if
(
this
.
textFile
.
getText
()
!=
null
&&
this
.
textFile
.
getText
()
!=
""
)
{
//$NON-NLS-1$
String
relationName
=
DataArffExchange
.
getRelationName
(
this
.
textFile
.
getText
());
if
(
relationName
!=
null
)
{
this
.
textData
.
setText
(
relationName
);
}
}
}
@SuppressWarnings
({
"unused"
,
"unchecked"
,
"deprecation"
})
protected
void
buttonOk_actionPerformed
()
{
try
{
Object
[]
result
=
DataArffExchange
.
arffToData
(
this
.
textFile
.
getText
());
Data
data
=
null
;
if
(
result
!=
null
)
{
Data
data
=
new
SimpleData
((
List
<
DataObject
>)
result
[
1
]);
// test if there is some file associated to the data
List
<
String
>
associatedFiles
=
DataArffExchange
.
getRelatedFiles
(
this
.
textFile
.
getText
());
String
message
;
int
nbImages
=
((
AttributeMultiDimSequence
)
((
List
<
DataObject
>)
result
[
1
])
.
get
(
0
).
getAttribute
(
0
)).
getNbTuples
();
int
nbChannels
=
((
AttributeMultiDimSequence
)
((
List
<
DataObject
>)
result
[
1
])
.
get
(
0
).
getAttribute
(
0
)).
getSequence
()[
0
].
length
;
if
(((
List
<
DataObject
>)
result
[
1
]).
get
(
0
).
getAttribute
(
0
)
instanceof
AttributeMultiDimSequence
)
{
message
=
Messages
.
getString
(
"ArffToDataDialog.61"
)
+
//$NON-NLS-1$
nbImages
+
Messages
.
getString
(
"ArffToDataDialog.62"
);
//$NON-NLS-1$
}
else
{
message
=
Messages
.
getString
(
"ArffToDataDialog.61"
)
+
"1"
+
//$NON-NLS-1$ //$NON-NLS-2$
Messages
.
getString
(
"ArffToDataDialog.62"
);
//$NON-NLS-1$
}
if
(
associatedFiles
!=
null
&&
associatedFiles
.
size
()
>
0
)
{
message
+=
Messages
.
getString
(
"ArffToDataDialog.63"
);
//$NON-NLS-1$
for
(
String
s
:
associatedFiles
)
{
message
+=
ImageData
.
getFileNameFromPath
(
s
)
+
"\n"
;
//$NON-NLS-1$
}
}
// ask if the user want to associate some images to the data
int
answer
=
JOptionPane
.
showConfirmDialog
(
this
,
message
,
Messages
.
getString
(
"ArffToDataDialog.16"
),
//$NON-NLS-1$
JOptionPane
.
YES_NO_OPTION
);
if
(
answer
==
JOptionPane
.
OK_OPTION
)
{
sequenceDialog
.
ajout_data
();
sequenceDialog
.
setModalityType
(
Dialog
.
ModalityType
.
APPLICATION_MODAL
);
sequenceDialog
.
setVisible
(
true
);
Vector
<
String
>
sequenceFiles
=
sequenceDialog
.
getSequenceData
();
// test if the number of images match the sequence length
if
(
sequenceFiles
.
size
()
!=
nbImages
)
{
new
IndexOutOfBoundsException
(
Messages
.
getString
(
"ArffToDataDialog.64"
))
//$NON-NLS-1$
.
printStackTrace
();
JOptionPane
.
showMessageDialog
(
this
,
Messages
.
getString
(
"ArffToDataDialog.64"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$
JOptionPane
.
WARNING_MESSAGE
);
this
.
dispose
();
return
;
}
// test if the number of channels are the same in the arff and the images
RawImage
img
=
new
RawImage
(
sequenceFiles
.
get
(
0
));
if
(
img
.
getNbBands
()
!=
nbChannels
)
{
new
IndexOutOfBoundsException
(
Messages
.
getString
(
"ArffToDataDialog.65"
))
//$NON-NLS-1$
.
printStackTrace
();
JOptionPane
.
showMessageDialog
(
this
,
Messages
.
getString
(
"ArffToDataDialog.64"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$
JOptionPane
.
WARNING_MESSAGE
);
this
.
dispose
();
return
;
}
// test if we have one or multiples images
if
(
sequenceFiles
.
size
()
>
1
)
{
data
=
new
ImageData
(
new
ImportedImageSampler
(
sequenceFiles
,
(
List
<
DataObject
>)
result
[
1
],
(
List
<
Integer
>)
result
[
0
]),
sequenceFiles
);
}
else
{
data
=
new
ImageData
(
new
ImportedImageSampler
(
sequenceFiles
.
get
(
0
),
(
List
<
DataObject
>)
result
[
1
],
(
List
<
Integer
>)
result
[
0
]),
sequenceFiles
.
get
(
0
));
}
}
else
{
// if no images is associated we create a SimpleData
data
=
new
SimpleData
((
List
<
DataObject
>)
result
[
1
]);
}
if
(
this
.
textData
.
getText
().
length
()
==
0
)
{
this
.
textData
.
setText
(
DataArffExchange
.
getRelationName
(
this
.
textFile
.
getText
()));
}
data
.
setDataName
(
this
.
textData
.
getText
());
MainFrame
.
getInstance
().
createDataSession
(
data
);
JOptionPane
.
showMessageDialog
(
this
,
Messages
.
getString
(
"ArffToDataDialog.15"
)
+
this
.
textData
.
getText
(),
Messages
.
getString
(
"ArffToDataDialog.16"
),
//$NON-NLS-1$ //$NON-NLS-2$
Messages
.
getString
(
"ArffToDataDialog.151"
)
+
this
.
textData
.
getText
()
//$NON-NLS-1$
+
Messages
.
getString
(
"ArffToDataDialog.152"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.16"
),
//$NON-NLS-1$
JOptionPane
.
INFORMATION_MESSAGE
);
}
else
{
JOptionPane
.
showMessageDialog
(
this
,
"File selected isn't supported"
,
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$ //$NON-NLS-2$
Messages
.
getString
(
"ArffToDataDialog.41"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$
JOptionPane
.
WARNING_MESSAGE
);
}
this
.
dispose
();
}
catch
(
Exception
e
)
{
JOptionPane
.
showMessageDialog
(
this
,
"File selected isn't supported"
,
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$ //$NON-NLS-2$
Messages
.
getString
(
"ArffToDataDialog.41"
),
//$NON-NLS-1$
Messages
.
getString
(
"ArffToDataDialog.4"
),
//$NON-NLS-1$
JOptionPane
.
WARNING_MESSAGE
);
e
.
printStackTrace
();
}
}
@Override
public
void
update
(
String
s
)
{
}
}
src/mustic/gui/dialog/DataToArffDialog.java
View file @
dd622006
...
...
@@ -25,8 +25,10 @@ import mustic.gui.MainFrame;
import
mustic.utils.io.dataExchange.DataArffExchange
;
/**
*
Fenetre permettant de creer des fichier ARFF à partir d'un image
*
Dialog that allow the user to generate an arff file representing a Data object.
*
* @author Baptiste LAFABREGUE
*
*/
public
class
DataToArffDialog
extends
JInternalFrame
{
...
...
src/mustic/gui/dialog/SequenceDialog.java
View file @
dd622006
...
...
@@ -29,19 +29,12 @@ import javax.swing.JScrollPane;
import
javax.swing.event.ListSelectionEvent
;
import
javax.swing.event.ListSelectionListener
;
import
jcl.data.Data
;
import
jcl.data.sampling.ImageSampler
;
import
jcl.data.sampling.Sampler
;
import
loci.formats.FormatException
;
import
mustic.gui.DesktopFrame
;
import
mustic.gui.ImageDesktopFrame
;
import
mustic.gui.MainFrame
;
import
mustic.gui.panels.classifier.ClassifierPanel
;
import
mustic.gui.panels.data.DataConstructPanel
;
import
mustic.io.ImageData
;
import
mustic.io.ImageMultiDimSequenceData
;
import
mustic.io.PictureTool
;
import
mustic.io.RawImage
;
import
mustic.utils.documentFilter.ToUpdateObject
;
/**
* Fenêtre permettant de creer des séquences d'images
...
...
@@ -67,59 +60,48 @@ public class SequenceDialog extends JDialog {
}
}
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
JPanel
panel
=
null
;
public
static
void
sortArray
(
Collator
collator
,
Donnee
[]
strArray
)
{
Donnee
tmp
;
if
(
strArray
.
length
==
1
)
return
;
for
(
int
i
=
0
;
i
<
strArray
.
length
;
i
++)
{
for
(
int
j
=
i
+
1
;
j
<
strArray
.
length
;
j
++)
{
if
(
collator
.
compare
(
strArray
[
i
].
toString
(),
strArray
[
j
].
toString
())
>
0
)
{
tmp
=
strArray
[
i
];
strArray
[
i
]
=
strArray
[
j
];
strArray
[
j
]
=
tmp
;
}
}
}
}
private
JButton
buttonAdd
=
new
JButton
(
new
ImageIcon
(
getClass
()
private
JButton
buttonAdd
=
new
JButton
(
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/go-next.png"
)));
//$NON-NLS-1$
private
JButton
buttonDel
=
new
JButton
(
new
ImageIcon
(
getClass
()
private
JButton
buttonDel
=
new
JButton
(
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/process-stop.png"
)));
//$NON-NLS-1$
private
JButton
buttonDown
=
new
JButton
(
new
ImageIcon
(
getClass
()
private
JButton
buttonDown
=
new
JButton
(
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/go-down.png"
)));
//$NON-NLS-1$
private
JButton
buttonOk
=
new
JButton
(
Messages
.
getString
(
"SequenceDialog.3"
));
//$NON-NLS-1$
private
JButton
buttonOk
=
new
JButton
(
Messages
.
getString
(
"SequenceDialog.3"
));
//$NON-NLS-1$
private
JButton
buttonOpen
=
new
JButton
(
new
ImageIcon
(
getClass
()
private
JButton
buttonOpen
=
new
JButton
(
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/icon_open.png"
)));
//$NON-NLS-1$
private
JButton
buttonUp
=
new
JButton
(
new
ImageIcon
(
getClass
()
private
JButton
buttonUp
=
new
JButton
(
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/go-up.png"
)));
//$NON-NLS-1$
private
DataConstructPanel
dataConstructPanel
;
private
ToUpdateObject
observer
;
private
DefaultListModel
<
Donnee
>
dlmData
;
private
DefaultListModel
dlmSeq
;
private
DefaultListModel
<
Donnee
>
dlmSeq
;
private
DropTarget
dropTarget
=
new
DropTarget
();
private
DropTarget
dropTarget
=
new
DropTarget
();
private
JList
jListData
=
new
JList
();
private
JList
<
Donnee
>
jListData
=
new
JList
<
Donnee
>
();
private
JList
jListSequence
=
new
JList
();
private
JList
<
Donnee
>
jListSequence
=
new
JList
<
Donnee
>
();
private
JPanel
panelData
=
new
JPanel
(
new
FlowLayout
());
private
JPanel
panelData
=
new
JPanel
(
new
FlowLayout
());
private
JPanel
panelSequence
=
new
JPanel
(
new
FlowLayout
());
private
JPanel
panelSequence
=
new
JPanel
(
new
FlowLayout
());
/** set a limit for the number of element to put in the sequence, -1 indicates no limit */
private
int
sequenceLimit
=
-
1
;
public
SequenceDialog
(
DataConstructPanel
cp
)
{
this
.
dataConstructPanel
=
cp
;
public
SequenceDialog
(
ToUpdateObject
observer
)
{
this
.
observer
=
observer
;
setSize
(
600
,
350
);
setLocation
(
200
,
200
);
try
{
...
...
@@ -166,7 +148,7 @@ public class SequenceDialog extends JDialog {
int
numItems
=
this
.
dlmData
.
getSize
();
Donnee
[]
a
=
new
Donnee
[
numItems
];
for
(
int
i
=
0
;
i
<
numItems
;
i
++)
{
a
[
i
]
=
(
Donnee
)
this
.
dlmData
.
getElementAt
(
i
);
a
[
i
]
=
this
.
dlmData
.
getElementAt
(
i
);
}
sortArray
(
Collator
.
getInstance
(),
a
);
...
...
@@ -178,7 +160,14 @@ public class SequenceDialog extends JDialog {
public
void
buttonAdd_actionPerformed
()
{
Object
items
[]
=
this
.
jListData
.
getSelectedValues
();
for
(
int
i
=
0
;
i
<
items
.
length
;
i
++)
{
this
.
dlmSeq
.
addElement
(
items
[
i
]);
if
(
sequenceLimit
>
0
&&
this
.
dlmSeq
.
size
()
>=
sequenceLimit
)
{
JOptionPane
.
showMessageDialog
(
this
,
Messages
.
getString
(
"SequenceDialog.41"
),
Messages
.
getString
(
"SequenceDialog.42"
),
//$NON-NLS-1$
JOptionPane
.
INFORMATION_MESSAGE
);
break
;
}
this
.
dlmSeq
.
addElement
((
Donnee
)
items
[
i
]);
}
}
...
...
@@ -196,7 +185,7 @@ public class SequenceDialog extends JDialog {
Object
item
[]
=
this
.
jListSequence
.
getSelectedValues
();
for
(
int
i
=
index
.
length
-
1
;
i
>=
0
;
i
--)
{
this
.
dlmSeq
.
remove
(
index
[
i
]);
this
.
dlmSeq
.
add
(
index
[
i
]
+
1
,
item
[
i
]);
this
.
dlmSeq
.
add
(
index
[
i
]
+
1
,
(
Donnee
)
item
[
i
]);
}
for
(
int
i
=
index
.
length
-
1
;
i
>=
0
;
i
--)
index
[
i
]++;
...
...
@@ -209,7 +198,6 @@ public class SequenceDialog extends JDialog {
if
(
this
.
dlmSeq
.
getSize
()
>
1
)
{
ImageDesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
.
getAllImageDesktopFrames
();
int
nbSessions
=
desktopFrames
.
length
;
Donnee
donnee0
=
((
Donnee
)
this
.
dlmSeq
.
getElementAt
(
0
));
RawImage
img0
=
desktopFrames
[
donnee0
.
index
].
getImageSession
()
...
...
@@ -280,8 +268,9 @@ public class SequenceDialog extends JDialog {
.
getBirdViewPanel
().
refresh
();
MainFrame
.
getInstance
().
getCurrentImageSession
().
associatedFrame
.
toBack
();
ajout_data
();
}
ajout_data
();
updateClassifier
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -296,7 +285,7 @@ public class SequenceDialog extends JDialog {
Object
item
[]
=
this
.
jListSequence
.
getSelectedValues
();
for
(
int
i
=
0
;
i
<
index
.
length
;
i
++)
{
this
.
dlmSeq
.
remove
(
index
[
i
]);
this
.
dlmSeq
.
add
(
index
[
i
]
-
1
,
item
[
i
]);
this
.
dlmSeq
.
add
(
index
[
i
]
-
1
,
(
Donnee
)
item
[
i
]);
}
for
(
int
i
=
0
;
i
<
index
.
length
;
i
++)
index
[
i
]--;
...
...
@@ -364,14 +353,14 @@ public class SequenceDialog extends JDialog {
* @throws Exception
*/
private
void
jbInit
()
throws
Exception
{
JPanel
panel
=
new
JPanel
(
new
FlowLayout
());
panel
=
new
JPanel
(
new
FlowLayout
());
this
.
setModal
(
true
);
this
.
setAlwaysOnTop
(
true
);
this
.
setTitle
(
Messages
.
getString
(
"SequenceDialog.18"
));
//$NON-NLS-1$
dlmData
=
new
DefaultListModel
();
dlmData
=
new
DefaultListModel
<
Donnee
>
();
ajout_data
();
this
.
jListData
=
new
JList
(
dlmData
);
this
.
jListData
=
new
JList
<
Donnee
>
(
dlmData
);
this
.
jListData
.
setFixedCellHeight
(
25
);
JScrollPane
jsp_listData
=
new
JScrollPane
(
this
.
jListData
);
jsp_listData
.
setBorder
(
null
);
...
...
@@ -414,8 +403,8 @@ public class SequenceDialog extends JDialog {
panelOption
.
add
(
panelUpDown
,
BorderLayout
.
SOUTH
);
panel
.
add
(
panelOption
,
BorderLayout
.
CENTER
);
dlmSeq
=
new
DefaultListModel
();
this
.
jListSequence
=
new
JList
(
dlmSeq
);
dlmSeq
=
new
DefaultListModel
<
Donnee
>
();
this
.
jListSequence
=
new
JList
<
Donnee
>
(
dlmSeq
);
this
.
jListSequence
.
setFixedCellHeight
(
25
);
JScrollPane
jsp_listSeq
=
new
JScrollPane
(
this
.
jListSequence
);
jsp_listSeq
.
setBorder
(
null
);
...
...
@@ -426,6 +415,7 @@ public class SequenceDialog extends JDialog {
this
.
panelSequence
.
setSize
(
210
,
300
);
panel
.
add
(
this
.
panelSequence
,
BorderLayout
.
EAST
);
this
.
add
(
panel
);
this
.
buttonOk
.
addActionListener
(
new
ActionListener
()
{
...
...
@@ -513,7 +503,7 @@ public class SequenceDialog extends JDialog {
if
(
jListData
.
getSelectedIndex
()
>=
0
)
{
Object
items
[]
=
jListData
.
getSelectedValues
();
for
(
int
i
=
0
;
i
<
items
.
length
;
i
++)
dlmSeq
.
addElement
(
items
[
i
]);
dlmSeq
.
addElement
(
(
Donnee
)
items
[
i
]);
}
}
...
...
@@ -531,7 +521,34 @@ public class SequenceDialog extends JDialog {
this
.
add
(
panelButton
,
BorderLayout
.
SOUTH
);
}
public
static
void
sortArray
(
Collator
collator
,
Donnee
[]
strArray
)
{
Donnee
tmp
;
if
(
strArray
.
length
==
1
)
return
;
for
(
int
i
=
0
;
i
<
strArray
.
length
;
i
++)
{
for
(
int
j
=
i
+
1
;
j
<
strArray
.
length
;
j
++)
{
if
(
collator
.
compare
(
strArray
[
i
].
toString
(),
strArray
[
j
].
toString
())
>
0
)
{
tmp
=
strArray
[
i
];
strArray
[
i
]
=
strArray
[
j
];
strArray
[
j
]
=
tmp
;
}
}
}
}
public
void
updateClassifier
()
{
this
.
dataConstructPanel
.
getSourceSelectionPanel
().
initializeComboBox
();
observer
.
update
(
""
);
}
/**
* Set a limit for the number of element to put in the sequence
*
* @param n
* the limit, 0 or less to disable the limit
*/
public
void
setSequenceLimit
(
int
n
)
{
this
.
sequenceLimit
=
n
;
}
}
src/mustic/gui/dialog/classifier/AgentDialog.java
View file @
dd622006
...
...
@@ -2,7 +2,6 @@ package mustic.gui.dialog.classifier;
import
java.awt.BorderLayout
;
import
java.awt.event.ActionEvent
;
import
java.util.Vector
;
import
javax.swing.JButton
;
import
javax.swing.JDialog
;
...
...
@@ -10,11 +9,8 @@ import javax.swing.JOptionPane;
import
javax.swing.JPanel
;
import
jcl.learning.LearningParameters
;
import
loci.formats.FormatException
;
import
mustic.gui.DataDesktopFrame
;
import
mustic.gui.DataSession
;
import
mustic.gui.DesktopFrame
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.gui.panels.classifier.AgentListManager
;
import
mustic.gui.panels.classifier.ClassifierPanel
;
...
...
src/mustic/gui/dialog/messages_en.properties
View file @
dd622006
...
...
@@ -69,11 +69,18 @@ ArffToImageDialog.7=OK
ArffToImageDialog.8
=
ARFF
ArffToImageDialog.9
=
%% Dimension
ArffToDataDialog.0
=
Input Arff file
\:
ArffToDataDialog.15=The data is loaded
ArffToDataDialog.151=The data
ArffToDataDialog.152
=
have been loaded.
ArffToDataDialog.16
=
Success
ArffToDataDialog.3
=
You must select an ARFF file.
ArffToDataDialog.4
=
Warning
ArffToDataDialog.41
=
File selected isn't supported
ArffToDataDialog.5
=
Output Data name :
ArffToDataDialog.61
=
Do you want to associate some images to the Data ?
\n
You need to associate
ArffToDataDialog.62
=
images to match the sequence.
ArffToDataDialog.63
=
\n\n
The following files were associated with the arff file :
\n
ArffToDataDialog.64
=
The number of images does not match the sequence length.
ArffToDataDialog.65
=
The number of image's channels does not match the sequence format.
ArffToDataDialog.7
=
OK
ArffToDataDialog.8
=
ARFF
ArffToDataDialog.9
=
%% Dimension
...
...
@@ -253,6 +260,8 @@ SequenceDialog.23=Rise in the sequence
SequenceDialog.24
=
Come down in the sequence
SequenceDialog.25
=
Sequence of data
SequenceDialog.3
=
OK
SequenceDialog.41
=
You have reached the sequence size limit,
\n
delete an element if you want to add another one.
SequenceDialog.42
=
Limit reached
TransformToRoiDialog.0
=
Transform to ROI
TransformToRoiDialog.1
=
OK
TransformToRoiDialog.10
=
Fond
\:
...
...
src/mustic/gui/dialog/messages_fr.properties
View file @
dd622006
...
...
@@ -69,11 +69,18 @@ ArffToImageDialog.7=OK
ArffToImageDialog.8
=
ARFF
ArffToImageDialog.9
=
%% Dimension
ArffToDataDialog.0
=
Fichier Arff en entre
\:
ArffToDataDialog.15=Le Data a t charg sous
ArffToDataDialog.151=Le Data
ArffToDataDialog.152
=
a t charg.
ArffToDataDialog.16
=
Succs
ArffToDataDialog.3
=
Vous devez choisir un fichier ARFF.
ArffToDataDialog.4
=
Attention
ArffToDataDialog.41
=
Le fichier slectionn n'est pas support.
ArffToDataDialog.5
=
Nom du Data a crer :
ArffToDataDialog.61
=
Voulez vous associer des images cette squence ?
\n
Vous devez choisir
ArffToDataDialog.62
=
images associer la squence.
ArffToDataDialog.63
=
\n\n
Les images suivantes sont l'origine du fichier arff :
\n
ArffToDataDialog.64
=
Le nombre d'images ne correspond la longueur de la squence.
ArffToDataDialog.65
=
Le nombre de bandes ne correspond entre la s"quences et les images.
ArffToDataDialog.7
=
OK
ArffToDataDialog.8
=
ARFF
ArffToDataDialog.9
=
%% Dimension
...
...
@@ -238,6 +245,8 @@ SequenceDialog.23=Hausse de l'ordre de la s
SequenceDialog.24
=
Descendez dans la squence
SequenceDialog.25
=
Squence de donnes
SequenceDialog.3
=
OK
SequenceDialog.41
=
Vous avez atteint la limite de taille de la squence,
\n
supprimez un lment si vous souhaitez en ajouter un supplmentaire.
SequenceDialog.42
=
Limite atteinte
TransformToRoiDialog.0
=
Convertir en rgion d'intert (RO)I
TransformToRoiDialog.1
=
OK
TransformToRoiDialog.10
=
Fond
\:
...
...
src/mustic/gui/messages_en.properties
View file @
dd622006
...
...
@@ -108,7 +108,7 @@ MainFrame.196=Clustering MF1
MainFrame.197
=
Clustering MF3
MainFrame.198
=
hierarchique
MainFrame.199
=
Classification hierarchique
MainFrame.2
=
Data
s
MainFrame.2
=
Data
MainFrame.20
=
ROI tools
MainFrame.202
=
Unknown file format ZIP FILE
MainFrame.203
=
Error
...
...
src/mustic/gui/panels/classifier/ClassifierPanel.java
View file @
dd622006
...
...
@@ -96,7 +96,7 @@ public class ClassifierPanel extends JPanel {
public
JButton
classifyButton
=
new
JButton
(
Messages
.
getString
(
"ClassifierPanel.4"
));
//$NON-NLS-1$
/** La panel pour l'affichage du bouton de lancement de la classification */
JPanel
classifyButton_
=
new
JPanel
();
private
JPanel
classifyButton_