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 |
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 = [ | |
# "pandas", | |
# "scipy", | |
# "starfile", | |
# "typer", | |
# "einops", | |
# "rich", | |
# ] |
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 = [ | |
# "pandas", | |
# "scipy", | |
# "starfile", | |
# "typer", | |
# "einops", | |
# ] | |
# [tool.uv] |
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 = [ | |
# "pandas", | |
# "starfile", | |
# "typer", | |
# ] | |
# [tool.uv] | |
# exclude-newer = "2025-01-01T00:00:00Z" | |
# /// |
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 = [ | |
# "dynamotable", | |
# "pandas", | |
# "scipy", | |
# "starfile", | |
# "typer", | |
# ] | |
# [tool.uv] |
NewerOlder