In [1]:
cd /nfs/xf11id
In [13]:
%matplotlib inline
import matplotlib.pyplot as plt
import pims
import numpy as np
import os
import pyXPCS.waterfall
import logging
logger = logging.getLogger('__main__')
logger.setLevel(logging.INFO)
In [12]:
filepath = '/nfs/xf11id/data/2015/4/4'
filename = 'Bfiber_s0p4_overweekend_*.tiff'
full_path = os.path.join(filepath, filename)
def make_gray(image):
return image.sum(axis=-1)
frames = pims.ImageSequence(full_path, process_func=make_gray)
frames
Out[12]:
In [4]:
labels = np.zeros_like(frames[0])
labels[:, 1000] = 1
indices = pyXPCS.waterfall.labels_to_indices(labels)
In [5]:
result = pyXPCS.waterfall.waterfall(frames, indices)
In [11]:
fig, ax = plt.subplots(figsize=(8, 8))
ax.imshow(result[1])
ax.set_aspect(1)
In [8]:
result[1].shape
Out[8]:
In [10]:
import pandas as pd
pd.Series(labels.ravel()).value_counts()
Out[10]:
In [12]:
np.empty((len(frames), len(indices[0]))).shape
In [10]:
indices
Out[10]:
In [ ]: