Jupyter notebook based on ImageD11 to process scanning 3DXRD data#
Written by Haixing Fang, Jon Wright and James Ball#
Date: 23/07/2024#
Source: ImageD11/nbGui/S3DXRD/import_test_data.ipynb. Shown as saved in git; the documentation build does not run it.
NOTE: These notebooks are under active development#
They require the latest version of ImageD11 from Git to run.
If you don’t have this set up yet, you can run the below cell.
It will automatically download and install ImageD11 to your home directory
# this cell is tagged with 'parameters'
# to view the tag, select the cell, then find the settings gear icon (right or left sidebar) and look for Cell Tags
download_dir = 'si_cube_test'
# python environment stuff
IMAGED11_PATH = None # means do not use git, otherwise "ImageD11" or "ImageD11_version_xx", etc
CHECKOUT_PATH = None # None means guess, or you can specify a folder for the checkout
if IMAGED11_PATH is not None:
exec(open('/data/id11/nanoscope/install_ImageD11_from_git.py').read())
PYTHONPATH=setup_ImageD11_from_git(CHECKOUT_PATH, IMAGED11_PATH)
else:
import site
PYTHONPATH = site.getsitepackages()[0]
print(PYTHONPATH)
import os
import ImageD11.sinograms.dataset
import ImageD11.sinograms.properties
from ImageD11.fetch_data import si_cube_s3dxrd_dataset
# Check that we're importing ImageD11 from the home directory rather than from the Jupyter kernel
?ImageD11.sinograms.dataset
# USER: change this as you like!
if not os.path.exists(download_dir):
os.mkdir(download_dir)
# we will download a test dataset from Zenodo
ds = si_cube_s3dxrd_dataset(download_dir, allow_download=True)
# Now label the sparse peaks to create a 2D peaks table
ImageD11.sinograms.properties.main(ds.dsfile, options={'algorithm': 'lmlabel', 'wtmax': 70000, 'save_overlaps': False})
# Save dataset to disk
ds.save()
print('Dataset saved to ' + ds.dsfile)
DONE!#
No need to segment, go straight to notebook 1