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] |
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] |
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] |
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 functools import partial | |
| import napari | |
| from magicgui.widgets import Button, Container | |
| from scipy.spatial.transform import Rotation as R | |
| from skimage import data | |
| viewer = napari.Viewer(ndisplay=3) | |
| blobs = data.binary_blobs(n_dim=3, length=32, volume_fraction=0.1) | |
| viewer.add_image(blobs) |
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 lxml import etree | |
| json_file = "/Users/burta2/data/fakery/MotionAndCTF2D/average/20170629_00021_frameImage_motion.json" | |
| # <GridMovementX Width="1" Height="1" Depth="3" MarginX="0" MarginY="0" MarginZ="0"> | |
| # <Node X="0" Y="0" Z="0" Value="-5.1639977" /> | |
| # <Node X="0" Y="0" Z="1" Value="0.7089546" /> | |
| # <Node X="0" Y="0" Z="2" Value="4.455043" /> | |
| # </GridMovementX> | |
| # <GridMovementY Width="1" Height="1" Depth="3" MarginX="0" MarginY="0" MarginZ="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
| import os | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| from pathlib import Path | |
| def find_relion_dirs(root_dir): | |
| """ | |
| Recursively walks through the directory and finds all directories that contain a 'Refine3D' or 'Class3D' subdirectory. | |
| Args: |