charlesnchr commited on
Commit
1922800
·
1 Parent(s): 58c4038

Added pattern selection

Browse files
app.py CHANGED
@@ -90,7 +90,7 @@ def plot_patch(patch):
90
  # iterate through patch and render if pixel is 1
91
  for row in range(patch.shape[0]):
92
  for col in range(patch.shape[1]):
93
- if patch[row, col] == 255:
94
  bounds = draw_rectangle_from_coords(ax, row, col)
95
  print(bounds)
96
  bounds_list.append(bounds)
@@ -188,12 +188,29 @@ with tabs[1]:
188
 
189
  # fallback
190
  if pattern is None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  cur_dir = os.path.dirname(os.path.abspath(__file__))
192
- def_pattern = f"{cur_dir}/patterns_spotSize_2_Nspots_5_dmdMapping_1.tif"
193
  img = io.imread(def_pattern)
 
194
  st.markdown(
195
- "**No pattern uploaded**: Loading default image with 2x2 spots and 5x5 spot grids: `%s`"
196
- % os.path.basename(def_pattern)
197
  )
198
  else:
199
  print("loading image", pattern)
 
90
  # iterate through patch and render if pixel is 1
91
  for row in range(patch.shape[0]):
92
  for col in range(patch.shape[1]):
93
+ if patch[row, col] > 100:
94
  bounds = draw_rectangle_from_coords(ax, row, col)
95
  print(bounds)
96
  bounds_list.append(bounds)
 
188
 
189
  # fallback
190
  if pattern is None:
191
+ option = st.selectbox(
192
+ "Select pattern",
193
+ (
194
+ "patterns_spotSize_2_Nspots_5_dmdMapping_1.tif",
195
+ "patterns_spotSize_5_Nspots_20_dmdMapping_1.tif",
196
+ "patterns_spotSize_1_Nspots_5_dmdMapping_1.tif",
197
+ "patterns_pixelsize_ratio_1_k2_200_func_square_wave_one_third_dmdMapping_1.tif",
198
+ "patterns_pixelsize_ratio_1_k2_200_func_square_wave_one_third_dmdMapping_0.tif",
199
+ "patterns_pixelsize_ratio_1_k2_80_func_square_wave_one_third_dmdMapping_1.tif",
200
+ "patterns_pixelsize_ratio_1_k2_80_func_square_wave_one_third_dmdMapping_0.tif",
201
+ "patterns_pixelsize_ratio_1_k2_20_func_square_wave_one_third_dmdMapping_1.tif",
202
+ "patterns_pixelsize_ratio_1.8_k2_200_func_square_wave_one_third.tif",
203
+ "patterns_pixelsize_ratio_1.8_k2_150_func_square_wave_one_third.tif",
204
+ "patterns_pixelsize_ratio_1.8_k2_110_func_square_wave_one_third.tif",
205
+ "patterns_pixelsize_ratio_1.6_k2_80.tif",
206
+ ),
207
+ )
208
  cur_dir = os.path.dirname(os.path.abspath(__file__))
209
+ def_pattern = f"{cur_dir}/patterns/{option}"
210
  img = io.imread(def_pattern)
211
+ st.markdown("""**No pattern uploaded**: Loading selected default image.""")
212
  st.markdown(
213
+ "Note that `pixelsize_ratio > 1` and `_dmdMapping_0` indicate an assumption of ortholinear grid (no DMD layout correction). The `_dmdMapping_1` patterns are corrected for DMD."
 
214
  )
215
  else:
216
  print("loading image", pattern)
patterns/patterns_pixelsize_ratio_1.6_k2_80.tif ADDED

Git LFS Details

  • SHA256: 36b605c2d2197a58a6dae0ec4a96032d5ef574c425c4761b39c87c64d3c6e280
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1.8_k2_110_func_square_wave_one_third.tif ADDED

Git LFS Details

  • SHA256: cd5bc0ecd94278fe4c1969b76588ed018b49bde87161311d8bc79663602fd102
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1.8_k2_150_func_square_wave_one_third.tif ADDED

Git LFS Details

  • SHA256: 2fc70d42d8ab30cb368b3b3baaf754f5f9f66a524b8b9ecbeb0a325545a80008
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1.8_k2_200_func_square_wave_one_third.tif ADDED

Git LFS Details

  • SHA256: 129fdc40e8676a428f7d8bfee6df44d94bc1965653c1e8fc918e1eb4a0228e7c
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1_k2_200_func_square_wave_one_third_dmdMapping_0.tif ADDED

Git LFS Details

  • SHA256: 3b14de097d57bfb9d2d8459a344e88a713ed8c06d04d6829b23c9754fd43afbb
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1_k2_200_func_square_wave_one_third_dmdMapping_1.tif ADDED

Git LFS Details

  • SHA256: 55fbc42c5598c86b0d44f0f5263fb3285bea478fdab34f6537f18e0dbeb81891
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1_k2_20_func_square_wave_one_third_dmdMapping_1.tif ADDED

Git LFS Details

  • SHA256: b915e016f95b1a4d4b03e2d801e35a74ab63b8f649e6670a0982a2e353c05f68
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1_k2_80_func_square_wave_one_third_dmdMapping_0.tif ADDED

Git LFS Details

  • SHA256: 546b4adacce430f33dc2d3d0cb4a0f64aa3841ac5a4feade8f39a25b4c55f9b3
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_pixelsize_ratio_1_k2_80_func_square_wave_one_third_dmdMapping_1.tif ADDED

Git LFS Details

  • SHA256: d4d4cb1ec935ed7278d0c38a19b4bcd198ab017e357ef9116bb8d6677be78478
  • Pointer size: 132 Bytes
  • Size of remote file: 9.36 MB
patterns/patterns_spotSize_1_Nspots_5_dmdMapping_1.tif ADDED

Git LFS Details

  • SHA256: 3ad6c6379b37832d5d1edd2466cfcd0ca625e78c4c01633e842bcc2cbcf600d9
  • Pointer size: 132 Bytes
  • Size of remote file: 2.08 MB
patterns_spotSize_2_Nspots_5_dmdMapping_1.tif → patterns/patterns_spotSize_2_Nspots_5_dmdMapping_1.tif RENAMED
File without changes
patterns/patterns_spotSize_5_Nspots_20_dmdMapping_1.tif ADDED

Git LFS Details

  • SHA256: 33388df93f6a2601658a2291e947c023a044fe34b06606f3adf98a1bce7bfd6c
  • Pointer size: 132 Bytes
  • Size of remote file: 2.08 MB