...
 
Commits (46)
......@@ -2,3 +2,5 @@
.sass-cache*
Gemfile.lock
_site*
*.swp
.travis.yml
image: ruby:2.5
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- bundle install
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
- apt-get -y update
- apt-get install -y python3
- apt-get install -y python3-pip
- gem install json kramdown jekyll
- pip3 install pyyaml
pages:
stage: deploy
script:
- bundle exec jekyll build -d public
- make --always-make site
artifacts:
paths:
- public
only:
- master
- carpentries-style
- theme
---
title: Image binarization
layout: module
prerequisites:
- "[Basic properties of images and pixels](pixels)"
objectives:
- "Describe the relationship between an intensity image and a derived binary image"
- "Apply a threshold to distinguish foreground and background pixels"
motivation: >
Very often, one wants to detect objects or specific regions in images. Typically, the first step to achieve this aim is to distinguish so-called background pixels, which do not contain objects or interesting regions, from foreground pixels, which mark the areas of interest. The foreground regions can than be further processed, e.g to detect objects or perform measurements.
concept_map: >
graph TD
PV("Pixel values") --> BA(Binarization algorithm)
BA --> BPV("Binarized pixel values")
BPV --> BG("Background (0)")
BPV --> FG("Foreground (1)")
figure: /figures/binarization.png
figure_legend: An image before and after applying a threshold. Can you see what the treshold value was?
activity_preface: >
Open an image and binarize it by applying a threshold.
activities:
"ImageJ GUI": "binarization/activities/binarization_imagejgui.md"
"ImageJ Macro": "binarization/activities/binarization_imagejmacro.md"
"Jython": "binarization/activities/binarization_jython.md"
"MATLAB": "binarization/activities/binarization_matlab.md"
exercises_preface: >
### Fill in the blanks
- Pixels in a binary image can have maximally ___ different values.
- If the threshold is larger than the maximal pixel value in the intensity image, all pixels in the binary image have a value of ___.
exercises:
"ImageJ GUI": "binarization/exercises/binarization_imagejgui.md"
"ImageJ Macro": "binarization/exercises/binarization_imagejmacro.md"
"Jython": "binarization/exercises/binarization_jython.md"
"MATLAB": "binarization/exercises/binarization_matlab.md"
learn_next:
- "[Algorithms to automatically determine a threshold value](auto_threshold)"
- "[Finding objects in a binary image](connected_components)"
external_links:
- "[Wikipedia: Binary image](https://en.wikipedia.org/wiki/Binary_image)"
---
---
layout: page
title: Authors
---
This material is the product of contributions from the following people:
* Aliaksandr Halavatyi
* Stefan Helfrich
* Jean-Karim Hériché
* Toby Hodges
* Julius Hossain
* Dominik Kutra
* Constantin Pape
* Christian Tischer
The material also owes much to [The Carpentries](https://carpentries.org):
the site theme is based on
[The Carpentries lesson style](https://github.com/carpentries/styles/)
and the concept-focussed style of the modules is inspired by material taught in
[The Carpentries Instructor Training](https://carpentries.github.io/instructor-training/).
---
layout: page
title: Citation
---
Citation info coming soon.
---
layout: page
title: "Contributor Code of Conduct"
---
As contributors and maintainers of this project,
we pledge to follow the [Carpentry Code of Conduct][coc].
Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by following our [reporting guidelines][coc-reporting].
{% include links.md %}
---
layout: default
layout: page
title: Guidelines for Contributing
---
# Guidelines for Contributing
Contributions to this project are very welcome.
Changes should be submitted by merge request from a new branch to `master`.
......@@ -133,7 +133,7 @@ clone and move into this repository,
and run:
```bash
bundle exec jekyll serve
make serve
```
All going well, your built pages are now beng served locally.
......
source "https://rubygems.org"
ruby RUBY_VERSION
# This will help ensure the proper Jekyll version is running.
gem "jekyll", "3.4.0"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# install GH-flavoured MD plugin
group :jekyll_plugins do
gem 'jekyll-commonmark-ghpages'
end
---
layout: page
title: License
---
This material is made available under the [Creative Commons Attribution license][cc-by-human].
The following is a human-readable summary of (and not a substitute for)
the [full legal text of the CC BY 4.0 license][cc-by-legal].
......@@ -35,7 +40,7 @@ Notices:
permissions necessary for your intended use. For example, other
rights such as publicity, privacy, or moral rights may limit how you
use the material.
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
[our-gitlab-repo]: https://git.embl.de/grp-bio-it/image-analysis-training-resources/
\ No newline at end of file
[our-gitlab-repo]: https://git.embl.de/grp-bio-it/image-analysis-training-resources/
## ========================================
## Commands for both workshop and lesson websites.
# Settings
MAKEFILES=Makefile $(wildcard *.mk)
JEKYLL=jekyll
JEKYLL_VERSION=3.8.5
PARSER=bin/markdown_ast.rb
DST=public
# Controls
.PHONY : commands clean files
.NOTPARALLEL:
all : commands
## commands : show all commands.
commands :
@grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
## docker-serve : use docker to build the site
docker-serve :
docker run --rm -it -v ${PWD}:/srv/jekyll -p 127.0.0.1:4000:4000 jekyll/jekyll:${JEKYLL_VERSION} make serve
## serve : run a local server.
serve : lesson-md
${JEKYLL} serve
## site : build files but do not run a server.
site : lesson-md
${JEKYLL} build -d ${DST}
# repo-check : check repository settings.
repo-check :
@bin/repo_check.py -s .
## clean : clean up junk files.
clean :
@rm -rf ${DST}
@rm -rf .sass-cache
@rm -rf bin/__pycache__
@find . -name .DS_Store -exec rm {} \;
@find . -name '*~' -exec rm {} \;
@find . -name '*.pyc' -exec rm {} \;
## clean-rmd : clean intermediate R files (that need to be committed to the repo).
clean-rmd :
@rm -rf ${RMD_DST}
@rm -rf fig/rmd-*
## ----------------------------------------
## Commands specific to workshop websites.
.PHONY : workshop-check
## workshop-check : check workshop homepage.
workshop-check :
@bin/workshop_check.py .
## ----------------------------------------
## Commands specific to lesson websites.
.PHONY : lesson-check lesson-md lesson-files lesson-fixme
# RMarkdown files
RMD_SRC = $(wildcard _episodes_rmd/??-*.Rmd)
RMD_DST = $(patsubst _episodes_rmd/%.Rmd,_episodes/%.md,$(RMD_SRC))
# Lesson source files in the order they appear in the navigation menu.
MARKDOWN_SRC = \
index.md \
CODE_OF_CONDUCT.md \
setup.md \
$(sort $(wildcard _episodes/*.md)) \
reference.md \
$(sort $(wildcard _extras/*.md)) \
LICENSE.md
# Generated lesson files in the order they appear in the navigation menu.
HTML_DST = \
${DST}/index.html \
${DST}/conduct/index.html \
${DST}/setup/index.html \
$(patsubst _episodes/%.md,${DST}/%/index.html,$(sort $(wildcard _episodes/*.md))) \
${DST}/reference/index.html \
$(patsubst _extras/%.md,${DST}/%/index.html,$(sort $(wildcard _extras/*.md))) \
${DST}/license/index.html
## lesson-md : convert Rmarkdown files to markdown
lesson-md : ${RMD_DST}
_episodes/%.md: _episodes_rmd/%.Rmd
@bin/knit_lessons.sh $< $@
## lesson-check : validate lesson Markdown.
lesson-check : lesson-fixme
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md
## lesson-check-all : validate lesson Markdown, checking line lengths and trailing whitespace.
lesson-check-all :
@bin/lesson_check.py -s . -p ${PARSER} -r _includes/links.md -l -w --permissive
## unittest : run unit tests on checking tools.
unittest :
@bin/test_lesson_check.py
## lesson-files : show expected names of generated files for debugging.
lesson-files :
@echo 'RMD_SRC:' ${RMD_SRC}
@echo 'RMD_DST:' ${RMD_DST}
@echo 'MARKDOWN_SRC:' ${MARKDOWN_SRC}
@echo 'HTML_DST:' ${HTML_DST}
## lesson-fixme : show FIXME markers embedded in source files.
lesson-fixme :
@fgrep -i -n FIXME ${MARKDOWN_SRC} || true
#-------------------------------------------------------------------------------
# Include extra commands if available.
#-------------------------------------------------------------------------------
-include commands.mk
# Image Analysis Training Resources
![](https://git.embl.de/grp-bio-it/image-analysis-training-resources/badges/master/pipeline.svg)
This project is intended to collect together various resources that can be useful
when planning/delivering training in image analysis.
......@@ -10,7 +12,7 @@ Detailed guidance for contributing can be found in [`CONTRIBUTING.md`](CONTRIBUT
Current repository structure:
- `_includes/`: among other things, contains folders holding activities and exercises specific to different platforms for image analysis, for each module
- `_layouts/`, `_sass/`, `Gemfile`, `_config.yml`, `.gitlab-ci.yml`: material for building the webpages associated with this repository
- `_layouts/`, `_sass/`, `Gemfile`, `_config.yml`, `.gitlab-ci.yml`: material for building the webpages associated with this repository
- `figures/`: a collection of illustrations/diagrams used to help explain the concepts in each module.
- `image_data/`: image files used in activities and exercises
- `modules/`: all of the individual module pages are collected here
......
title: Image Analysis Training
email: image-analysis-support@embl.de
title: "Image Analysis Training"
email: "image-analysis-support@embl.de"
description: > # this means to ignore newlines until "baseurl:"
A collection of material for teaching image analysis.
Includes concept maps, exercises, example data
......@@ -8,8 +8,50 @@ url: "https://grp-bio-it.embl-community.io/" # the base hostname & protocol for
contributing: CONTRIBUTING
# Build settings
markdown: CommonMarkGhPages
commonmark:
options: ["SMART"]
# Turn on built-in syntax highlighting.
highlighter: rouge
exclude: ["README.md", "TEACHING.md"]
# options are: "NONE", "ImageJ GUI", "ImageJ Macro", "Jython", "MATLAB"
default-platform: "NONE"
life_cycle: "pre-alpha"
kind: "lesson"
# Sites
repository: "https://git.embl.de/grp-bio-it/image-analysis-training-resources"
repo_url: "https://git.embl.de/grp-bio-it/image-analysis-training-resources"
cc_by_human: "https://creativecommons.org/licenses/by/4.0/"
# Specify that things in the episodes collection should be output.
collections:
modules:
output: true
permalink: /:path/index.html
extras:
output: true
permalink: /:path/index.html
# Set the default layout for things in the modules collection.
defaults:
- values:
root: .
layout: page
- scope:
path: ""
type: modules
values:
root: ..
layout: module
- scope:
path: ""
type: extras
values:
root: ..
layout: page
# Files and directories that are not to be copied.
exclude:
- Makefile
- bin/
- .Rproj.user/
---
layout: page
title: About
---
TODO
{% include links.md %}
---
title: Discussion
---
FIXME
{% include links.md %}
---
layout: page
title: Figures
---
{% include base_path.html %}
<script>
window.onload = function() {
var lesson_modules = [
{% for module in site.modules %}
"{{ module.url }}"{% unless forloop.last %},{% endunless %}
{% endfor %}
];
var xmlHttp = []; /* Required since we are going to query every episode. */
for (i=0; i < lesson_modules.length; i++) {
xmlHttp[i] = new XMLHttpRequest();
xmlHttp[i].module = lesson_modules[i]; /* To enable use this later. */
xmlHttp[i].onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
var article_here = document.getElementById(this.module);
var images = htmlDocArticle.getElementsByTagName("img");
if (images.length > 0) {
var h1text = htmlDocArticle.getElementsByTagName("h1")[0].innerHTML;
var htitle = document.createElement('h2');
htitle.innerHTML = h1text;
article_here.appendChild(htitle);
var image_num = 0;
for (let image of images) {
image_num++;
var title = document.createElement('p');
title.innerHTML = "<strong>Figure " + image_num + ".</strong> " + image.alt;
article_here.appendChild(title);
article_here.appendChild(image.cloneNode(false));
if (image_num < images.length) {
var hr = document.createElement('hr');
article_here.appendChild(hr);
}
}
}
}
}
module_url = "{{ relative_root_path }}" + lesson_modules[i];
xmlHttp[i].open("GET", module_url);
xmlHttp[i].send(null);
}
}
</script>
{% comment %}
Create anchor for each one of the modules.
{% endcomment %}
{% for module in site.modules %}
<article id="{{ module.url }}" class="figures"></article>
{% endfor %}
{% include links.md %}
# Teaching tips
---
title: "Instructor Notes"
layout: page
---
## White-boards
......@@ -17,3 +20,4 @@
- People can see and hear you better.
- Construct something to have your computer up, such that you can stand in front of it.
{% include links.md %}
{% comment %}
As a maintainer, you don't need to edit this file.
If you notice that something doesn't work, please
open an issue: https://github.com/carpentries/styles/issues/new
{% endcomment %}
<script>
window.onload = function() {
var lesson_episodes = [
{% for episode in site.episodes %}
"{{ episode.url}}"{% unless forloop.last %},{% endunless %}
{% endfor %}
];
var xmlHttp = []; /* Required since we are going to query every episode. */
for (i=0; i < lesson_episodes.length; i++) {
xmlHttp[i] = new XMLHttpRequest();
xmlHttp[i].episode = lesson_episodes[i]; /* To enable use this later. */
xmlHttp[i].onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var article_here = document.getElementById(this.episode);
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
article_here.innerHTML = htmlDocArticle.innerHTML;
}
}
var episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
xmlHttp[i].open("GET", episode_url);
xmlHttp[i].send(null);
}
}
</script>
{% comment %}
Create an anchor for every episode.
{% endcomment %}
{% for episode in site.episodes %}
<article id="{{ episode.url }}"></article>
{% endfor %}
{% comment %}
Display key points of all episodes for reference.
{% endcomment %}
{% include base_path.html %}
<h2>Key Points</h2>
<table class="table table-striped">
{% for episode in site.episodes %}
{% unless episode.break %}
<tr>
<td class="col-md-3">
<a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a>
</td>
<td class="col-md-9">
<ul>
{% for keypoint in episode.keypoints %}
<li>{{ keypoint|markdownify }}</li>
{% endfor %}
</ul>
</td>
</tr>
{% endunless %}
{% endfor %}
</table>
{% comment %}
This is adapted from: https://ricostacruz.com/til/relative-paths-in-jekyll
`page.url` gives the URL of the current page with a leading /:
- when the URL ends with the extension (e.g., /foo/bar.html) then we can get
the depth by counting the number of / and remove - 1
- when the URL ends with a / (e.g. /foo/bar/) then the number / gives the depth
directly
{% endcomment %}
{% assign relative_root_path = '' %}
{% assign last_char = page.url | slice: -1 %}
{% if last_char == "/"}
{% assign offset = 0 %}
{% else %}
{% assign offset = 1 %}
{% endif %}
{% assign depth = page.url | split: '/' | size | minus: offset %}
{% if depth <= 1 %}{% assign relative_root_path = '.' %}
{% elsif depth == 2 %}{% assign relative_root_path = '..' %}
{% elsif depth == 3 %}{% assign relative_root_path = '../..' %}
{% elsif depth == 4 %}{% assign relative_root_path = '../../..' %}
{% endif %}
[![Image binarization](https://api.hub.knime.com/repository/*yaYVMcWMurQJfRAq:image)](https://kni.me/w/yaYVMcWMurQJfRAq)
[//]: # (Original URL: https://hub.knime.com/stelfrich/space/Image%20Analysis%20Training%20Resources/Image%20binarization)
``` python
import numpy as np
import matplotlib.pyplot as plt
from skimage import io
# load the image from file
image_file = "/image-analysis-training-resources/image_data/xy_8bit__two_cells.tif"
image = io.imread(image_file)
# binarize the image, so that all values larger than the threshold are foreground
threshold_value = 60
binarized = image > threshold_value
# display the original and the binarized image
fig, ax = plt.subplots(2)
ax[0].imshow(image)
ax[0].set_title("Image")
ax[1].imshow(binarized)
ax[1].set_title("Binarized")
```
For associated course material in jupyter, [click here](https://nbviewer.jupyter.org/github/embl-bio-it/image-analysis-with-python/blob/carpentry/image-analysis-session/image-binarization.ipynb#Image-Binarization).
You can also spin up an interactive [binder session](https://gke.mybinder.org/v2/gh/embl-bio-it/image-analysis-with-python/carpentry?filepath=image-analysis-session/image-binarization.ipynb).
......@@ -4,18 +4,16 @@ This file should contain language-specific exercises, *written* in **Markdown**
#### Exercise 1
What is the solution to the first exercise?
What is the solution to the first exercise?
<details>
<summary>Solution</summary>
This is the solution to the first exercise.
</details>
> ## Solution
> This is the solution to the first exercise.
{: .solution}
#### Exercise 2
What is the solution to the second exercise?
<details>
<summary>Solution</summary>
This is the solution to the second exercise.
</details>
> ## Solution
> This is the solution to the second exercise.
{: .solution}
{% comment %}
General description of Software, Data, and Library Carpentry.
{% endcomment %}
{% include base_path.html %}
<div class="row">
<div class="col-md-2" align="center">
<a href="{{ site.carpentries_site }}"><img src="{{ relative_root_path }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" /></a>
</div>
<div class="col-md-8">
<p><a href="{{ site.carpentries_site }}">The Carpentries</a> comprises
Software Carpentry, Data Carpentry, and Library Carpentry communities of Instructors, Trainers,
Maintainers, helpers, and supporters who share a mission to teach
foundational coding and data science skills to researchers and people
working in library- and information-related roles. In January,
2018, The Carpentries was formed by the merger of Software Carpentry and
Data Carpentry. Library Carpentry became an official Carpentries Lesson Program in November 2018.</p>
<p>While individual lessons and workshops continue to be run under each
lesson project, The Carpentries provide overall staffing and governance, as
well as support for assessment, instructor training and mentoring.
Memberships are joint, and the Carpentries project maintains a shared Code
of Conduct. The Carpentries is a fiscally sponsored project of Community
Initiatives, a registered 501(c)3 non-profit based in California, USA.</p>
</div>
</div>
<div class="row">
<div class="col-md-2" align="center">
<a href="{{ site.swc_site }}"><img src="{{ relative_root_path }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
</div>
<div class="col-md-8">
<p>Since 1998, <a href="{{ site.swc_site }}">Software Carpentry</a> has
been teaching researchers across all disciplines the foundational coding
skills they need to get more done in less time and with less pain. Its
volunteer instructors have run hundreds of events for thousands of learners
around the world. Now that all research involves some degree of
computational work, whether with big data, cloud computing, or simple task
automation, these skills are needed more than ever.</p>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-2" align="center">
<a href="{{ site.dc_site }}"><img src="{{ relative_root_path }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
</div>
<div class="col-md-8">
<p><a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches
workshops on the fundamental data skills needed to conduct research. Its
target audience is researchers who have little to no prior computational
experience, and its lessons are domain specific, building on learners'
existing knowledge to enable them to quickly apply skills learned to their
own research. Data Carpentry workshops take researchers through the entire
data life cycle.</p>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-2" align="center">
<a href="{{ site.lc_site }}"><img src="{{ relative_root_path }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
</div>
<div class="col-md-8">
<p><a href="{{ site.lc_site }}">Library Carpentry</a> develops lessons and
teaches workshops for and with people working in library- and
information-related roles. Its goal is to create an on-ramp to empower this
community to use software and data in their own work, as well as be
advocates for and train others in efficient, effective and reproducible data
and software practices.</p>
</div>
</div>
* Open image: xy_8bit_binary__nuclei.tif
* Perform connected components analysis
* Explore multi-color LUTs for object labelling
* Explore removing and joining labels
[![Connected components](https://api.hub.knime.com/repository/*XCeGNgTQOzoPwzje:image)](https://kni.me/w/XCeGNgTQOzoPwzje)
[//]: # (Original URL: https://hub.knime.com/stelfrich/space/Image%20Analysis%20Training%20Resources/Connected%20components)
{% comment %}
Display a break's timings in a box similar to a learning episode's.
{% endcomment %}
<blockquote class="objectives">
<h2>Overview</h2>
<div class="row">
<div class="col-md-3">
<strong>Break:</strong> {{ page.break }} min
</div>
<div class="col-md-9">
</div>
</div>
</blockquote>
{% comment %}
Display key points for an episode.
{% endcomment %}
<blockquote class="keypoints">
<h2>Key Points</h2>
<ul>
{% for keypoint in page.keypoints %}
<li>{{ keypoint|markdownify }}</li>
{% endfor %}
</ul>
</blockquote>
{% comment %}
For some reason, the relative_root_path seems out of scope in this file, so we
need to re-assign it here
{% endcomment %}
{% include base_path.html %}
{% comment %}
Navigation bar for an episode.
{% endcomment %}
<div class="row">
<div class="col-xs-1">
<h3 class="text-left">
{% if page.previous.url %}
<a href="{{ relative_root_path }}{{ page.previous.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
{% else %}
<a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
{% endif %}
</h3>
</div>
<div class="col-xs-10">
{% if include.episode_navbar_title %}
<h3 class="maintitle"><a href="{{ relative_root_path }}/">{{ site.title }}</a></h3>
{% endif %}
</div>
<div class="col-xs-1">
<h3 class="text-right">
{% if page.next.url %}
<a href="{{ relative_root_path }}{{ page.next.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
{% else %}
<a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
{% endif %}
</h3>
</div>
</div>
{% comment %}
Display an episode's timings and learning objectives.
{% endcomment %}
<blockquote class="objectives">
<h2>Overview</h2>
<div class="row">
<div class="col-md-3">
<strong>Teaching:</strong> {{ page.teaching }} min
<br/>
<strong>Exercises:</strong> {{ page.exercises }} min
</div>
<div class="col-md-9">
<strong>Questions</strong>
<ul>
{% for question in page.questions %}
<li>{{ question|markdownify }}</li>
{% endfor %}
</ul>
</div>
</div>
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-9">
<strong>Objectives</strong>
<ul>
{% for objective in page.objectives %}
<li>{{ objective|markdownify }}</li>
{% endfor %}
</ul>
</div>
</div>
</blockquote>
<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-10">
<h1 class="maintitle">{{ page.title }}</h1>
</div>
<div class="col-md-1">
</div>
</div>
{% assign favicon_url = relative_root_path | append: '/assets/favicons/' | append: site.carpentry %}
{% if site.carpentry == 'swc' %}
{% assign carpentry = 'Software Carpentry' %}
{% elsif site.carpentry == 'dc' %}
{% assign carpentry = 'Data Carpentry' %}
{% elsif site.carpentry == 'lc' %}
{% assign carpentry = 'Library Carpentry' %}
{% elsif site.carpentry == 'cp' %}
{% assign carpentry = 'The Carpentries' %}
{% endif %}
<!-- Favicons for everyone -->
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="{{ favicon_url }}/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ favicon_url }}/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ favicon_url }}/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ favicon_url }}/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="{{ favicon_url }}/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ favicon_url }}/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ favicon_url }}/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ favicon_url }}/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-196x196.png" sizes="196x196" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ favicon_url }}/favicon-128.png" sizes="128x128" />
<meta name="application-name" content="{{ carpentry }} - {{ site.title }}"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="{{ favicon_url }}/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="{{ favicon_url }}/mstile-70x70.png" />
<meta name="msapplication-square150x150logo" content="{{ favicon_url }}/mstile-150x150.png" />
<meta name="msapplication-wide310x150logo" content="{{ favicon_url }}/mstile-310x150.png" />
<meta name="msapplication-square310x310logo" content="{{ favicon_url }}/mstile-310x310.png" />
- **[ Open... ]** "/image-analysis-training-resources/image_data/xy_8bit__nuclei_noisy_different_intensity.tif"
- Appreciate that you cannot readily apply a threshold to binarize the image into two nuclei and background
- Apply a mean filter **[ Mean]**
- Try different neighbourhood sizes for mean filter
- Appreciate that the filtered pixel values are slightly wrong due to integer data type
- Binarize the filtered image by applying a threshold ()
[![Image binarization](https://api.hub.knime.com/repository/*wt_07Y4FqvY-QyYb:image)](https://kni.me/w/wt_07Y4FqvY-QyYb)
[//]: # (Original URL: https://hub.knime.com/stelfrich/space/Image%20Analysis%20Training%20Resources/Neighbourhood%20image%20filters)
{% comment %}
When rendering websites locally, `site.github.url` doesn't get resolved properly
unless a GitHub Personal Access Token is set up and available in the
environment. This leads to warnings and errors when trying to serve the site
locally. To work around this, we use the `jekyll.environment` variable which is
set to `development` when rendering the site locally, and set to `production` on
GitHub where `site.github.url` is defined.
{% endcomment %}
{% if jekyll.environment == "production" %}
{% comment %}
First, get the name of the repository
{% endcomment %}
{% assign repo_name = site.github.repository_name %}
{% comment %}
`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part
of the metadata that is relevant to the present repository.
{% endcomment %}
{% assign repo_info = site.github.public_repositories | where: "name", repo_name %}
{% comment %}
Now, we can extract the default branch for the repo
{% endcomment %}
{% assign default_branch = repo_info[0].default_branch %}
{% comment %}
Other variables requested by the template
{% endcomment %}
{% assign repo_url = site.github.repository_url %}
{% assign search_domain_url = site.github.url %}
{% assign project_title = site.github.project_title %}
{% assign source_branch = site.github.source.branch %}
{% elsif jekyll.environment == "development" %}
{% assign repo_name = "" %}
{% assign repo_url = "" %}
{% assign default_branch = "" %}
{% assign search_domain_url = "" %}
{% assign project_title = "" %}
{% assign source_branch = "" %}
{% endif %}
<header class="site-header">
<!-- TODO this file has become a mess, refactor it -->
<div class="wrapper">
{% if page.bigimg or page.title %}
<a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>
{% if page.bigimg %}
<div id="header-big-imgs" data-num-img={% if page.bigimg.first %}{{ page.bigimg.size }}{% else %}1{% endif %}
{% for bigimg in page.bigimg %}
{% assign imgnum = forloop.index %}
{% for imginfo in bigimg %}
{% if imginfo[0] %}
data-img-src-{{ imgnum }}="{{ imginfo[0] | relative_url }}"
data-img-desc-{{ imgnum }}="{{ imginfo[1] }}"
{% else %}
data-img-src-{{ imgnum }}="{{ imginfo | relative_url }}"
{% endif %}
{% endfor %}
{% endfor %}
></div>
{% endif %}
<nav class="site-nav">
<a href="#" class="menu-icon">
<svg viewBox="0 0 18 15">
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
</svg>
</a>
<header class="header-section {% if page.bigimg %}has-img{% endif %}">
{% if page.bigimg %}
<div class="big-img intro-header">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="{{ include.type }}-heading">
<h1>{% if page.title %}{{ page.title }}{% else %}<br/>{% endif %}</h1>
{% if page.subtitle %}
{% if include.type == "page" %}
<hr class="small">
<span class="{{ include.type }}-subheading">{{ page.subtitle }}</span>
{% else %}
<h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
{% endif %}
{% endif %}
<div class="trigger">
{% for my_page in site.pages %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a>
{% endif %}
{% endfor %}
{% if include.type == "post" %}
<span class="post-meta">Posted on {{ page.date | date: "%B %-d, %Y" }}</span>
{% endif %}
</div>
</div>
</nav>
</div>
</div>
<span class='img-desc'></span>
</div>
{% endif %}
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="{{ include.type }}-heading">
<h1>{% if page.title %}{{ page.title }}{% else %}<br/>{% endif %}</h1>
{% if page.subtitle %}
{% if include.type == "page" %}
<hr class="small">
<span class="{{ include.type }}-subheading">{{ page.subtitle }}</span>
{% else %}
<h2 class="{{ include.type }}-subheading">{{ page.subtitle }}</h2>
{% endif %}
{% endif %}
{% if include.type == "post" %}
<span class="post-meta">Posted on {{ page.date | date: "%B %-d, %Y" }}</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</header>
{% else %}
<div class="intro-header"></div>
{% endif %}
{% comment %}
JavaScript used in lesson and workshop pages.
{% endcomment %}
<script src="{{ relative_root_path }}/assets/js/jquery.min.js"></script>
<script src="{{ relative_root_path }}/assets/js/bootstrap.min.js"></script>
<script src="{{ relative_root_path }}/assets/js/lesson.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37305346-2', 'auto');
ga('send', 'pageview');
</script>
{% comment %}
Footer for lesson pages.
{% endcomment %}
<!-- {% include gh_variables.html %} -->
<footer>
<div class="row">
<div class="col-md-6 copyright" align="left">
{% if site.carpentry == "swc" %}
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
by <a href="{{ site.carpentries_site }}">The Carpentries</a>
<br>
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–2018
by <a href="{{ site.swc_site }}">Software Carpentry Foundation</a>
{% elsif site.carpentry == "dc" %}
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
by <a href="{{ site.carpentries_site }}">The Carpentries</a>
<br>
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–2018
by <a href="{{ site.dc_site }}">Data Carpentry</a>
{% elsif site.carpentry == "lc" %}
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2016–{{ 'now' | date: "%Y" }}
by <a href="{{ site.lc_site }}">Library Carpentry</a>
{% elsif site.carpentry == "cp" %}
Licensed under <a href="{{ site.cc_by_human }}">CC-BY 4.0</a> 2018–{{ 'now' | date: "%Y" }}
by <a href="{{ site.carpentries_site }}">The Carpentries</a>
{% endif %}
</div>
<div class="col-md-6 help-links" align="right">
{% if page.source %}
{% if page.source == "Rmd" %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
{% endif %}
{% else %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit source file</a>
{% endif %}
/
<a href="{{ repo_url }}/blob/{{ source_branch }}/contributing" data-checker-ignore>Contributing</a>
/
<a href="{{ repo_url }}/">Source</a>
<!-- /
<a href="{{ repo_url }}/blob/{{ source_branch }}/CITATION" data-checker-ignore>Cite</a> -->
/
<a href="mailto:{{ site.email }}">Contact</a>
</div>
</div>
<div class="row">
<div class="col-md-12" align="center">
Adapted from <a href="https://github.com/carpentries/styles/">The Carpentries style</a>
version <a href="https://github.com/carpentries/styles/releases/tag/v9.5.3">9.5.3</a>.
</div>
</div>
</footer>
{% if site.life_cycle == "pre-alpha" %}
<div class="panel panel-default life-cycle">
<div id="life-cycle" class="panel-body pre-alpha">
This lesson is still being designed and assembled (Pre-Alpha version)
</div>
</div>
{% elsif site.life_cycle == "alpha" %}
<div class="panel panel-default life-cycle">
<div id="life-cycle" class="panel-body alpha">
This lesson is in the early stages of development (Alpha version)
</div>
</div>
{% elsif site.life_cycle == "beta" %}
<div class="panel panel-default life-cycle">
<div id="life-cycle" class="panel-body beta">
This lesson is being piloted (Beta version)
</div>
</div>
{% elsif site.life_cycle == "stable" %}
{% comment %}
We don't do anything special for now
{% endcomment %}
{% endif %}
{% include base_path.html %}
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
[ci]: http://communityin.org/
[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/incident-reporting.html
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
[contrib-covenant]: https://contributor-covenant.org/
[contributing]: {{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md
[cran-checkpoint]: https://cran.r-project.org/package=checkpoint
[cran-knitr]: https://cran.r-project.org/package=knitr
[cran-stringr]: https://cran.r-project.org/package=stringr
[dc-lessons]: http://www.datacarpentry.org/lessons/
[email]: mailto:team@carpentries.org
[github-importer]: https://import.github.com/
[importer]: https://github.com/new/import
[jekyll-collection]: https://jekyllrb.com/docs/collections/
[jekyll-install]: https://jekyllrb.com/docs/installation/
[jekyll-windows]: http://jekyll-windows.juthilo.com/
[jekyll]: https://jekyllrb.com/
[jupyter]: https://jupyter.org/
[kramdown]: https://kramdown.gettalong.org/
[lc-lessons]: https://librarycarpentry.org/lessons/
[lesson-aio]: {{ relative_root_path }}{% link aio.md %}
[lesson-coc]: {{ relative_root_path }}{% link CODE_OF_CONDUCT.md %}
[lesson-example]: https://carpentries.github.io/lesson-example/
[lesson-license]: {{ relative_root_path }}{% link LICENSE.md %}
[lesson-mainpage]: {{ relative_root_path }}{% link index.md %}
[lesson-reference]: {{ relative_root_path }}{% link reference.md %}
[lesson-setup]: {{ relative_root_path }}{% link setup.md %}
[mit-license]: https://opensource.org/licenses/mit-license.html
[morea]: https://morea-framework.github.io/
[numfocus]: https://numfocus.org/
[osi]: https://opensource.org
[pandoc]: https://pandoc.org/
[paper-now]: https://github.com/PeerJ/paper-now
[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/
[pyyaml]: https://pypi.python.org/pypi/PyYAML
[r-markdown]: https://rmarkdown.rstudio.com/
[rstudio]: https://www.rstudio.com/
[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/
[ruby-installer]: https://rubyinstaller.org/
[rubygems]: https://rubygems.org/pages/download/
[styles]: https://github.com/carpentries/styles/
[swc-lessons]: https://software-carpentry.org/lessons/
[swc-releases]: https://github.com/swcarpentry/swc-releases
[training]: https://carpentries.github.io/instructor-training/
<!-- [workshop-repo]: {{ site.workshop_repo }} -->
[yaml]: http://yaml.org/
{% comment %}
Main title for lesson pages.
{% endcomment %}
{% include base_path.html %}
<h1 class="maintitle"><a href="{{ relative_root_path }}{% link index.md %}">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
{% comment %}
Lesson navigation bar.
{% endcomment %}
{% include gh_variables.html %}
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
{% comment %} Select what logo to display. {% endcomment %}
{% if site.carpentry == "swc" %}
<a href="{{ site.swc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/swc-icon-blue.svg %}" alt="Software Carpentry logo" />
</a>
{% elsif site.carpentry == "dc" %}
<a href="{{ site.dc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/dc-icon-black.svg %}" alt="Data Carpentry logo" />
</a>
{% elsif site.carpentry == "lc" %}
<a href="{{ site.lc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/lc-icon-black.svg %}" alt="Library Carpentry logo" />
</a>
{% elsif site.carpentry == "cp" %}
<a href="{{ site.carpentries_site }}" class="pull-left">
<img class="navbar-logo" src="{{ relative_root_path }}{% link /assets/img/cp-logo-blue.svg %}" alt="The Carpentries logo" />
</a>
{% endif %}
{% comment %} Always show link to home page. {% endcomment %}
<a class="navbar-brand" href="{{ relative_root_path }}{% link index.md %}">Home</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
{% comment %} Always show code of conduct. {% endcomment %}
<li><a href="{{ relative_root_path }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>
{% if site.kind == "lesson" %}
{% comment %} Show setup instructions. {% endcomment %}
<li><a href="{{ relative_root_path }}{% link setup.md %}">Setup</a></li>
{% comment %} Show lesson episodes for lessons. {% endc