Skip to content

3D Interactive Embedding Visualization

3D visualization extends the 2D projection step by allowing interactive exploration of your dataset’s embedding space.

Here, you can manually inspect micrographs within clusters, identify distinct regions (e.g., vitreous vs. crystalline ice), and export high-quality subsets for further analysis.

Tip

Use this step to interpret learned representations and select data subsets for refinement or reconstruction.

1. Visualize Precomputed Embeddings

If you already generated 2D embeddings, you can skip re-computation and directly visualize them in 3D:

prismpyp eval3d \
  --evaluate \
  --output-path output_dir/real \
  --metadata-path metadata \
  --embedding-path output_dir/real/inference/embeddings.pth \
  --feature-extractor-weights output_dir/real/checkpoints/model_best.pth.tar \
  --n-clusters 10 \
  --num-neighbors 10

Tip

Reuse embeddings from the eval2d step to speed up processing and maintain consistency across visualization scales.

2. Generate New 3D Embeddings from Scratch

If you haven’t yet produced embeddings, you can create them during the 3D visualization process:

prismpyp eval3d \
  --evaluate \
  --output-path output_dir/real \
  --metadata-path metadata \
  --feature-extractor-weights output_dir/real/checkpoints/model_best.pth.tar \
  --n-clusters 10 \
  --num-neighbors 10

Add the --use-fft flag to process Fourier-domain data.

Warning

As in model training and 2D evaluation, if you are running multiple jobs at the same time (e.g., evaluating on real domain and Fourier domain images simultaneously), you will need to provide different --dist-url arguments for each job so that they do not try to access the same port.

3. Generate Thumbnails for Visualization

If this is your first time running prismpyp eval3d, you may want to generate zipped image thumbnails for interactive rendering:

prismpyp eval3d \
  --evaluate \
  --output-path output_dir/real \
  --metadata-path metadata \
  --embedding-path output_dir/real/inference/embeddings.pth \
  --feature-extractor-weights output_dir/real/checkpoints/model_best.pth.tar \
  --zip-images

Warning

The zipping process may take a few minutes to run. Only rerun with --zip-images if your micrographs have changed since the last embedding.

4. Output Files

At the end of visualization, the following files will be created in /path/to/outputs/inference:

File Description
data_for_export.parquet.zip Metadata table with micrograph names, embeddings, and CTF/defocus/ice thickness metrics
zipped_thumbnail_images.tar.gz Composite thumbnails combining micrograph and power spectrum for interactive visualization

Your 3D embeddings are now ready for interactive inspection in Phoenix — the visualization tool described in the next section.