Git Product home page Git Product logo

sandoghdarlab / piscat Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 12.0 17.49 MB

PiSCAT is a python-based package with a graphical user interface for performing high-performance analysis on a variety of iSCAT measurements.

Home Page: https://piscat.readthedocs.io/

License: GNU General Public License v3.0

Python 28.21% Jupyter Notebook 71.79%
data-analysis microscopy-images nano-particles python

piscat's People

Contributors

marcoheisig avatar matthias-baer avatar msarraf avatar po60nani avatar reza-ghm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

piscat's Issues

plot_contrast_extraction changes class attributes of PlotProteinHistogram

Hey,

There is a problem with the plot_contrast_extraction function in piscat.Analysis.PlotProteinHistogram: Whenever you call it, the data_handling function is also called with the parameters of the particle under consideration. This changes various class attributes of PlotProteinHistogram such as t_contrast_peaks, t_contrast_intersection, t_contrast_Prominence, etc. The value for the particle under consideration is appended to each of these lists.
If you subsequently want to read out the peaks, intersections, prominences, etc. of the individual particles in PlotProteinHistogram, they are no longer correct.

Many greetings,
Sandro

Simplified and standardized config file handling

At the moment, the PiSCAT configuration files are placed in ../piscat_configuration, so in a location that depends on the current working directory. This should be changed to use the operating system specific standard locations (e.g. $HOME/.config on Linux).

Furthermore, I suggest placing all config data into a single toml file instead of multiple JSON files. Toml is easier to understand and modify by humans and well supported throughout the Python tool chain.

The only question we should discuss is whether we need to preserve backward compatibility with the old config files and their locations.

Windows installation - Documentation Suggestions

Hi!

I installed this (piscat==0.1.12) on Windows 10 using python 3.9 (windows store edition) and I have to say it was a bit challenging. The following points could help other people to get this project to work.

  • Using a virtualenv is highly recommended and saves a lot of pain. I should have done this from the beginning. Also, using the "windows store" edition of Python is way more convenient the using the "official" installer, but that might be personal preference.
    • to create a virtualenv simply run python -m venv .venv using the commandline (cmd.exe) in an empty folder (mkdir somefolder cd somefolder). After that activate the env executing activate.bat in the .venv/Scripts folder.
    • in the activated environment run pip install piscat
  • The installation crashed because H5PY 2.10.0 was not available as normal wheel using pip, I had to download the modified version from this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#h5py. After that I installed it using pip install <filename>. There might me a better way but this worked quite well.
  • After installation I had to downgrade some dependencies because of mysterious DLL loading problems. I was able to start the GUI using the following versions:
    • Pillow==8.2.0
    • matplotlib==3.3.1
    • scikit-image==0.18.0rc0
    • I also installed msvc-runtime but I am not sure if that solved anything

And another small thing: The data download-step in Tutorial1 failed with an SSL verification error. I downloaded the files from the URLs provided inside the code, extracted the files manually and added them to the data-folder. After that the Tutorial worked without any troubles. There was no problem on my linux machine and also Chrome did not show any errors. I would assume that the SSL library on windows uses a reduced set of trusted CAs, but that's only a guess.

It might also be a good idea to host the tutorial-files as artifacts to your releases on Github instead. It would be a shame to lose this data and break the tutorial functionality if someone migrates/updates/deletes the used owncloud instance.

Hope this helps whoever might need it :)

Cheers, Michael

Linux installation - Documentation Suggestions

Hi!

I finished installing this project (piscat==0.1.12) on my Fedora 34 machine with Python 3.9 and would like to share some helpful hints if someone is going to do similar someday.

  • Using a virualenv really helps, I know you already mention that in your README but I took it lightly. Do not try to install this with pip install --user piscat the low-level mkl/intel numpy dependencies are a bit "snappy". Go into an empty folder, run python -m venv .venv followed by source ./.venv/bin/activate, and install with pip install piscat.
  • I had to install some dependencies. On Fedora try sudo dnf install python3-devel hdf5-devel if you encounter problems stating "libhdf5.so" or "Python.h"
  • I also had a problem with Qt5, building opencv-python from source fixed it (took ~1h to build). There might be a better way but this worked for me. To do this install some dev-tools dnf install gcc qt-devel cmake (you might need more) and reinstall opencv from source using pip install --no-binary opencv-python opencv-python --force-reinstall.

After that the first tutorial worked perfectly.

Thx for your effort and open-sourcing this project. (I have no clue about physics but I know people that are happy to have it ;) ).

Cheers, Michael

Pyright conformance

Pyright is a static type checker for Python. It can find many kinds of programming errors that wouldn't normally be found by a test suite. I added support for Pyright in 3b143df, and it found 1067 errors and 29 warnings in PiSCAT. None of these errors are particularly severe - most of them concern corner cases that are not triggered in practice - but I thing it would be good practice to get the number of Pyright errors and warnings down to zero.

