https://docs.conda.io/en/latest/miniconda.html
If you haven't already, add conda forge to your channels
conda config --add channels conda-forge
conda config --set channel_priority stricttip: to download a version of miniconda with conda-forge already setup, use miniforge
# to clone
git clone https://github.com/tlambert03/hms_pyintro2.gitor download and unzip: https://github.com/tlambert03/hms_pyintro2/archive/refs/heads/master.zip
... then cd into the new directory
cd hms_pyintro2conda create -n imgproc python
conda activate imgprocnote: anytime you close and reopen your terminal, you'll need to reactivate your conda environment with
conda activate <name_of_env>
pip install -r requirements.txtthis will
pip installeach of the requirements listed in therequirements.txtfile. You could also install them with conda if you'd like. See the previous lecture for details on pip vs conda.
jupyter-lab 01_image_io.ipynbpathlib.Pathfor filesystem operations. (offers similar functionality to theos.pathmodule, in an object-oriented design)- Open files (like text files) with
open, or
Path.read_text - Loading image data:
- tifffile - read and write TIFF files. Used internally by many other packages.
- imageio - read and write a wide
range of image data
(but use
volreadinstead ofimreadfor nd tiffs) - scikit-image io
module - Utilities
to read and write images in various formats. Wraps
tifffileandimageio, and other plugins. - pims - consistent interface for image sequences. offers Bioformats wrapper, and pure-python nd2 readers with
nd2readerandpims_nd2. - so many others... let me know if you have a challenging image format...
- Viewing images:
matplotlib.pyplot.imshowexcellent image viewer with lots of options... but mostly designed for 2D data.napari.view_imageview n-dimensional arrays in the napari viewer.napari.view_path, open file path in napari viewer. Can install use napari plugins to read proprietary formats.
- Numpy - the fundamental package for scientific computing in Python. It's critical to understand the basics of working with numpy arrays when dealing with image data (indexing, slicing, operations, etc...). Start with the quickstart and go from there...
- Saving images:
tifffile.imsaveskimage.io.imsavenumpy.save
- Start with scikit-image for most of your basic image processing and analysis needs.
- Start with the user-guide
- tutorial on scikit-image with napari
scipy.ndimagehas lots of good functions (filtering, interpolation, measurements) for nd images.- OpenCV has a ton of functionality.
- napari tutorials
- napari training course presented for NEUBIAS webinar.