image_processing

Open source python workflow to segment multiphase flow images

https://github.com/cspurin/image_processing

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Open source python workflow to segment multiphase flow images

Basic Info
  • Host: GitHub
  • Owner: cspurin
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 95.5 MB
Statistics
  • Stars: 17
  • Watchers: 1
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Created about 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Citation

README.md

Image Processing Workflow

Python notebook that uses skimage packages to segment an image. Can be used as a subsitute to Avizo. The paper associated with this work is: https://doi.org/10.31223/X58D69

Guide to getting the code running

Recommended steps for running the notebook.

  1. Download and install vscode: https://code.visualstudio.com/
  2. Download and install python: https://www.python.org/downloads/ (download version 3.10.11)
  3. Install the python extension in vscode. In vscode, click the extensions icon in the sidebar and search for "python"
  4. Open a new folder (link it the folder containing the contents of this repository, wherever that is on your computer)
  5. Create a virtual enviornment. In vscode click View>Terminal and enter the code below:
    python -m venv myenv
    Then for Mac enter: source myenv/bin/activate
    or for Windows: myenv\Scripts\activate
  6. Install the necessary packages by typing this in the terminal: pip install -r requirements.txt NB must be in the folder where the requirements.txt file is. Alternatively, you can install the packages individually e.g. pip install numpy. Now open the notebook (waveletplottingGRL_paper.ipynb) and begin!

Pore space segmentation

This is done with imagesegmentation3D.ipynb. Here we segement the pore space using watershed segmentation.

The pore space is loaded and cropped to remove everything that isn't the core (i.e. no sleeve or core holder in the images): image

The data is filtered using a non-local means filter: image

Then the image is segmented using a watershed segmentation. Values for this are chosen by the user: image

Flow segmentation

This is done with flowsegmentation3D.ipynb. Here we segment the gas in the images using differential imaging and a simple threshold. This requires an image with only brine in the pore space prior to the injeciton of the gas (or oil).

The wet image is cropped and registered to the dry scan.
The flow image is cropped and registered to the dry scan.

The images are filtered using the non-local means filter: image

We subtract the wet image from the flow image to get the location of the gas: image

The segmented dry scan can get the location of the water in the final segmentation of the images.

Owner

  • Name: Catherine Spurin
  • Login: cspurin
  • Kind: user
  • Company: Stanford University

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this work in your research, please cite it as follows."
authors:
  - family-names: "Catherine"
    given-names: "Spurin"
  - family-names: "Ellman"
    given-names: "Sharon"
  - family-names: "Sherburn"
    given-names: "Dane"
  - family-names: "Bultreys"
    given-names: "Tom"
  - family-names: "Tchelepi"
    given-names: "Hamdi"
title: "Python workflow for segmenting multiphase flow in porous rocks"
version: 1.0.0
date-released: 2024-03-30
url: "https://github.com/cspurin/image_processing"

GitHub Events

Total
  • Watch event: 11
  • Push event: 3
  • Pull request event: 4
  • Fork event: 1
  • Create event: 2
Last Year
  • Watch event: 11
  • Push event: 3
  • Pull request event: 4
  • Fork event: 1
  • Create event: 2

Dependencies

