Custom delayed operations
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the showtree and .rec_showtree methods, then trace how getArrayElement handles DelayedOp subclasses. Reproduce the example with DelayedAffineSeed and DelayedTranslateSeed, including the subset operation on the temporary Zarr array. Done means external classes containing DelayedOp can participate in the requested delayed-operation inspection or access flow without the reported missing-method error.
Written by the indexing model from the issue text.
Description
Dear @hpages,
I am working on devising lazy image transformations for https://github.com/HelenaLC/SpatialData/issues/162.
I was wondering if it is possible to use showtree or .rec_showtree methods (or similar methods) for external classes that facilitate delayed operations.
I have tried below, but it requires me to define additional methods for these classes that contain DelayedOp:
setClass(
"DelayedAffineSeed",
contains = "DelayedOp",
slots = c(
seed = "ANY",
dim = "integer",
dimnames = "list",
m = "matrix",
axes = "character",
filter = "character",
bg.col = "character",
antialias = "logical",
trace = "logical"
)
)
setClass(
"DelayedTranslateSeed",
contains = "DelayedOp",
slots = c(
seed = "ANY",
dim = "integer",
dimnames = "list",
shift = "numeric",
axes = "character"
)
)
# save as zarr
td <- tempfile(fileext = ".zarr")
delayed_img <- writeZarrArray(x = EBImage::imageData(img), zarr_path = td)
# affine
rotated_delayed_img <- lazy_affine(delayed_img, m = m, filter = "bilinear")
# translate
translate_delayed_img <- lazy_translate(rotated_delayed_img, shift = c(100,200))
# subset
subset_delayed_img <- translate_delayed_img[100:200, 100:200]
> subset_delayed_img@seed
101x101 double: Subset
└─ 1024x512 double: DelayedTranslateSeed object
Error: unable to find an inherited method for function ‘getArrayElement’ for signature ‘x = "DelayedTranslateSeed"’
- Dominant language
- R
- Stars
- 29
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Bioconductor/DelayedArray
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Bioconductor/DelayedArray#129 · 11 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Bioconductor/DelayedArray#125 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Bioconductor/DelayedArray#123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Bioconductor/DelayedArray#122 ·
-
`base::cbind()` Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Bioconductor/DelayedArray#116 · 3 comments ·
All issues in Bioconductor/DelayedArray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
easystats/performance#950 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
briandconnelly/airnow#9 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
Difficulty 1/5 Under an hour Newbie friendliness 60/100
openjournals/joss-reviews#11330 · 7 comments ·