pub struct DatasetDescription {Show 14 fields
pub name: String,
pub bids_version: String,
pub license: Option<String>,
pub authors: Option<Vec<String>>,
pub acknowledgements: Option<String>,
pub how_to_acknowledge: Option<String>,
pub funding: Option<Vec<String>>,
pub ethics_approvals: Option<Vec<String>>,
pub references_and_links: Option<Vec<String>>,
pub dataset_doi: Option<String>,
pub dataset_type: Option<String>,
pub generated_by: Option<Vec<GeneratedBy>>,
pub source_datasets: Option<Vec<Value>>,
pub pipeline_description: Option<PipelineDescription>,
}Expand description
Contents of a BIDS dataset_description.json file.
See: https://bids-specification.readthedocs.io/en/stable/modality-agnostic-files.html
§Example
use bids_core::DatasetDescription;
let json = r#"{"Name": "My Dataset", "BIDSVersion": "1.9.0"}"#;
let desc: DatasetDescription = serde_json::from_str(json).unwrap();
assert_eq!(desc.name, "My Dataset");
assert!(!desc.is_derivative());Fields§
§name: StringName of the dataset.
bids_version: StringThe version of the BIDS standard used.
license: Option<String>What license the dataset is distributed under.
List of individuals who contributed to the creation/curation of the dataset.
acknowledgements: Option<String>Text acknowledging contributions of individuals or institutions.
how_to_acknowledge: Option<String>How to acknowledge this dataset when used in publications.
funding: Option<Vec<String>>List of sources of funding.
ethics_approvals: Option<Vec<String>>List of ethics committee approvals.
references_and_links: Option<Vec<String>>List of references to publications about the dataset.
dataset_doi: Option<String>The DOI of the dataset.
dataset_type: Option<String>Type of dataset: “raw” or “derivative”.
generated_by: Option<Vec<GeneratedBy>>Information about the pipeline that generated a derivative dataset.
source_datasets: Option<Vec<Value>>Datasets that were used to generate this derivative dataset.
pipeline_description: Option<PipelineDescription>Legacy field (deprecated in BIDS 1.4.0).
Implementations§
Source§impl DatasetDescription
impl DatasetDescription
Sourcepub fn from_dir(dir: &Path) -> Result<Self>
pub fn from_dir(dir: &Path) -> Result<Self>
Load dataset_description.json from the given directory.
§Errors
Returns BidsError::MissingDatasetDescription if the file doesn’t exist,
or an I/O or JSON error if the file can’t be read or parsed.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate that mandatory fields are present.
§Errors
Returns BidsError::MissingMandatoryField if Name or BIDSVersion
is empty.
Sourcepub fn is_derivative(&self) -> bool
pub fn is_derivative(&self) -> bool
Whether this is a derivative dataset.
Sourcepub fn pipeline_name(&self) -> Option<&str>
pub fn pipeline_name(&self) -> Option<&str>
Get the pipeline name for derivative datasets.
Trait Implementations§
Source§impl Clone for DatasetDescription
impl Clone for DatasetDescription
Source§fn clone(&self) -> DatasetDescription
fn clone(&self) -> DatasetDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more