In [1]:
import sys
sys.path.append('../code/functions')
sys.path.append('../code/tests')
In [8]:
import cv2
import quality
from cluster import Cluster
from scipy import ndimage
from neighborhoodLib import neighborhoodDensity
import connectLib as cLib
import mouseVis as mv
import tiffIO as tIO
import cPickle as pickle
import hyperReg as hype
import matplotlib.pyplot as plt
import pipeline as current
import plotly
plotly.offline.init_notebook_mode()
In [20]:
data = pickle.load(open('../code/tests/synthDat/realDataRaw_t1.io'))
In [26]:
smallData=data[70:90]
In [33]:
%%time
currentClusters3, curBin3 = current.pipeline(smallData,
interPlane=3,
intraPlane=3,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [34]:
%%time
currentClusters5, curBin5 = current.pipeline(smallData,
interPlane=5,
intraPlane=5,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [35]:
%%time
currentClusters7, curBin7 = current.pipeline(smallData,
interPlane=7,
intraPlane=7,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [47]:
plt.figure()
plt.imshow(smallData[5], cmap='gray')
plt.title('Raw data')
plt.show()
plt.figure()
plt.imshow(smallData[5]*5, cmap='gray')
plt.title('Raw data with artificial brightening')
plt.show()
In [37]:
cLib.clusterAnalysis(curBin3)
In [38]:
cLib.clusterAnalysis(curBin5)
In [39]:
cLib.clusterAnalysis(curBin7)
In [51]:
plt.figure()
plt.imshow(curBin3[5], cmap='gray')
plt.title('Binary output with neighborhood=3')
plt.show()
plt.figure()
plt.imshow(curBin5[5], cmap='gray')
plt.title('Binary output with neighborhood=5')
plt.show()
plt.figure()
plt.imshow(curBin7[5], cmap='gray')
plt.title('Binary output with neighborhood=7')
plt.show()
In [52]:
plt.figure()
plt.imshow(smallData[5], cmap='gray')
plt.title('Raw data')
plt.show()
plt.figure()
plt.imshow(smallData[5]*5, cmap='gray')
plt.title('Raw data with artificial brightening')
plt.show()
In [53]:
%%time
currentClustersLargeInter, curBinLargeInter = current.pipeline(smallData,
interPlane=10,
intraPlane=5,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [56]:
plt.figure()
plt.imshow(curBinLargeInter[5], cmap='gray')
plt.title('Binary output with interN=10, intraN=5')
plt.show()
plt.figure()
plt.imshow(curBin5[5], cmap='gray')
plt.title('Binary output with interN=5, intraN=5')
plt.show()
In [66]:
%%time
currentClustersLargeInter15, curBinLargeInter15 = current.pipeline(smallData,
interPlane=15,
intraPlane=5,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [70]:
plt.figure()
plt.imshow(curBinLargeInter15[5], cmap='gray')
plt.title('Binary output with interN=15, intraN=5')
plt.show()
In [68]:
%%time
currentClustersLargeInter25, curBinLargeInter25 = current.pipeline(smallData,
interPlane=25,
intraPlane=5,
volThreshLowerBound=25,
volThreshUpperBound=250,
meanNormSlices=True,
verbose=False,
returnBinary = True)
In [71]:
plt.figure()
plt.imshow(curBinLargeInter25[5], cmap='gray')
plt.title('Binary output with interN=25, intraN=5')
plt.show()
In [72]:
plt.figure()
plt.imshow(curBin5[5], cmap='gray')
plt.title('Binary output with interN=5, intraN=5')
plt.show()
In [ ]: