Open aschampion opened 5 years ago
ImageBlockCache
will eventually be replaced by an external library that can be shared with the webservice, so should be written such that it can be compatible with future features like multiscale and multilabel, even if it does not initially implement them.ImageBlockLayer
prototype.PaintingTool
PaintingLayer
or PaintingOverlay
EditTool
to something more clear like MetaTool
Navigator
to use correct prototype implementationTracingTool
to prototype inheritanceStackLayer
interpolation made should be an enum-like of linear, nearest, inherit, rather than a booleanEnd of day goals were set to show independent progress on the three main components of this solution:
ImageBlockLayer
display a layer from a (raw) stackLabelAnnotations
understand stack group orthoviews, so that the controllers will share settings for all layers of the same underlying stack data.Some cleanup tasks and code merging plans after the week is up:
VecDataBlock
bound changesDisplay
for DataType
block_metadata
by making fields optionalModifiedReader
traits and implsN5AsyncReader
via block_metadata
changes upstreamMerge order/branch dependencies for features:
Backend specification of stack type, either Raw or Label.
@tomka Regarding this, now that the frontend LabelAnnotations
transitively infers the equivalence of label stacks via groups they are related to as view
s, I'm wondering if a different approach to specifying stack type should be taken. The motivation is this: if we want to start adding annotations to label IDs, that label ID needs to be scoped to a label stack. However, this may not be one stack, but many sharing the same label set/semantics. Hence we want to be able to create something in the Class
system that is a label space, to which either stacks or stack groups can be related. In that design, the most meaningful specification of whether a stack is a label stack is not a property on individual stacks, but whether a stack (via StackClassInstance
) or any of its view
-related stack groups (via StackGroupClassInstance
) is related to a label space class instance.
But maybe we should go with the simpler, Stack
field solution first. I just hate making migrations likely to be superceded soon after.
Summary of changes (mostly from gitter) and additional tasks:
BigInt
(i.e., everything except Chrome for now) support should raise an error.ReorientedStack
s, that wrap existing stacks into new orientations. This will only be available for stacks with image block source mirrors.
Progress tracking for tested label bit depth support
bits | vis (shader hash) | shader ids | selection | issues |
---|---|---|---|---|
8 | :white_check_mark: | shader generality | ||
16 | shader generality | |||
24/32 | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
32 | :white_check_mark: | premultiplied alpha | ||
48/64 | 16bpp, bigint, shader p | |||
53/64 | premultiplied alpha, 16bpp, bigint, shader p | |||
64 | premultiplied alpha, 16bpp, bigint, shader p, js numerics |
Minor update: bit depths > 32 are waiting on scijs/ndarray#43 to be merged (which will then need a release and an update in numjs
).
This is a tracking ticket for MVP visualization and painting of label volumes via CATMAID.
Goals
Non-goals
Our vision for CATMAID does not include a rich, general-purpose painting tool or segmentation proofreading tool, encompassing features like:
Instead, we believe these are the purview of other tools like Paintera / BigCat / neuroglancer and that CATMAID should interoperate with these tools. Our vision for interoperation is incremental, progressive enhancement through three general stages of:
The plan below builds towards this vision. Relatedly, features that would be handled by such a state synchronization backend are also non-goals, such as the N-dimensional persistence itself, efficient delta exchange and conflict resolution.
Prior work
A painting layer was previously prototyped by Larry in CATSOP (#533, catsop feature branch). However, this was never merged to mainline CATSOP (which in turn was never merged into mainline CATMAID). Painting was never a development focus of CATSOP; the majority of CATSOP development was dealing either with SOPNET-specific issues, WebGL support (merged into CATMAID), database scaling optimization (partially merged into CATMAID), or the more general problem of dependent dataflow synchronization in a distributed, collaborative setting. None of these are goals here.
Draft plan
General prerequisite infrastructure
package.json
and webpack bundle for frontendindex.html
numjs
is built on top ofndarray
and has the most useful functionality, slicing and view.Volumetric stack access and rendering
ImageBlockLayer
, comparable toTileLayer
, for rendering N5 image volumes in theStackViewer
. Note that unlike tile layers this will be WebGL-only (via Pixi for now) likePixiTileLayer
, without a legacy DOM fallback.StackLayer
abstract base class which bothTileLayer
andImageBlockLayer
can extend (or into mixin/component if appropriate)Option AImageBlockLayer
fromPixiTileLayer
, keeping the majority of tile creation logic.ImageBlockLayer
should refer to anImageBlockCache
(orImageBlockStore
orImageBlockManager
), similar to the global texture cache.ImageBlockCache
should have a CATMAID event bus for mutation and eviction, to whichImageBlockLayer
subscribes, orImageBlockLayer
must have explicit notification methods for block-specific redraws. This is necessary for block mutation during painting.ImageBlockCache
should also track a state identifier for the last version of each block in the cache received from n5-wasm. Initially this will be either an mtime or content hash.imageValueAtLocation
or similar method toTileLayer
that looks up the image intensity value for a location inside the current view boundary. This would already be useful for querying intensity in raw stacks, but will be necessary for label picking in label stacks.http://example.org/path/to/folder.n5/group/dataset/%SCALE_DATASET%/0_1_3
Label stack specification and visualization
Raw
orLabel
. @tomka and I have discussed alternatives (e.g., property ofProjectStack
, specification via relation like stack groups and channels) and are fine with this being a new column directly onStack
.StackClassInstance
related properties or in the N5attributes.json
. For now this is stored in a magicStack.metadata
property,catmaidLabelMeta.specialLabels
.SkeletonAnnotations
in that they coordinate the selection state, display and mutation of label annotations in tools, but rather than having one per project, there is one per open label stack.ImageBlockLayer
is supportedImageBlockCache
and theImageBlockLayer
, possibly through a wrapper. In this design label mapping occurs in Javascript and the texture uploaded to the GPU would be the global label IDs.LabelFilter
filters that are applied to theImageBlockLayer
through the existingPixiLayer
filter system. This is already partially implemented (cc @clbarnes).RandomizedLayerColorMap
orObjectLabelColorMap
filters).ObjectLabelColorMap
, but can later be adapted to assign particular colors via a label selection source model just as skeleton sources do now.Painting
ImageBlockLayer
.ImageBlockCache
backing the label layer.Option BStrokes are painted directly into theImageBlockCache
.N5 doesn't support multi-block locking, but rust-n5 could be trivially extended to do so.The webservice itself will handle multi-block locking, as it would also be responsible for any future, more elaborate, conflict resolution mechanism.ClassInstance
representing the CATMAID ontology object for this label.Unresolved questions
Alternatives
ImageBlockCache
functionality in wasm. This functionality will likely be provided by an external library in future iterations anyway.N5Writer
directly over WebDAV and bypass the CATMAID backend for block writing, but WebDAV is a mess and few implementations provide locking.N5Writer
for a generic RESTful HTTP backend.Known limitations
Misc. notes
cc @tomka @bellonet