Skip to content

Commit

Permalink
Final modifications for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
balciemrah committed Jul 26, 2024
1 parent b9212b8 commit be25731
Show file tree
Hide file tree
Showing 19 changed files with 10,927 additions and 8,366 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Black

on: [workflow_call, push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
166 changes: 160 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,160 @@
/.venv
/__pycache__
/build
/build_old
.gitignore
README_absolete.md
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
[![Black](https://github.com/balciemrah/TME_Analyzer_20240320/actions/workflows/black.yml/badge.svg)](https://github.com/balciemrah/TME_Analyzer_20240320/actions/workflows/black.yml)

# TME_Analyzer

## Introduction
TME-Analyzer is a stand alone software for analysis of fluorescent and other high-dimensional images that have a nuclear marker for cell detection. It comes with integrated quantification of cellular and tissue phenotypes, their densities in defined compartments and their interspacing, as well as visualization and exportation of data. This repository contains the Python code, as described in the paper:
[TME-Analyzer](https://tme-facility.com/technology/tme-analyzer) is a stand alone software developed in the [Laboratory of Tumor Immunology, Erasmus MC](https://www.erasmusmc.nl/en/cancer-institute/research/groups/medical-oncology-tumor-immunology) for analysis of fluorescent and other high-dimensional images that have a nuclear marker for cell detection. It comes with integrated quantification of cellular and tissue phenotypes, their densities in defined compartments and their interspacing, as well as visualization and exportation of data. This repository contains the Python code, as described in the paper:

- Hayri E Balcioglu, Rebecca Wijers, Marcel Smid, Dora Hammerl, Anita M Trapman-Jansen, Astrid Oostvogels, Mieke Timmermans, John WM Martens and Reno Debets.
[*TME-Analyzer: a new interactive and dynamic image analysis tool that identified immune cell distances as predictors for survival of triple negative breast cancer patients*](https://doi.org/10.1038/s44303-024-00022-6).
npj Imaging.

The stand alone software can be downloaded [*here*](https://drive.usercontent.google.com/download?id=1maGzQBfjvbCphI1srRWiicWShfaJLmWm&export=download&authuser=0).

Please cite the paper if you are using TME-Analyzer or (parts of) this code in your research.

## Getting started
## Getting started

Follow one of the following installations approaches (pip, venv or conda)

### pip

The pip installation was created by [*Rolf Harkes*](https://github.com/rharkes).

Get python version 3.11.9
- Create a venv: `python.exe -m venv .venv`
- Activate the environment `./.venv/Scripts/Activate.ps1`;
- Maybe with an execution policy: `powershell -ExecutionPolicy Bypass -File "./.venv/Scripts/Activate.ps1"`
- Install tmeanalyzer in [editable](https://pip.pypa.io/en/stable/cli/pip_install/#options) format with pip: `pip install -e .`
- You can install in developer mode with: `pip install -e .[dev]`
- Run TME-Analyzer: `tmeanalyzer`

### Venv

Get python version 3.8.10
Get python version 3.11.9
- Create a venv: `python.exe -m venv .venv`
- Activate the environment `./.venv/Scripts/Activate.ps1`;
- Maybe with an execution policy: `powershell -ExecutionPolicy Bypass -File "./.venv/Scripts/Activate.ps1"`
- install dependencies: `python.exe -m pip install -r requirements.txt`
- note that requirements.txt give the minimal packages, and this should get all the packages in the requirements_extended.txt file

And run: `python.exe TME_analyzer.py`
And run: `python ./src/tmeanalyzer/TME_analyzer.py`

### Conda

Run: `mamba env create -f environment.yml`

And run: `python.exe TME_analyzer.py`
And run: `python ./src/tmeanalyzer/TME_analyzer.py`

## Cx-Freeze
## Freeze it with pyinstaller to create a single executable (available in developer mode, tested on Windows and Ubuntu 22.04)

Pack the project into a single binary with:
```python setup.py build```
- Creat a `.spec` file with: `pyi-makespec --onefile --noconsole --paths=./src/tmeanalyzer ./src/tmeanalyzer/TME_analyzer.py --hidden-import='PIL._tkinter_finder'`
- Create an executable with: `pyinstaller TME_analyzer.spec`

## Image analysis tutorial

Expand Down Expand Up @@ -220,4 +237,4 @@ You should end up more or less with the same analysis you have performed above.
- The analysis parameters through the `Data Analysis -> Display Log`, and pressing `Print params`. You would then have to change your analysis to the other (main window, dropdown at right bottom) and press `Print params` again.

## Final points
Hope you made it here and are excited about TME-A. This tutorial does not cover all the aspects of the TME-A. So, feel free to explore and contact us with any questions, feedback, amendments you see necessary and bug reports.
Hope you made it here and are excited about TME-A. This tutorial does not cover all the aspects of the TME-A. So, feel free to explore and contact us with any questions, feedback, amendments you see necessary and bug reports.
Loading

0 comments on commit be25731

Please sign in to comment.