Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Scilpy version - part 1 #1100

Merged
merged 12 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scilpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
_ver.append(_version_extra)

__version__ = '.'.join(map(str, _ver))
version_string = "\nScilpy version: " + __version__

CLASSIFIERS = ["Development Status :: 3 - Alpha",
"Environment :: Console",
Expand Down
41 changes: 21 additions & 20 deletions scripts/scil_aodf_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@
SH coefficients.

Formerly: scil_compute_asym_odf_metrics.py
--------------------------------------------------------------------------------
References:
[1] C. Poirier and M. Descoteaux, "Filtering Methods for Asymmetric ODFs:
Where and How Asymmetry Occurs in the White Matter." bioRxiv. 2022 Jan 1;
2022.12.18.520881. doi: https://doi.org/10.1101/2022.12.18.520881

[2] S. Cetin Karayumak, E. Özarslan, and G. Unal,"Asymmetric Orientation
Distribution Functions (AODFs) revealing intravoxel geometry in diffusion MRI"
Magnetic Resonance Imaging, vol. 49, pp. 145-158, Jun. 2018,
doi: https://doi.org/10.1016/j.mri.2018.03.006.

[3] C. Poirier, E. St-Onge, and M. Descoteaux, "Investigating the Occurence of
Asymmetric Patterns in White Matter Fiber Orientation Distribution Functions"
[Abstract], In: Proc. Intl. Soc. Mag. Reson. Med. 29 (2021), 2021 May 15-20,
Vancouver, BC, Abstract number 0865.
---------------------------------------------------------------------------------
"""


Expand All @@ -44,29 +60,14 @@
assert_headers_compatible, assert_outputs_exist,
add_overwrite_arg, parse_sh_basis_arg)
from scilpy.io.image import get_data_as_mask


EPILOG = """
References:
[1] C. Poirier and M. Descoteaux, "Filtering Methods for Asymmetric ODFs:
Where and How Asymmetry Occurs in the White Matter." bioRxiv. 2022 Jan 1;
2022.12.18.520881. doi: https://doi.org/10.1101/2022.12.18.520881

[2] S. Cetin Karayumak, E. Özarslan, and G. Unal,
"Asymmetric Orientation Distribution Functions (AODFs) revealing intravoxel
geometry in diffusion MRI," Magnetic Resonance Imaging, vol. 49, pp. 145-158,
Jun. 2018, doi: https://doi.org/10.1016/j.mri.2018.03.006.

[3] C. Poirier, E. St-Onge, and M. Descoteaux, "Investigating the Occurence of
Asymmetric Patterns in White Matter Fiber Orientation Distribution Functions"
[Abstract], In: Proc. Intl. Soc. Mag. Reson. Med. 29 (2021), 2021 May 15-20,
Vancouver, BC, Abstract number 0865.
"""
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_sh', help='Input SH image.')

p.add_argument('--mask',
Expand Down
8 changes: 4 additions & 4 deletions scripts/scil_bids_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from scilpy.io.utils import (add_overwrite_arg, add_verbose_arg,
assert_inputs_exist,
assert_outputs_exist)

from scilpy.version import version_string

conversion = {"i": "x",
"i-": "x-",
Expand All @@ -49,9 +49,9 @@


def _build_arg_parser():
p = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=__doc__)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument("in_bids",
help="Input BIDS folder.")
Expand Down
28 changes: 15 additions & 13 deletions scripts/scil_bingham_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
with 1mm isotropic resolution. Other metrics take less than a second.

Formerly: scil_compute_lobe_specific_fodf_metrics.py
------------------------------------------------------------------------------
References:
[1] T. W. Riffert, J. Schreiber, A. Anwander, and T. R. Knösche, “Beyond
fractional anisotropy: Extraction of bundle-specific structural metrics
from crossing fiber models,” NeuroImage, vol. 100, pp. 176-191, Oct. 2014,
doi: 10.1016/j.neuroimage.2014.06.015.

[2] J. Schreiber, T. Riffert, A. Anwander, and T. R. Knösche, “Plausibility
Tracking: A method to evaluate anatomical connectivity and microstructural
properties along fiber pathways,” NeuroImage, vol. 90, pp. 163-178, Apr.
2014, doi: 10.1016/j.neuroimage.2014.01.002.
------------------------------------------------------------------------------
"""

import nibabel as nib
Expand All @@ -33,24 +45,14 @@
compute_fiber_spread,
compute_fiber_fraction)


EPILOG = """
[1] T. W. Riffert, J. Schreiber, A. Anwander, and T. R. Knösche, “Beyond
fractional anisotropy: Extraction of bundle-specific structural metrics
from crossing fiber models,” NeuroImage, vol. 100, pp. 176-191, Oct. 2014,
doi: 10.1016/j.neuroimage.2014.06.015.

[2] J. Schreiber, T. Riffert, A. Anwander, and T. R. Knösche, “Plausibility
Tracking: A method to evaluate anatomical connectivity and microstructural
properties along fiber pathways,” NeuroImage, vol. 90, pp. 163-178, Apr.
2014, doi: 10.1016/j.neuroimage.2014.01.002.
"""
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=EPILOG)
epilog=version_string)

p.add_argument('in_bingham',
help='Input Bingham nifti image.')

