NEUBIAS / training-resources

Resources for teaching/preparing to teach bioimage analysis
https://neubias.github.io/training-resources
Other
48 stars 21 forks source link

Main section #45

Closed tischi closed 3 years ago

tischi commented 3 years ago

@tobyhodges cc @manerotoni

We would need a "main" section for writing some more general stuff between

figure:
figure_legend:
main: // <- currently missing (other name than "main" would be also ok)
activity_preface:

Could that be added?

tischi commented 3 years ago

@tobyhodges

Could you please point us to the place where the layout of one module is defined? We would like to add a main section for general explanations.

Is this maybe the place?

_layouts/module.html

tobyhodges commented 3 years ago

That's the right file but the layout is already set up so that any content you write in the body of the module Markdown file (i.e. below the closing --- of the YAML header) will appear below the figure caption and above the activity section. This is done with the {{ content }} variable substitution on line 125 of module.html.

tischi commented 3 years ago

I think we tried just writing something below figure_legend but go a compilation error. @manerotoni can you confirm?

tobyhodges commented 3 years ago

What I mean is that you can write something in the main body of the Markdown file, i.e.

---
title:     Connected components 
layout:    module
[...more YAML...]
learn_next:
  - "[Split touching objects](object_splitting)"
  - "[Measure object shapes](measure_shapes)"
external_links:
  - "[Wikipedia: Connected components labeling](https://en.wikipedia.org/wiki/Connected-component_labeling)"
---

Any Markdown content added here, below the YAML header, will be rendered 
and inserted between the figure caption and the Activity section.
tischi commented 3 years ago

ah! thanks! so that is much further up in the document than where we tried.

tobyhodges commented 3 years ago

Further up? Just checking we understand each other: the important stuff is happening at the bottom of the example I gave above.

tobyhodges commented 3 years ago

The modules are set up to take a lot of common page features as parameters in the YAML header. It helps to keep the structure of each module consistent but is not really how the lesson template was designed to be used e.g. one major disadvantage is that YAML is much harder to write than Markdown.

You might find it helpful to look at how a more standard lesson episode is put together, and compare the source .md file to the rendered page.

tischi commented 3 years ago

Below the current pixels.md, could you let us know in that example where to add the "main" text?

---
title: Pixels
layout: module

prerequisites:

objectives:
  - Understand that an image is composed of pixels.
  - Understand what pixels and voxels are.
  - Examine the values and indices of pixels in an image.

motivation: >
  Although the technical [definition](https://mathworld.wolfram.com/Image.html) an image is more general, in practice images are very often represented as an array of pixels (voxels). Pixel stands for "picture element". In 3-D, a pixel is sometimes also called a voxel, which stands for "volume element". For image analysis it is crucial to know how to examine the pixels (voxels) in an image.

concept_map: >
  graph TD
    Im("Image") -->|has many| P("Pixel")
    P -->|has| Va("Value")
    P -->|has| I("Indices")
    P -->|aka| Vo("Voxel")

figure: /figures/pixels.png
figure_legend:

activity_preface: |
  - Open image: xy_8bit__nuclei_noisy_different_intensity.tif
  - Explore different ways to inspect pixel values and indices, e.g.,
    - Examine individual (or a range of) pixel values
    - Plot line profiles
    - Compute and plot pixel value histograms

activities:
#  "ImageJ GUI": "pixels/activities/pixels_imagejgui.md"
#  "ImageJ Macro": "pixels/activities/pixels_ijmacro.md"
#  "Jython": "pixels/activities/pixels_jython.md"
#  "MATLAB": "pixels/activities/pixels_matlab.md"

exercises_preface: |

  - Inspect a 2D image: xy_8bit__nuclei_noisy_different_intensity.tif¶
  1. What is the value of the pixel at the indices (20,20)?
  1. What is the highest value in the image?
  1. What is the most frequently occuring value in the image?
  1. What are the lowest pixel indices (?,?) and where is this pixel?
  1. How many pixels does this image have in the horizontal direction?
  1. What is the highest pixel index in the horizontal direction?
  1. If you were to rotate the image by 90 degrees, would it change the image histogram?

  > ## Solution
  > 1. TODO
  {: .solution}

  - Inspect a 3D image: TODO¶
  1. What is the value of the voxel at the indices (100,100,100)?
  1. Whats is the highest value in the image?
  1. What is the most frequently occuring value in the image?
  1. Where is the voxel with the lowest indices and what are those indices (?,?,?) ?¶

  > ## Solution
  > 1. TODO
  {: .solution}

exercises:

learn_next:
  - "[Image display](image_display)"
external_links:
tobyhodges commented 3 years ago
---
title: Pixels
layout: module

prerequisites:

objectives:
  - Examine the values of pixels in an image.

motivation: >
  Images are very often composed of pixels. Pixel stands for "picture element". In 3-D, a pixel is sometimes also called a voxel, which stands for "volume element".
  To analyse images it is very important to know how to examine the pixels (voxels) in an image.

concept_map: >
  graph TD
    Im("Image") -->|has many| P("Pixel")
    P -->|has| V("Value")
    P -->|has| I("Indices")
    P -->|aka| V("Voxel")
    P -->|can have| S("Size")

figure: /figures/pixels.png
figure_legend:

activity_preface: >

  Explore the values, indices (and sizes) of pixels in an image.

activities:
  "ImageJ GUI": "pixels/activities/pixels_imagejgui.md"
#  "ImageJ Macro": "pixels/activities/pixels_ijmacro.md"
#  "Jython": "pixels/activities/pixels_jython.md"
#  "MATLAB": "pixels/activities/pixels_matlab.md"

exercises_preface: >
  True or false?

    - The lowest pixel index of a 2D image always is `[1,1]`.
    - When looking at a 2D image, the lowest pixel indices are always in the lower left corner.

exercises:
#  "ImageJ GUI": "pixels/exercises/pixels_imagejgui.md"
#  "ImageJ Macro": "pixels/exercises/pixels_imagejmacro.md"
#  "Jython": "pixels/exercises/pixels_jython.md"
#  "MATLAB": "pixels/exercises/pixels_matlab.md"

learn_next:
  - "[Image display](image_display)"
external_links:

---

Add any other content as Markdown here and it will be rendered and inserted into the page. <---------
tischi commented 3 years ago

Great! Thank you for the clarification!