Prototype python implementation of the ome-ngff table spec

Overview

ome-ngff-tables-prototype

prototype python implementation of the ome-ngff table spec

Installation

pip install git+https://github.com/kevinyamauchi/ome-ngff-tables-prototype

Usage

To make an example OME-Zarr dataset with an image and points data, run the examples/save_load_points.py example.

Additionally, you can view the zarr files with a points table that is generated by examples/save_load_points.py in examples/test_image.zarr.

Comments
  • Add matplotlib dependency

    Add matplotlib dependency

    Hey @kevinyamauchi

    I was trying to run your examples/save_load_points.py example, but ran into a missing matplotlib dependency. This should fix that dependency :)

    opened by jluethi 2
  • can't run `example/save_load_points.py`

    can't run `example/save_load_points.py`

    hey @kevinyamauchi 👋

    finally have time to try this out, although can't run example:

    $ python examples/save_load_points.py
               y          x  size
    0  47.642445  24.209154     3
    1  80.593025  12.381161     3
    2  83.739708  93.137802     3
    3  17.738497  55.634464     3
    4  58.593430  86.256935     3
    5  32.610691  67.198502     3
    6   9.933817  82.030869     3
    7  75.796082  21.599758     3
    8  12.506199  10.603416     3
    9  82.929871  61.387028     3
    /Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_core/anndata.py:121: ImplicitModificationWarning: Transforming to str index.
      warnings.warn("Transforming to str index.", ImplicitModificationWarning)
    Traceback (most recent call last):
      File "/Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_io/utils.py", line 214, in func_wrapper
        return func(elem, key, val, *args, **kwargs)
      File "/Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_io/specs/registry.py", line 175, in write_elem
        _REGISTRY.get_writer(dest_type, t, modifiers)(f, k, elem, *args, **kwargs)
      File "/Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_io/specs/registry.py", line 64, in get_writer
        raise TypeError(
    TypeError: No method has been defined for writing <class 'anndata._core.aligned_mapping.AxisArrays'> elements to <class 'zarr.hierarchy.Group'>
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "examples/save_load_points.py", line 32, in <module>
        write_points_dataset(
      File "/Users/giovanni.palla/Projects/ome-ngff-tables-prototype/src/ngff_tables_prototype/writer.py", line 106, in write_points_dataset
        write_table(points_group, points_anndata)
      File "/Users/giovanni.palla/Projects/ome-ngff-tables-prototype/src/ngff_tables_prototype/writer.py", line 38, in write_table
        write_attribute(group, "obsm", adata.obsm, dataset_kwargs)
      File "/Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_io/utils.py", line 134, in write_attribute
        return write_elem(*args, **kwargs)
      File "/Users/giovanni.palla/miniconda3/envs/squidpy/lib/python3.8/site-packages/anndata/_io/utils.py", line 220, in func_wrapper
        raise type(e)(
    TypeError: No method has been defined for writing <class 'anndata._core.aligned_mapping.AxisArrays'> elements to <class 'zarr.hierarchy.Group'>
    
    Above error raised while writing key 'obsm' of <class 'zarr.hierarchy.Group'> to <zarr.storage.FSStore object at 0x7f9be6abf400>
    

    do I maybe need a specific branch on ome-ngff ? I just cloned and installed so might be missing something

    Thanks!

    opened by giovp 0
  • allow anndata to write uppercase keys

    allow anndata to write uppercase keys

    @jhnnsrs discovered that we were forcing the table keys to be lower case. This is incompatible with AnnData, which expects the dense matrix key to be X (i.e., upper case). This PR provides a fix by allowing the keys to be upper case when writting the AnnData group.

    opened by kevinyamauchi 0
  • consolidate_metadata for tables

    consolidate_metadata for tables

    See discussion at https://github.com/ome/ngff/pull/64/files#r1025073730

    In order to allow full access to all the tables metadata when the ability to ls subdirectories is not available (e.g. over https / s3), consolidate_metadata() can be used to add metadata to the image.zarr/tables group.

    This would also provide a work-around for the listing of tables within that top-level tables group. See https://github.com/ome/ngff/pull/64/files#r1022858025

    cc @ivirshup @joshmoore

    opened by will-moore 9
  • Error running example

    Error running example

    Hi @kevinyamauchi !

    Found potential typo in the reader.py This might be a quick fix for it? https://github.com/kevinyamauchi/ome-ngff-tables-prototype/pull/9 Lmk when do you think

    I will keep playing with it. So far so good! 👍

    Best, Tong

    opened by BioinfoTongLI 0
  • [WIP] High Content Screening OME-NGFF example

    [WIP] High Content Screening OME-NGFF example

    I'm trying to add an HCS example dataset, here's a WIP PR for this.

    Motivation: Provide example data in the OME-NGFF High Content Screening format spec

    My example dataset contains 2x2 field of views (fovs) for a single well, with label images, already saved in the OME-Zarr HCS spec. Additionally, I have feature measurements for each site saved as csvs and an example script that loads those measurements and saves them as an AnnData table per site. The saving seems to work nicely and I have an AnnData tables folder per fov. Really cool to see this working already!

    Current issues:

    1. I don't have a nice way to share example data. It's currently on a Google Drive, but my attempts to use gdown to download it from there directly have failed. Does anyone know an easy way to fix this? At the moment, one needs to follow the instructions in the example file to manually download the data first, unzip the OME-Zarr file & then run the example.
    2. It seems the load_to_napari_viewer function is flipping x & y dimensions here. Is that intentional? When I open my images with the napari-ome-zarr plugin, they are displayed like this:
    Screenshot 2022-06-23 at 18 46 10 But when I open them with `load_to_napari_viewer`, x&y dimensions are flipped for the images (but not for the label, thus making the label not match the images anymore) Screenshot 2022-06-23 at 18 46 13
    1. It appears the loading isn't designed to handle the plate spec. I haven't had time to look into it much. At the moment, I just load the first field of view, because load_to_napari_viewer throws a zarr.errors.ContainsGroupError: path 'tables' contains a group if I provide e.g. the full well (and full plates currently don't support displaying label images in ome-zarr-py, see here: https://github.com/ome/ome-zarr-py/issues/65#issuecomment-1155295470

    Solved Issues:

    1. I also used the library originally to save my label images to the OME-Zarr file. Saving 3D label images needed axes parameters & I added parsing for those for label images (not used in the example anymore, but maybe useful to somebody else)
    opened by jluethi 3
Owner
Kevin Yamauchi
Kevin Yamauchi
Code for ICCV2021 paper SPEC: Seeing People in the Wild with an Estimated Camera

SPEC: Seeing People in the Wild with an Estimated Camera [ICCV 2021] SPEC: Seeing People in the Wild with an Estimated Camera, Muhammed Kocabas, Chun-

Muhammed Kocabas 187 Dec 26, 2022
Implementation of the paper "Self-Promoted Prototype Refinement for Few-Shot Class-Incremental Learning"

Self-Promoted Prototype Refinement for Few-Shot Class-Incremental Learning This is the implementation of the paper "Self-Promoted Prototype Refinement

Kai Zhu 78 Dec 2, 2022
Adaptive Prototype Learning and Allocation for Few-Shot Segmentation (CVPR 2021)

ASGNet The code is for the paper "Adaptive Prototype Learning and Allocation for Few-Shot Segmentation" (accepted to CVPR 2021) [arxiv] Overview data/

Gen Li 91 Dec 23, 2022
Prototype for Baby Action Detection and Classification

Baby Action Detection Table of Contents About Install Run Predictions Demo About An attempt to harness the power of Deep Learning to come up with a so

Shreyas K 30 Dec 16, 2022
Normal Learning in Videos with Attention Prototype Network

Codes_APN Official codes of CVPR21 paper: Normal Learning in Videos with Attention Prototype Network (https://arxiv.org/abs/2108.11055) Overview of ou

null 11 Dec 13, 2022
functorch is a prototype of JAX-like composable function transforms for PyTorch.

functorch is a prototype of JAX-like composable function transforms for PyTorch.

Facebook Research 1.2k Jan 9, 2023
Audio-Visual Generalized Few-Shot Learning with Prototype-Based Co-Adaptation

Audio-Visual Generalized Few-Shot Learning with Prototype-Based Co-Adaptation The code repository for "Audio-Visual Generalized Few-Shot Learning with

Kaiaicy 3 Jun 27, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
[CVPR'22] Weakly Supervised Semantic Segmentation by Pixel-to-Prototype Contrast

wseg Overview The Pytorch implementation of Weakly Supervised Semantic Segmentation by Pixel-to-Prototype Contrast. [arXiv] Though image-level weakly

Ye Du 96 Dec 30, 2022
CVPR2022 (Oral) - Rethinking Semantic Segmentation: A Prototype View

Rethinking Semantic Segmentation: A Prototype View Rethinking Semantic Segmentation: A Prototype View, Tianfei Zhou, Wenguan Wang, Ender Konukoglu and

Tianfei Zhou 239 Dec 26, 2022
Unofficial implementation of "TTNet: Real-time temporal and spatial video analysis of table tennis" (CVPR 2020)

TTNet-Pytorch The implementation for the paper "TTNet: Real-time temporal and spatial video analysis of table tennis" An introduction of the project c

Nguyen Mau Dung 438 Dec 29, 2022
Python periodic table module

elemenpy Hello! elements.py is a small Python periodic table module that is used for calling certain information about an element. Installation Instal

Eric Cheng 2 Dec 27, 2021
FeTaQA: Free-form Table Question Answering

FeTaQA: Free-form Table Question Answering FeTaQA is a Free-form Table Question Answering dataset with 10K Wikipedia-based {table, question, free-form

Language, Information, and Learning at Yale 40 Dec 13, 2022
Code and data for "TURL: Table Understanding through Representation Learning"

TURL This Repo contains code and data for "TURL: Table Understanding through Representation Learning". Environment and Setup Data Pretraining Finetuni

SunLab-OSU 63 Nov 23, 2022
Practical Single-Image Super-Resolution Using Look-Up Table

Practical Single-Image Super-Resolution Using Look-Up Table [Paper] Dependency Python 3.6 PyTorch glob numpy pillow tqdm tensorboardx 1. Training deep

Younghyun Jo 116 Dec 23, 2022
TAPEX: Table Pre-training via Learning a Neural SQL Executor

TAPEX: Table Pre-training via Learning a Neural SQL Executor The official repository which contains the code and pre-trained models for our paper TAPE

Microsoft 157 Dec 28, 2022
deep-table implements various state-of-the-art deep learning and self-supervised learning algorithms for tabular data using PyTorch.

deep-table implements various state-of-the-art deep learning and self-supervised learning algorithms for tabular data using PyTorch.

null 63 Oct 17, 2022
Convert Table data to approximate values with GUI

Table_Editor Convert Table data to approximate values with GUIs... usage - Import methods for extension Tables. Imported method supposed to have only

CLJ 1 Jan 10, 2022
Table-Extractor 表格抽取

(t)able-(ex)tractor 本项目旨在实现pdf表格抽取。 Models 版面分析模块(Yolo) 表格结构抽取(ResNet + Transformer) 文字识别模块(CRNN + CTC Loss) Acknowledgements TableMaster attention-i

null 2 Jan 15, 2022