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
| # /// script | |
| # dependencies = [ | |
| # "torch", | |
| # "numpy", | |
| # "scipy", | |
| # "mrcfile", | |
| # "torch-transform-image", | |
| # "torch-affine-utils", | |
| # "matplotlib", | |
| # ] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 itertools import combinations | |
| import einops | |
| import numpy as np | |
| import torch | |
| import torch.nn.functional as F | |
| from torch_affine_utils import homogenise_coordinates | |
| from torch_affine_utils.transforms_3d import Rx, Ry, Rz, T | |
| from torch_grid_utils import dft_center | |
| from torch_subpixel_crop import subpixel_crop_2d |
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 typing import Tuple | |
| import mmdf | |
| import numpy as np | |
| import torch | |
| from fast_histogram import histogramdd | |
| import einops | |
| from scipy.stats import special_ortho_group | |
| from torch_affine_utils.transforms_3d import Rz, Ry, T | |
| from torch_affine_utils import homogenise_coordinates |
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 datetime | |
| import os | |
| from collections import defaultdict | |
| from typing import Dict, List, Any | |
| import requests | |
| class GitHubContributionsAnalyzer: | |
| def __init__(self, org_name: str, token: str = 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
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "numpy", | |
| # "scipy", | |
| # "starfile", | |
| # "napari[pyqt5]", | |
| # "magicgui", | |
| # "typer", | |
| # ] |
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 mrcfile | |
| import numpy as np | |
| image_path = "CountRef_20250327_s004101_75-4_000_Mar27_17.04.37.mrc" | |
| image = mrcfile.read(image_path) | |
| image = np.array(image) | |
| image = image[:, :4031] |
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 | |
| from scipy.spatial.transform import Rotation as R | |
| from torch_fourier_slice import project_3d_to_2d, backproject_2d_to_3d | |
| tilt_angles = np.linspace(-60, 60, 41, endpoint=True) | |
| rotation_matrices = R.from_euler('y', angles=tilt_angles, degrees=True).as_matrix() | |
| volume = simulate_volume() | |
| projections = project_3d_to_2d(volume, rotation_matrices) | |
| simulated_tomogram = backproject_2d_to_3d(projections, rotation_matrices) |
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 mrcfile | |
| import torch | |
| from torch_fourier_slice import project_3d_to_2d | |
| volume = torch.tensor(mrcfile.read("run_class001.mrc")).float() | |
| projection = project_3d_to_2d(volume, rotation_matrices=torch.eye(3)) | |
| d, h, w = volume.shape |
NewerOlder