diff --git a/src/brainhops/datamodel/enums.py b/src/brainhops/datamodel/enums.py index 425af285..426ab055 100644 --- a/src/brainhops/datamodel/enums.py +++ b/src/brainhops/datamodel/enums.py @@ -7,6 +7,11 @@ "OrientationType", "AnatomicalOrientationValue", "SimplifyPolicy", + "SpaceEnum", + "IntentEnum", + "Manufacturer", + "IlluminationType", + "ContrastMethod", ] from brainhops._core.enum import IntEnum, StrEnum @@ -193,3 +198,422 @@ class AnatomicalOrientationValue(StrEnum): base_to_apex = "base-to-apex" # fmt: on # ruff: enable[E501] + + +# ---------------------------------------------------------------------- +# METADATA TERMS +# ---------------------------------------------------------------------- +# +# The known terms of the free-text fields of `brainhops.datamodel.metadata`. +# A field typed `Union[, str]` holds a member when its value is one +# of these, and the string otherwise: the lists help consistency and +# documentation, and do not close the vocabulary. + + +# ruff: disable[E501] +# fmt: off +class SpaceEnum(StrEnum): + """ + The known labels of a world space, used by the `space`, `input_space` + and `output_space` metadata fields. + + The first five members are the names that NIfTI gives to its + `sform_code` and `qform_code` values. They are followed by the BIDS + template identifiers, which BIDS uses for `SpatialReference` and for + the `space-` entity of a file name, and by the spaces that BIDS + defines without a template. A label that is not listed here is kept + as a plain string. + + +------------------------+--------------------------+----------------------------------------------------------+ + | Member | Value | Meaning | + +========================+==========================+==========================================================+ + | `scanner` | `"scanner"` | NIfTI xform code 1: scanner-based anatomical coordinates | + +------------------------+--------------------------+----------------------------------------------------------+ + | `aligned` | `"aligned"` | NIfTI xform code 2: aligned to another file | + +------------------------+--------------------------+----------------------------------------------------------+ + | `talairach` | `"talairach"` | NIfTI xform code 3: Talairach-Tournoux atlas | + +------------------------+--------------------------+----------------------------------------------------------+ + | `mni` | `"mni"` | NIfTI xform code 4: MNI 152 | + +------------------------+--------------------------+----------------------------------------------------------+ + | `template` | `"template"` | NIfTI xform code 5: another template | + +------------------------+--------------------------+----------------------------------------------------------+ + | `ICBM452AirSpace` | `"ICBM452AirSpace"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `ICBM452Warp5Space` | `"ICBM452Warp5Space"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `IXI549Space` | `"IXI549Space"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152Lin` | `"MNI152Lin"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009aAsym` | `"MNI152NLin2009aAsym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009aSym` | `"MNI152NLin2009aSym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009bAsym` | `"MNI152NLin2009bAsym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009bSym` | `"MNI152NLin2009bSym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009cAsym` | `"MNI152NLin2009cAsym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin2009cSym` | `"MNI152NLin2009cSym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin6Asym` | `"MNI152NLin6Asym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI152NLin6Sym` | `"MNI152NLin6Sym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNI305` | `"MNI305"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNIColin27` | `"MNIColin27"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNIInfant` | `"MNIInfant"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `MNIPediatricAsym` | `"MNIPediatricAsym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `NMT31Sym` | `"NMT31Sym"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `OASIS30AntsOASISAnts` | `"OASIS30AntsOASISAnts"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `OASIS30Atropos` | `"OASIS30Atropos"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `Talairach` | `"Talairach"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `UNCInfant` | `"UNCInfant"` | BIDS standard template (volume) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaverage` | `"fsaverage"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaverage3` | `"fsaverage3"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaverage4` | `"fsaverage4"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaverage5` | `"fsaverage5"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaverage6` | `"fsaverage6"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsaveragesym` | `"fsaveragesym"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsLR` | `"fsLR"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `fsnative` | `"fsnative"` | BIDS standard template (surface) | + +------------------------+--------------------------+----------------------------------------------------------+ + | `orig` | `"orig"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + | `anat` | `"anat"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + | `T1w` | `"T1w"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + | `T2w` | `"T2w"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + | `individual` | `"individual"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + | `study` | `"study"` | BIDS non-standard space | + +------------------------+--------------------------+----------------------------------------------------------+ + """ + + # NIfTI + scanner = "scanner" + aligned = "aligned" + talairach = "talairach" + mni = "mni" + template = "template" + + # BIDS standard templates (volumes) + ICBM452AirSpace = "ICBM452AirSpace" + ICBM452Warp5Space = "ICBM452Warp5Space" + IXI549Space = "IXI549Space" + MNI152Lin = "MNI152Lin" + MNI152NLin2009aAsym = "MNI152NLin2009aAsym" + MNI152NLin2009aSym = "MNI152NLin2009aSym" + MNI152NLin2009bAsym = "MNI152NLin2009bAsym" + MNI152NLin2009bSym = "MNI152NLin2009bSym" + MNI152NLin2009cAsym = "MNI152NLin2009cAsym" + MNI152NLin2009cSym = "MNI152NLin2009cSym" + MNI152NLin6Asym = "MNI152NLin6Asym" + MNI152NLin6Sym = "MNI152NLin6Sym" + MNI305 = "MNI305" + MNIColin27 = "MNIColin27" + MNIInfant = "MNIInfant" + MNIPediatricAsym = "MNIPediatricAsym" + NMT31Sym = "NMT31Sym" + OASIS30AntsOASISAnts = "OASIS30AntsOASISAnts" + OASIS30Atropos = "OASIS30Atropos" + Talairach = "Talairach" + UNCInfant = "UNCInfant" + + # BIDS standard templates (surfaces) + fsaverage = "fsaverage" + fsaverage3 = "fsaverage3" + fsaverage4 = "fsaverage4" + fsaverage5 = "fsaverage5" + fsaverage6 = "fsaverage6" + fsaveragesym = "fsaveragesym" + fsLR = "fsLR" + fsnative = "fsnative" + + # BIDS non-standard spaces + orig = "orig" + anat = "anat" + T1w = "T1w" + T2w = "T2w" + individual = "individual" + study = "study" + + +class IntentEnum(StrEnum): + """ + The known values of the `intent` metadata field, which says what the + values of an image represent. + + The members are the NIfTI intent names, spelled as `nibabel` spells + them, with their NIfTI intent codes. Codes 2 to 24 name statistical + distributions, codes 1001 to 2005 name other kinds of values, and the + codes from 2006 onwards are FSL's own. An intent that is not listed + here is kept as a plain string. + + +---------------------------+-----------------------------+------------+ + | Member | Value | NIfTI code | + +===========================+=============================+============+ + | `correlation` | `"correlation"` | 2 | + +---------------------------+-----------------------------+------------+ + | `t_test` | `"t test"` | 3 | + +---------------------------+-----------------------------+------------+ + | `f_test` | `"f test"` | 4 | + +---------------------------+-----------------------------+------------+ + | `z_score` | `"z score"` | 5 | + +---------------------------+-----------------------------+------------+ + | `chi2` | `"chi2"` | 6 | + +---------------------------+-----------------------------+------------+ + | `beta` | `"beta"` | 7 | + +---------------------------+-----------------------------+------------+ + | `binomial` | `"binomial"` | 8 | + +---------------------------+-----------------------------+------------+ + | `gamma` | `"gamma"` | 9 | + +---------------------------+-----------------------------+------------+ + | `poisson` | `"poisson"` | 10 | + +---------------------------+-----------------------------+------------+ + | `normal` | `"normal"` | 11 | + +---------------------------+-----------------------------+------------+ + | `non_central_f_test` | `"non central f test"` | 12 | + +---------------------------+-----------------------------+------------+ + | `non_central_chi2` | `"non central chi2"` | 13 | + +---------------------------+-----------------------------+------------+ + | `logistic` | `"logistic"` | 14 | + +---------------------------+-----------------------------+------------+ + | `laplace` | `"laplace"` | 15 | + +---------------------------+-----------------------------+------------+ + | `uniform` | `"uniform"` | 16 | + +---------------------------+-----------------------------+------------+ + | `non_central_t_test` | `"non central t test"` | 17 | + +---------------------------+-----------------------------+------------+ + | `weibull` | `"weibull"` | 18 | + +---------------------------+-----------------------------+------------+ + | `chi` | `"chi"` | 19 | + +---------------------------+-----------------------------+------------+ + | `inverse_gaussian` | `"inverse gaussian"` | 20 | + +---------------------------+-----------------------------+------------+ + | `extreme_value_1` | `"extreme value 1"` | 21 | + +---------------------------+-----------------------------+------------+ + | `p_value` | `"p value"` | 22 | + +---------------------------+-----------------------------+------------+ + | `log_p_value` | `"log p value"` | 23 | + +---------------------------+-----------------------------+------------+ + | `log10_p_value` | `"log10 p value"` | 24 | + +---------------------------+-----------------------------+------------+ + | `estimate` | `"estimate"` | 1001 | + +---------------------------+-----------------------------+------------+ + | `label` | `"label"` | 1002 | + +---------------------------+-----------------------------+------------+ + | `neuroname` | `"neuroname"` | 1003 | + +---------------------------+-----------------------------+------------+ + | `general_matrix` | `"general matrix"` | 1004 | + +---------------------------+-----------------------------+------------+ + | `symmetric_matrix` | `"symmetric matrix"` | 1005 | + +---------------------------+-----------------------------+------------+ + | `displacement_vector` | `"displacement vector"` | 1006 | + +---------------------------+-----------------------------+------------+ + | `vector` | `"vector"` | 1007 | + +---------------------------+-----------------------------+------------+ + | `pointset` | `"pointset"` | 1008 | + +---------------------------+-----------------------------+------------+ + | `triangle` | `"triangle"` | 1009 | + +---------------------------+-----------------------------+------------+ + | `quaternion` | `"quaternion"` | 1010 | + +---------------------------+-----------------------------+------------+ + | `dimensionless` | `"dimensionless"` | 1011 | + +---------------------------+-----------------------------+------------+ + | `time_series` | `"time series"` | 2001 | + +---------------------------+-----------------------------+------------+ + | `node_index` | `"node index"` | 2002 | + +---------------------------+-----------------------------+------------+ + | `rgb_vector` | `"rgb vector"` | 2003 | + +---------------------------+-----------------------------+------------+ + | `rgba_vector` | `"rgba vector"` | 2004 | + +---------------------------+-----------------------------+------------+ + | `shape` | `"shape"` | 2005 | + +---------------------------+-----------------------------+------------+ + | `fnirt_disp_field` | `"fnirt disp field"` | 2006 | + +---------------------------+-----------------------------+------------+ + | `fnirt_cubic_spline_coef` | `"fnirt cubic spline coef"` | 2007 | + +---------------------------+-----------------------------+------------+ + | `fnirt_dct_coef` | `"fnirt dct coef"` | 2008 | + +---------------------------+-----------------------------+------------+ + | `fnirt_quad_spline_coef` | `"fnirt quad spline coef"` | 2009 | + +---------------------------+-----------------------------+------------+ + | `topup_field` | `"topup field"` | 2018 | + +---------------------------+-----------------------------+------------+ + """ + + correlation = "correlation" + t_test = "t test" + f_test = "f test" + z_score = "z score" + chi2 = "chi2" + beta = "beta" + binomial = "binomial" + gamma = "gamma" + poisson = "poisson" + normal = "normal" + non_central_f_test = "non central f test" + non_central_chi2 = "non central chi2" + logistic = "logistic" + laplace = "laplace" + uniform = "uniform" + non_central_t_test = "non central t test" + weibull = "weibull" + chi = "chi" + inverse_gaussian = "inverse gaussian" + extreme_value_1 = "extreme value 1" + p_value = "p value" + log_p_value = "log p value" + log10_p_value = "log10 p value" + estimate = "estimate" + label = "label" + neuroname = "neuroname" + general_matrix = "general matrix" + symmetric_matrix = "symmetric matrix" + displacement_vector = "displacement vector" + vector = "vector" + pointset = "pointset" + triangle = "triangle" + quaternion = "quaternion" + dimensionless = "dimensionless" + time_series = "time series" + node_index = "node index" + rgb_vector = "rgb vector" + rgba_vector = "rgba vector" + shape = "shape" + fnirt_disp_field = "fnirt disp field" + fnirt_cubic_spline_coef = "fnirt cubic spline coef" + fnirt_dct_coef = "fnirt dct coef" + fnirt_quad_spline_coef = "fnirt quad spline coef" + topup_field = "topup field" +# fmt: on +# ruff: enable[E501] + + +class Manufacturer(StrEnum): + """ + The known values of the `manufacturer` metadata field (BIDS + `Manufacturer`), spelled as converters such as `dcm2niix` normalise the + DICOM `Manufacturer` tag. Any other manufacturer is kept as a plain + string. + + +---------------+-----------------+ + | Member | Value | + +===============+=================+ + | `Siemens` | `"Siemens"` | + +---------------+-----------------+ + | `GE` | `"GE"` | + +---------------+-----------------+ + | `Philips` | `"Philips"` | + +---------------+-----------------+ + | `Canon` | `"Canon"` | + +---------------+-----------------+ + | `Toshiba` | `"Toshiba"` | + +---------------+-----------------+ + | `Hitachi` | `"Hitachi"` | + +---------------+-----------------+ + | `Bruker` | `"Bruker"` | + +---------------+-----------------+ + | `UIH` | `"UIH"` | + +---------------+-----------------+ + | `MRSolutions` | `"MRSolutions"` | + +---------------+-----------------+ + """ + + Siemens = "Siemens" + GE = "GE" + Philips = "Philips" + Canon = "Canon" + Toshiba = "Toshiba" + Hitachi = "Hitachi" + Bruker = "Bruker" + UIH = "UIH" + MRSolutions = "MRSolutions" + + +class IlluminationType(StrEnum): + """ + The known values of the `illumination_type` metadata field, which are + the members of the OME `Channel.IlluminationType` enumeration. Any + other value is kept as a plain string. + + +-------------------+---------------------+ + | Member | Value | + +===================+=====================+ + | `Transmitted` | `"Transmitted"` | + +-------------------+---------------------+ + | `Epifluorescence` | `"Epifluorescence"` | + +-------------------+---------------------+ + | `Oblique` | `"Oblique"` | + +-------------------+---------------------+ + | `NonLinear` | `"NonLinear"` | + +-------------------+---------------------+ + | `Other` | `"Other"` | + +-------------------+---------------------+ + """ + + Transmitted = "Transmitted" + Epifluorescence = "Epifluorescence" + Oblique = "Oblique" + NonLinear = "NonLinear" + Other = "Other" + + +class ContrastMethod(StrEnum): + """ + The known values of the `contrast_method` metadata field, which are the + members of the OME `Channel.ContrastMethod` enumeration. Any other + value is kept as a plain string. + + +-----------------------+-------------------------+ + | Member | Value | + +=======================+=========================+ + | `Brightfield` | `"Brightfield"` | + +-----------------------+-------------------------+ + | `Phase` | `"Phase"` | + +-----------------------+-------------------------+ + | `DIC` | `"DIC"` | + +-----------------------+-------------------------+ + | `HoffmanModulation` | `"HoffmanModulation"` | + +-----------------------+-------------------------+ + | `ObliqueIllumination` | `"ObliqueIllumination"` | + +-----------------------+-------------------------+ + | `PolarizedLight` | `"PolarizedLight"` | + +-----------------------+-------------------------+ + | `Darkfield` | `"Darkfield"` | + +-----------------------+-------------------------+ + | `Fluorescence` | `"Fluorescence"` | + +-----------------------+-------------------------+ + | `Other` | `"Other"` | + +-----------------------+-------------------------+ + """ + + Brightfield = "Brightfield" + Phase = "Phase" + DIC = "DIC" + HoffmanModulation = "HoffmanModulation" + ObliqueIllumination = "ObliqueIllumination" + PolarizedLight = "PolarizedLight" + Darkfield = "Darkfield" + Fluorescence = "Fluorescence" + Other = "Other" diff --git a/zensical.toml b/zensical.toml index b597156e..d029195e 100644 --- a/zensical.toml +++ b/zensical.toml @@ -214,5 +214,7 @@ emoji_generator = "zensical.extensions.emoji.to_svg" emoji_index = "zensical.extensions.emoji.twemoji" [project.markdown_extensions.pymdownx.keys] [project.markdown_extensions.tables] +# Grid tables (`+---+` borders); the package is in the docs requirements. +[project.markdown_extensions.markdown_grid_tables] [project.markdown_extensions.toc] toc_depth = 3