Once the number of Pyright errors and warnings is zero, I'd also like to enable Pyright as a commit hook, such that all new code has to pass Pyright before it can be committed.

Unable to import PiSCAT module on VScode

I created a new conda environment for PiSCAT analysis which uses Python 3.12.4. I am also doing the analysis in Jupyter notebook.
The PiSCAT package installation was completed with no issues, and import piscat also works.
However, running:
from piscat.Localization import particle_localization
gives me the error:
ModuleNotFoundError: No module named 'pywt'

I tries doing a pip install of pywt and pywavelet in my conda environment but the installation was not completed due to errors in the package. Is there any way I can get around this issue?

(Note: I am not an expert in coding or python)

Completely separate GUI and data analysis

Right now, several functions (background correction, preprocessing, ...) are somewhat intertwined with the GUI code. Those functions should be written not to refer to the GUI at all.

Problem with PSF Preview - Tutorial 4

Hi, I was loading Tutorial 4 and function psf_detection_preview() didn't load properly - slider for threshold was displayed, but without the analysed video. On the website it looks like the other picture.
issue_piscat_tutorial
piscat_tutorial_website

No module named 'pywt' when trying to add PiSCAT plugins

The Problem

pip3 install piscat
worked fine. But then I wanted to further follow the documentation and add PiSCAT plugins via
python3 -m piscat.Plugins UAI
which gives me
ModuleNotFoundError: No module named 'pywt'

Manual Solution

After manually installing pywt via
pip3 install PyWavelets
I can run the command with no problems.

Suggested Changes

PyWavelets is already in the requirements.txt since the commit ca6ac18 from 2023-12-01, but the version on PyPi is from 2023-08-12. It would be highly appreciated if the version on PyPi could be updated.

Continuous Benchmarking

PiSCAT doesn't just have to be correct, we also want it to be reasonably fast. In order to avoid performance regressions, and to track our optimization progress, I suggest we set up continuous benchmarking in addition to the regular CI setup.

Coding style and linter conformance

PiSCAT should pass all the usual Python style guides, such as PEP8, and avoid the most notorious kinds of error prone constructs. Luckily, there are tools such as Flake8, Black, and Ruff that can ensure that all code obeys these rules.

We should make PiSCAT pass all the usual checks from these tools, and then enable them automatically as git hooks for all developers.

One important thing that should be agreed upon is the maximum admissible line length. PEP8 uses a maximum of 79 characters, but on today's very wide screens, we could probably go for something like 99 characters. Either limit will bring substantial changes to the code base, because the current code base has many lines of far longer than 100 characters.

Storing camera and CPU configuration without saving on JSON files

Greetings,

I stumbled upon your library and I was interested in using it in combination with another software to perform background corrections and differential rolling average on real-time acquired camera frames. I understand that these algorithms use some settings class (CPUConfigurations and CameraParameters) which when creating an instance try to read a JSON file which is written as the first instance is created. Would it be possible to just create an instance without generating the JSON file?

Thank you.

Test suite shouldn't require internet connection

More than half of PiSCAT's tests fail if there is no internet connection. This is because the necessary TestData is not shipped with PiSCAT and has to be downloaded first. Even after the test data has been downloaded, there are some tests that still connect to the internet and fail otherwise. This is bad, because it means testing cannot really done in isolation.

Normally I would suggest the test data is simply incorporated into this repository, but with 4.4 GB it is far too large for that. I suggest the test suite is rewritten to use synthetic test data where possible, so that those huge piles of data aren't needed at all.

Doing so would not only aid reproducibility, but probably speed up the test suite quite a bit.

Tutorial 5, iSCAT, material of particle

Hey,

I am using your model to simulate iPSF functions. I did the tutorial 5 and everything worked fine.
However, I would like to change the material parameters i.e. instead of a gold particle use e.g. a silver particle but I can not find how to incorporate these parameters.
Is there a way to account for size and material of the particle?

Best,
Phil

Problem running PiSCAT using the tutorials

I got this issue that I can use the command python -m piscat in this path:"C:\Users\snajafi\Desktop\piscat"
I can also use it in this path: "C:\Users\snajafi\Desktop\piscat\PiSCAT\piscat"
and it runs perfectly in both cases and brings up the GUI.
But in this path "C:\Users\snajafi\Desktop\piscat\PiSCAT" If I run it I get this error: "AttributeError: module 'PySide6.QtGui' has no attribute 'QMainWindow' "
So what's the problem with it because if it's installed and has python and piscat in its environment it should work properly in either of the directories because it's just gonna load the module, what's the difference, and if there was a problem why it runs without problem in both the PiSCAT directory's parent and child?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.