Skip to content
Snippets Groups Projects
Commit d2d1bfd7 authored by fima's avatar fima :beers:
Browse files

Docs update

parent bcf9831d
No related branches found
No related tags found
1 merge request!55Docs update
---
icon: fontawesome/solid/images
---
# Data visualization
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non dolor non justo pharetra elementum porttitor at quam. Duis quam ligula, consequat vitae dolor non, facilisis tincidunt justo. Aliquam congue ex ac nibh tristique, et fringilla odio hendrerit. Cras sit amet dui mauris. Curabitur vitae nibh ut dui luctus cursus at id orci. Proin quam lacus, finibus in porttitor sed, ultrices vel ante. Phasellus ut rhoncus diam. Vestibulum vel ultricies orci, ut vehicula libero. Sed bibendum velit sed volutpat maximus. Maecenas non euismod ipsum. Donec eu tempor lorem. Donec lectus turpis, interdum eget commodo sed, euismod id sapien. Fusce malesuada tortor est.
The `qim3d`libray aims to provide easy ways to explore and get insights from volumetric data.
Example:
!!! Example
```python
import qim3d
img = qim3d.examples.shell_225x128x128
qim3d.viz.slices(img, n_slices=15)
```
![Grid of slices](assets/screenshots/viz-slices.png)
!!! Example
```python
import qim3d
vol = qim3d.examples.bone_128x128x128
qim3d.viz.vol(vol)
```
![viz k3d](assets/screenshots/viz-k3d.png)
::: qim3d.viz.img
options:
members:
- grid_overview
- grid_pred
- slices
::: qim3d.viz.k3d
options:
members:
- vol
......@@ -3,17 +3,18 @@ site_url: https://platform.qim.dk/qim3d/
site_author: Qim3d contributors
site_description: Documentation for the Qim3d python library
repo_url: https://lab.compute.dtu.dk/QIM/tools/qim3d
repo_name: Source code at Gitlab
repo_name: Gitlab
nav:
- 📦 qim3d: index.md
- 📥 Input & Output: io.md
- 📊 Visualization: viz.md
- 🔧 Utils: utils.md
- 🖥️ GUIs: gui.md
- 🧠 ML Models: models.md
- 📋 Release history: releases.md
- qim3d: index.md
- Input & Output: io.md
- Visualization: viz.md
- Utils: utils.md
- GUIs: gui.md
- ML Models: models.md
- CLI: cli.md
- Release history: releases.md
theme:
language: en
......@@ -23,6 +24,7 @@ theme:
favicon: assets/qim3d-icon.svg
features:
- navigation.tabs
- navigation.sections
# - navigation.expand
# - navigation.instant
- toc.integrate
......@@ -31,6 +33,8 @@ theme:
# - content.tabs.link
# - content.code.annotation
- content.code.copy
- content.code.annotate
- header.autohide
palette:
primary: white
......@@ -48,7 +52,19 @@ extra:
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- admonition
- attr_list
- md_in_html
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.details
- pymdownx.superfences
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
plugins:
- tags
......
......@@ -6,4 +6,6 @@ import qim3d.models as models
import qim3d.processing as processing
import logging
__version__ = '0.3.2'
examples = io.ImgExamples()
"""
The GUI can be launched directly from the command line:
```bash
qim3d gui --data-explorer
```
Or launched from a python script
```python
import qim3d
app = qim3d.gui.data_explorer.Interface()
app.launch()
```
"""
import gradio as gr
import numpy as np
import os
......
"""
The GUI can be launched directly from the command line:
```bash
qim3d gui --iso3d
```
Or launched from a python script
```python
import qim3d
app = qim3d.gui.iso3d.Interface()
app.launch()
```
"""
import gradio as gr
import numpy as np
import os
......
"""
!!! quote "Reference"
Dahl, V. A., & Dahl, A. B. (2023, June). Fast Local Thickness. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW).
<https://doi.org/10.1109/cvprw59228.2023.00456>
```bibtex
@inproceedings{Dahl_2023, title={Fast Local Thickness},
url={http://dx.doi.org/10.1109/CVPRW59228.2023.00456},
DOI={10.1109/cvprw59228.2023.00456},
booktitle={2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
publisher={IEEE},
author={Dahl, Vedrana Andersen and Dahl, Anders Bjorholm},
year={2023},
month=jun }
```
The GUI can be launched directly from the command line:
```bash
qim3d gui --local-thickness
```
Or launched from a python script
```python
import qim3d
app = qim3d.gui.local_thickness.Interface()
app.launch()
```
"""
import gradio as gr
import numpy as np
import os
......
This diff is collapsed.
This diff is collapsed.
"Class for downloading larger images from the QIM Data Repository"
"Manages downloads and access to data"
import os
import urllib.request
......@@ -16,15 +16,15 @@ class Downloader:
"""Class for downloading large data files available on the QIM data repository.
Attributes:
[folder_name_1] (str): folder class with the name of the first folder in the QIM data repository.
[folder_name_2] (str): folder class with the name of the second folder in the QIM data repository.
...
[folder_name_n] (str): folder class with the name of the n-th folder in the QIM data repository.
[folder_name] (str): folder class with the name of the folder in [https://data.qim.dk/data-repository/](https://data.qim.dk/data-repository/)
Example:
```python
import qim3d
dl = qim3d.io.Downloader()
# Downloads and Loads (optional) image:
img = dl.Corals.Coral2_DOWNSAMPLED(load = True)
```
"""
def __init__(self):
......
"""Provides functionality for saving data to various file formats."""
"""
Provides functionality for loading data from various file formats.
Example:
```python
import qim3d
img = qim3d.examples.fly_150x256x256
qim3d.io.save("img.tif", img)
```
Volumes can also be saved with one file per slice:
```python
import qim3d
img = qim3d.examples.fly_150x256x256
qim3d.io.save("slices", img, basename="fly-slices", sliced_dim=0)
```
"""
import os
import h5py
......
"""Implementing the UNet model class and Hyperparameters class."""
"""UNet model and Hyperparameters class."""
from monai.networks.nets import UNet as monai_UNet
from monai.losses import FocalLoss, DiceLoss, DiceCELoss
......@@ -27,7 +28,9 @@ class UNet(nn.Module):
ValueError: If `size` is not one of 'small', 'medium', or 'large'.
Example:
```python
model = UNet(size='large')
```
"""
def __init__(self, size = 'medium',
dropout = 0,
......@@ -101,16 +104,15 @@ class Hyperparameters:
ValueError: If `optimizer` is not one of 'Adam', 'SGD', 'RMSprop'.
Example:
# Create hyperparameters instance
```
hyperparams = Hyperparameters(model=my_model, n_epochs=20, learning_rate=0.001)
# Get the hyperparameters
params_dict = hyperparams()
params_dict = hyperparams() # Get the hyperparameters
# Access the optimizer and criterion
optimizer = params_dict['optimizer']
criterion = params_dict['criterion']
n_epochs = params_dict['n_epochs']
```
"""
def __init__(self,
model,
......
......@@ -259,9 +259,13 @@ def slices(
ValueError: If the `position` keyword argument is not a integer, list of integers or one of the following strings: "start", "mid" or "end".
Example:
vol_path = '/my_vol_path/my_vol.tif'
vol = qim3d.io.load(vol_path)
slices(vol, axis = 1, position = 'mid', n_slices = 3, cmap = 'viridis', img_height = 4, img_width = 4, show = True, show_position = True, interpolation = None)
```python
import qim3d
img = qim3d.examples.shell_225x128x128
qim3d.viz.slices(img, n_slices=15)
```
"""
# Numpy array or Torch tensor input
......
"""
Volumetric visualization using K3D
!!! quote "Reference"
Volumetric visualization uses K3D:
[Github page](https://github.com/K3D-tools/K3D-jupyter)
"""
import k3d
......@@ -22,7 +27,7 @@ def vol(img, show=True, save=False):
Examples:
```python
import qim3d
vol = qim3d.examples.fly_150x256x256
vol = qim3d.examples.bone_128x128x128
# shows the volume inline
qim3d.viz.vol(vol)
......
......@@ -16,4 +16,8 @@ torch>=2.0.1,
torchvision>=0.15.2,
torchinfo>=1.8.0,
tqdm>=4.65.0,
nibabel>=5.2.0
nibabel>=5.2.0,
dask>=2023.6.0,
k3d>=2.16.1
olefile>=0.46
psutil>=5.9.0
\ No newline at end of file
......@@ -9,13 +9,13 @@ with open("README.md", "r", encoding="utf-8") as f:
setup(
name="qim3d",
version="0.3.1",
version="0.3.2",
author="Felipe Delestro",
author_email="fima@dtu.dk",
description="QIM tools and user interfaces",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://lab.compute.dtu.dk/QIM/tools/qim3d",
url="https://platform.qim.dk/qim3d",
packages=find_packages(),
include_package_data=True,
entry_points = {
......@@ -55,6 +55,10 @@ setup(
"torchvision>=0.15.2",
"torchinfo>=1.8.0",
"tqdm>=4.65.0",
"nibabel>=5.2.0"
"nibabel>=5.2.0",
"dask>=2023.6.0",
"k3d>=2.16.1",
"olefile>=0.46",
"psutil>=5.9.0"
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment