Added plots module with orthographic and grid plots #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is this PR
Why is this PR needed?
It would be nice to have some in-built plotting funcitons to help us get a quick overview of an image stack. Such overviews can be useful for quality control - i.e to select images to be included in the template and to inspect the consequences of various preprocessing steps. They can also be used for quickly inspecting the resulting templates.
What does this PR do?
Adds a new
plots.py
module with two public functions:plot_orthographic()
- generates a figure with 4 subplots: 3 for each section (frontal, horizontal, sagittal), and 1 with a top view surface rendering (an attenuated max intensity projection).plot_grid()
- plots multiple slices of a specific section (e.g. frontal) as a grid.Here's how these plots look:
Both functions are "anatomically literate", as in the produced plots are labelled with anatomical axes, courtesy of the
AnatomicalSpace
class frombrainglobe-space
. The user needs to supply the image orientation to the plotting functions (default is "ASR") to the best of their knowledge. If they've misjudged the image orientation, the results will be obvious on the plots.Apart from the two public functions, the new module also contains a bunch of small private utilities used by the 2 main functions.
How has this PR been tested?
Manually tested on the SWC rat data. No unit tests added yet.
Is this a breaking change?
No.
Does this PR require an update to the documentation?
In principle yes, but I haven't documented the new functions anywhere, yet. That said, extensive docstrings have been added.
Checklist: