Code Monkey home page Code Monkey logo

spacetx-writer's Introduction

SpaceTx Writer

Command-line tool and library for converting bioimaging filesets into the SpaceTx format. Generated filesets contain the required SpaceTx metadata in JSON, 2D TIFF stacks, and an OME companion file.

Getting started

Prerequisites

The following are required:

JDK 7 or higher
Gradle

Building with Gradle

From the root directory, run:

gradle build

Downloaded files (including the Gradle distribution itself) will be stored in the Gradle user home directory (~/.gradle by default).

Installing Gradle build

You will need to unpack one of the built distribution from build/distributions, e.g.:

unzip -d /tmp/ build/distributions/spacetx-writer-$VERSION.zip
/tmp/spacetx-writer-$VERSION/bin/spacetx-writer

Building with Docker

If instead of installing a JDK and building from source, you can locally build the docker image: From the root directory, run:

docker build -t spacetx-writer .

Running the built image will call the spacetx-writer executable by default.

Pulling from GitLab

Finally, you can pull a pre-built image from Docker Hub:

docker pull spacetx/spacetx-writer

Usage

Basics

If you would like to use the docker image, it is important that you mount input and output directories into the container:

docker run -ti --rm -v /tmp:/tmp -v /data:/data:ro spacetx-writer ...

Once that is done, behavior of the docker container and the command-line are the same. A simplest invocation would be:

spacetx-writer -o /tmp/new-directory /data/my-data.nd2

See -h for more information.

Choosing your input file

Bio-Formats takes a single input file, searches through around 150 different file formats to determine the type, and then groups associated files together into a single fileset automatically. You can see a list of the file formats and which file should be chosen on the Datset Structure Table page.

Grouping files

If Bio-Formats does not detect the data type, you may need to tell it how to group multiple multiple unrelated files into a single fileset. This can be done by creating a "pattern file".

For example, if you have 5 large TIFF files t1.tif through t5.tif, each representing a separate round, create a file with the contents:

t<1-5>.tif

and pass it to the tool. Similarly, if you have several 2D TIFFs, create a file which matches your chosen pattern:

my_tiffs_z<1-12>_c<1-3>_t<1-100>.tiff

For more information, see the Grouping files using a pattern file page on the Bio-Formats documentation.

Multiple FOVs

If you pass multiple files to the tool, they will be interpreted as separate filesets, each of which which will be made into a field-of-view. The FOV will have the dimensions detected by Bio-Formats. If Bio-Formats does not show the expected dimensions, you may need to try grouping files.

Further Resources

spacetx-writer's People

Contributors

joshmoore avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

nicokiaru

spacetx-writer's Issues

Repo status?

Is there interest in trying to get this building again? Or would archiving the repo be more appropriate?

Limit number of files per directory

No more than approx. 10^3 files should be placed in the same directory. If necessary, artificial prefix directories should be generated (e.g. 000/first-batch-of.tiff)

t<1-5>.tif patterns do not work

Hi, today I tried to resave a large 3d image with 1550 z planes. I tried encoding it as "z_<0000-1549>.tif" in the filename, but that does not work. I looked at the source code and it seems that this feature is not implemented because it immediately checks that the filename exists, which of course it doesn't - it would need to be parsed first and "z_<0000-1549>.tif" would have to be expanded into 1550 filenames:

for (String input : inputs) {
if (!new File(input).exists()) {
Errors.doesNotExist.raise(input);

I added my 1500 filenames by hand using a for-loop instead, which works fine. So my guess would be that somehow, parsing of the filename would have to happen just before the code snippet I posted above. Or am I doing something wrong or missing something?

Thanks so much,
Stephan

Issues with build?

I have been trying to get my .nd2 images in spacetx format, but since I have many FOVs ~2TB in size across 12 rounds on an individual FOV basis (i.e. sect1_Time00000_Point0007_ChannelL-750,DAPI,L-488_Seq0007.nd2), I really struggled to load them with the existing starfish tutorials without having to split them tediously into separate DAPI and FISH channels.

I was hoping the spacetxx-writer would help, and from the looks of it, it built without issues using docker. I did not get an error message. The last few lines of the build were:

=> exporting to image                                                                                                                0.1s 
=> => exporting layers                                                                                                               0.1s 
=> => writing image sha256:a735297a4368641df2b309ffeab42a1116d60022dabef2059c9fbc0010b9ac92                                          0.0s 
=> => naming to docker.io/library/spacetx-writer  

When trying to run spacetx-writer, I get the following error:
zsh: command not found: spacetx-writer

I am not certain if something went wrong with the build, or what I am doing wrong. I followed the usage instructions of the simple example with my filenames, but find it a little hard to trouble shoot.

I am running this on a Mac OsX Ventura 13.3.1 (M1 Max, 32GB)

Codebook-csv

Spacetx-writer does not convert a custom codebook.csv into codebook.json.
I was wondering if I have to write my codebook in a specific way or format that makes it usable for the conversion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.