Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Swain Lab
aliby
aliby-mirror
Commits
0a8370f2
Commit
0a8370f2
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes
parent
21af9f9d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aliby/io/dataset.py
+6
-6
6 additions, 6 deletions
aliby/io/dataset.py
aliby/io/image.py
+1
-1
1 addition, 1 deletion
aliby/io/image.py
aliby/pipeline.py
+2
-6
2 additions, 6 deletions
aliby/pipeline.py
with
9 additions
and
13 deletions
aliby/io/dataset.py
+
6
−
6
View file @
0a8370f2
...
@@ -16,7 +16,7 @@ class DatasetLocal:
...
@@ -16,7 +16,7 @@ class DatasetLocal:
"""
"""
def
__init__
(
self
,
dpath
:
Union
[
str
,
PosixPath
]):
def
__init__
(
self
,
dpath
:
Union
[
str
,
PosixPath
]
,
*
args
,
**
kwargs
):
self
.
fpath
=
Path
(
dpath
)
self
.
fpath
=
Path
(
dpath
)
assert
len
(
self
.
get_images
()),
"
No tif files found
"
assert
len
(
self
.
get_images
()),
"
No tif files found
"
...
@@ -94,8 +94,8 @@ class Dataset(Argo):
...
@@ -94,8 +94,8 @@ class Dataset(Argo):
def
files
(
self
):
def
files
(
self
):
if
self
.
_files
is
None
:
if
self
.
_files
is
None
:
self
.
_files
=
{
self
.
_files
=
{
x
.
G
etFile
n
ame
():
x
x
.
g
etFile
N
ame
():
x
for
x
in
self
.
dataset
.
L
istAnnotations
()
for
x
in
self
.
dataset
.
l
istAnnotations
()
if
isinstance
(
x
,
omero
.
gateway
.
FileAnnotationWrapper
)
if
isinstance
(
x
,
omero
.
gateway
.
FileAnnotationWrapper
)
}
}
if
not
len
(
self
.
_files
):
if
not
len
(
self
.
_files
):
...
@@ -107,17 +107,17 @@ class Dataset(Argo):
...
@@ -107,17 +107,17 @@ class Dataset(Argo):
if
self
.
_tags
is
None
:
if
self
.
_tags
is
None
:
self
.
_tags
=
{
self
.
_tags
=
{
x
.
getname
():
x
x
.
getname
():
x
for
x
in
self
.
dataset
.
L
istAnnotations
()
for
x
in
self
.
dataset
.
l
istAnnotations
()
if
isinstance
(
x
,
omero
.
gateway
.
TagAnnotationWrapper
)
if
isinstance
(
x
,
omero
.
gateway
.
TagAnnotationWrapper
)
}
}
return
self
.
_tags
return
self
.
_tags
def
cache_logs
(
self
,
root_dir
):
def
cache_logs
(
self
,
root_dir
):
for
name
,
annotation
in
self
.
files
.
items
():
for
name
,
annotation
in
self
.
files
.
items
():
filepath
=
root_dir
/
annotation
.
G
etFile
n
ame
().
replace
(
"
/
"
,
"
_
"
)
filepath
=
root_dir
/
annotation
.
g
etFile
N
ame
().
replace
(
"
/
"
,
"
_
"
)
if
str
(
filepath
).
endswith
(
"
txt
"
)
and
not
filepath
.
exists
():
if
str
(
filepath
).
endswith
(
"
txt
"
)
and
not
filepath
.
exists
():
# save only the text files
# save only the text files
with
open
(
str
(
filepath
),
"
wb
"
)
as
fd
:
with
open
(
str
(
filepath
),
"
wb
"
)
as
fd
:
for
chunk
in
annotation
.
G
etFileInChunks
():
for
chunk
in
annotation
.
g
etFileInChunks
():
fd
.
write
(
chunk
)
fd
.
write
(
chunk
)
return
True
return
True
This diff is collapsed.
Click to expand it.
aliby/io/image.py
+
1
−
1
View file @
0a8370f2
...
@@ -13,7 +13,7 @@ from aliby.io.omero import Argo
...
@@ -13,7 +13,7 @@ from aliby.io.omero import Argo
class
ImageLocal
:
class
ImageLocal
:
def
__init__
(
self
,
path
:
str
):
def
__init__
(
self
,
path
:
str
,
*
args
,
**
kwargs
):
self
.
path
=
path
self
.
path
=
path
self
.
image_id
=
str
(
path
)
self
.
image_id
=
str
(
path
)
...
...
This diff is collapsed.
Click to expand it.
aliby/pipeline.py
+
2
−
6
View file @
0a8370f2
...
@@ -253,12 +253,8 @@ class Pipeline(ProcessABC):
...
@@ -253,12 +253,8 @@ class Pipeline(ProcessABC):
print
(
"
Searching OMERO
"
)
print
(
"
Searching OMERO
"
)
# Do all all initialisations
# Do all all initialisations
dataset_wrapper
=
(
dataset_wrapper
=
DatasetLocal
if
isinstance
(
expt_id
,
str
)
else
Dataset
lambda
x
:
DatasetLocal
(
x
)
with
dataset_wrapper
(
expt_id
,
**
self
.
general
.
get
(
"
server_info
"
,
{}))
as
conn
:
if
isinstance
(
expt_id
,
str
)
else
lambda
x
:
Dataset
(
int
(
x
),
**
self
.
general
[
"
server_info
"
])
)
with
dataset_wrapper
(
expt_id
)
as
conn
:
image_ids
=
conn
.
get_images
()
image_ids
=
conn
.
get_images
()
directory
=
self
.
store
or
root_dir
/
conn
.
unique_name
directory
=
self
.
store
or
root_dir
/
conn
.
unique_name
...
...
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