Skip to content
Snippets Groups Projects
Commit fe3b8453 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 14f89207
No related branches found
No related tags found
No related merge requests found
import h5py
import numpy as np
import pandas as pd
import random
def hdf5_to_npz_csv(hdf5_filename, output_file_prefix, chunk_size=10000):
......@@ -14,6 +15,15 @@ def hdf5_to_npz_csv(hdf5_filename, output_file_prefix, chunk_size=10000):
chunk_size (int): Size of chunks to process at once (default is 1000).
"""
# # New step: keep only 10 mask values == True
# mask_indices = list(np.nonzero(mask)[0])
# if len(mask_indices) > 10:
# selected_indices = random.sample(mask_indices, 10)
# new_mask = np.zeros(mask.size).astype(np.bool)
# new_mask[selected_indices] = True
# mask = new_mask
# keep_array.append(data[mask])
# Step 1: Open HDF5 file
with h5py.File(hdf5_filename, "r") as file:
fov_mask = np.asarray(file["FOV_mask"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment