Felipe Delestro
Senior Research Software Specialist @ QIM Center
Danmarks Tekniske Universitet (DTU)
fima@dtu.dk
Center for Quantification of Imaging Data from MAX IV
supported by
Head of the QIM Center
Deputy Head of the QIM Center
Professor at Lund university
Center Manager
open-source Python library, that focuses on 3D volumetric data
Getting started is easy:
pip install qim3d
Documentation at platform.qim.dk/qim3d/
Data handlingVolumetric data can be stored in a variety of file formats.
This can make the very first step of importing the data more complex than it should be
Data handlingData handlingVolumetric data can be stored in a variety of file formats.
This can make the very first step of importing the data more complex than it should be
qim3d.io.load and qim3d.io.save can handle the most common data formats:
Tiff (including file stacks)HDF5TXRM/TXM/XRM
NIfTIPIL (including file stacks)VOL/VGI
DICOMimport qim3d
vol = qim3d.io.load("path/to/image.tif", virtual_stack=True)Data handlingWe make a distinction between load/save and import/export when the operation includes transformations to the data.
Currently we're implementing a 3D import/export following the OME-Zarr standard, which
uses chunked data with a
ulti-scales scheme.
VisualizationVisualizationEasily exploring volumetric data may not be so straightforward. The library provides helper functions this task simple and easy, even within Jupyter Notebooks
import qim3d
vol = qim3d.examples.bone_128x128x128
qim3d.viz.slicer(vol)Visualizationimport qim3d
vol = qim3d.examples.shell_225x128x128
qim3d.viz.slices_grid(vol, num_slices=15)Visualizationimport qim3d
# Generate synthetic collection of objects
num_objects = 15
vol, labels = qim3d.generate.volume_collection(num_objects = num_objects)# Visualize synthetic collection
qim3d.viz.volumetric(vol)Visualizationimport qim3d
vol = qim3d.generate.volume(base_shape=(128,128,128),
final_shape=(128,128,128),
noise_scale=0.03,
order=1,
gamma=1,
max_value=255,
threshold=0.5,
dtype='uint8'
)
mesh = qim3d.mesh.from_volume(vol, step_size=3)
qim3d.viz.mesh(mesh.vertices, mesh.faces)Visualizationimport qim3d
vol = qim3d.examples.cement_128x128x128
binary = qim3d.filters.gaussian(vol, sigma = 2) < 60
labeled_volume, num_labels = qim3d.segmentation.watershed(binary)
color_map = qim3d.viz.colormaps.segmentation(num_labels, style = 'bright')
qim3d.viz.slicer(labeled_volume, slice_axis = 1, color_map=color_map)qim3d.viz.colormaps.segmentation creates an colormap designes specifically for segmentation tasks
The parameter min_dist allows us to control how different neighbour colors are
+
=
❤️