nu_plugin_dcm
A nushell plugin to parse Dicom objects.
This plugin is in the early stage of the development. It is usable but it might not be able to cope with all Dicom objects. One notable limitation is that all Dicom objects are expected to have a preamble.
I'm still trying to figure out what is the most useful way of using this plugin. Please feel free to try it out, send feedback in Discussions or report problems in Issues.
Usage
dcm plugin reads its input from single values or from specific columns:
dcm: expects a string/filename or binary Dicom datadcm $column_name: reads a string/filename or binary Dicom data from$column. This is equivalent toget $column | dcm.
Examples
Output Dicom file as a table
| | | | | | |
Dump Dicom file as a JSON/YAML document
| |
| |
Dump all Dicom files in the current directory to a JSON/YAML document
| |
| |
For each file in the current directory, show the filename, file size, SOP Instance UID, Modality and Pixel Spacing and sort by SOP Instance UID
PixelSpacing is an array with 2 values. To flatten the array use .0 and .1 indices.
| | |
dcm name is a shortcut for get name | dcm. The following commands are equivalent:
| | |
| | |
| | |
Find all files in the current directory and subdirectories, parse them and output a histogram of modalities
Note that not all Dicom files have (0008,0060) Modality tag available. This will default missing to ???.
| | | |
Installation
Build and install the plugin to your PATH using