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
+18-14Lines changed: 18 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,12 @@ 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, from specific columns, or from list of values:
15
-
-`dcm`: expects a string/filename or binary DICOM data
16
-
-`dcm $column_name`: reads a string/filename or binary DICOM data from `$column`. This is
17
-
equivalent to `get $column | dcm`.
18
-
-`ls *.dcm | select name | dcm`: reads all files foun dby `ls` and returns a list of records.
14
+
`dcm` plugin reads its input from single values, or from list of values:
15
+
-`dcm`: expects a string/filename, file record (must contain `name` and `type`), dicomweb record, or binary DICOM data
16
+
-`ls *.dcm | dcm`: process a list of files, resulting in a list of dicom records
17
+
-`ls *.dcm | select name type | dcm`: process a list of files specified by their filename, resulting in a list of dicom records
18
+
-`open --raw file.dcm | into binary | dcm`: process a binary stream, resulting in a dicom record
19
+
-`open dicomweb.json | dcm`: process a dicomweb record, resulting in a dicom record
19
20
20
21
See Examples for more details.
21
22
@@ -42,11 +43,14 @@ See Examples for more details.
42
43
43
44
### Output DICOM file as a record/table (list of records)
44
45
```sh
45
-
echo file.dcm | dcm # uses filename/string to specify which file to open
46
-
open --raw file.dcm | dcm # pass binary data to `dcm`
47
-
ls file.dcm | dcm name # use `name` column as the filename (equivalent of `ls file.dcm | select name | dcm`)
48
-
echo file.dcm | wrap foo | dcm foo # use `foo` column as the filename
49
-
open -r file.dcm | into binary | wrap foo | dcm foo # use `foo` column as binary data (see Known Limitations for details)
46
+
echo file.dcm | dcm # uses filename/string to specify which file to open
47
+
"file.dcm"| dcm # same asa above, uses filename/string to specify which file to open
48
+
open --raw file.dcm | dcm # pass (hopefully) binary data to `dcm`
49
+
open --raw file.dcm | into binary | dcm # pass binary data to `dcm`
50
+
ls file.dcm | dcm # use file records as the filename
51
+
ls file.dcm |selectnametype| dcm # use file record-like records as the filename
52
+
# ls file.dcm | select name | dcm # fails because the record only contains `name` field.
53
+
ls file.dcm | get name | dcm # use a list of filenames (list of strings, rather than a list of records)
50
54
```
51
55
52
56
### Dump DICOM file as a JSON/YAML document
@@ -57,16 +61,16 @@ open -r file.dcm | dcm | to yaml
57
61
58
62
### Dump all DICOM files in the current directory to a JSON/YAML document
59
63
```sh
60
-
ls *.dcm | dcm name | to json --indent 2
61
-
ls *.dcm | dcm name | to yaml
64
+
ls *.dcm | dcm | to json --indent 2
65
+
ls *.dcm | dcm | to yaml
62
66
```
63
67
64
68
### Find all files in the current directory and subdirectories, parse them and group by Modality
65
69
66
70
```sh
67
71
ls **/*|
68
72
where type == file |
69
-
dcm name -e error |
73
+
dcm -e error |
70
74
where error == ""|
71
75
select--ignore-errors SOPInstanceUID Modality |
72
76
group-by Modality
@@ -79,7 +83,7 @@ let files = (ls | where type == file)
0 commit comments