Skip to content

Instantly share code, notes, and snippets.

View eaglebh's full-sized avatar

Pablo Marcondes Fonseca eaglebh

View GitHub Profile
@eaglebh
eaglebh / pythonenvs.md
Created July 25, 2023 18:03 — forked from ziritrion/pythonenvs.md
Cheatsheet for Conda, Pipenv

Conda

  1. Create a virtual environment
    • conda create --name my_env_name python=3.8 or whatever Python version you may need.
  2. List available envs (2 different ways
    • conda env list
    • conda info --envs
  3. Activate virtual env
    • conda activate my_env_name
  4. Deactivate current environment
@eaglebh
eaglebh / get_crop.py
Created July 19, 2023 13:33 — forked from rfezzani/get_crop.py
Crop extraction from tiled TIFF image file directory without whole page loading using tifffile
from tifffile import TiffFile
import numpy as np
def get_crop(page, i0, j0, h, w):
"""Extract a crop from a TIFF image file directory (IFD).
Only the tiles englobing the crop area are loaded and not the whole page.
This is usefull for large Whole slide images that can't fit int RAM.