Skip to content

Instantly share code, notes, and snippets.

View jeanpat's full-sized avatar
🙂

Pommier jeanpat

🙂
View GitHub Profile
@jeanpat
jeanpat / extractParticles.py
Last active August 29, 2015 13:56
A python function relying on scipy.ndimage to extract region of interest in an image or in a stack of images with a a label image, spurious pixels are removed.
def extractParticles(greyIm, LabIm):
locations = nd.find_objects(LabIm)
i=1
extracted_images=[]
for loc in locations:
lab_image = np.copy(LabIm[loc])
grey_image = np.copy(greyIm[loc])
lab_image[lab_image<>i]=0
grey_image[lab_image <>i]=0
extracted_images.append(grey_image)
@jeanpat
jeanpat / extractParticles.ipynb
Created January 29, 2014 14:13
Image segmentation can be performed by an image labelling process. Once segmented, it could necessary to isolate in independant images the labelled regions. Think of chromosomes in a metaphase image, if resolving chromosomes overlapps or karyotyping must be performed. The following script takes "two images", (in fact two small numpy arrays:img i…
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / anisotropy.ipynb
Created November 27, 2013 10:53
Ipython notebook analysing anisotropy of a segmented object (chromosome image) by successive erosion
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / anisotropy_RoseDirections.py
Created November 27, 2013 09:23
This python code implements the morphological "rose des directions" operator, based on morphological erosion. readmagick is used to load an image, another lib could be used.
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 7 15:19:19 2011
@author: Jean-Patrick Pommier
http://www.dip4fish.blogspot.com
"""
from __future__ import division
import numpy as np
from scipy import ndimage as nd
@jeanpat
jeanpat / pictures.kv
Created August 20, 2013 20:10
Interface file for the pictures.py application. Modified version of kivy-example/demo/pictures/pictures.kv
#:kivy 1.0
#:import kivy kivy
#:import win kivy.core.window
FloatLayout:
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
source: 'data/images/background.jpg'
@jeanpat
jeanpat / pictures.py
Created August 20, 2013 19:52
modified version of kivy-example/demo/pictures/main.py available in kivy package
'''
Pictures demo
=============
This is a basic picture viewer, using the scatter widget.
'''
import os
import kivy
kivy.require('1.0.6')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / HMT-SE.ipynb
Created June 20, 2013 16:18
Several structuring elements used with hit-or-miss operator implemented in mahotas to detect branched-points and end-points
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / SkeletonToGraph.ipynb
Last active June 11, 2021 11:05
A ipython notebook. Takes an image, converts its skeleton to a networkx graph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / LargestBlob
Created June 5, 2013 07:29
ipython notebook. Detect the largest blob in an image and calculate its area.
{
"metadata": {
"name": "largest object"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [