This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import napari | |
| import numpy as np | |
| from skimage import data | |
| from napari_threedee.manipulators.base_manipulator import BaseManipulator | |
| class FullManipulator(BaseManipulator): | |
| def __init__(self, viewer, layer=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import torch | |
| import einops | |
| import mmdf | |
| from libtilt.grids._patch_grid_utils import patch_grid_centers | |
| from libtilt.grids import coordinate_grid | |
| RESOLUTION_ANGSTROMS = 3.4 | |
| VOLUME_SIZE = (512, 512, 512) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import einops | |
| def sliding_window_3d(tensor, window_size): | |
| d, h, w = tensor.shape | |
| window_depth, window_height, window_width = window_size | |
| # Calculate the number of windows in each dimension | |
| new_d = d - window_depth + 1 | |
| new_h = h - window_height + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import h3 | |
| import torch | |
| import einops | |
| from scipy.spatial.transform import Rotation as R | |
| def get_h3_grid_at_resolution(resolution: int) -> list[str]: | |
| """Get h3 cells (their h3 index) at a given resolution. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from enum import Enum | |
| from pathlib import Path | |
| from glob import glob | |
| import dynamotable | |
| import mrcfile | |
| import pandas as pd | |
| import napari | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pathlib import Path | |
| import imageio | |
| import numpy as np | |
| import napari | |
| from napari.utils.notifications import show_info | |
| IMAGE_FILE_PATTERN = 'images/*' | |
| DIRECTORY_FOR_GOOD_IMAGES = 'good_images' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pathlib import Path | |
| import numpy as np | |
| import pandas as pd | |
| import starfile | |
| # generate fake data | |
| a = np.random.uniform(0, 200, size=(100, 3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pathlib import Path | |
| import typer | |
| cli = typer.Typer() | |
| @cli.command(no_args_is_help=True) | |
| def my_command_line_interface( | |
| pixel_size: float = 1.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from math import ceil, floor | |
| import torch | |
| import torch.nn.functional as F | |
| from libtilt.utils.fft import ( | |
| _target_fftfreq_from_spacing, | |
| _pad_to_best_fft_shape, dft_center, | |
| ) | |
| from libtilt.shift.fourier_shift import phase_shift_dft_2d |