dmriprep.utils package¶
Submodules¶
dmriprep.utils.bids module¶
Utilities to handle BIDS inputs¶
-
dmriprep.utils.bids.collect_data(bids_dir, participant_label, concat_dwis, session_label=None)[source]¶ Uses pybids to retrieve the input data for a given participant
-
dmriprep.utils.bids.collect_participants(bids_dir, participant_label=None, strict=False, bids_validate=True)[source]¶ List the participants under the BIDS root and checks that participants designated with the participant_label argument exist in that folder. Returns the list of participants to be finally processed. Requesting all subjects in a BIDS directory root: >>> collect_participants(str(datadir / ‘ds114’), bids_validate=False) [‘01’, ‘02’, ‘03’, ‘04’, ‘05’, ‘06’, ‘07’, ‘08’, ‘09’, ‘10’] Requesting two subjects, given their IDs: >>> collect_participants(str(datadir / ‘ds114’), participant_label=[‘02’, ‘04’], … bids_validate=False) [‘02’, ‘04’] Requesting two subjects, given their IDs (works with ‘sub-‘ prefixes): >>> collect_participants(str(datadir / ‘ds114’), participant_label=[‘sub-02’, ‘sub-04’], … bids_validate=False) [‘02’, ‘04’] Requesting two subjects, but one does not exist: >>> collect_participants(str(datadir / ‘ds114’), participant_label=[‘02’, ‘14’], … bids_validate=False) [‘02’] >>> collect_participants( … str(datadir / ‘ds114’), participant_label=[‘02’, ‘14’], … strict=True, bids_validate=False) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): dmriprep.utils.bids.BIDSError: …
dmriprep.utils.hemisphere module¶
-
dmriprep.utils.hemisphere.is_hemispherical(vecs)[source]¶ Test whether all points on a unit sphere lie in the same hemisphere.
Inputs
- vecsnumpy.ndarray
2D numpy array with shape (N, 3) where N is the number of points. All points must lie on the unit sphere.
Outputs
- is_hemibool
If True, one can find a hemisphere that contains all the points. If False, then the points do not lie in any hemisphere
- polenumpy.ndarray
If is_hemi == True, then pole is the “central” pole of the input vectors. Otherwise, pole is the zero vector.
References
https://rstudio-pubs-static.s3.amazonaws.com/27121_a22e51b47c544980bad594d5e0bb2d04.html # noqa