Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lafabregue
MultiCube
Commits
41cccadf
Commit
41cccadf
authored
Apr 19, 2018
by
balanche
Browse files
Correction d'un bug sur la progress bar Sampling et d'un autre bug sur la progress bar Displaying
parent
1ebd5b90
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/mustic/gui/ClassificationImage.java
View file @
41cccadf
package
mustic.gui
;
import
java.lang.management.ManagementFactory
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Iterator
;
import
javax.swing.ImageIcon
;
import
javax.swing.WindowConstants
;
...
...
@@ -57,19 +60,17 @@ public class ClassificationImage extends ClassificationModel {
}
rpanel
.
setName
(
title
);
resultPanels
.
add
(
rpanel
);
Tab
t1
=
ClassificationModel
.
createTab
(
title
,
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/document-open-result.png"
)),
//$NON-NLS-1$
rpanel
,
true
);
pane
.
addTab
(
t1
);
t1
.
setSelected
(
true
);
}
@Override
public
void
doOperationAfterClassification
(
Classification
result
)
{
/
*
Monitoring the operation
*/
result
.
setStatus
(
"Step "
+
(
result
.
getProgressableList
().
size
()+
1
)
+
"/"
+
(
result
.
getProgressableList
().
size
()+
1
)
+
" : Displaying
result
"
);
/
/
Monitoring the operation
status
result
.
setStatus
(
"Step "
+
(
result
.
getProgressableList
().
size
()+
1
)
+
"/"
+
(
result
.
getProgressableList
().
size
()+
1
)
+
" : Displaying"
);
if
(!
result
.
isHybrid
()
&&
!(
result
instanceof
ClassificationSAM4
))
{
if
(
result
.
getTimeExec
()
!=
0
)
result
.
setTimeExec
(
ManagementFactory
.
getThreadMXBean
()
...
...
@@ -97,6 +98,7 @@ public class ClassificationImage extends ClassificationModel {
irp
.
historique
.
addInfosln
(
Messages
.
getString
(
"ClassificationImage.6"
)
//$NON-NLS-1$
+
(
exec
/
1.0E9
)
+
"s"
);
//$NON-NLS-1$
}
}
}
...
...
src/mustic/gui/panels/ImageResultPanel.java
View file @
41cccadf
...
...
@@ -4,6 +4,8 @@ import java.awt.*;
import
java.awt.event.*
;
import
java.awt.image.*
;
import
java.io.*
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.Vector
;
...
...
@@ -200,10 +202,9 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
MainFrame
.
getInstance
().
getCurrentDataSession
().
addResultPanel
(
this
);
this
.
result
=
classification
.
getClusteringResult
();
this
.
clusterMap
=
new
MultiResolutionClusterMap
(
this
,
imgData
.
getWidth
(),
imgData
.
getHeight
(),
result
.
getClusterMap
(
false
),
this
.
result
.
getClusters
());
//!!
imgData
.
getHeight
(),
result
.
getClusterMap
(
false
),
this
.
result
.
getClusters
());
this
.
classPanel
.
addTreeSelectionListener
(
this
);
if
(
imgData
.
getRawImages
()
!=
null
&&
imgData
.
getRawImages
().
size
()
>
0
)
{
this
.
viewer
=
new
ClusteringImageViewer
(
new
GDALPyramidImageViewer
(
imgData
.
getRawImages
().
get
(
0
),
true
),
this
.
clusterMap
);
...
...
src/mustic/io/ImageData.java
View file @
41cccadf
...
...
@@ -238,13 +238,10 @@ public class ImageData extends SimpleData implements Serializable {
* a mask to apply to the sampler
*/
public
ImageData
(
Sampler
sampler
,
RawImage
path
,
Mask
mask
)
{
System
.
out
.
println
(
"ImageData(Sampler sampler, RawImage path, Mask mask)"
);
if
(
MainFrame
.
DEBUG_MODE
)
{
System
.
out
.
println
(
">> ImageData(Sampler,String) <<"
);
}
MainFrame
.
getProgressStatus
().
setMessage
(
"loading sampler..."
);
this
.
rawImages
.
add
(
path
);
long
startTime
=
System
.
currentTimeMillis
();
...
...
src/mustic/models/thread/ClassificationThread.java
View file @
41cccadf
...
...
@@ -132,7 +132,7 @@ public class ClassificationThread extends Thread {
/* Si on a un container on affiche le resultat */
if
(
this
.
container_
!=
null
)
{
this
.
container_
.
doOperationAfterClassification
(
this
.
classification_
);
//prends aussi du temps ?!!!
.
doOperationAfterClassification
(
this
.
classification_
);
}
}
...
...
src/mustic/utils/image/viewer/MultiResolutionClusterMap.java
View file @
41cccadf
...
...
@@ -41,13 +41,13 @@ public class MultiResolutionClusterMap {
private
void
generateMaps
(
int
[]
map
)
{
int
[][]
newMap
=
new
int
[
width
][
height
];
double
pas
=
100
./(
height
*
width
);
double
progress
=
imageResultPanel
.
getClassification
().
getProgress
()+
pas
;
//
double
step
= 100./(height*width);
//
double progress = imageResultPanel.getClassification().getProgress()+
step
;
for
(
int
j
=
0
;
j
<
height
;
j
++)
{
for
(
int
i
=
0
;
i
<
width
;
i
++)
{
newMap
[
i
][
j
]
=
map
[
i
+
j
*
width
];
progress
+=
pas
;
imageResultPanel
.
getClassification
().
setProgress
((
int
)
progress
);
//
progress+=
step
;
//
imageResultPanel.getClassification().setProgress((int)progress);
}
}
this
.
maps
.
add
(
newMap
);
...
...
src/mustic/utils/jclAdapters/ImageSampler.java
View file @
41cccadf
...
...
@@ -64,7 +64,7 @@ public class ImageSampler extends Sampler {
private
double
progressM
=
100
;
private
String
status
=
null
;
private
String
status
=
"Sampling"
;
/**
* Constructor from a sequence of images
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment