diff --git a/.gitignore b/.gitignore
index e16642c..482c16f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,3 +117,7 @@ venv.bak/
.idea/
.vs/
*.~lock.*
+
+
+# macOS
+*.DS_Store
diff --git a/doc_build/main/dev/CONTRIBUTING.md b/doc_build/main/dev/CONTRIBUTING.md
index eb8c61e..33795ff 100644
--- a/doc_build/main/dev/CONTRIBUTING.md
+++ b/doc_build/main/dev/CONTRIBUTING.md
@@ -28,7 +28,7 @@ clean commit history.
#### Formatting
-`neuro` uses [Black](https://github.com/python/black) o ensure a consistent
+`neuro` uses [Black](https://github.com/python/black) to ensure a consistent
code style. Please run `black ./ -l 79 --target-version py37` before making
any commits. To prevent any errors, it is easier to add a formatting check
as a [pre-commit hook](https://www.atlassian.com/git/tutorials/git-hooks).
diff --git a/doc_build/main/user_guide/tools/cells_to_brainrender.md b/doc_build/main/user_guide/tools/cells_to_brainrender.md
index 4a976b3..8e23dac 100644
--- a/doc_build/main/user_guide/tools/cells_to_brainrender.md
+++ b/doc_build/main/user_guide/tools/cells_to_brainrender.md
@@ -5,7 +5,7 @@ To convert cell positions (e.g. in `cells_in_standard_space.xml`) to
a format that can be used in
[BrainRender](https://github.com/BrancoLab/BrainRender).
-
+### Usage
```bash
points_to_brainrender cells_in_standard_space.xml exported_cells.h5
```
@@ -16,7 +16,8 @@ Run `points_to_brainrender -h` to see all options.
#### Positional
* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
cells file to be converted
-* Output filename. Should end with '.h5'
+* Output filename. Should end with '.h5'. If the containing directory doesn't
+exist, it will be created.
#### The following options may also need to be used:
diff --git a/doc_build/main/user_guide/tools/heatmap.md b/doc_build/main/user_guide/tools/heatmap.md
new file mode 100644
index 0000000..b36b990
--- /dev/null
+++ b/doc_build/main/user_guide/tools/heatmap.md
@@ -0,0 +1,47 @@
+# Heatmap generation
+
+To generate a heatmap of detected cells, which shows cell distributions in a
+more intuitive way that showing individual cell positions:
+
+
+
+
+*Overlay on raw data and segentation from
+[amap](https://github.com/SainsburyWellcomeCentre) added separately*
+
+
+### Usage
+```bash
+ heatmap cell_classification.xml heatmap.nii raw_data registered_atlas.nii -x 2 -y 2 -z 5
+```
+
+### Arguments
+Run `heatmap -h` to see all options.
+
+#### Positional arguments
+* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
+classified cells file (usually `cell_classification.xml`)
+* Output filename. Should end with '.nii'. If the containing directory doesn't
+exist, it will be created.
+* Path to raw data (just a single channel). Used to find the shape of the
+raw image that the detected cell positions are defined in.
+* Registered atlas file from [amap](https://github.com/SainsburyWellcomeCentre)
+ (typically run automatically in
+ [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)). File
+ is usually `registered_atlas.nii`.
+
+
+#### Keyword arguments
+* `-x` or `--x-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the first dimension, specified in um.
+* `-y` or `--y-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the second dimension, specified in um.
+* `-z` or `--z-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the third dimension, specified in um.
+
+
+#### The following options may also need to be used:
+* `--heatmap-bin` Heatmap bin size (um of each edge of histogram cube)
+* `--heatmap-smoothing` Gaussian smoothing sigma, in um.
+* `--no-mask-figs` Don't mask the figures (removing any areas outside the
+brain, from e.g. smoothing)
diff --git a/docs/_sources/main/dev/CONTRIBUTING.md.txt b/docs/_sources/main/dev/CONTRIBUTING.md.txt
index eb8c61e..33795ff 100644
--- a/docs/_sources/main/dev/CONTRIBUTING.md.txt
+++ b/docs/_sources/main/dev/CONTRIBUTING.md.txt
@@ -28,7 +28,7 @@ clean commit history.
#### Formatting
-`neuro` uses [Black](https://github.com/python/black) o ensure a consistent
+`neuro` uses [Black](https://github.com/python/black) to ensure a consistent
code style. Please run `black ./ -l 79 --target-version py37` before making
any commits. To prevent any errors, it is easier to add a formatting check
as a [pre-commit hook](https://www.atlassian.com/git/tutorials/git-hooks).
diff --git a/docs/_sources/main/user_guide/tools/cells_to_brainrender.md.txt b/docs/_sources/main/user_guide/tools/cells_to_brainrender.md.txt
index 4a976b3..8e23dac 100644
--- a/docs/_sources/main/user_guide/tools/cells_to_brainrender.md.txt
+++ b/docs/_sources/main/user_guide/tools/cells_to_brainrender.md.txt
@@ -5,7 +5,7 @@ To convert cell positions (e.g. in `cells_in_standard_space.xml`) to
a format that can be used in
[BrainRender](https://github.com/BrancoLab/BrainRender).
-
+### Usage
```bash
points_to_brainrender cells_in_standard_space.xml exported_cells.h5
```
@@ -16,7 +16,8 @@ Run `points_to_brainrender -h` to see all options.
#### Positional
* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
cells file to be converted
-* Output filename. Should end with '.h5'
+* Output filename. Should end with '.h5'. If the containing directory doesn't
+exist, it will be created.
#### The following options may also need to be used:
diff --git a/docs/_sources/main/user_guide/tools/heatmap.md.txt b/docs/_sources/main/user_guide/tools/heatmap.md.txt
new file mode 100644
index 0000000..b36b990
--- /dev/null
+++ b/docs/_sources/main/user_guide/tools/heatmap.md.txt
@@ -0,0 +1,47 @@
+# Heatmap generation
+
+To generate a heatmap of detected cells, which shows cell distributions in a
+more intuitive way that showing individual cell positions:
+
+
+
+
+*Overlay on raw data and segentation from
+[amap](https://github.com/SainsburyWellcomeCentre) added separately*
+
+
+### Usage
+```bash
+ heatmap cell_classification.xml heatmap.nii raw_data registered_atlas.nii -x 2 -y 2 -z 5
+```
+
+### Arguments
+Run `heatmap -h` to see all options.
+
+#### Positional arguments
+* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
+classified cells file (usually `cell_classification.xml`)
+* Output filename. Should end with '.nii'. If the containing directory doesn't
+exist, it will be created.
+* Path to raw data (just a single channel). Used to find the shape of the
+raw image that the detected cell positions are defined in.
+* Registered atlas file from [amap](https://github.com/SainsburyWellcomeCentre)
+ (typically run automatically in
+ [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)). File
+ is usually `registered_atlas.nii`.
+
+
+#### Keyword arguments
+* `-x` or `--x-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the first dimension, specified in um.
+* `-y` or `--y-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the second dimension, specified in um.
+* `-z` or `--z-pixel-size` Pixel spacing of the data that the cells are
+defined in, in the third dimension, specified in um.
+
+
+#### The following options may also need to be used:
+* `--heatmap-bin` Heatmap bin size (um of each edge of histogram cube)
+* `--heatmap-smoothing` Gaussian smoothing sigma, in um.
+* `--no-mask-figs` Don't mask the figures (removing any areas outside the
+brain, from e.g. smoothing)
diff --git a/docs/genindex.html b/docs/genindex.html
index 0c05df6..5a93507 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -81,6 +81,7 @@
- Contributing
diff --git a/docs/index.html b/docs/index.html
index 3a81562..802168a 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -81,6 +81,7 @@