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
d194c91b
Commit
d194c91b
authored
13 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2526 Sanofi: dropbox
SVN: 23118
parent
2e57e2ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sanofi/dist/etc/sanofi-dropbox/dropbox-all-in-one-with-library.py
+2
-1
2 additions, 1 deletion
...ist/etc/sanofi-dropbox/dropbox-all-in-one-with-library.py
sanofi/dist/etc/sanofi-dropbox/registration.py
+42
-10
42 additions, 10 deletions
sanofi/dist/etc/sanofi-dropbox/registration.py
with
44 additions
and
11 deletions
sanofi/dist/etc/sanofi-dropbox/dropbox-all-in-one-with-library.py
+
2
−
1
View file @
d194c91b
...
...
@@ -5,6 +5,7 @@ Each directory should contain:
- raw images on the main level
- optionally: segmentation images in the directory containin
"
_ROITiff
"
- optionally: analysis results in the xml file
- optionally: xdce file with image metadata (used to fix colors of the channels determined by the wavelength)
If all kinds of data are provided, 3 datasets will be registered for each incoming directory.
Segmentation and analysis dataset will be linked to the raw images dataset.
"""
...
...
@@ -20,7 +21,7 @@ from ch.systemsx.cisd.openbis.generic.shared.basic.dto.api import ValidationExce
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
import
SearchCriteria
from
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria
import
MatchClause
,
MatchClauseAttribute
reload
(
utils
)
#
reload(utils)
reload
(
config
)
# Can be switched on manually only after the module's code has been changed on the fly:
#reload(plateinitializer)
...
...
This diff is collapsed.
Click to expand it.
sanofi/dist/etc/sanofi-dropbox/registration.py
+
42
−
10
View file @
d194c91b
...
...
@@ -16,6 +16,7 @@ from ch.systemsx.cisd.openbis.dss.etl.dto.api.v1 import SimpleImageDataConfig, I
from
ch.systemsx.cisd.openbis.dss.etl.dto.api.v1
import
Channel
from
ch.systemsx.cisd.openbis.dss.etl.dto.api.v1
import
ChannelColorRGB
from
ch.systemsx.cisd.openbis.dss.etl.custom.incell
import
IncellImageMetadataParser
from
ch.systemsx.cisd.openbis.dss.etl.custom.geexplorer
import
GEExplorerImageAnalysisResultParser
from
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto
import
Geometry
...
...
@@ -97,27 +98,58 @@ class MyImageDataSetConfig(SimpleImageDataConfig):
# can be made available.
# It is usually useful to add "-depth 12" parameter additionally
# if the original image has color depth > 8 bits.
buffer
.
appendImageMagicConvert
(
"
-edge 1 -depth 12
"
,
"
Edge detection
"
)
#
buffer.appendImageMagicConvert("-edge 1 -depth 12", "Edge detection")
return
buffer
.
getTransformations
()
# sets the basic colors
def
createChannel
(
self
,
channelCode
):
channelCode
=
channelCode
.
upper
()
channel
=
Channel
(
channelCode
,
channelCode
)
channelCode
=
channelCode
.
upper
()
if
(
channelCode
==
"
DAPI
"
):
#channel.setWavelengthAndColor(455)
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
0
,
0
,
255
))
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
0
,
77
,
255
))
elif
(
channelCode
==
"
FITC
"
):
#channel.setWavelengthAndColor(525)
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
0
,
255
,
0
))
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
56
,
255
,
0
))
elif
(
channelCode
==
"
CY5
"
):
#channel.setWavelengthAndColor(705)
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
255
,
0
,
0
))
channel
.
setChannelColorRGB
(
ChannelColorRGB
(
244
,
0
,
0
))
channel
.
setAvailableTransformations
(
self
.
getAvailableChannelTransformations
(
channelCode
))
# color of other channels will be set automatically
return
channel
class
RawImageDataSetConfig
(
MyImageDataSetConfig
):
_codeToWavelengthMap
=
None
def
__init__
(
self
,
incomingDir
):
MyImageDataSetConfig
.
__init__
(
self
,
incomingDir
)
self
.
_codeToWavelengthMap
=
self
.
_tryReadCodeToWavelengthMap
(
incomingDir
)
def
_tryReadCodeToWavelengthMap
(
self
,
incomingDir
):
imageMetadataFile
=
utils
.
findFileByExt
(
incomingDir
,
"
xdce
"
)
if
imageMetadataFile
is
not
None
:
parser
=
IncellImageMetadataParser
(
imageMetadataFile
.
getPath
())
channelCodes
=
parser
.
getChannelCodes
()
channelWavelengths
=
parser
.
getChannelWavelengths
()
codeToWavelengthMap
=
{}
for
i
in
range
(
0
,
len
(
channelCodes
)):
codeToWavelengthMap
[
channelCodes
[
i
].
upper
()]
=
channelWavelengths
[
i
]
return
codeToWavelengthMap
return
None
# overrides the basic colors by using the wavelengths found in the xdce file
def
createChannel
(
self
,
channelCode
):
channel
=
MyImageDataSetConfig
.
createChannel
(
self
,
channelCode
)
channelCode
=
channelCode
.
upper
()
if
self
.
_codeToWavelengthMap
is
not
None
:
if
channelCode
in
self
.
_codeToWavelengthMap
:
wavelength
=
self
.
_codeToWavelengthMap
[
channelCode
]
# This will override the color from the superclass and set it
# using Bruton's algorithm.
channel
.
setWavelengthAndColor
(
wavelength
)
return
channel
def
createRawImagesDataset
(
incoming
,
plate
,
batchName
,
transaction
,
factory
):
imageDatasetConfig
=
My
ImageDataSetConfig
(
incoming
)
imageDatasetConfig
=
Raw
ImageDataSetConfig
(
incoming
)
imageDatasetConfig
.
setRawImageDatasetType
()
imageDatasetConfig
.
setFileFormatType
(
config
.
IMAGE_DATASET_FILE_FORMAT
)
imageDatasetConfig
.
setUseImageMagicToGenerateThumbnails
(
config
.
USE_IMAGE_MAGIC_CONVERT_TOOL
)
...
...
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