@@ -33,7 +33,7 @@ def main():
33
33
34
34
# Comment if only taking one stack
35
35
allFiles = glob .glob ('//lebnas1.epfl.ch/microsc125/iSIMstorage/Users/Willi/'
36
- '180420_drp_mito_Dora/**/*MMStack*_combine* .ome.tif' , recursive = True )
36
+ '180420_drp_mito_Dora/**/*MMStack*_combine.ome.tif' , recursive = True )
37
37
38
38
# allFiles = glob.glob('W:/iSIMstorage/Users/Willi/160622_caulobacter/'
39
39
# '160622_CB15N_WT/SIM images/Series*[0-9].ome.tif')
@@ -44,14 +44,16 @@ def main():
44
44
# nnFile = file[:-8] + '_nn.ome.tif'
45
45
sample = re .split ('sample' , file )[1 ][0 ]
46
46
cell = re .split ('cell_' , file )[1 ][0 ]
47
- atsFolder = os .path .dirname (file ) + '/s' + str (sample ).zfill (2 ) + '_c' + str (cell ).zfill (2 ) + '_ATS'
47
+ atsFolder = (os .path .dirname (file ) + '/s' + str (sample ).zfill (2 ) + '_c' +
48
+ str (cell ).zfill (2 ) + '_ATS2' )
48
49
49
50
# atsFolder = file[:-4] + '_ATS_ffmodel'
50
51
# if not os.path.isfile(nnFile):
51
52
if not os .path .isdir (atsFolder ):
52
53
stacks .append (file )
53
54
stacks = sorted (stacks )
54
55
print ('\n ' .join (stacks ))
56
+ stacks = ['C:/Users/stepp/Documents/02_Raw/SmartMito/sample1_cell_3.tif' ]
55
57
atsOnStack (stacks )
56
58
57
59
@@ -63,7 +65,7 @@ def atsOnStack(stacks: list):
63
65
# USER SETTINGS
64
66
# see end of file for setting the folders/files to do the simulation on
65
67
#
66
- modelPath = '//lebnas1.epfl.ch/microsc125/Watchdog/Model/model_Willi .h5'
68
+ modelPath = '//lebnas1.epfl.ch/microsc125/Watchdog/Model/paramSweep5/f32_c07_b08 .h5'
67
69
# Should we get the settings from the central settings file?
68
70
extSettings = False
69
71
dataOrder = 0 # 0 for drp/foci first, 1 for mito/structure first
@@ -102,7 +104,8 @@ def atsOnStack(stacks: list):
102
104
# newFolder = re.split(r'.tif', stack)[0] + '_ATS_ffmodel'
103
105
sample = re .split ('sample' , stack )[1 ][0 ]
104
106
cell = re .split ('cell_' , stack )[1 ][0 ]
105
- newFolder = os .path .dirname (stack ) + '/s' + str (sample ).zfill (2 ) + '_c' + str (cell ).zfill (2 ) + '_ATS'
107
+ newFolder = (os .path .dirname (stack ) + '/s' + str (sample ).zfill (2 ) + '_c' +
108
+ str (cell ).zfill (2 ) + '_ATS2' )
106
109
if os .path .exists (newFolder ):
107
110
shutil .rmtree (newFolder )
108
111
os .mkdir (newFolder )
@@ -122,9 +125,16 @@ def atsOnStack(stacks: list):
122
125
123
126
# dataOrder = dataOrderMetadata(stack)
124
127
dataOrder = dataOrderMetadata (stack , write = False )
125
- drpOrig , mitoOrig , drpTimes , mitoTimes = loadTifStack (stack , outputElapsed = True )
128
+ drpOrig , mitoOrig , drpTimes , mitoTimes = loadTifStack (stack , order = dataOrder ,
129
+ outputElapsed = True )
126
130
print ('stack loaded' )
127
131
132
+ # check if there is timing in the times or just frames and if adjust for timing in ms
133
+ diff = np .diff (drpTimes )
134
+ if np .max (diff ) < 3 :
135
+ drpTimes = np .multiply (drpTimes , 500 )
136
+ mitoTimes = np .multiply (mitoTimes , 500 )
137
+
128
138
time = drpTimes [0 ]
129
139
frame = 0
130
140
fastMode = False
@@ -278,7 +288,6 @@ def atsOnStack(stacks: list):
278
288
print ((' -> ' + str (frame )), end = ' ' )
279
289
print (('fast frames:' + str (fastCount )), end = '\r ' )
280
290
281
-
282
291
if outputData [- 1 ] == 0 :
283
292
fileHandle = open ("ATSSim_logging.txt" , "a" )
284
293
fileHandle .write ('\n outputData was 0 at frame' )
@@ -290,7 +299,5 @@ def atsOnStack(stacks: list):
290
299
print ('\n total fast frames: ' , fastCum , '\n \n ' )
291
300
292
301
293
-
294
-
295
302
if __name__ == '__main__' :
296
303
main ()
0 commit comments