napari-psf-analysis

napari-psf-analysis

A plugin to analyse point spread functions (PSFs).


    View project data

    License PyPI Python Version tests codecov napari hub

    This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.


    application_screenshot A plugin to analyse point spread funcitons (PSFs) of optical systems.

    Usage

    Starting Point

    To run a PSF analysis open an image of acquired beads. Add a point-layer and indicate the beads you want to measure by adding a point.

    Run Analyis

    Open the plugin (Plugins > napari-psf-analysis > PSF Analysis) and ensure that your bead image and point layers are select in the Basic tab under Image and Points respectively. In the Advanced tab further information can be provided. Only the filled in fields of the Advanced tab are saved in the output.

    After verifying all input fields click Extract PSFs.

    Discard and Save Measurement

    Once the PSF extraction has finished a new layer (Analyzed Beads) appears, holding a summary image for every selected bead. Individual summaries can be discarded by clicking the Delete Displayed Measurement button.

    Results are saved to the selected Save Dir by clicking the Save Measurements button.

    Note: Beads for which the bounding box does not fit within the image are automatically excluded from the analysis and no output is generated.

    Saved Data

    Every image of the Analyzed Beads layer is saved as {source_image_name}_X {bead-centroid-x}_Y{bead-centroid-y}_Z{bead-centroid-z}.png file. Additionally a PSFMeasurement_{source_image_acquisition_date}_ {source_image_name}_{microscope_name}_{magnification}_{NA}.csv file is stored containing the measured values and all filled in fields.

    For the demo gif above the following table is saved:

    ImageNameDateMicroscopeMagnificationNAAmplitudeAmplitude_2DBackgroundBackground_2DXYZX_2DY_2DFWHM_XFWHM_YFWHM_ZFWHM_X_2DFWHM_Y_2DPrincipalAxis_1PrincipalAxis_2PrincipalAxis_3PrincipalAxis_1_2DPrincipalAxis_2_2DSignalToBGSignalToBG_2DXYpixelsizeZspacingcov_xxcov_xycov_xzcov_yycov_yzcov_zzcov_xx_2Dcov_xy_2Dcov_yy_2Dsde_peaksde_backgroundsde_Xsde_Ysde_Zsde_cov_xxsde_cov_xysde_cov_xzsde_cov_yysde_cov_yzsde_cov_zzsde_peak_2Dsde_background_2Dsde_X_2Dsde_Y_2Dsde_cov_xx_2Dsde_cov_xy_2Dsde_cov_yy_2DversionObjective_idPSF_path
    100x_1_conf488Virtex.tif2022-03-03Microscope1001.44969.6688877089175337.819377008636108.68118565810401112.062609783986893304.25017435627573250.40337619254163065.74056709314443298.3024394671463250.4113027135386200.8139074557401197.03885411472754674.9482557309917183.72294307475494176.22103947242965675.8518951846926199.23103476771948195.54256297143823184.93322114936828174.950502371705445.7270396675907547.6324742686064165.0200.07272.305680278791199.512016642965163544.2341648839237001.4549434294441986.681900657982482153.394093426356087.112657801992213.672050542912615600.1552815336724.5053140279160240.0206230599631869950.069147469332990170.067847833249828390.2324105848665418111.7946951292566548.18573485944644128.32222437395927611.35530009328964627.596443942593737133.244165297593244.5053140279160240.0206230599631869950.069147469332990170.067847833249828390.2324105848665418111.7946951292566548.1857348594464410.2.2.dev0+g1cb747a.d20221017obj_1./100x_1_conf488Virtex.tif_Bead_X3304.3_Y3250.4_Z3065.7.png
    100x_1_conf488Virtex.tif2022-03-03Microscope1001.46131.7831564596557007.7128858909955108.97903673830632112.030498130718063283.18151798929473369.9704760297133032.5542479290973276.8514816994533370.657390994046210.4996203597178197.86302004157108689.3745507955736190.91529553428666174.67418701487333689.6867779885374209.54607959880923197.78706972073468190.9553524915874174.6303955016553356.26571256253656462.5518318923686565.0200.07990.74341898611871.212822845289382449.83834665787077060.148226446074195.4670241206959585702.806815986716573.03583769533954.418310301189645502.2714628693974.6218429152125040.022043794261435390.0602622601544658760.056644262964503840.1973534782375395410.7749352657114027.161133877720641525.0580143345426629.52036076149626223.451758416706767115.561923597121984.6218429152125040.022043794261435390.0602622601544658760.056644262964503840.1973534782375395410.7749352657114027.16113387772064150.2.2.dev0+g1cb747a.d20221017obj_1./100x_1_conf488Virtex.tif_Bead_X3283.2_Y3370.0_Z3032.6.png
    100x_1_conf488Virtex.tif2022-03-03Microscope1001.45619.4982123943545796.371864919072108.65622592515462111.582660643263223091.1087536352283279.7225103104663076.29868166458533084.3187319215033278.6653904046307214.82526951473534210.45093794302085708.1707538388272205.59236614714763202.64724874262387709.557918556187211.60340602370195209.0379608329753206.12587984384623202.1045523968669551.71814283578391551.94688701186681465.0200.08322.52833820903217.277661773920474878.6244122878287987.0477950510332326.008347045901290439.994321898787622.519106230307100.78659029306467405.6976235877834.8305918725459950.02414380472710050.070139225237598010.068710983462391770.2312155419227880612.7988348967815218.86790597967245730.2985151973585612.28296805932244829.332165284940636139.085893133522234.8305918725459950.02414380472710050.070139225237598010.068710983462391770.2312155419227880612.7988348967815218.8679059796724570.2.2.dev0+g1cb747a.d20221017obj_1./100x_1_conf488Virtex.tif_Bead_X3091.1_Y3279.7_Z3076.3.png

    With the three summary images:

    summaries


    Installation

    We recommend installation into a fresh conda environment.

    1. Install napari

    conda create -y -n psf-analysis -c conda-forge python=3.9
    
    conda activate psf-analysis
    
    python -m pip install "napari[all]"

    2. Install napari-aicsimageio and bioformats

    Required if you want to open other files than .tif e.g. .stk. .

    Note: See napari-aicsimageio for more information about opening images.

    conda install -c conda-forge openjdk
    
    conda deactivate
    conda activate psf-analysis
    
    python -m pip install "bfio[bioformats]"
    python -m pip install "aicsimageio[all]"
    python -m pip install napari-aicsimageio

    3. Install napari-psf-analysis

    You can install napari-psf-analysis via pip:

    python -m pip install napari-psf-analysis

    4. Optional Set Config

    You can provide a config yaml file with the available microscope names and a default save directory. This will change the Microscope text field to a drop down menu and change the default save directory.

    example_config.yaml

    microscopes:
      - TIRF
      - Zeiss Z1
    output_path: "D:\\psf_analysis\\measurements"

    To use this config navigate to Plugins > napari-psf-analysis > Set Config and select the config file.

    Note: The save path is OS specific.

    5. Desktop Icon for Windows

    Follow this thread by Robert Haase.

    Contributing

    Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

    License

    Distributed under the terms of the BSD-3 license, "napari-psf-analysis" is free and open source software

    Issues

    If you encounter any problems, please file an issue along with a detailed description.

    Version:

    • 0.2.5

    Release date:

    • 23 November 2022

    First released:

    • 30 March 2022

    License:

    • BSD-3-Clause

    Supported data:

    • Information not submitted

    Plugin type:

    GitHub activity:

    • Stars: 5
    • Forks: 1
    • Issues + PRs: 6

    Python versions supported:

    Operating system:

    Requirements:

    • bfio
    • matplotlib
    • matplotlib-scalebar
    • napari
    • numpy
    • pandas
    • scikit-image

    Sign up to receive updates