Skip to content

Commit 766c61d

Browse files
committed
Improving the documentation by adding some examples
1 parent d4d225f commit 766c61d

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

docs/source/index.rst

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Installation
2424

2525
Install from PyPI::
2626

27+
conda env create -f environment.yaml
28+
conda activate clabtoolkit-env
2729
pip install clabtoolkit
2830

2931
For development installation::
@@ -35,16 +37,44 @@ For development installation::
3537
Quick Start
3638
===========
3739

40+
Surface Visualization
41+
=====================
42+
43+
.. code-block:: python
44+
import clabtoolkit.surfacetools as cltsurf
45+
46+
# Reading a surface file
47+
surf_lh = cltsurf.Surface("/opt/freesurfer/subjects/fsaverage/surf/lh.pial")
48+
49+
# Loading scalar maps
50+
surf_lh.load_scalar_maps("/opt/freesurfer/subjects/fsaverage/surf/lh.thickness", maps_names="Thickness")
51+
surf_lh.plot(overlay_name="Thickness",
52+
views="4_views",
53+
cmap= "jet",
54+
colorbar_position="right")
55+
56+
57+
Working with FreeSurfer
58+
=======================
3859
.. code-block:: python
3960
40-
import clabtoolkit.bidstools as bids
41-
import clabtoolkit.connectivitytools as conn
42-
43-
# Load BIDS configuration
44-
config = bids.load_bids_json()
45-
46-
# Extract entities from BIDS filename
47-
entities = bids.str2entity("sub-01_ses-M00_T1w.nii.gz")
61+
import clabtoolkit.freesurfertools as cltfree
62+
63+
# Get the FREESURFER_HOME environment variable
64+
freesurfer_home = os.environ.get('FREESURFER_HOME')
65+
66+
# Get the default subject directory
67+
fs_subject_dir = os.path.join(freesurfer_home, 'subjects')
68+
69+
fs_fullid = 'bert'
70+
71+
# Load the Subject object
72+
subject = cltfree.FreeSurferSubject(fs_fullid, fs_subject_dir)
73+
74+
# Print subject details
75+
print(f"Subject ID: {subject.subj_id}")
76+
print(f"Subject Directory: ")
77+
cltmisc.print_dict_tree(subject.fs_files)
4878
4979
API Reference
5080
=============

0 commit comments

Comments
 (0)