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
bfa9b9a0
Commit
bfa9b9a0
authored
Aug 18, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation of pyramid and simple viewers
parent
5b0f182c
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
646 additions
and
947 deletions
+646
-947
src/mustic/gui/ImageSession.java
src/mustic/gui/ImageSession.java
+3
-1
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+2
-10
src/mustic/gui/dialog/CropDialog.java
src/mustic/gui/dialog/CropDialog.java
+1
-6
src/mustic/gui/dialog/SequenceDialog.java
src/mustic/gui/dialog/SequenceDialog.java
+1
-11
src/mustic/gui/dialog/VegetationIndiceExtractionDialog.java
src/mustic/gui/dialog/VegetationIndiceExtractionDialog.java
+1
-1
src/mustic/gui/dialog/classifier/ConstraintsSelectionDialog.java
...tic/gui/dialog/classifier/ConstraintsSelectionDialog.java
+9
-5
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+82
-68
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+51
-30
src/mustic/gui/panels/ImageResultPanel.java
src/mustic/gui/panels/ImageResultPanel.java
+49
-49
src/mustic/io/ImageResult.java
src/mustic/io/ImageResult.java
+0
-31
src/mustic/io/MusticImageMask.java
src/mustic/io/MusticImageMask.java
+12
-8
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+1
-646
src/mustic/io/roi/ROIImage.java
src/mustic/io/roi/ROIImage.java
+0
-48
src/mustic/utils/image/BufferedImageHelper.java
src/mustic/utils/image/BufferedImageHelper.java
+83
-0
src/mustic/utils/image/BufferedImageViewer.java
src/mustic/utils/image/BufferedImageViewer.java
+5
-9
src/mustic/utils/image/ImageHelper.java
src/mustic/utils/image/ImageHelper.java
+1
-0
src/mustic/utils/image/ImageViewer.java
src/mustic/utils/image/ImageViewer.java
+45
-24
src/mustic/utils/image/PyramidImageViewer.java
src/mustic/utils/image/PyramidImageViewer.java
+300
-0
No files found.
src/mustic/gui/ImageSession.java
View file @
bfa9b9a0
...
...
@@ -10,7 +10,9 @@ import javax.swing.*;
import
jcl.data.Data
;
import
jcl.jcld.database.SSHParameters
;
import
mustic.gui.panels.*
;
import
mustic.gui.panels.BirdViewPanel
;
import
mustic.gui.panels.ImageInformationPanel
;
import
mustic.gui.panels.ImagePanel
;
import
mustic.gui.segmentation.SegmentationPanel
;
import
mustic.io.RawImage
;
import
net.infonode.tabbedpanel.TabFactory
;
...
...
src/mustic/gui/MainFrame.java
View file @
bfa9b9a0
...
...
@@ -85,7 +85,7 @@ public class MainFrame extends JFrame {
* temporary files directory Always check the directory existence or create it
*/
private static final String TMP_DIR_PATH = "temporary";
p
rivate
static final File TMP_DIR_FILE = new File(TMP_DIR_PATH);
p
ublic
static final File TMP_DIR_FILE = new File(TMP_DIR_PATH);
/** l'instance unique de ce singleton */
private static MainFrame instance = null;
...
...
@@ -186,6 +186,7 @@ public class MainFrame extends JFrame {
*/
public MainFrame() {
super();
TMP_DIR_FILE.mkdir();
this.setTitle("MultiCube 0.8"); //$NON-NLS-1$
this.setIconImage(new ImageIcon(this.getClass().getResource("/icons/musticFond.png")).getImage());
this.setSize(1040, 768);
...
...
@@ -2758,12 +2759,6 @@ public class MainFrame extends JFrame {
this.currentImageSession.getBirdViewPanel().setR(0);
this.currentImageSession.getBirdViewPanel().setG(1);
this.currentImageSession.getBirdViewPanel().setB(2);
PictureTool.setR(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 0);
this.getProgressBar().setValue(85);
PictureTool.setG(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 1);
this.getProgressBar().setValue(90);
PictureTool.setB(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 2);
this.getProgressBar().setValue(95);
MainFrame.this.currentImageSession.getBirdViewPanel().refresh();
this.getProgressBar().setValue(100);
}
...
...
@@ -2975,9 +2970,6 @@ public class MainFrame extends JFrame {
currentImageSession.getBirdViewPanel().setG(1);
currentImageSession.getBirdViewPanel().setB(2);
currentImageSession.getBirdViewPanel().syncImage();
PictureTool.setR(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 0);
PictureTool.setG(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 1);
PictureTool.setB(MainFrame.this.currentImageSession.getRawImage().getBirdview(), 2);
MainFrame.this.currentImageSession.getBirdViewPanel().refresh();
}
...
...
src/mustic/gui/dialog/CropDialog.java
View file @
bfa9b9a0
...
...
@@ -78,11 +78,6 @@ public class CropDialog extends JInternalFrame {
return
null
;
}
@Override
protected
Picture
load
()
{
// TODO Auto-generated method stub
return
null
;
}
@Override
protected
Picture
load
(
double
zoomfactor
)
{
...
...
@@ -177,7 +172,7 @@ public class CropDialog extends JInternalFrame {
JPanel
panelImage
=
new
JPanel
(
new
BorderLayout
());
// affichage de l'image
this
.
imageSource
=
session
.
get
RawImage
().
getBirdview
().
getImage
();
this
.
imageSource
=
session
.
get
BirdViewPanel
().
getImage
();
this
.
image
=
new
BufferedImage
(
this
.
imageSource
.
getWidth
(),
this
.
imageSource
.
getHeight
(),
BufferedImage
.
TYPE_INT_RGB
);
for
(
int
x
=
0
;
x
<
this
.
imageSource
.
getWidth
();
x
++)
{
for
(
int
y
=
0
;
y
<
this
.
imageSource
.
getHeight
();
y
++)
{
...
...
src/mustic/gui/dialog/SequenceDialog.java
View file @
bfa9b9a0
...
...
@@ -249,20 +249,10 @@ public class SequenceDialog extends JDialog {
.
getBirdViewPanel
().
setG
(
1
);
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
setB
(
2
);
MainFrame
.
getInstance
()
MainFrame
.
getInstance
()
.
getCurrentImageSession
()
.
getBirdViewPanel
()
.
syncImage
();
PictureTool
.
setR
(
MainFrame
.
getInstance
()
.
getCurrentImageSession
().
getRawImage
()
.
getBirdview
(),
0
);
PictureTool
.
setG
(
MainFrame
.
getInstance
()
.
getCurrentImageSession
().
getRawImage
()
.
getBirdview
(),
1
);
PictureTool
.
setB
(
MainFrame
.
getInstance
()
.
getCurrentImageSession
().
getRawImage
()
.
getBirdview
(),
2
);
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
refresh
();
MainFrame
.
getInstance
().
getCurrentImageSession
().
associatedFrame
...
...
src/mustic/gui/dialog/VegetationIndiceExtractionDialog.java
View file @
bfa9b9a0
...
...
@@ -169,7 +169,7 @@ public class VegetationIndiceExtractionDialog extends JFrame {
}
ExecCommand
.
NdviExtraction
(
textInput
.
getText
(),
"temporary/vegetation.tif"
,
(
int
)
spinnerRed
.
getValue
(),
(
int
)
spinnerNir
.
getValue
(),
(
String
)
indiceComboBox
.
getSelectedItem
());
ExecCommand
.
Rescale
(
"temporary/vegetation.tif"
,
path
);
ExecCommand
.
Rescale
(
"temporary/vegetation.tif"
,
path
,
0
,
255
);
JOptionPane
.
showMessageDialog
(
this
,
"Vegetation indice extraction successful"
);
...
...
src/mustic/gui/dialog/classifier/ConstraintsSelectionDialog.java
View file @
bfa9b9a0
...
...
@@ -56,7 +56,6 @@ import jcl.clustering.constraints.MustLinkConstraint;
import
jcl.clustering.constraints.NbClusterConstraint
;
import
jcl.data.Data
;
import
jcl.utils.Images.StreamedImageReaderWrapper
;
import
mustic.gui.MainFrame
;
import
mustic.gui.ProgressPropertyChangeListener
;
import
mustic.io.RawImage
;
...
...
@@ -70,7 +69,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
private
static
final
long
serialVersionUID
=
1L
;
ImportConstraintsTask
importConstraintsTask
=
null
;
ImportConstraintsTask
importConstraintsTask
=
null
;
/** data related fields */
private
RawImage
image
=
null
;
...
...
@@ -152,7 +151,12 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
// otherwise we base our estimation on the image
StreamedImageReaderWrapper
reader
=
new
StreamedImageReaderWrapper
(
img
.
getPath
());
minDistance
=
0
;
maxDistance
=
reader
.
getMaxValue
()
-
reader
.
getMinValue
();
maxDistance
=
0
;
for
(
int
i
=
0
;
i
<
reader
.
getMaxValues
().
length
;
i
++)
{
double
d
=
(
reader
.
getMaxValues
()[
i
]
-
reader
.
getMinValues
()[
i
]);
maxDistance
+=
d
*
d
;
}
maxDistance
=
Math
.
sqrt
(
maxDistance
);
}
// display the image
...
...
@@ -762,7 +766,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
.
getComponent
(
1
)).
setText
(
""
+
index
);
}
pr
ivate
void
displayPixels
()
{
pr
otected
void
displayPixels
()
{
if
(
image
==
null
)
{
return
;
}
...
...
@@ -1012,7 +1016,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
}
}
pr
ivate
void
enableAllComponents
()
{
pr
otected
void
enableAllComponents
()
{
for
(
Component
c
:
otherComponentList
)
{
c
.
setEnabled
(
true
);
}
...
...
src/mustic/gui/panels/BirdViewPanel.java
View file @
bfa9b9a0
...
...
@@ -14,88 +14,85 @@ import java.util.Vector;
import
javax.swing.JPanel
;
import
mustic.gui.DesktopFrame
;
import
mustic.gui.ImageDesktopFrame
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.gui.segmentation.SegmentationPanel
;
import
mustic.io.Pi
cture
;
import
mustic.io.Pi
LLiTools
;
import
mustic.io.RawImage
;
public
class
BirdViewPanel
extends
JPanel
implements
MouseListener
,
MouseMotionListener
{
/** Represents the moving action. */
static
private
final
int
ACT_MOVE
=
1
;
static
private
final
int
ACT_MOVE
=
1
;
/** Represents no action. */
static
private
final
int
ACT_NONE
=
0
;
static
private
final
int
ACT_NONE
=
0
;
/** Represents the bottom-left resinzing. */
static
private
final
int
ACT_RESIZE_BL
=
5
;
static
private
final
int
ACT_RESIZE_BL
=
5
;
/** Represents the bottom-right resinzing. */
static
private
final
int
ACT_RESIZE_BR
=
4
;
static
private
final
int
ACT_RESIZE_BR
=
4
;
/** Represents the top-left resinzing. */
static
private
final
int
ACT_RESIZE_TL
=
2
;
static
private
final
int
ACT_RESIZE_TL
=
2
;
/** Represents the top-right resinzing. */
static
private
final
int
ACT_RESIZE_TR
=
3
;
static
private
final
int
ACT_RESIZE_TR
=
3
;
/** Represents the size of the selection square in pixel. */
static
final
private
short
SEL_SQ_SIZE
=
4
;
static
final
private
short
SEL_SQ_SIZE
=
4
;
/** */
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** Represents the last action which occured. */
private
int
action
=
BirdViewPanel
.
ACT_NONE
;
private
int
action
=
BirdViewPanel
.
ACT_NONE
;
/** Red value */
int
r
=
0
;
/** Blue value */
int
b
=
0
;
int
b
=
0
;
/** Green value */
int
g
=
0
;
private
BufferedImage
bImage
;
private
BufferedImage
bImage
;
/** Represents the graphics object associated with the offscreen image */
private
Graphics
buffer
;
/** Green value */
int
g
=
0
;
private
Graphics
buffer
;
/** Represents the initial selction area. */
private
Rectangle
initArea
=
new
Rectangle
();
private
Rectangle
initArea
=
new
Rectangle
();
/** The Image */
private
BufferedImage
mBirdImage
;
private
BufferedImage
mBirdImage
;
/** The Data */
private
RawImage
mImage
;
private
RawImage
mImage
;
/** Represents the panel which display the selection area */
private
ImagePanel
mImagePanel
;
private
ImagePanel
mImagePanel
;
private
double
max
[];
// max value for each band
private
double
min
[];
// min value for each band
/** Info */
private
ImageInformationPanel
mInfoPanel
;
private
ImageInformationPanel
mInfoPanel
;
/** Represents an offscreen image for double buffer purpose */
private
Image
offscreenImage
;
/** Red value */
int
r
=
0
;
public
int
rxsave
;
public
int
rysave
;
private
Image
offscreenImage
;
public
int
rxsave
;
public
int
rysave
;
/** Represents the selected area in the birdview */
private
Rectangle
selArea
;
private
Rectangle
selArea
;
/** Represents the start point of the action. */
private
Point
startPos
=
new
Point
();
public
int
xsave
;
public
int
xxsave
;
private
Point
startPos
=
new
Point
();
public
int
xsave
;
public
int
xxsave
;
public
int
ysave
;
public
int
yysave
;
public
int
ysave
;
public
int
yysave
;
/** the father session */
private
ImageSession
session
;
...
...
@@ -127,32 +124,51 @@ public class BirdViewPanel extends JPanel implements MouseListener,
// syncImage();
if
(
session
.
isDisplayEnable
())
{
this
.
mImage
.
createBirdview
(
180
,
200
);
this
.
mBirdImage
=
getImage
();
computeMinMaxBands
();
createBirdview
(
180
,
200
);
}
}
private
void
computeMinMaxBands
()
{
double
data
[][][]
=
this
.
mImage
.
load
(
0
,
0
,
this
.
mImage
.
getWidth
(),
this
.
mImage
.
getHeight
());
this
.
max
=
new
double
[
data
.
length
];
this
.
min
=
new
double
[
data
.
length
];
// for each band
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++)
{
this
.
max
[
i
]
=
this
.
min
[
i
]
=
data
[
i
][
0
][
0
];
// for each column
for
(
int
x
=
0
;
x
<
data
[
i
].
length
;
x
++)
{
// for each line
for
(
int
y
=
0
;
y
<
data
[
i
][
x
].
length
;
y
++)
{
// searching the max and min value of the band
this
.
max
[
i
]
=
Math
.
max
(
this
.
max
[
i
],
data
[
i
][
x
][
y
]);
this
.
min
[
i
]
=
Math
.
min
(
this
.
min
[
i
],
data
[
i
][
x
][
y
]);
}
}
/**
* <p>
* Creates a birdView for this image.
* </p>
*
* @param dest_w
* the desired width of the birdview
* @param dest_h
* the desired height of the birdview
*/
private
void
createBirdview
(
int
dest_w
,
int
dest_h
)
{
double
x_zoomFactor
=
1
;
double
y_zoomFactor
=
1
;
// testing params
if
(
dest_w
<=
0
||
dest_h
<=
0
)
{
PiLLiTools
.
error
(
"Invalid desired dimension for the new birdview"
,
"BirdViewPanal.java"
,
"createBirdview(int, int)"
);
return
;
}
// we considerate only the smallest zoom factor
if
(
this
.
mImage
.
getWidth
()
>
0
)
x_zoomFactor
=
(
double
)
dest_w
/
(
double
)
this
.
mImage
.
getWidth
();
if
(
this
.
mImage
.
getHeight
()
>
0
)
y_zoomFactor
=
(
double
)
dest_h
/
(
double
)
this
.
mImage
.
getHeight
();
if
(
MainFrame
.
DEBUG_MODE
)
System
.
out
.
println
(
"public void createBirdview(int dest_w, int dest_h)"
+
dest_w
+
" "
+
dest_h
+
" "
+
x_zoomFactor
+
" "
+
y_zoomFactor
);
if
(
x_zoomFactor
<
y_zoomFactor
)
{
this
.
mBirdImage
=
this
.
mImagePanel
.
getBirdViewImage
(
x_zoomFactor
);
}
else
{
this
.
mBirdImage
=
this
.
mImagePanel
.
getBirdViewImage
(
y_zoomFactor
);
}
}
/** Get the blue value */
...
...
@@ -165,8 +181,8 @@ public class BirdViewPanel extends JPanel implements MouseListener,
return
this
.
g
;
}
p
rivate
BufferedImage
getImage
()
{
return
this
.
m
Image
.
getBirdview
().
getImage
()
;
p
ublic
BufferedImage
getImage
()
{
return
this
.
m
BirdImage
;
}
public
int
getNbBands
()
{
...
...
@@ -733,11 +749,10 @@ public class BirdViewPanel extends JPanel implements MouseListener,
* height in the original image
*/
public
void
updateSelectedArea
(
int
x
,
int
y
,
int
width
,
int
height
)
{
Picture
birdview
=
this
.
mImage
.
getBirdview
();
double
xfact
=
(
double
)
this
.
mImage
.
getWidth
()
/
(
double
)
birdview
.
getImage
()
.
getWidth
();
/
(
double
)
mBirdImage
.
getWidth
();
double
yfact
=
(
double
)
this
.
mImage
.
getHeight
()
/
(
double
)
birdview
.
getImage
()
.
getHeight
();
/
(
double
)
mBirdImage
.
getHeight
();
int
sx
=
(
int
)
(
x
/
xfact
);
int
sy
=
(
int
)
(
y
/
yfact
);
...
...
@@ -780,11 +795,10 @@ public class BirdViewPanel extends JPanel implements MouseListener,
if
(!
session
.
isDisplayEnable
())
return
;
// Compute the real selection area
Picture
birdview
=
this
.
mImage
.
getBirdview
();
double
xfact
=
(
double
)
this
.
mImage
.
getWidth
()
/
(
double
)
birdview
.
getImage
()
.
getWidth
();
/
(
double
)
mBirdImage
.
getWidth
();
double
yfact
=
(
double
)
this
.
mImage
.
getHeight
()
/
(
double
)
birdview
.
getImage
()
.
getHeight
();
/
(
double
)
mBirdImage
.
getHeight
();
int
rx
=
(
int
)
(
this
.
selArea
.
x
*
xfact
);
int
ry
=
(
int
)
(
this
.
selArea
.
y
*
yfact
);
...
...
@@ -810,9 +824,9 @@ public class BirdViewPanel extends JPanel implements MouseListener,
return
;
// Compute the real selection area
double
xfact
=
(
double
)
this
.
mImage
.
getWidth
()
/
(
double
)
this
.
m
Image
.
getBirdview
().
getImage
()
.
getWidth
();
/
(
double
)
this
.
m
BirdImage
.
getWidth
();
double
yfact
=
(
double
)
this
.
mImage
.
getHeight
()
/
(
double
)
this
.
m
Image
.
getBirdview
().
getImage
()
.
getHeight
();
/
(
double
)
this
.
m
BirdImage
.
getHeight
();
double
xgeo
;
double
ygeo
;
...
...
src/mustic/gui/panels/ImagePanel.java
View file @
bfa9b9a0
...
...
@@ -2,7 +2,6 @@ package mustic.gui.panels;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.awt.geom.AffineTransform
;
import
java.awt.image.*
;
import
java.util.Vector
;
...
...
@@ -10,12 +9,12 @@ import javax.swing.*;
import
jcl.data.mask.Mask
;
import
mustic.gui.*
;
import
mustic.io.Picture
;
import
mustic.io.RawImage
;
import
mustic.io.roi.RegionOfInterest
;
import
mustic.utils.filters.ZipFileFilter
;
import
mustic.utils.image.BufferedImageViewer
;
import
mustic.utils.image.ImageViewer
;
import
mustic.utils.image.PyramidImageViewer
;
/**
* Display an image and allows the user to do some operations on it (zoom, contrast..)
...
...
@@ -56,7 +55,7 @@ public class ImagePanel extends JPanel {
protected
float
mZoomRate
=
1.0f
;
/** zoom step */
private
float
mZoomStep
=
0.
2
f
;
private
float
mZoomStep
=
0.
7
f
;
private
ClassList
pl_label
=
null
;
...
...
@@ -88,7 +87,7 @@ public class ImagePanel extends JPanel {
* @param infoPanel acces to the information panel
*/
public
ImagePanel
(
RawImage
aImage
,
ImageSession
session
)
{
this
.
viewer
=
new
Buffere
dImageViewer
(
aImage
.
getFilename
(),
true
);
this
.
viewer
=
new
Pyrami
dImageViewer
(
aImage
.
getFilename
(),
true
);
this
.
session
=
session
;
this
.
mImageLabel
=
new
JLabel
();
this
.
mImageLabel
.
setHorizontalAlignment
(
SwingConstants
.
CENTER
);
...
...
@@ -590,6 +589,9 @@ public class ImagePanel extends JPanel {
updateImageView
();
}
/**
* Update the associated BirdViewPanle to the image displayed
*/
private
void
updateBirdViewPanel
()
{
lastWidth
=
mImageLabel
.
getIcon
().
getIconWidth
();
lastHeight
=
mImageLabel
.
getIcon
().
getIconHeight
();
...
...
@@ -600,12 +602,23 @@ public class ImagePanel extends JPanel {
(
int
)
(
lastWidth
/
mZoomRate
),
(
int
)
(
lastHeight
/
mZoomRate
));
}
public
BufferedImage
getBirdViewImage
(
double
zoomFactor
)
{
BufferedImage
result
=
viewer
.
getScreenImage
(
0
,
0
,
(
int
)
(
viewer
.
getRealImageWidth
()*
zoomFactor
),
(
int
)
(
viewer
.
getRealImageHeight
()*
zoomFactor
),
zoomFactor
);
if
(
lastWidth
>
0
)
{
viewer
.
getScreenImage
(
currentX
,
currentY
,
lastWidth
,
lastHeight
,
mZoomRate
);
}
else
{
viewer
.
resetAll
();
}
return
result
;
}
/**
* Zoom in !
*/
public
void
zoomIn
()
{
this
.
mZoomRate
+
=
this
.
mZoomStep
;
this
.
mZoomRate
/
=
this
.
mZoomStep
;
refresh
();
}
...
...
@@ -613,8 +626,8 @@ public class ImagePanel extends JPanel {
* Zoom out !
*/
public
void
zoomOut
()
{
if
(
this
.
mZoomRate
-
this
.
mZoomStep
>
0
)
{
this
.
mZoomRate
-
=
this
.
mZoomStep
;
if
(
this
.
mZoomRate
*
this
.
mZoomStep
>
0.001f
)
{
this
.
mZoomRate
*
=
this
.
mZoomStep
;
refresh
();
}
else
...
...
@@ -762,14 +775,16 @@ public class ImagePanel extends JPanel {
public
void
mouseClicked
(
MouseEvent
e
)
{
if
(
e
.
getButton
()
==
MouseEvent
.
BUTTON1
)
{
// if the display is disabled we don't take it in consideration
if
(!
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
isDisplayEnable
())
{
if
(!
session
.
isDisplayEnable
())
{
return
;
}
// Toute les JInternalFrames afiche sur le MusticDesktop
ImageDesktopFrame
[]
jInternalFrames
=
MainFrame
.
getInstance
().
getDesktop
().
getAllImageDesktopFrames
();
if
(
jInternalFrames
.
length
>=
1
&&
((
this
.
mi
==
null
||
this
.
mi
.
getIndexOfSelectedButton
()
==
-
1
))
&&
MainFrame
.
getTargetMode
())
{
if
(
jInternalFrames
.
length
>=
1
&&
((
this
.
mi
==
null
||
this
.
mi
.
getIndexOfSelectedButton
()
==
-
1
))
&&
MainFrame
.
getTargetMode
())
{
double
x2
=
e
.
getX
()
-
((
mImageLabel
.
getWidth
()
-
mImageLabel
.
getIcon
().
getIconWidth
())
/
2.0
);
double
y2
=
e
.
getY
()
-
((
mImageLabel
.
getHeight
()
-
mImageLabel
.
getIcon
().
getIconHeight
())
/
2.0
);
...
...
@@ -777,32 +792,36 @@ public class ImagePanel extends JPanel {
x2
=
x2
/
mZoomRate
;
y2
=
y2
/
mZoomRate
;
int
x
=
(
int
)
x2
+
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
xxsave
;
int
x
=
(
int
)
x2
+
session
.
getBirdViewPanel
().
xxsave
;
// birdViewPanel.xxsave;
int
y
=
(
int
)
y2
+
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
yysave
;
int
y
=
(
int
)
y2
+
session
.
getBirdViewPanel
().
yysave
;
// birdViewPanel.yysave;
// geoposition
if
(
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getInitPosGeo
()
!=
null
)
{
double
xgeo
=
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getInitPosGeoX
()
+
x
*
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getResolution
()[
0
];
double
ygeo
=
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getInitPosGeoY
()
-
y
*
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getResolution
()[
1
];
if
(
session
.
getRawImage
().
getInitPosGeo
()
!=
null
)
{
double
xgeo
=
session
.
getRawImage
().
getInitPosGeoX
()
+
x
*
session
.
getRawImage
().
getResolution
()[
0
];
double
ygeo
=
session
.
getRawImage
().
getInitPosGeoY
()
-
y
*
session
.
getRawImage
().
getResolution
()[
1
];
for
(
int
s
=
0
;
s
<
jInternalFrames
.
length
;
s
++)
{
ImagePanel
ip
=
jInternalFrames
[
s
].
getImageSession
().
getImagePanel
();
ImageSession
imageSession
=
jInternalFrames
[
s
].
getImageSession
();
if
(
imageSession
.
getRawImage
().
getInitPosGeo
()
!=
null
&&
ip
.
getROIToolsFrame
()
==
null
)
{
double
resX
=
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getResolution
()[
0
]
double
resX
=
session
.
getRawImage
().
getResolution
()[
0
]
/
imageSession
.
getRawImage
().
getResolution
()[
0
];
double
resY
=
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getRawImage
().
getResolution
()[
1
]
double
resY
=
session
.
getRawImage
().
getResolution
()[
1
]
/
imageSession
.
getRawImage
().
getResolution
()[
1
];
int
xn
,
yn
;
xn
=
(
int
)
((
xgeo
-
imageSession
.
getRawImage
().
getInitPosGeoX
())
/
imageSession
.
getRawImage
().
getResolution
()[
0
]);
yn
=
(
int
)
((
imageSession
.
getRawImage
().
getInitPosGeoY
()
-
ygeo
)
/
imageSession
.
getRawImage
().
getResolution
()[
1
]);
xn
=
(
int
)
((
xgeo
-
imageSession
.
getRawImage
().
getInitPosGeoX
())
/
imageSession
.
getRawImage
().
getResolution
()[
0
]);
yn
=
(
int
)
((
imageSession
.
getRawImage
().
getInitPosGeoY
()
-
ygeo
)
/
imageSession
.
getRawImage
().
getResolution
()[
1
]);
xn
-=
imageSession
.
getBirdViewPanel
().
xxsave
;
// ip.birdViewPanel.xxsave;
yn
-=
imageSession
.
getBirdViewPanel
().
yysave
;
// ip.birdViewPanel.yysave;
xn
*=
imageSession
.
getImagePanel
().
getZoomRate
();
yn
*=
imageSession
.
getImagePanel
().
getZoomRate
();
if
(
resX
<
1.0
)
resX
=
1
;
...
...
@@ -811,17 +830,21 @@ public class ImagePanel extends JPanel {
// ip.birdViewPanel
imageSession
.
getBirdViewPanel
().
syncImage
();
ip
.
reloadPoint
(
imageSession
.
getBirdViewPanel
().
xxsave
,
imageSession
.
getBirdViewPanel
().
yysave
,
imageSession
.
getBirdViewPanel
().
rxsave
,
imageSession
.
getBirdViewPanel
().
rysave
);
//imageSession.getBirdViewPanel().syncImage();;
ip
.
reloadPoint
(
imageSession
.
getBirdViewPanel
().
xxsave
,
imageSession
.
getBirdViewPanel
().
yysave
,
imageSession
.
getBirdViewPanel
().
rxsave
,
imageSession
.
getBirdViewPanel
().
rysave
);
// lignes rouges pour visualiser le point cliqué
Color
c
;
c
=
new
Color
(
1.0f
,
0.0f
,
0.0f
,
0.5f
);
Graphics
g
=
ip
.
getImage
().
getGraphics
();
g
.
setColor
(
c
);
g
.
drawLine
(
xn
+
(
int
)
(
resX
/
2
),
0
,
xn
+
(
int
)
(
resX
/
2
),
imageSession
.
getRawImage
().
getHeight
());
g
.
drawLine
(
0
,
yn
+
(
int
)
(
resY
/
2
),
imageSession
.
getRawImage
().
getWidth
(),
yn
+
(
int
)
(
resY
/
2
));
g
.
drawLine
(
xn
+
(
int
)
(
resX
/
2
),
0
,
xn
+
(
int
)
(
resX
/
2
),
imageSession
.
getRawImage
().
getHeight
());
g
.
drawLine
(
0
,
yn
+
(
int
)
(
resY
/
2
),
imageSession
.
getRawImage
().
getWidth
(),
yn
+
(
int
)
(
resY
/
2
));
c
=
new
Color
(
1.0f
,
1.0f
,
1.0f
,
0.5f
);
g
.
setColor
(
c
);
g
.
fillRect
(
xn
,
yn
,
(
int
)
resX
,
(
int
)
resY
);
...
...
@@ -860,16 +883,14 @@ public class ImagePanel extends JPanel {
if
(
this
.
pl
!=
null
&&
x
>=
0
&&
y
>=
0
&&
x
<=
ImagePanel
.
this
.
viewer
.
getScreenImage
().
getWidth
()
&&
y
<=
ImagePanel
.
this
.
viewer
.
getScreenImage
().
getHeight
())
{
Vector
<
Integer
>
vi
=
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
getvalInformation
();
Vector
<
Integer
>
vi
=
session
.
getBirdViewPanel
().
getvalInformation
();
// ImagePanel.this.birdViewPanel.getvalInformation();
this
.
pl
.
choixTraitement
(
x
,
y
,
// (x + ImagePanel.this.birdViewPanel.getSelArea().x)
(
x
+
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
getSelArea
().
x
)
+
(
vi
.
get
(
2
)
-
vi
.
get
(
0
)),
(
x
+
session
.
getBirdViewPanel
().
getSelArea
().
x
)
+
(
vi
.
get
(
2
)
-
vi
.
get
(
0
)),
// (y + ImagePanel.this.birdViewPanel.getSelArea().y)
(
y
+
MainFrame
.
getInstance
().
getCurrentImageSession
()
.
getBirdViewPanel
().
getSelArea
().
y
)
+
(
vi
.
get
(
3
)
-
vi
.
get
(
1
)));
(
y
+
session
.
getBirdViewPanel
().
getSelArea
().
y
)
+
(
vi
.
get
(
3
)
-
vi
.
get
(
1
)));
}
}
...
...
src/mustic/gui/panels/ImageResultPanel.java
View file @
bfa9b9a0
...
...
@@ -443,55 +443,55 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
* This should'nt be used because it really memory and time consuming