diff --git a/_includes/chunked_pyramidal_storage/save_as_bdv_n5.ijm b/_includes/chunked_pyramidal_storage/save_as_bdv_n5.ijm new file mode 100644 index 00000000..735979b4 --- /dev/null +++ b/_includes/chunked_pyramidal_storage/save_as_bdv_n5.ijm @@ -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"); diff --git a/_modules/chunked_pyramidal_image_storage.md b/_modules/chunked_pyramidal_image_storage.md new file mode 100644 index 00000000..daf82fa0 --- /dev/null +++ b/_modules/chunked_pyramidal_image_storage.md @@ -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: +--- \ No newline at end of file diff --git a/figures/chunked_pyramidal_image_storage.png b/figures/chunked_pyramidal_image_storage.png new file mode 100644 index 00000000..49d787b8 Binary files /dev/null and b/figures/chunked_pyramidal_image_storage.png differ diff --git a/figures/resources/chunked_image_grid.ijm b/figures/resources/chunked_image_grid.ijm new file mode 100644 index 00000000..b6d9fce7 --- /dev/null +++ b/figures/resources/chunked_image_grid.ijm @@ -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); + } +} + + + diff --git a/figures/resources/chunked_pyramidal_image_storage.pptx b/figures/resources/chunked_pyramidal_image_storage.pptx new file mode 100644 index 00000000..27d1ee9c Binary files /dev/null and b/figures/resources/chunked_pyramidal_image_storage.pptx differ diff --git a/image_data/xyz_8bit__many_local_maxima.tif b/image_data/xyz_8bit__many_local_maxima.tif new file mode 100644 index 00000000..011c505a Binary files /dev/null and b/image_data/xyz_8bit__many_local_maxima.tif differ diff --git a/image_data/xyz_8bit__very_dense_local_maxima.tif b/image_data/xyz_8bit__very_dense_local_maxima.tif new file mode 100644 index 00000000..a7c58b17 Binary files /dev/null and b/image_data/xyz_8bit__very_dense_local_maxima.tif differ