Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunked pyramidal image storage #128

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _includes/chunked_pyramidal_storage/save_as_bdv_n5.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
run("MRI Stack");
run("Scale...", "x=3 y=3 z=20 interpolation=Bilinear average process create");
run("Export Current Image as XML/N5", " subsampling_factors=[{ {1,1,1}, {2,2,2}, {4,4,4} }] n5_chunk_sizes=[{ {64,64,64}, {64,64,64}, {64,64,64} }] compression=[raw (no compression)] default export_path=/Users/tischer/Desktop/export.xml");
54 changes: 54 additions & 0 deletions _modules/chunked_pyramidal_image_storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Chunked pyramidal image storage
layout: module

prerequisites:
- "[Basic properties of images and pixels](../pixels)"

objectives:
- Understand the concept of chunked pyramidal image storage and its relevance for big image data analysis and visualisation
- Store an image in a chunked pyramidal format and inspect its layout on disk

motivation: >
Microscopy modalities such as light sheet or volume EM can generate images in the TB range. For such images, it is not efficient/ possible to load the whole image into RAM for analysis or visualisation. Thus it is important to store the image such that only the parts ("chunks") can be efficiently loaded that are currently being displayed or analysed. In addition, storing several versions of the image at different ("pyramidal") resolution levels ("google maps style") is advantageous for smooth browsing of the image data.

concept_map: >
graph TD
I("Image") --> R("Resolution levels")
R --> C("Chunks")

figure: figures/chunked_pyramidal_image_storage.png
figure_legend: TODO: Image before and after background correction

activity_preface: |
- TODO: Open image [xy_16bit__nuclei_high_dynamic_range_with_offset](https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_16bit__nuclei_high_dynamic_range_with_offset.tif)
- Save image in a pyramidal chunked image data format
- Inspect the image on disk (identify the resolution levels and chunks)

activities:
- IDEA: inspect an image on disk and determine the number of resolution levels and the chunk size
- IDEA: store an image with different amount of resolution levels and check the file size
- ["TODO: ImageJ Macro & GUI", "global_background_correction/activities/global_background_correction.ijm", "java"]

exercises:
- ["TODO: ImageJ Macro & GUI", "global_background_correction/exercises/global_background_correction.md"]

assessment: |
### True or false?
1. The size of an image increases by a factor of XYZ when saving additional resolution levels in 2D/3D.
2. More (i.e. smaller) chunks will increase the size of the image on disk.
3. The optimal chunk size....
4. Downsampling by powers of 2 or 3.....

> ## Solution
> 1. TODO: The datatype is irrelevant for background subtraction. **FALSE**
> 2. TODO: Background subtraction using a unsigned integer image will always lead to a positive valued background. **TRUE**
> 3. TODO: Global background subtraction is important for ratiometric computations. **TRUE**
> 4. TODO: Global background subtraction affects differences in intensities. **FALSE**
{: .solution}

learn_next:


external_links:
---
Binary file added figures/chunked_pyramidal_image_storage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions figures/resources/chunked_image_grid.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
run("Close All");

n = 512;

setForegroundColor(255, 255, 255);

newImage("grid", "8-bit black", n, n, 1);
drawGrid(n/50, 1);
drawGrid(n/10, 3);
run("Invert");

newImage("grid", "8-bit black", n, n, 1);
drawGrid(n/100, 1);
drawGrid(n/20, 3);
run("Invert");


function drawGrid(d, w)
{
setLineWidth(w);
for (x = 0; x < n; x+=d) {
drawLine(x, 0, x, n);
}
for (y = 0; y < n; y+=d) {
drawLine(0, y, n, y);
}
}



Binary file not shown.
Binary file added image_data/xyz_8bit__many_local_maxima.tif
Binary file not shown.
Binary file added image_data/xyz_8bit__very_dense_local_maxima.tif
Binary file not shown.