This gear opens a DICOM file, checks some of the DICOM tags, and then set a Flywheel tag on the input file based on whether the checks pass or fail. The gear checks are configurable.
License: MIT
Category: utility
Gear Level:
- Project
- Subject
- Session
- Acquisition
- Analysis
[[TOC]]
-
dicom_file
- Type: file
- Optional: no
- Description: File to check
-
override_checks
- Type: yaml file
- Optional: yes
- Description: A set of DICOM tags to use instead of the defaults
-
debug
- Type: boolean
- Description: Log debug messages
- Default: False
-
tag_prefix
- Type: string
- Description: Append '-pass' or '-fail' to <tag_prefix> to generate the Flywheel tag to be placed on the input file.
- Default: dicom-checker
None
None
The input file will be tagged based on the tag_prefix configuration parameter and if the checks pass or fail.
None
None
None
None
This gear should be run by a gear rule to check what kind of file the input file is and tag the result to allow further processing.
This gear uses the fw-classification library to look for DICOM tags as defined by the default profile which can be overridden by a provide profile file. That profile should result in the input file being given a Flywheel tag that can trigger further processing.
A DICOM file to check.
A YAML file to use instead of default.yaml. See that file for the proper format and also CT-override.yaml for another example. All features of the classification library can be used.
- Create a classification profile file if you want to override the default. See fw-classification for more information. The default.yaml file shows the format necessary to use the Jinja templating engine to allow the gear to put the tag_prefix configuration parameter into the Flywheel tag that will be placed on the input file.
- Upload the override profile to the project so that it can be used as an input to the gear in a gear rule.
- Set up a gear rule so the dicom-checker gear will run when a file appears.
- Set the override_checks input to your profile or leave it empty to use the default profile.
- Set the tag_prefix configuration string or leave it blank to use the default, "dicom-checker". "-pass" or "-fail" will be added to this string to create the tag that will be placed on the input file. This functionality is provided by the classification profile.
- When a file appears the dicom-checker gear will:
- Run the Jinja templating engine on the classification profile to substitute the tag_prefix configuration parameter into the profile.
- Call the fw-classification library to check the DICOM tags in the input file and perform whatever actions are specified in the profile.
- Update the input file's metadata to apply the tag in the profile to the input file.
The gear logs the tag that is the result of the classification profile.
[For more information about how to get started contributing to that gear, checkout CONTRIBUTING.md.]