code_demo/requirements.txt pypi
  • HeapDict ==1.0.1
  • Jinja2 ==3.1.4
  • MarkupSafe ==2.1.5
  • Pillow ==9.5.0
  • Pint ==0.24.3
  • PyOpenGL ==3.1.7
  • PyWavelets ==1.4.1
  • PyYAML ==6.0.2
  • Pygments ==2.18.0
  • QtPy ==2.4.1
  • Sphinx ==8.0.2
  • alabaster ==1.0.0
  • annotated-types ==0.7.0
  • app-model ==0.2.8
  • appdirs ==1.4.4
  • appnope ==0.1.3
  • asttokens ==2.2.1
  • attrs ==24.2.0
  • babel ==2.16.0
  • backcall ==0.2.0
  • brokenaxes ==0.6.2
  • build ==1.2.2
  • cachey ==0.2.1
  • certifi ==2024.8.30
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • cloudpickle ==3.0.0
  • comm ==0.1.3
  • contourpy ==1.0.7
  • cycler ==0.11.0
  • dask ==2024.9.0
  • debugpy ==1.6.7
  • decorator ==5.1.1
  • docstring_parser ==0.16
  • docutils ==0.21.2
  • einops ==0.6.1
  • executing ==1.2.0
  • flexcache ==0.3
  • flexparser ==0.3.1
  • fonttools ==4.39.3
  • freetype-py ==2.5.1
  • fsspec ==2024.9.0
  • hsluv ==5.0.4
  • idna ==3.10
  • imageio ==2.28.1
  • imagesize ==1.4.1
  • importlib_metadata ==8.5.0
  • in-n-out ==0.2.1
  • ipykernel ==6.22.0
  • ipython ==8.13.1
  • ipywidgets ==8.1.5
  • jedi ==0.18.2
  • jsonschema ==4.23.0
  • jsonschema-specifications ==2023.12.1
  • jupyter_client ==8.2.0
  • jupyter_core ==5.3.0
  • jupyterlab_widgets ==3.0.13
  • kiwisolver ==1.4.4
  • lazy_loader ==0.2
  • locket ==1.0.0
  • magicgui ==0.9.1
  • markdown-it-py ==3.0.0
  • matplotlib ==3.7.1
  • matplotlib-inline ==0.1.6
  • mdurl ==0.1.2
  • napari ==0.5.3
  • napari-console ==0.0.9
  • napari-plugin-engine ==0.2.0
  • napari-svg ==0.2.0
  • nest-asyncio ==1.5.6
  • networkx ==3.1
  • npe2 ==0.7.7
  • numpy ==1.24.3
  • numpydoc ==1.8.0
  • packaging ==23.1
  • pandas ==2.2.3
  • parso ==0.8.3
  • partd ==1.4.2
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • platformdirs ==3.5.0
  • pooch ==1.8.2
  • prompt-toolkit ==3.0.38
  • psutil ==5.9.5
  • psygnal ==0.11.1
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pyconify ==0.1.6
  • pydantic ==2.9.2
  • pydantic-compat ==0.1.2
  • pydantic_core ==2.23.4
  • pyparsing ==3.0.9
  • pyproject_hooks ==1.1.0
  • python-dateutil ==2.8.2
  • pytz ==2024.2
  • pyvista ==0.44.1
  • pyzmq ==25.0.2
  • qtconsole ==5.6.0
  • referencing ==0.35.1
  • requests ==2.32.3
  • rich ==13.8.1
  • rpds-py ==0.20.0
  • scikit-image ==0.20.0
  • scipy ==1.10.1
  • scooby ==0.10.0
  • shellingham ==1.5.4
  • six ==1.16.0
  • snowballstemmer ==2.2.0
  • sphinxcontrib-applehelp ==2.0.0
  • sphinxcontrib-devhelp ==2.0.0
  • sphinxcontrib-htmlhelp ==2.1.0
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==2.0.0
  • sphinxcontrib-serializinghtml ==2.0.0
  • stack-data ==0.6.2
  • superqt ==0.6.7
  • tabulate ==0.9.0
  • tifffile ==2023.4.12
  • tomli_w ==1.0.0
  • toolz ==0.12.1
  • tornado ==6.3.1
  • tqdm ==4.66.5
  • traitlets ==5.9.0
  • typer ==0.12.5
  • typing_extensions ==4.12.2
  • tzdata ==2024.2
  • urllib3 ==2.2.3
  • vispy ==0.14.3
  • vtk ==9.3.1
  • wcwidth ==0.2.6
  • widgetsnbextension ==4.0.13
  • wrapt ==1.16.0
  • zipp ==3.20.2
requirements.txt pypi
  • Pillow *
  • einops *
  • ipywidgets *
  • jupyter *
  • matplotlib *
  • napari *
  • scikit-image *
  • scikit-learn *
  • skimage *