-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_loading_files.py
More file actions
40 lines (30 loc) · 1.13 KB
/
test_loading_files.py
File metadata and controls
40 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import decafx as dx
import numpy as np
#os.chdir('jan/')
#(X,y,fnames)=dx.import_ideas
folder = '../jan/extracted_tifs'
imsize = (32,32)
channels = (('Ch1','Ch2'),('Ch1','Ch2'))
#folder = 'F:\\Imaging Flow Cytometry Tutorial\\brocker data\data_Aug_2016\\train_set\\extracted_tifs'
(X,y,fnames) = dx.import_ideas(folder = folder,
classes = ('apoptotic_cells','attached_cells'),
channels = channels,
imsize = imsize,
imtype='uint16')
(X2,y2,fnames2) = dx.import_ideas(folder = folder,
classes = ('apoptotic_cells','attached_cells'),
channels = channels,
imsize = imsize,
imtype='uint16',
image_dim_ordering='tf')
X.shape
X2.shape
import matplotlib.pyplot as plt
#32x32 image of ch0 of first cell in theano ordering
plt.imshow(X[0,0,:,:],cmap='gray')
plt.imshow(X2[0,0,:,:],cmap='gray')#this is just a 32x2 slice
#32x32 image of ch0 of first cell in tensorflow ordering
plt.imshow(X2[0,:,:,0],cmap='gray')
X[0,0,1:5,0]==X2[0,1:5,0,0]#All true
np.array_equal(X[0,0,:,:],X2[0,:,:,0])#True