Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue that the ticked checkboxes of tomo slices are ignored #76

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/box_manager/io/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,22 +527,35 @@ def _write_particle_data(
orignal_filename=filename, output_path=path, suffix=suffix
)
empty_slices = []

# Generating mask
mask = np.ones(len(coordinates), dtype=bool)
for z in meta["metadata"]:
if not isinstance(z, int):
continue
if meta["metadata"][z]["write"] is False:
mask[coordinates[:, 0] == z] = False

slices_with_coords = np.unique(coordinates[:, 0]).tolist()
for z in meta["metadata"]:
print('z',z)
if isinstance(z,int):
print(meta["metadata"][z]["write"] )
if (
not isinstance(z, int)
or meta["metadata"][z]["write"] is not True
):
continue
if z in slices_with_coords:

if z in slices_with_coords and meta["metadata"][z]["write"] is not False:
continue
empty_slices.append(z)
if not is_3d:
coordinates = coordinates[:,1:]

print(empty_slices)
export_data[output_file] = (
format_func(
coordinates=coordinates,
coordinates=coordinates[mask],
box_size=boxsize,
features=features,
metadata=meta["metadata"],
Expand Down
Loading