Expand Down
4 changes: 3 additions & 1 deletion scripts/scil_btensor_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@
add_verbose_arg, add_skip_b0_check_arg,
add_tolerance_arg, assert_headers_compatible)
from scilpy.reconst.divide import fit_gamma, gamma_fit2metrics
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('--in_dwis', nargs='+', required=True,
help='Path to the input diffusion volume for each '
Expand Down
5 changes: 4 additions & 1 deletion scripts/scil_bundle_alter_to_target_dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@
from scilpy.tractograms.tractogram_operations import transform_streamlines_alter, \
trim_streamlines_alter, cut_streamlines_alter, subsample_streamlines_alter, \
replace_streamlines_alter, shuffle_streamlines, shuffle_streamlines_orientation
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundle',
help='Input bundle filename (.trk, .tck).')
p.add_argument('out_bundle',
Expand Down
4 changes: 3 additions & 1 deletion scripts/scil_bundle_clean_qbx_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
assert_outputs_exist,
assert_output_dirs_exist_and_empty,
assert_headers_compatible)
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundles', nargs='+',
help='List of the clusters filename.')
Expand Down
7 changes: 4 additions & 3 deletions scripts/scil_bundle_compute_centroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
add_verbose_arg,
add_reference_arg)
from scilpy.tractanalysis.bundle_operations import get_streamlines_centroid
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundle',
help='Fiber bundle file.')
Expand Down
7 changes: 4 additions & 3 deletions scripts/scil_bundle_compute_endpoints_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
assert_outputs_exist)
from scilpy.tractograms.streamline_and_mask_operations import \
get_head_tail_density_maps
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundle',
help='Fiber bundle filename.')
Expand Down
7 changes: 5 additions & 2 deletions scripts/scil_bundle_diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@
from scilpy.viz.backends.vtk import create_tube_with_radii
from scilpy.viz.color import get_lookup_table
from scilpy.viz.screenshot import compose_image
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundles', nargs='+',
help='List of tractography files.')
p.add_argument('in_labels', nargs='+',
Expand Down
6 changes: 4 additions & 2 deletions scripts/scil_bundle_filter_by_occurence.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
from scilpy.tractanalysis.streamlines_metrics import compute_tract_counts_map
from scilpy.tractograms.tractogram_operations import (
intersection_robust, union_robust)
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description=__doc__)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundles', nargs='+',
help='Input bundles filename(s). All tractograms must have '
Expand Down
7 changes: 5 additions & 2 deletions scripts/scil_bundle_fixel_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@
add_verbose_arg,
assert_output_dirs_exist_and_empty)
from scilpy.tractanalysis.fixel_density import (fixel_density, maps_to_masks)
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_peaks',
help='Path of the peaks. The peaks are expected to be '
'given as unit directions. \nTo get these from fODF '
Expand Down
20 changes: 10 additions & 10 deletions scripts/scil_bundle_generate_priors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
be used for bundle-specific tractography, but not for FOD metrics.

Formerly: scil_generate_priors_from_bundle.py
-----------------------------------------------------------------------------
Reference:
[1] Rheault, Francois, et al. "Bundle-specific tractography with incorporated
anatomical and orientational priors." NeuroImage 186 (2019): 382-398
-----------------------------------------------------------------------------
"""

import argparse
Expand All @@ -30,19 +35,14 @@
assert_headers_compatible)
from scilpy.reconst.utils import find_order_from_nb_coeff
from scilpy.tractanalysis.todi import TrackOrientationDensityImaging


EPILOG = """
References:
[1] Rheault, Francois, et al. "Bundle-specific tractography with
incorporated anatomical and orientational priors."
NeuroImage 186 (2019): 382-398
"""
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description=__doc__, epilog=EPILOG,)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundle',
help='Input bundle filename.')

Expand Down
7 changes: 4 additions & 3 deletions scripts/scil_bundle_label_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
from scilpy.tractograms.streamline_operations import \
resample_streamlines_num_points
from scilpy.viz.color import get_lookup_table
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundles', nargs='+',
help='Fiber bundle file.')
Expand Down
24 changes: 13 additions & 11 deletions scripts/scil_bundle_mean_fixel_afd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
Please use a bundle file rather than a whole tractogram.

Formerly: scil_compute_fixel_afd_from_bundles.py
-----------------------------------------------------------------------------
Reference:
[1] Raffelt, D., Tournier, JD., Rose, S., Ridgway, GR., Henderson, R.,
Crozier, S., Salvado, O., & Connelly, A. (2012).
Apparent Fibre Density: a novel measure for the analysis of
diffusion-weighted magnetic resonance images. NeuroImage, 59(4),
3976--3994.
-----------------------------------------------------------------------------
"""

import argparse
Expand All @@ -26,20 +34,14 @@
parse_sh_basis_arg, assert_headers_compatible)
from scilpy.tractanalysis.afd_along_streamlines \
import afd_map_along_streamlines

EPILOG = """
Reference:
[1] Raffelt, D., Tournier, JD., Rose, S., Ridgway, GR., Henderson, R.,
Crozier, S., Salvado, O., & Connelly, A. (2012).
Apparent Fibre Density: a novel measure for the analysis of
diffusion-weighted magnetic resonance images. NeuroImage, 59(4),
3976--3994.
"""
from scilpy.version import version_string


def _build_arg_parser():
p = argparse.ArgumentParser(description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawTextHelpFormatter)
p = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawTextHelpFormatter,
epilog=version_string)

p.add_argument('in_bundle',
help='Path of the bundle file.')
p.add_argument('in_fodf',
Expand Down
Loading
Loading