Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Kimberly Isobel Meechan
Image Data Explorer
Commits
5abd1aab
Commit
5abd1aab
authored
Oct 28, 2020
by
Jean-Karim Heriche
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed losing current selection due to persistence of previous input on image.
parent
f4754ed3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
R/explore_image.R
R/explore_image.R
+4
-2
No files found.
R/explore_image.R
View file @
5abd1aab
...
...
@@ -76,6 +76,8 @@ explore_image_server <-function(input, output, session, rv){
observe
({
if
(
!
is.null
(
input
$
pixelPosition
))
{
rv
$
pixelPosition
<-
matrix
(
input
$
pixelPosition
,
ncol
=
2
,
byrow
=
TRUE
)
# Reset event to avoid triggering updates when switching workspaces
runjs
(
"Shiny.setInputValue('explore_module-image-pixelPosition', null);"
)
}
else
{
rv
$
pixelPosition
<-
NULL
}
...
...
@@ -94,13 +96,13 @@ explore_image_server <-function(input, output, session, rv){
if
(
!
is.null
(
rv
$
selectedFrame
))
{
for
(
i
in
1
:
nrow
(
rv
$
pixelPosition
))
{
if
(
!
is.null
(
rv
$
roiFrame
)
&&
rv
$
roiFrame
!=
""
)
{
## rv$selectedFrame should always have a unique value even when length>1
##
rv$imgPath1 and
rv$selectedFrame should always have a unique value even when length>1
## because the image has already been selected if we click on it
## so it's safe to use the first value
clickPosition
<-
data.frame
(
t
(
c
(
rv
$
pixelPosition
[
i
,],
rv
$
selectedFrame
[
1
])))
## Make sure we're looking only for ROIs present in the frame currently displayed
## This assumes that we interact with imageViewer1
roiData
<-
rv
$
data
[
rv
$
data
[,
rv
$
fileCol1
]
==
rv
$
imgPath1
&
rv
$
data
[,
rv
$
roiFrame
]
==
rv
$
selectedFrame
[
1
],
roiData
<-
rv
$
data
[
rv
$
data
[,
rv
$
fileCol1
]
==
rv
$
imgPath1
[
1
]
&
rv
$
data
[,
rv
$
roiFrame
]
==
rv
$
selectedFrame
[
1
],
c
(
rv
$
roiX
,
rv
$
roiY
,
rv
$
roiFrame
)]
}
else
{
clickPosition
<-
data.frame
(
t
(
c
(
rv
$
pixelPosition
[
i
,])))
...
...
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