Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
e8dabfb9
Commit
e8dabfb9
authored
11 years ago
by
pkupczyk
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-75 / Javascript-based Microscopy Data Viewer - introduce channel stack chooser
SVN: 31400
parent
c224f7d6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/core-plugins/microscopy/1/as/webapps/image-viewer/html/index.html
+107
-17
107 additions, 17 deletions
...gins/microscopy/1/as/webapps/image-viewer/html/index.html
with
107 additions
and
17 deletions
screening/source/core-plugins/microscopy/1/as/webapps/image-viewer/html/index.html
+
107
−
17
View file @
e8dabfb9
...
@@ -95,22 +95,31 @@
...
@@ -95,22 +95,31 @@
this
.
load
(
function
(){
this
.
load
(
function
(){
var
channelWidget
=
new
ChannelChooserWidget
(
thisImageViewer
.
getChannels
());
var
channelWidget
=
new
ChannelChooserWidget
(
thisImageViewer
.
getChannels
());
channelWidget
.
setSelectedChannel
(
"
RGB
"
);
channelWidget
.
addChangeListener
(
function
(){
channelWidget
.
addChangeListener
(
function
(){
imageWidget
.
setChannels
(
channelWidget
.
getSelectedOrMergedChannels
());
imageWidget
.
setChannels
(
channelWidget
.
getSelectedOrMergedChannels
());
});
});
thisImageViewer
.
panel
.
append
(
channelWidget
.
render
());
thisImageViewer
.
panel
.
append
(
channelWidget
.
render
());
var
resolutionWidget
=
new
ResolutionChooserWidget
(
thisImageViewer
.
getResolutions
());
var
resolutionWidget
=
new
ResolutionChooserWidget
(
thisImageViewer
.
getResolutions
());
resolutionWidget
.
setSelectedResolution
(
"
512x512
"
);
resolutionWidget
.
addChangeListener
(
function
(){
resolutionWidget
.
addChangeListener
(
function
(){
imageWidget
.
setResolution
(
resolutionWidget
.
getSelectedResolution
());
imageWidget
.
setResolution
(
resolutionWidget
.
getSelectedResolution
());
});
});
thisImageViewer
.
panel
.
append
(
resolutionWidget
.
render
());
thisImageViewer
.
panel
.
append
(
resolutionWidget
.
render
());
var
channelStackWidget
=
new
ChannelStackChooserWidget
(
thisImageViewer
.
getChannelStacks
());
channelStackWidget
.
setSelectedChannelStack
(
thisImageViewer
.
getChannelStacks
()[
0
].
id
);
channelStackWidget
.
addChangeListener
(
function
(){
imageWidget
.
setChannelStackId
(
channelStackWidget
.
getSelectedChannelStack
());
});
thisImageViewer
.
panel
.
append
(
channelStackWidget
.
render
());
var
imageWidget
=
new
ImageWidget
();
var
imageWidget
=
new
ImageWidget
();
imageWidget
.
setDataStoreUrl
(
"
http://localhost:8889/datastore_server_screening
"
);
imageWidget
.
setDataStoreUrl
(
"
http://localhost:8889/datastore_server_screening
"
);
imageWidget
.
setSessionToken
(
thisImageViewer
.
context
.
getSessionId
());
imageWidget
.
setSessionToken
(
thisImageViewer
.
context
.
getSessionId
());
imageWidget
.
setDataSetCode
(
thisImageViewer
.
context
.
getEntityPermId
());
imageWidget
.
setDataSetCode
(
thisImageViewer
.
context
.
getEntityPermId
());
imageWidget
.
setChannelStackId
(
thisImageViewer
.
get
ChannelStack
(
0
,
0
).
id
);
imageWidget
.
setChannelStackId
(
channelStackWidget
.
getSelected
ChannelStack
(
)
);
imageWidget
.
setResolution
(
resolutionWidget
.
getSelectedResolution
());
imageWidget
.
setResolution
(
resolutionWidget
.
getSelectedResolution
());
imageWidget
.
setChannels
(
channelWidget
.
getSelectedOrMergedChannels
());
imageWidget
.
setChannels
(
channelWidget
.
getSelectedOrMergedChannels
());
...
@@ -122,18 +131,21 @@
...
@@ -122,18 +131,21 @@
},
},
getChannels
:
function
(){
getChannels
:
function
(){
return
this
.
imageInfo
.
imageDataset
.
imageDataset
.
imageParameters
.
channels
;
//return this.imageInfo.imageDataset.imageDataset.imageParameters.channels;
return
[
{
code
:
"
RGB
"
,
label
:
"
RGB label
"
},
{
code
:
"
CMYK
"
,
label
:
"
CMYK label
"
}
];
},
},
getChannelStack
:
function
(
timePoint
,
depth
){
getChannelStacks
:
function
(){
if
(
this
.
channelStacks
==
null
){
return
this
.
imageInfo
.
channelStacks
;
var
map
=
{};
this
.
imageInfo
.
channelStacks
.
forEach
(
function
(
channelStack
){
map
[
channelStack
.
timePointOrNull
+
"
_
"
+
channelStack
.
depthOrNull
]
=
channelStack
;
});
this
.
channelStacks
=
map
;
}
return
this
.
channelStacks
[
timePoint
+
"
_
"
+
depth
];
},
},
getResolutions
:
function
(){
getResolutions
:
function
(){
...
@@ -292,16 +304,26 @@
...
@@ -292,16 +304,26 @@
$
(
"
<option>
"
).
attr
(
"
value
"
,
value
).
text
(
value
).
appendTo
(
select
);
$
(
"
<option>
"
).
attr
(
"
value
"
,
value
).
text
(
value
).
appendTo
(
select
);
});
});
if
(
this
.
selectedResolution
){
select
.
val
(
this
.
selectedResolution
);
}
select
.
change
(
function
(){
select
.
change
(
function
(){
thisChooser
.
setSelectedResolution
(
select
.
val
());
thisChooser
.
setSelectedResolution
(
select
.
val
());
});
});
this
.
rendered
=
true
;
this
.
refresh
();
return
this
.
panel
;
return
this
.
panel
;
},
},
refresh
:
function
(){
if
(
!
this
.
rendered
){
return
;
}
var
select
=
this
.
panel
.
find
(
"
select
"
);
if
(
this
.
selectedResolution
){
select
.
val
(
this
.
selectedResolution
);
}
},
getSelectedResolution
:
function
(){
getSelectedResolution
:
function
(){
return
this
.
selectedResolution
;
return
this
.
selectedResolution
;
...
@@ -309,7 +331,7 @@
...
@@ -309,7 +331,7 @@
setSelectedResolution
:
function
(
resolution
){
setSelectedResolution
:
function
(
resolution
){
this
.
selectedResolution
=
resolution
;
this
.
selectedResolution
=
resolution
;
this
.
panel
.
find
(
"
select
"
).
val
(
resolution
);
this
.
refresh
(
);
this
.
notifyChangeListeners
();
this
.
notifyChangeListeners
();
},
},
...
@@ -323,6 +345,74 @@
...
@@ -323,6 +345,74 @@
});
});
//
// CHANNEL STACK CHOOSER
//
function
ChannelStackChooserWidget
(
channelStacks
)
{
this
.
init
(
channelStacks
);
}
$
.
extend
(
ChannelStackChooserWidget
.
prototype
,
{
init
:
function
(
channelStacks
){
this
.
channelStacks
=
channelStacks
;
this
.
selectedChannelStack
=
null
;
this
.
listeners
=
new
ListenerManager
();
this
.
panel
=
$
(
"
<div>
"
);
},
render
:
function
(){
var
thisChooser
=
this
;
var
select
=
$
(
"
<select>
"
).
appendTo
(
this
.
panel
);
this
.
channelStacks
.
forEach
(
function
(
channelStack
){
var
value
=
channelStack
.
id
;
var
text
=
"
T:
"
+
channelStack
.
timePointOrNull
+
"
, D:
"
+
channelStack
.
depthOrNull
;
$
(
"
<option>
"
).
attr
(
"
value
"
,
value
).
text
(
text
).
appendTo
(
select
);
});
select
.
change
(
function
(){
thisChooser
.
setSelectedChannelStack
(
select
.
val
());
});
this
.
rendered
=
true
;
this
.
refresh
();
return
this
.
panel
;
},
refresh
:
function
(){
if
(
!
this
.
rendered
){
return
;
}
var
select
=
this
.
panel
.
find
(
"
select
"
);
if
(
this
.
selectedChannelStack
){
select
.
val
(
this
.
selectedChannelStack
);
}
},
getSelectedChannelStack
:
function
(){
return
this
.
selectedChannelStack
;
},
setSelectedChannelStack
:
function
(
channelStack
){
this
.
selectedChannelStack
=
channelStack
;
this
.
refresh
();
this
.
notifyChangeListeners
();
},
addChangeListener
:
function
(
listener
){
this
.
listeners
.
addListener
(
'
change
'
,
listener
);
},
notifyChangeListeners
:
function
(){
this
.
listeners
.
notifyListeners
(
'
change
'
);
}
});
//
//
// IMAGE
// IMAGE
//
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment