You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,19 @@ I'm still trying to figure out what is the most useful way of using this plugin.
11
11
send feedback in [Discussions](https://github.com/realcundo/nu_plugin_dcm/discussions) or report problems in [Issues](https://github.com/realcundo/nu_plugin_dcm/issues).
12
12
13
13
## Usage
14
-
`dcm` plugin reads its input from single values or from specific columns:
14
+
`dcm` plugin reads its input from single values, from specific columns, or from list of values:
15
15
-`dcm`: expects a string/filename or binary DICOM data
16
16
-`dcm $column_name`: reads a string/filename or binary DICOM data from `$column`. This is
17
17
equivalent to `get $column | dcm`.
18
+
-`ls *.dcm | select name | dcm`: reads all files foun dby `ls` and returns a list of records.
19
+
20
+
See Examples for more details.
18
21
19
22
## Error handling
20
23
21
24
`dcm` plugin works in two modes:
22
-
- default, when errors are reported as error rows,
23
-
-in custom columns when `--error` option is used. This will report all errors in the specified column. Empty column value means no error.
25
+
- default, when errors are reported as error rows, reported by nu,
26
+
- when `--error` option is used, errors are reported in provided column. If there were no errors, the column value is empty.
24
27
25
28
## Known Limitations
26
29
@@ -35,16 +38,15 @@ send feedback in [Discussions](https://github.com/realcundo/nu_plugin_dcm/discus
35
38
Without `into binary`, `dcm` would see a list of strings, assuming it's a list of filenames.
36
39
37
40
38
-
39
41
## Examples
40
42
41
-
### Output DICOM file as a table
43
+
### Output DICOM file as a record/table (list of records)
42
44
```sh
43
45
echo file.dcm | dcm # uses filename/string to specify which file to open
44
46
open --raw file.dcm | dcm # pass binary data to `dcm`
45
47
ls file.dcm | dcm name # use `name` column as the filename (equivalent of `ls file.dcm | select name | dcm`)
46
48
echo file.dcm | wrap foo | dcm foo # use `foo` column as the filename
47
-
open -r file.dcm | wrap foo | dcm foo # use `foo` column as binary data
49
+
open -r file.dcm |into binary |wrap foo | dcm foo # use `foo` column as binary data (see Known Limitations for details)
48
50
```
49
51
50
52
### Dump DICOM file as a JSON/YAML document
@@ -66,6 +68,7 @@ ls **/* |
66
68
where type == file |
67
69
dcm name -e error |
68
70
where error == ""|
71
+
select--ignore-errors SOPInstanceUID Modality |
69
72
group-by Modality
70
73
```
71
74
@@ -93,7 +96,7 @@ ls **/* | where type == file |
93
96
par-each { |it| {
94
97
name: $it.name,
95
98
size: $it.size,
96
-
sha256: (open $it.name | hash sha256),
99
+
sha256: (open --raw $it.name | hash sha256),
97
100
dcm: ($it.name | dcm -e error)
98
101
} } |
99
102
select --ignore-errors name size sha256 dcm.Modality dcm.SOPInstanceUID dcm.error |
0 commit comments