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 pathlib import Path | |
| from typing import Tuple, Optional | |
| import einops | |
| import fast_histogram | |
| import mmdf | |
| import mrcfile | |
| import numpy as np | |
| from scipy.stats import special_ortho_group |
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 einops | |
| import mrcfile | |
| import numpy as np | |
| import torch | |
| import typer | |
| cli = typer.Typer(add_completion=False) |
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 pathlib import Path | |
| import einops | |
| import mmdf | |
| import mrcfile | |
| import numpy as np | |
| import typer | |
| cli = typer.Typer(add_completion=False) |
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 typing import Tuple | |
| import starfile | |
| import numpy as np | |
| import einops | |
| from scipy.spatial.transform import Rotation as R | |
| CHIMERAX_VIEW_MATRIX_OUTPUT_FILE = 'chimerax/view_matrix_output_origin_at_rotation_center.txt' | |
| PARTICLE_STAR_FILE = 'class3d_dir/run_it025_data.star' |
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 | |
| import napari | |
| import numpy as np | |
| import pandas as pd | |
| import starfile | |
| from magicgui import magicgui | |
| from scipy.spatial.transform import Rotation as R | |
| PARTICLE_STAR_FILE = 'ricardo_data.star' |
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 pandas as pd | |
| import einops | |
| import numpy as np | |
| def Rx(angles_degrees: np.ndarray) -> np.ndarray: | |
| """Affine matrix for a rotation around the X-axis.""" | |
| angles_degrees = np.asarray(angles_degrees).reshape(-1) | |
| c = np.cos(np.deg2rad(angles_degrees)) | |
| s = np.sin(np.deg2rad(angles_degrees)) |
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 Sequence, Tuple, Literal | |
| import einops | |
| import mrcfile | |
| import napari | |
| from magicgui import magicgui | |
| from napari.types import ImageData | |
| import numpy as np | |
| import torch | |
| from torch.nn import functional as F |
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 | |
| # set up initial orientations of two particles | |
| p0 = np.eye(3) # oriented same as basis vectors of coord system | |
| p1 = R.from_euler(seq='XYZ', angles=[10, 10, 60], degrees=True) # slightly rotated out of plane, in plane quite different | |
| # take y vector from p0, project onto y and y from p1 | |
| # take y vector because is easier for construction of x-vector with the cross product | |
| p0_y = p0[:, 1] |