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
2ead1919
Commit
2ead1919
authored
May 15, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix about mask application
parent
a3c6831f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
23 deletions
+137
-23
src/mustic/gui/ImageSession.java
src/mustic/gui/ImageSession.java
+4
-2
src/mustic/gui/dialog/SequenceDialog.java
src/mustic/gui/dialog/SequenceDialog.java
+30
-2
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+13
-12
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+10
-1
src/mustic/gui/panels/data/DataConstructPanel.java
src/mustic/gui/panels/data/DataConstructPanel.java
+61
-0
src/mustic/gui/panels/data/components/SourceSelectionPanel.java
...stic/gui/panels/data/components/SourceSelectionPanel.java
+18
-5
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+1
-1
No files found.
src/mustic/gui/ImageSession.java
View file @
2ead1919
...
...
@@ -269,8 +269,10 @@ public class ImageSession {
this
.
rawImage
.
setMask
(
file
);
}
this
.
mImagePanel
.
applyMask
(
this
.
rawImage
.
getMask
());
this
.
mImagePanel
.
doZoomOp
();
if
(
displayEnable
)
{
this
.
mImagePanel
.
applyMask
(
this
.
rawImage
.
getMask
());
this
.
mImagePanel
.
doZoomOp
();
}
}
/**
...
...
src/mustic/gui/dialog/SequenceDialog.java
View file @
2ead1919
...
...
@@ -31,6 +31,7 @@ import javax.swing.event.ListSelectionListener;
import
loci.formats.FormatException
;
import
mustic.gui.ImageDesktopFrame
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.io.PictureTool
;
import
mustic.io.RawImage
;
...
...
@@ -305,9 +306,9 @@ public class SequenceDialog extends JDialog {
}
/**
* Re
nvoie la donnée correspondant à la sequence d'images
* Re
turn the list of image path constituting the selected sequence
*
* @return
data
* @return
the list of ordered file path
*
* @throws FormatException
* if the images don't have the same dimensions
...
...
@@ -331,6 +332,33 @@ public class SequenceDialog extends JDialog {
return
paths
;
}
/**
* Return the list of image sessions constituting the selected sequence
*
* @return the list of ordered session
*
* @throws FormatException
* if the images don't have the same dimensions
*/
public
Vector
<
ImageSession
>
getSequenceSessions
()
throws
FormatException
{
int
nb
=
this
.
dlmSeq
.
getSize
();
Donnee
donnee
;
Vector
<
ImageSession
>
paths
=
new
Vector
<
ImageSession
>();
if
(
nb
>
0
)
{
ImageDesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
.
getAllImageDesktopFrames
();
// int nbSessions = desktopFrames.length;
for
(
int
i
=
0
;
i
<
nb
;
i
++)
{
donnee
=
(
Donnee
)
this
.
dlmSeq
.
getElementAt
(
i
);
paths
.
add
(
desktopFrames
[
donnee
.
index
].
getImageSession
());
}
}
return
paths
;
}
/**
* Renvoie les indices de chaque image de la sequence
...
...
src/mustic/gui/panels/BirdViewPanel.java
View file @
2ead1919
...
...
@@ -969,6 +969,19 @@ public class BirdViewPanel extends JPanel implements MouseListener,
}
}
session
.
getBirdViewPanel
().
selArea
.
x
=
(
int
)
Math
.
round
(
rx
/
xfact
);
session
.
getBirdViewPanel
().
selArea
.
y
=
(
int
)
Math
.
round
(
ry
/
yfact
);
session
.
getBirdViewPanel
().
selArea
.
width
=
this
.
selArea
.
width
;
session
.
getBirdViewPanel
().
selArea
.
height
=
this
.
selArea
.
height
;
session
.
getBirdViewPanel
().
xsave
=
(
int
)
Math
.
round
(
rx
/
xfact
);
session
.
getBirdViewPanel
().
ysave
=
(
int
)
Math
.
round
(
ry
/
yfact
);
session
.
getBirdViewPanel
().
xxsave
=
realarea
.
x
;
session
.
getBirdViewPanel
().
yysave
=
realarea
.
y
;
session
.
getBirdViewPanel
().
rxsave
=
rx
;
session
.
getBirdViewPanel
().
rysave
=
ry
;
session
.
getRawImage
().
afficheRoi
(
image
,
rx
,
ry
);
session
.
getImagePanel
().
setImage
(
image
);
...
...
@@ -980,18 +993,6 @@ public class BirdViewPanel extends JPanel implements MouseListener,
for
(
SegmentationPanel
segPanel
:
session
.
getSegPanels
())
{
segPanel
.
setImage
(
image
,
rx
,
ry
);
}
session
.
getBirdViewPanel
().
selArea
.
x
=
(
int
)
Math
.
round
(
rx
/
xfact
);
session
.
getBirdViewPanel
().
selArea
.
y
=
(
int
)
Math
.
round
(
ry
/
yfact
);
session
.
getBirdViewPanel
().
selArea
.
width
=
this
.
selArea
.
width
;
session
.
getBirdViewPanel
().
selArea
.
height
=
this
.
selArea
.
height
;
session
.
getBirdViewPanel
().
xsave
=
(
int
)
Math
.
round
(
rx
/
xfact
);
session
.
getBirdViewPanel
().
ysave
=
(
int
)
Math
.
round
(
ry
/
yfact
);
session
.
getBirdViewPanel
().
xxsave
=
realarea
.
x
;
session
.
getBirdViewPanel
().
yysave
=
realarea
.
y
;
session
.
getBirdViewPanel
().
rxsave
=
rx
;
session
.
getBirdViewPanel
().
rysave
=
ry
;
//
}
...
...
src/mustic/gui/panels/ImagePanel.java
View file @
2ead1919
...
...
@@ -10,7 +10,6 @@ import javax.swing.*;
import
jcl.data.mask.Mask
;
import
mustic.gui.*
;
import
mustic.io.MusticImageMask
;
import
mustic.io.RawImage
;
import
mustic.io.roi.RegionOfInterest
;
import
mustic.utils.filters.ZipFileFilter
;
...
...
@@ -105,6 +104,9 @@ public class ImagePanel extends JPanel {
this
.
mImageLabel
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mouseClicked
(
MouseEvent
e
)
{
if
(
mImageLabel
.
getIcon
()
==
null
)
return
;
double
w1
=
mImageLabel
.
getWidth
();
double
w2
=
mImageLabel
.
getIcon
().
getIconWidth
();
...
...
@@ -742,6 +744,10 @@ public class ImagePanel extends JPanel {
@Override
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
())
{
return
;
}
// Toute les JInternalFrames afiche sur le MusticDesktop
ImageDesktopFrame
[]
jInternalFrames
=
MainFrame
.
getInstance
().
getDesktop
().
getAllImageDesktopFrames
();
...
...
@@ -823,6 +829,9 @@ public class ImagePanel extends JPanel {
@Override
public
void
mousePressed
(
MouseEvent
e
)
{
if
(
ImagePanel
.
this
.
mScreenImage
==
null
)
{
return
;
}
// ici on receptionne les evenements de clic de la souris sur
// l'image satelitte
int
x
=
(
int
)
((
e
.
getX
()
-
(
int
)
((
ImagePanel
.
this
.
mImageLabel
.
getWidth
()
-
(
ImagePanel
.
this
.
mScreenImage
.
getWidth
()
*
ImagePanel
.
this
.
mZoomRate
))
/
2
))
/
ImagePanel
.
this
.
mZoomRate
);
...
...
src/mustic/gui/panels/data/DataConstructPanel.java
View file @
2ead1919
...
...
@@ -4,6 +4,8 @@ import java.awt.BorderLayout;
import
java.awt.FlowLayout
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Vector
;
import
javax.swing.JButton
;
...
...
@@ -14,8 +16,10 @@ import com.l2fprod.common.swing.JTaskPane;
import
com.l2fprod.common.swing.JTaskPaneGroup
;
import
jcl.data.mask.Mask
;
import
jcl.data.sampling.ImageSampler
;
import
jcl.data.sampling.Sampler
;
import
mustic.gui.ImageDesktopFrame
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.gui.dialog.SequenceDialog
;
import
mustic.gui.panels.data.components.SamplingSelectionPanel
;
...
...
@@ -39,6 +43,8 @@ public class DataConstructPanel extends JPanel implements ToUpdateObject {
public
static
int
SEGMENTATION_SOURCE_TYPE
=
1
;
private
Vector
<
String
>
filesPaths
=
null
;
private
Vector
<
ImageSession
>
imageSessions
=
null
;
/** Les menus deroulants */
private
JTaskPane
taskPane
=
new
JTaskPane
();
...
...
@@ -119,6 +125,21 @@ public class DataConstructPanel extends JPanel implements ToUpdateObject {
private
void
generateData
()
{
ImageData
data
=
null
;
if
(
sourcePanel
.
isSequenceMaskSelected
()
&&
sample
instanceof
ImageSampler
&&
imageSessions
!=
null
)
{
List
<
Mask
>
maskSequence
=
new
ArrayList
<
Mask
>();
boolean
containsAtLeastOne
=
false
;
for
(
ImageSession
session
:
imageSessions
)
{
Mask
m
=
session
.
getRawImage
().
getMask
();
maskSequence
.
add
(
m
);
if
(
m
!=
null
)
{
containsAtLeastOne
=
true
;
}
}
if
(
containsAtLeastOne
)
{
((
ImageSampler
)
sample
).
setMaskSequence
(
maskSequence
);
}
}
if
(
filesPaths
.
size
()
>
1
)
{
data
=
new
ImageData
(
sample
,
filesPaths
);
}
else
{
...
...
@@ -134,18 +155,58 @@ public class DataConstructPanel extends JPanel implements ToUpdateObject {
samplingPanel
.
updatedSample
();
}
/**
* Set the list of file path constituting of the current data generated
*
* @param filesPaths
* the list of image's file paths
*/
public
void
setFileSources
(
Vector
<
String
>
filesPaths
)
{
this
.
filesPaths
=
filesPaths
;
}
/**
* Return the list of file path constituting of the current data generated
*
* @return the list of image's file paths
*/
public
Vector
<
String
>
getFilesSources
()
{
return
filesPaths
;
}
/**
* Set the list of ImageSessions constituting of the current data generated
*
* @param imageSessions
* the list of ImageSessions
*/
public
void
setImageSessions
(
Vector
<
ImageSession
>
imageSessions
)
{
this
.
imageSessions
=
imageSessions
;
}
/**
* Return the list of ImageSessions constituting of the current data generated
*
* @return the list of ImageSessions
*/
public
Vector
<
ImageSession
>
getImageSessions
()
{
return
imageSessions
;
}
/**
* Return the subpanel used to select the data source
*
* @return the panel
*/
public
SourceSelectionPanel
getSourceSelectionPanel
()
{
return
sourcePanel
;
}
/**
* Return the subpanel used to select the sampling parameters
*
* @return the panel
*/
public
SamplingSelectionPanel
getSamplingSelectionPanel
()
{
return
samplingPanel
;
}
...
...
src/mustic/gui/panels/data/components/SourceSelectionPanel.java
View file @
2ead1919
package
mustic.gui.panels.data.components
;
import
java.awt.BorderLayout
;
import
java.awt.Component
;
import
java.awt.FlowLayout
;
import
java.awt.GridLayout
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.io.File
;
...
...
@@ -22,6 +22,7 @@ import javax.swing.JRadioButton;
import
jcl.data.sampling.ImageSampler
;
import
loci.formats.FormatException
;
import
mustic.gui.ImageDesktopFrame
;
import
mustic.gui.ImageSession
;
import
mustic.gui.MainFrame
;
import
mustic.gui.dialog.MaskImportDialog
;
import
mustic.gui.panels.data.DataConstructPanel
;
...
...
@@ -64,7 +65,7 @@ public class SourceSelectionPanel extends JPanel {
private
JLabel
maskLabel
=
new
JLabel
(
"_"
);
//$NON-NLS-1$
private
JPanel
parameterContainer
=
n
ull
;
private
JPanel
parameterContainer
=
n
ew
JPanel
()
;
/** store the sessions used to build the combobox, the order might change
* in the MusticDesktop, so we use it to search by index */
...
...
@@ -110,7 +111,9 @@ public class SourceSelectionPanel extends JPanel {
}
private
void
updateParametersPanel
()
{
parameterContainer
=
new
JPanel
();
for
(
Component
c
:
parameterContainer
.
getComponents
())
{
parameterContainer
.
remove
(
c
);
}
parameterContainer
.
setLayout
(
new
BoxLayout
(
parameterContainer
,
BoxLayout
.
Y_AXIS
));
JPanel
addMaskPanel
=
new
JPanel
();
...
...
@@ -153,11 +156,16 @@ public class SourceSelectionPanel extends JPanel {
parameterContainer
.
add
(
addMaskPanel
);
if
(
multiDateRadioButton
.
isSelected
())
{
JPanel
useSequenceMaskPanel
=
new
JPanel
();
useSequenceMaskPanel
.
setLayout
(
new
FlowLayout
(
FlowLayout
.
LEFT
));
sequenceMaskCheckBox
=
new
JCheckBox
(
Messages
.
getString
(
"source.22"
));
//$NON-NLS-1$
parameterContainer
.
add
(
sequenceMaskCheckBox
);
useSequenceMaskPanel
.
add
(
sequenceMaskCheckBox
);
parameterContainer
.
add
(
useSequenceMaskPanel
);
}
else
{
sequenceMaskCheckBox
=
null
;
}
//parameterContainer.validate();
parameterContainer
.
updateUI
();
}
...
...
@@ -320,6 +328,8 @@ public class SourceSelectionPanel extends JPanel {
}
fatherContainer
.
setFileSources
(
fatherContainer
.
getSequenceDialog
().
getSequenceData
());
fatherContainer
.
setImageSessions
(
fatherContainer
.
getSequenceDialog
().
getSequenceSessions
());
}
catch
(
FormatException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -338,6 +348,9 @@ public class SourceSelectionPanel extends JPanel {
filesPath
.
add
(
allImageDesktopFrames
[
index
]
.
getImageSession
().
getImageFilePath
());
fatherContainer
.
setFileSources
(
filesPath
);
Vector
<
ImageSession
>
imageSessions
=
new
Vector
<
ImageSession
>();
imageSessions
.
add
(
allImageDesktopFrames
[
index
].
getImageSession
());
fatherContainer
.
setImageSessions
(
imageSessions
);
}
}
...
...
@@ -346,7 +359,7 @@ public class SourceSelectionPanel extends JPanel {
//TODO we should also initialize the sequenceDialog
}
public
boolean
is
s
equenceMaskSelected
()
{
public
boolean
is
S
equenceMaskSelected
()
{
if
(
sequenceMaskCheckBox
==
null
)
{
return
false
;
}
...
...
src/mustic/io/RawImage.java
View file @
2ead1919
...
...
@@ -825,7 +825,7 @@ public class RawImage implements Serializable, MemoryFlush {
* <p>
* Returns the current mask of this image.
* </p>
* @return the image's mask
.
* @return the image's mask
, null if none
*/
public
Mask
getMask
()
{
return
this
.
mask
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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