Golden is an algorithm that identifies, clusters, and evaluates density of immunigold particles in electron microscopy images of the brain.
Golden uses a 'traditional algorithm' (non-machine learning) approach to identify the particles. It uses an approach derived from network theory to find the density of particles.
Please use Python 3.12 or later with this project. Earlier versions are not guaranteed to work (3.11+ will probably work, but it may break in the future).
Uses the immunogold dataset from Max Planck Florida Institute for Neuroscience. The paper is linked here.
To install the program, first clone the repository:
$ git clone https://github.com/AlexanderJCS/golden.gitThen, navigate to the directory and install the package:
$ cd golden
$ pip install -r ./requirements.txtInstallation is complete. To use the program, see the usage section.
View the help info by running the program with the -h flag:
# from the repository's root dir
$ python -m src.cli -hThis will show the following help info:
usage: Golden [-h] [-m] [-v] name
Find gold particles and their density in electron microscopy images
positional arguments:
name The name of the dataset to analyze. This is the name of the folder in the 'analyzed synapses' directory,e.g., 'S1' or 'S7'
options:
-h, --help show this help message and exit
-m, --mask Whether to apply the mask to the image before finding gold particles. Default: False
-v, --visual Whether to display the image with the gold particles marked on it. Default: False
To run the program, use the following command:
# from the repository's root dir
$ python -m src.cli S1
# S1 is the name of the image bundle to analyze, e.g., "S1", "S4", "S7" etc.
# See a full list by looking at the directory names in the "analyzed synapses" directoryYou can also add the following flags:
| Flag | Action |
|---|---|
-m or --mask |
Whether to apply the image mask found in the image bundle |
-v or --visual |
Whether to use matplotlib to show the results visually after calculation |
To test the project, first navigate to the test package:
# from the repository's root dir
$ cd testThen run the tests:
$ python -m pytest -k "not gold_accuracy_test"We exclude the gold accuracy test since it is a long-runnning test and does not have a pass/fail condition. Instead, it is used to evaluate the accuracy of the gold-finding portion of the program by generating a confusion matrix. We can run it by using:
$ python -m pytest -k "gold_accuracy_test" -sThe -s flag is essential since it is used to print the confusion matrix to the console.
Since this project is for a class, contributions are not open.