Skip to content

Commit bf7ac6f

Browse files
authored
Improve plots of datasets in documentation (#1325)
1 parent dfe3271 commit bf7ac6f

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

docs/source/datasets.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MNI
9393

9494
import torchio as tio
9595
subject = tio.datasets.Colin27()
96-
subject.plot()
96+
subject.plot(figsize=(9, 9))
9797

9898

9999
:class:`Pediatric`
@@ -104,7 +104,7 @@ MNI
104104

105105
import torchio as tio
106106
subject = tio.datasets.Pediatric((4.5, 8.5))
107-
subject.plot()
107+
subject.plot(figsize=(14, 9))
108108

109109

110110
:class:`Sheep`
@@ -140,7 +140,7 @@ ITK-SNAP
140140
.. plot::
141141

142142
import torchio as tio
143-
tio.datasets.BrainTumor().plot()
143+
tio.datasets.BrainTumor().plot(figsize=(16, 9))
144144

145145

146146
:class:`T1T2`
@@ -162,7 +162,7 @@ ITK-SNAP
162162

163163
import torchio as tio
164164
subject = tio.datasets.AorticValve()
165-
subject.plot()
165+
subject.plot(figsize=(12, 9))
166166

167167

168168
3D Slicer
@@ -198,7 +198,7 @@ FPG
198198

199199
import torchio as tio
200200
subject = tio.datasets.FPG(load_all=True)
201-
subject.plot()
201+
subject.plot(figsize=(16, 9))
202202

203203

204204
MedMNIST
@@ -313,3 +313,17 @@ MedMNIST
313313
tensor = rearrange(tensor, pattern, b1=rows, b2=cols)
314314
sx = tensor.shape[1]
315315
plt.imshow(tensor[0, sx // 2], cmap='gray')
316+
317+
ZonePlate
318+
---------
319+
320+
.. currentmodule:: torchio.datasets.zone_plate
321+
322+
323+
.. autoclass:: ZonePlate
324+
325+
.. plot::
326+
327+
from torchio.datasets import ZonePlate
328+
zone_plate = ZonePlate(size=201)
329+
zone_plate.plot(interpolation='bicubic')

src/torchio/datasets/ct_rate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class CtRate(SubjectsDataset):
5858
**kwargs: Additional arguments for SubjectsDataset.
5959
6060
Examples:
61-
>>> dataset = CtRate('/path/to/data', split='train')
61+
>>> from torchio.datasets import CtRate
62+
>>> dataset = CtRate('/path/to/CT-RATE', sizes=[512])
6263
"""
6364

6465
_REPO_ID = 'ibrahimhamamci/CT-RATE'

0 commit comments

Comments
 (0)