nimare.nimads
.Studyset
- class Studyset(source, target_space=None, mask=None, annotations=None)[source]
Bases:
object
A collection of studies for meta-analysis.
Added in version 0.0.14.
This is the primary target for Estimators and Transformers in NiMARE.
- Variables:
id (str) – A unique identifier for the Studyset.
name (str) – A human-readable name for the Studyset.
annotations (
list
ofnimare.nimads.Annotation
objects) – The Annotation objects associated with the Studyset.studies (
list
ofnimare.nimads.Study
objects) – The Study objects comprising the Studyset.
Methods
Combine analyses in Studyset.
copy
()Create a copy of the Studyset.
from_nimads
(filename)Create a Studyset from a NIMADS JSON file.
get_analyses_by_annotations
(key[, value])Extract a list of Analyses with a given label/annotation.
get_analyses_by_coordinates
(xyz[, r, n])Extract a list of Analyses with at least one Point near the requested coordinates.
get_analyses_by_mask
(img)Extract a list of Analyses with at least one Point in the specified mask.
get_analyses_by_metadata
(key[, value])Extract a list of Analyses with a metadata field/value.
get_annotations
(analyses)Collect Annotations associated with specified Analyses.
get_images
(analyses)Collect image files associated with specified Analyses.
get_metadata
(analyses)Collect metadata associated with specified Analyses.
get_points
(analyses)Collect Points associated with specified Analyses.
get_texts
(analyses)Collect texts associated with specified Analyses.
load
(filename)Load a Studyset from a pickled file.
merge
(right)Merge a separate Studyset into the current one.
save
(filename)Write the Studyset to a pickled file.
slice
(analyses)Create a new Studyset with only requested Analyses.
Convert the Studyset to a NiMARE Dataset.
to_dict
()Return a dictionary representation of the Studyset.
to_nimads
(filename)Write the Studyset to a NIMADS JSON file.
Properties
Return existing Annotations.
- property annotations
Return existing Annotations.
- get_analyses_by_annotations(key, value=None)[source]
Extract a list of Analyses with a given label/annotation.
- get_analyses_by_coordinates(xyz, r=None, n=None)[source]
Extract a list of Analyses with at least one Point near the requested coordinates.
- Parameters:
- Returns:
A list of Analysis IDs with at least one point within the search criteria.
- Return type:
Notes
Either r or n must be provided, but not both.
- get_analyses_by_mask(img)[source]
Extract a list of Analyses with at least one Point in the specified mask.
- get_analyses_by_metadata(key, value=None)[source]
Extract a list of Analyses with a metadata field/value.
- merge(right)[source]
Merge a separate Studyset into the current one.
- Parameters:
right (Studyset) – The other Studyset to merge with this one.
- Returns:
A new Studyset containing merged studies from both input Studysets. For studies with the same ID, their analyses and metadata are combined, with data from self (left) taking precedence in case of conflicts.
- Return type: