This repository contains supporting code for the Computer Vision and Machine Learning analysis of ImageStream data collected for analysing the effect of age on Extracellular Vesicles.
- PIL >=1.1.7
- skimage >=0.13.1
- matplotlib >=2.1.1
- pickle rev >=72223
- scipy >=0.19.1
- seaborn >=0.9.1
- ipython and jupyter notebooks
- tqdm
To begin, store the data in a data folder somewhere on your computer accesible at <path_to_data_folder>
. The data folder can contain multiple subfolders containing images.
In our case we had two subfolders called old and young. When you store the data, store the folder names in the format: <folder_name>_np
.
The <folder_name>
need to be populated in the folders
list variable in the BioImage class.
The images inside each folder are labeled in a specific format indexed preferably from 0 to N without leading zeros (in our case N=10000).
The image naming format is:
<folder_name>__<index>_Ch<channel_number>.ome.tif
The <channel_number>
mappings should also be populated in the channel variable. Note that if this is changed in the codebase, then there are going to be lots of micro edits required to move the channels around. When this software was written, we did not expect switching channels in and out.
This format can be changed in the __init__
function of the BioImage
class.
- Pickle folders: For every
<folder_name>_np
in your data repository, the code creates an empty<folder_name>_pickle
folder. This will contain optimized, combined versions of the tif files that can be loaded much quicker than the tiff files. - Data folder: Contains the features computed using the
BioAnalysis
class as.npy
files.
The format exported by imagestream contains non-standard elements and therefore cannot be opened by python's image processing libraries. An easy hack to get around this problem is to run a batch convert operation from tif to tif using the ImageJ application.
In a python window, either using a python ide or jupyter notebooks, import the Bioanalysis class and create an object as shown below.
import BioAnalysis
analysis = BioAnalysis('<path_to_data_folder>')
This will start a series of computations that will loop through each image in the data folder. Once all these are complete, you can start playing around with the generated data. For a reference on how to do this, inspect the ipynb files.