diff --git a/README.md b/README.md index c6bded1..62b906a 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,15 @@ pip install --editable . ## Getting started -We provide an example analysis pipeline that can be run by calling - -```bash -python run_pipeline.py +Once the package has been installed the pipeline can be tested with: +```python +from micro_match.run_pipeline import run_microMatch_test +run_microMatch_test() ``` -This file will run all steps of the microMatch pipeline on the example data we provide in the `example_data` folder and can be used as a basis to use microMatch on your own data. It also illustrates some basic shape analysis outputs that can be retreived once correspondence has been established. +This analysis pipeline runs all steps of the microMatch pipeline on the example data we provide in the `example_data` folder and can be used as a basis to use microMatch on your own data. It also illustrates some basic shape analysis outputs that can be retreived once correspondence has been established. + +Feel free to adjust the pipeline for your needs in the "micro_match/run_pipeline.py" file. We also provide a further example of visualization of the correspondence map in the jupyter notebook `scalar_plotting.ipynb`. Once `run_pipeline.py` has been run once, `scalar_plotting.ipynb` can be explored in your browser through the jupyter notebook interface by running @@ -66,13 +68,6 @@ pip install pre-commit black flake8 isort pre-commit install ``` -## Running the pipeline on example data - -With the mumatch environment activated: -```bash -python run_pipeline.py -``` - ## How to cite If you use µMatch, please cite us as follows: diff --git a/scalar_plotting.ipynb b/scalar_plotting.ipynb index 4e748b8..2a26685 100644 --- a/scalar_plotting.ipynb +++ b/scalar_plotting.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "b6745ab8", "metadata": {}, "outputs": [], @@ -21,19 +21,18 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "dc393e87", "metadata": {}, "outputs": [], "source": [ - "folder_path = \"\"\n", - "mesh_dir = '/Users/lfranz/Desktop/tracking/mumesh/example_data/processed_data/meshes'\n", - "match_dir = '/Users/lfranz/Desktop/tracking/mumesh/example_data/match_results'" + "mesh_dir = './example_data/processed_data/meshes'\n", + "match_dir = './example_data/processed_data/match_results'" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "b058b0d6", "metadata": {}, "outputs": [], @@ -60,52 +59,13 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "9a630681", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/lfranz/opt/anaconda3/envs/mumatch/lib/python3.8/site-packages/jupyter_client/session.py:716: UserWarning: Message serialization failed with:\n", - "Out of range float values are not JSON compliant\n", - "Supporting this message is deprecated in jupyter-client 7, please make sure your message is JSON-compliant\n", - " content = self.pack(content)\n" - ] - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "3f43ccdcdb724a5fb6040fdb2b4bb466", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "HBox(children=(Output(), Output()))" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "a460419313bc4b45991732acc3c9b291", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "HBox(children=(Output(), Output()))" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ - "fn1 = \"170517\"\n", - "fn2 = \"170519\"\n", + "fn1 = \"Q03\"\n", + "fn2 = \"Q04\"\n", "\n", "i,j = np.load(os.path.join(match_dir, \"{0}_{1}.npy\".format(fn1, fn2)))\n", "v1,f1 = readMesh(os.path.join(mesh_dir, fn1 + \".ply\"))\n", @@ -123,52 +83,6 @@ "mp.subplot(v2, f2, c=scalar[i], s=[2, 2, 1], data=fig)" ] }, - { - "cell_type": "code", - "execution_count": 11, - "id": "3a574e6c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "7" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "t = [2,5]\n", - "def add(x,y):\n", - " return x+y\n", - "add(*t)" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "5574fb5e", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['A13-z1-links-170517-2', 'A13-z1-links-170517-3', 'A13-z1-links-170517-1', 'A13-z1-links-170517-0', 'A13-z1-links-170517-4', 'A13-z1-links-170517-5', 'A13-z1-links-170519-8', 'A13-z1-links-170517-7', 'A13-z1-links-170517-6', 'A13-z1-links-170519-9', 'A13-z1-links-170517-26', 'A13-z1-links-170517-24', 'A13-z1-links-170517-18', 'A13-z1-links-170517-19', 'A13-z1-links-170517-25', 'A13-z1-links-170517-21', 'A13-z1-links-170517-20', 'A13-z1-links-170517-22', 'A13-z1-links-170517-23', 'A13-z1-links-170517-12', 'A13-z1-links-170517-13', 'A13-z1-links-170517-11', 'A13-z1-links-170519-14', 'A13-z1-links-170517-10', 'A13-z1-links-170519-11', 'A13-z1-links-170517-14', 'A13-z1-links-170517-15', 'A13-z1-links-170519-10', 'A13-z1-links-170519-12', 'A13-z1-links-170517-17', 'A13-z1-links-170517-16', 'A13-z1-links-170519-13', 'A13-z1-links-170519-4', 'A13-z1-links-170519-5', 'A13-z1-links-170519-7', 'A13-z1-links-170517-8', 'A13-z1-links-170517-9', 'A13-z1-links-170519-6', 'A13-z1-links-170519-2', 'A13-z1-links-170519-3', 'A13-z1-links-170519-1', 'A13-z1-links-170519-0']\n" - ] - } - ], - "source": [ - "from pathlib import Path\n", - "cur_dir = \"/Users/lfranz/Desktop/tracking/mumesh/all_follicles/\"\n", - "raw_dir = os.path.join(cur_dir, \"raw\")\n", - "raw_files = [str(path.stem) for path in Path(raw_dir).glob(\"*.ply\")]\n", - "print(raw_files)" - ] - }, { "cell_type": "code", "execution_count": null,