Skip to content

Instantly share code, notes, and snippets.

@effigies
Created August 15, 2024 15:40
Show Gist options
  • Save effigies/4e9b24169c141e0ec34c2273aee1d509 to your computer and use it in GitHub Desktop.
Save effigies/4e9b24169c141e0ec34c2273aee1d509 to your computer and use it in GitHub Desktop.
npx --package=json-schema-to-typescript json2ts -i context.json
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Context {
/**
* The BIDS specification schema
*/
schema: {
[k: string]: unknown;
};
/**
* Properties and contents of the entire dataset
*/
dataset: {
/**
* Contents of /dataset_description.json
*/
dataset_description: {
[k: string]: unknown;
};
/**
* Tree view of all files in dataset
*/
tree: {
[k: string]: unknown;
};
/**
* Set of ignored files
*/
ignored: string[];
/**
* Data types present in the dataset
*/
datatypes: string[];
/**
* Modalities present in the dataset
*/
modalities: string[];
/**
* Collections of subjects in dataset
*/
subjects: {
/**
* Subjects as determined by sub-* / directories
*/
sub_dirs: string[];
/**
* The participant_id column of participants.tsv
*/
participant_id?: string[];
/**
* The union of participant_id columns in phenotype files
*/
phenotype?: string[];
};
};
/**
* Properties and contents of the current subject
*/
subject?: {
/**
* Collections of sessions in subject
*/
sessions: {
/**
* Sessions as determined by ses-* / directories
*/
ses_dirs: string[];
/**
* The session_id column of sessions.tsv
*/
session_id?: string[];
/**
* The union of session_id columns in phenotype files
*/
phenotype?: string[];
};
};
/**
* Path of the current file
*/
path: string;
/**
* Length of the current file in bytes
*/
size: number;
/**
* Entities parsed from the current filename
*/
entities?: {
[k: string]: string;
};
/**
* Datatype of current file, for examples, anat
*/
datatype?: string;
/**
* Suffix of current file
*/
suffix?: string;
/**
* Extension of current file including initial dot
*/
extension?: string;
/**
* Modality of current file, for examples, MRI
*/
modality?: string;
/**
* Sidecar metadata constructed via the inheritance principle
*/
sidecar: {
[k: string]: unknown;
};
/**
* Associated files, indexed by suffix, selected according to the inheritance principle
*
*/
associations: {
/**
* Events file
*/
events?: {
/**
* Path to associated events file
*/
path: string;
/**
* Contents of the onset column
*/
onset: string[];
};
/**
* ASL context file
*/
aslcontext?: {
/**
* Path to associated aslcontext file
*/
path: string;
/**
* Number of rows in aslcontext.tsv
*/
n_rows: number;
/**
* Contents of the volume_type column
*/
volume_type: string[];
};
/**
* M0 scan file
*/
m0scan?: {
/**
* Path to associated M0 scan file
*/
path: string;
};
/**
* Magnitude image file
*/
magnitude?: {
/**
* Path to associated magnitude file
*/
path: string;
};
/**
* Magnitude1 image file
*/
magnitude1?: {
/**
* Path to associated magnitude1 file
*/
path: string;
};
/**
* B value file
*/
bval?: {
/**
* Path to associated bval file
*/
path: string;
/**
* Number of columns in bval file
*/
n_cols: number;
/**
* Number of rows in bval file
*/
n_rows: number;
/**
* B-values contained in bval file
*/
values: number[];
};
/**
* B vector file
*/
bvec?: {
/**
* Path to associated bvec file
*/
path: string;
/**
* Number of columns in bvec file
*/
n_cols: number;
/**
* Number of rows in bvec file
*/
n_rows: number;
};
/**
* Channels file
*/
channels?: {
/**
* Path to associated channels file
*/
path: string;
/**
* Contents of the type column
*/
type: string[];
/**
* Contents of the short_channel column
*/
short_channel?: string[];
/**
* Contents of the sampling_frequency column
*/
sampling_frequency?: string[];
};
/**
* Coordinate system file
*/
coordsystem?: {
/**
* Path to associated coordsystem file
*/
path: string;
};
};
/**
* TSV columns, indexed by column header, values are arrays with column contents
*/
columns?: {
[k: string]: string[];
};
/**
* Contents of the current JSON file
*/
json?: {
[k: string]: unknown;
};
/**
* Parsed contents of gzip header
*/
gzip?: {
/**
* Modification time, unix timestamp
*/
timestamp: number;
/**
* Filename
*/
filename: string;
/**
* Comment
*/
comment?: string;
};
/**
* Parsed contents of NIfTI header referenced elsewhere in schema.
*/
nifti_header?: {
/**
* Metadata about dimensions data.
*/
dim_info: {
/**
* These fields encode which spatial dimension (1, 2, or 3).
*/
freq: number;
/**
* Corresponds to which acquisition dimension for MRI data.
*/
phase: number;
/**
* Slice dimensions.
*/
slice: number;
};
/**
* Data seq dimensions.
*
* @minItems 8
* @maxItems 8
*/
dim: [number, number, number, number, number, number, number, number];
/**
* Grid spacings (unit per dimension).
*
* @minItems 8
* @maxItems 8
*/
pixdim: [number, number, number, number, number, number, number, number];
/**
* Data array shape, equal to dim[1:dim[0] + 1]
*
* @minItems 0
* @maxItems 7
*/
shape:
| []
| [number]
| [number, number]
| [number, number, number]
| [number, number, number, number]
| [number, number, number, number, number]
| [number, number, number, number, number, number]
| [number, number, number, number, number, number, number];
/**
* Voxel sizes, equal to pixdim[1:dim[0] + 1]
*
* @minItems 0
* @maxItems 7
*/
voxel_sizes:
| []
| [number]
| [number, number]
| [number, number, number]
| [number, number, number, number]
| [number, number, number, number, number]
| [number, number, number, number, number, number]
| [number, number, number, number, number, number, number];
/**
* Units of pixdim[1..4]
*/
xyzt_units: {
/**
* String representing the unit of voxel spacing.
*/
xyz: "unknown" | "meter" | "mm" | "um";
/**
* String representing the unit of inter-volume intervals.
*/
t: "unknown" | "sec" | "msec" | "usec";
};
/**
* Use of the quaternion fields.
*/
qform_code: number;
/**
* Use of the affine fields.
*/
sform_code: number;
};
/**
* Parsed contents of OME-XML header, which may be found in OME-TIFF or OME-ZARR files
*/
ome?: {
/**
* Pixels / @PhysicalSizeX
*/
PhysicalSizeX?: number;
/**
* Pixels / @PhysicalSizeY
*/
PhysicalSizeY?: number;
/**
* Pixels / @PhysicalSizeZ
*/
PhysicalSizeZ?: number;
/**
* Pixels / @PhysicalSizeXUnit
*/
PhysicalSizeXUnit?: string;
/**
* Pixels / @PhysicalSizeYUnit
*/
PhysicalSizeYUnit?: string;
/**
* Pixels / @PhysicalSizeZUnit
*/
PhysicalSizeZUnit?: string;
};
/**
* TIFF file format metadata
*/
tiff?: {
/**
* TIFF file format version (the second 2-byte block)
*/
version: number;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment