fw-gear-file-metadata-importer


Namefw-gear-file-metadata-importer JSON
Version 1.4.1 PyPI version JSON
download
home_page
SummaryExtract metadata of input file to Flywheel.
upload_time2023-12-02 00:34:47
maintainer
docs_urlNone
authorFlywheel
requires_python>=3.9,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # File metadata importer

Flywheel gear for importing metadata header of file to Flywheel.
Metadata is stored under `file.info.header`. Currently, supporting
the following file types:

* DICOM and DICOM Zip Archive
* PTD (Siemens PT format)
* NIfTI
* ParaVision (Bruker format)
* PAR/REC (Philips format)
* EEG (BrainVision, EDF, BDF, EEGLAB)

## Usage

### Inputs

* __input-file__: The input file.

### Configuration

* __debug__ (boolean, default: `False`): Include debug statements in log.
* __siemens CSA__ (boolean, default: `False`): If True, extracts Siemens CSA header for Dicom.
* __derived metadata__ (boolean, default: `True`): If True, derives additional metadata from the file header and stores them under file.info.header.derived.
* __tag__ (string, default: `file-metadata-importer`): The tag to be added on
  input file upon run completion.

## file.info.header structure

### DICOM

Dicom header will be stored under `file.info.header.dicom`. Additionally, if:

* `input-file` is an archive (e.g dicom.zip), then `file.info.header.dicom_array` will be populated.
* `Siemens CSA` is enabled, then `file.info.header.csa` will be populated if found.

### Bruker ParaVision

ParaVision metadata will be stored under `file.info.header.paravision`

### Siemens PTD

The raw PTD preamble will be stored under `file.info.header.ptd`

## Details

### DICOM

By default, the following tags are not extracted:

* All private tags
* `PixelData`
* `Pixel Data`
* `ContourData`
* `EncryptedAttributesSequence`
* `OriginalAttributesSequence`
* `SpectroscopyData`

By default, for zip archive or multiframe the following tags are extracted
and stored in `file.info.header.dicom_array`:

* `AcquisitionNumber`
* `AcquisitionTime`
* `EchoTime`
* `ImageOrientationPatient`
* `ImagePositionPatient`
* `ImageType`
* `InstanceNumber`
* `SliceLocation`
* `PhaseCount`
* `PhaseIndexes`

### Extracting additional tags

Additional tags can be extracted and indexed by ammending the list above.

To add or remove to that list, specific key/value must be set on the project
custom information (`project.info`) like below:

```json
context: 
   header:
      dicom:
         <DICOM-tag>: True
```

`Key: value` should take the form of `Tag: bool` where `Tag` can either be
a Dicom keyword (e.g. `PatientID`), a Dicom hex index (e.g `00100020`) or
a Dicom private tag `GEMS_PARM_01, 0043xx01`. If `bool` is `True`,  the tag
will be added to the parsed tags in the `file.info.header.dicom` *and*
the `file.info.header.dicom_array` namespaces, if `False` is will be removed.

### Derived fields

The following values derived from dicom are stored in a `file.info.header.derived` dictionary

* `SpacingBetweenSlices` ( Also a type 3 tag at (0018,0088))
* `MinSliceLocation` : Minimum value of slice location
* `MaxSliceLocation` : Maximum value of slice location
* `ScanCoverage` : Span of slice location (max-min)
* `SliceAxis` : 3D unit vector connecting slice origins
* `PhaseCount` : Number of sequences of consecutive slices with uniform spacing & orientation
* `PhaseIndexes` : If PhaseCount > 1, this array maps the slices indexes to the phase index
* `fov` : "Field of view" which is 3D span in patient coords along x,y,z (empty if slice spacing is not uniform)
* `affine` : 4x4 affine transform to convert grid to patient coords (empty if slice spacing is not uniform)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fw-gear-file-metadata-importer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Flywheel",
    "author_email": "support@flywheel.io",
    "download_url": "",
    "platform": null,
    "description": "# File metadata importer\n\nFlywheel gear for importing metadata header of file to Flywheel.\nMetadata is stored under `file.info.header`. Currently, supporting\nthe following file types:\n\n* DICOM and DICOM Zip Archive\n* PTD (Siemens PT format)\n* NIfTI\n* ParaVision (Bruker format)\n* PAR/REC (Philips format)\n* EEG (BrainVision, EDF, BDF, EEGLAB)\n\n## Usage\n\n### Inputs\n\n* __input-file__: The input file.\n\n### Configuration\n\n* __debug__ (boolean, default: `False`): Include debug statements in log.\n* __siemens CSA__ (boolean, default: `False`): If True, extracts Siemens CSA header for Dicom.\n* __derived metadata__ (boolean, default: `True`): If True, derives additional metadata from the file header and stores them under file.info.header.derived.\n* __tag__ (string, default: `file-metadata-importer`): The tag to be added on\n  input file upon run completion.\n\n## file.info.header structure\n\n### DICOM\n\nDicom header will be stored under `file.info.header.dicom`. Additionally, if:\n\n* `input-file` is an archive (e.g dicom.zip), then `file.info.header.dicom_array` will be populated.\n* `Siemens CSA` is enabled, then `file.info.header.csa` will be populated if found.\n\n### Bruker ParaVision\n\nParaVision metadata will be stored under `file.info.header.paravision`\n\n### Siemens PTD\n\nThe raw PTD preamble will be stored under `file.info.header.ptd`\n\n## Details\n\n### DICOM\n\nBy default, the following tags are not extracted:\n\n* All private tags\n* `PixelData`\n* `Pixel Data`\n* `ContourData`\n* `EncryptedAttributesSequence`\n* `OriginalAttributesSequence`\n* `SpectroscopyData`\n\nBy default, for zip archive or multiframe the following tags are extracted\nand stored in `file.info.header.dicom_array`:\n\n* `AcquisitionNumber`\n* `AcquisitionTime`\n* `EchoTime`\n* `ImageOrientationPatient`\n* `ImagePositionPatient`\n* `ImageType`\n* `InstanceNumber`\n* `SliceLocation`\n* `PhaseCount`\n* `PhaseIndexes`\n\n### Extracting additional tags\n\nAdditional tags can be extracted and indexed by ammending the list above.\n\nTo add or remove to that list, specific key/value must be set on the project\ncustom information (`project.info`) like below:\n\n```json\ncontext: \n   header:\n      dicom:\n         <DICOM-tag>: True\n```\n\n`Key: value` should take the form of `Tag: bool` where `Tag` can either be\na Dicom keyword (e.g. `PatientID`), a Dicom hex index (e.g `00100020`) or\na Dicom private tag `GEMS_PARM_01, 0043xx01`. If `bool` is `True`,  the tag\nwill be added to the parsed tags in the `file.info.header.dicom` *and*\nthe `file.info.header.dicom_array` namespaces, if `False` is will be removed.\n\n### Derived fields\n\nThe following values derived from dicom are stored in a `file.info.header.derived` dictionary\n\n* `SpacingBetweenSlices` ( Also a type 3 tag at (0018,0088))\n* `MinSliceLocation` : Minimum value of slice location\n* `MaxSliceLocation` : Maximum value of slice location\n* `ScanCoverage` : Span of slice location (max-min)\n* `SliceAxis` : 3D unit vector connecting slice origins\n* `PhaseCount` : Number of sequences of consecutive slices with uniform spacing & orientation\n* `PhaseIndexes` : If PhaseCount > 1, this array maps the slices indexes to the phase index\n* `fov` : \"Field of view\" which is 3D span in patient coords along x,y,z (empty if slice spacing is not uniform)\n* `affine` : 4x4 affine transform to convert grid to patient coords (empty if slice spacing is not uniform)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extract metadata of input file to Flywheel.",
    "version": "1.4.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "455f3294a1955f10f39440d88d044a8e6f40506640c16c3f3c4b010f6ffb4698",
                "md5": "a853ab3a2097c69510ae3a6c679ebb2c",
                "sha256": "4e03ee25279a4c9d53bf23b659b135b2abe81e97b9ec648e27c314965baecc3c"
            },
            "downloads": -1,
            "filename": "fw_gear_file_metadata_importer-1.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a853ab3a2097c69510ae3a6c679ebb2c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 26346,
            "upload_time": "2023-12-02T00:34:47",
            "upload_time_iso_8601": "2023-12-02T00:34:47.951367Z",
            "url": "https://files.pythonhosted.org/packages/45/5f/3294a1955f10f39440d88d044a8e6f40506640c16c3f3c4b010f6ffb4698/fw_gear_file_metadata_importer-1.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-02 00:34:47",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fw-gear-file-metadata-importer"
}
        
Elapsed time: 0.14675s