Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -26,7 +26,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install C dependencies
run: |
sudo apt-get install fftw3-dev
sudo apt-get install libfftw3-dev
sudo apt-get install liblapack-dev
- name: Install Python dependencies
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
scons
- name: Install python package
run: |
python setup.py install
python -m pip install -e .
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Storm-Analysis
==============

This is a repository of code developed in the `Zhuang Lab <http://zhuang.harvard.edu/>`_
and the `Babcock Lab <https://hazenbabcock.github.io/>`_ for analysis of STORM
and the `Babcock Lab <https://hazenbabcock.github.io/hcai/index.html>`_ for analysis of STORM
movies. The code is available on `github <https://github.com/ZhuangLab/storm-analysis>`_.

Some algorithms were developed in other groups and ported to Python. In this
Expand Down
38 changes: 12 additions & 26 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ C libraries
Python
~~~~~~

* `scons <https://scons.org/>`_ (to build the C libraries).
* `numpy <http://www.numpy.org/>`_
* `scipy <https://www.scipy.org/>`_
* `matplotlib <http://matplotlib.org/>`_
Expand Down Expand Up @@ -87,10 +88,11 @@ The C libraries are built using `SCons <http://scons.org/>`_.

Basic installation ::

$ git clone https://github.com/ZhuangLab/storm-analysis.git
$ cd storm-analysis
$ python setup.py build_c
$ python setup.py install
$ git clone https://github.com/ZhuangLab/storm-analysis.git
$ cd storm-analysis
$ python -m pip install scons
$ scons
$ python -m pip install .

You may find that this does not work because ``build_c`` fails. This step is just a
wrapper for SCons, so you may have better luck running the SCons by itself, then using
Expand All @@ -99,14 +101,16 @@ wrapper for SCons, so you may have better luck running the SCons by itself, then
Linux / OS-X example ::

$ cd storm-analysis
$ python -m pip install scons
$ scons
$ python setup.py install
$ python -m pip install .

Windows (mingw64) example ::

$ cd storm-analysis
$ scons
$ python setup.py install
$ python -m pip install scons
$ scons -Q compiler=mingw
$ python -m pip install .

`nuwen <https://nuwen.net/mingw.html>`_ is one source for mingw64.

Expand Down Expand Up @@ -155,25 +159,7 @@ Install storm-analysis ::
Testing
~~~~~~~

Test the (source) installation (this will take a few minutes to run).
Test the (source) installation (this requires ``pytest`` will take a few minutes to run) ::

Option 1 ::

$ cd storm-analysis
$ python setup.py test

Option 2 ::

$ cd storm-analysis
$ pytest

.. note:: Due to issues with creating pickle files that are compatible between Python2
and Python3 all of the tests that involve pickles (Spliner mostly) are skipped
on Python2.

Also
----

If you are modifying the code in the storm-analysis project you may find it more convenient
to add a .pth file to your pythonX.Y/site-packages directory. Then you won't have to
run ``python setup.py install`` after every change.
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[build-system]
requires = ['setuptools>=61.0']
build-backend = 'setuptools.build_meta'

[project]
name = 'storm_analysis'
version = '2.2'
dependencies = [
'scons',
'numpy',
'scipy',
'matplotlib',
'pillow',
'tifffile',
'Shapely',
'randomcolor',
'PyWavelets',
'h5py',
'astropy'
]
requires-python = '>=3.10'
authors = [{name = 'Hazen Babcock'}]
maintainers = []
description = 'STORM movie analysis code.'
readme = 'README.md'
keywords = ['STORM', 'microscopy']
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: Mixed'
]

[tool.pytest]
minversion = '9.0'
addopts = ['-ra', '-q']
testpaths = [
'storm_analysis/test'
]

[tool.setuptools]
packages = ["storm_analysis"]

[project.optional-dependencies]
test = [
'pytest',
]
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

106 changes: 0 additions & 106 deletions setup.py

This file was deleted.

6 changes: 3 additions & 3 deletions storm_analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def configureMatplotlib():


def getData(data_path):
import pkg_resources
data = pkg_resources.resource_filename(__name__, data_path)
return data
import importlib.resources
data = importlib.resources.files(__name__).joinpath(data_path)
return str(data)


def getPath(path):
Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/admm/admm_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Pure Python code for doing ADMM in 3D.

minimize 1/2*|| Ax - b ||_2^2 + \lambda || x ||_1
minimize 1/2*|| Ax - b ||_2^2 + lambda || x ||_1

As described in:
Boyd et al., "Distributed Optimization and Statistical Learning
Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/admm/admm_decon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Uses ADMM to perform image deconvolution.

This minimizes 1/2*|| Ax - b ||_2^2 + \lambda || x ||_1.
This minimizes 1/2*|| Ax - b ||_2^2 + lambda || x ||_1.

Hazen 11/19
"""
Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/fista/fista_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Pure Python code for doing FISTA in 3D.

minimize || Ax - b ||_2^2 + \lambda || x ||_1
minimize || Ax - b ||_2^2 + lambda || x ||_1

As described in:
Beck and Teboulle, "A Fast Iterative Shrinkage-Thresholding
Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/fista/fista_decon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Deconvolve images in 3D using FISTA.

This minimizes || Ax - b ||_2^2 + \lambda || x ||_1.
This minimizes || Ax - b ||_2^2 + lambda || x ||_1.

Hazen 11/19
"""
Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/fista/fista_fft_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def newImage(self, image, background):
c_background = numpy.ascontiguousarray(background, dtype = float)
fista_fft.newImage(self.c_fista, c_image, c_background)

def run(self, f_lamba, iterations):
def run(self, f_lambda, iterations):
fista_fft.run(self.c_fista, f_lambda, iterations)


Expand Down
2 changes: 1 addition & 1 deletion storm_analysis/micrometry/micrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def makeTreeAndQuadsFromH5File(h5_filename, min_size = None, max_size = None, ma
def plotMatch(kd1, kd2, transform, save_as = None, show = True):
[x2, y2] = applyTransform(kd2, transform)

fig = pyplot.figure()
fig = pyplot.figure(figsize = (10,10))
pyplot.scatter(kd1.data[:,0], kd1.data[:,1], facecolors = 'none', edgecolors = 'red', s = 100)
pyplot.scatter(x2, y2, color = 'green', marker = '+', s = 100)

Expand Down
Loading
Loading