Biomedical User Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read and Write DICOM tags

This document informs you how to read and write DICOM tags using the Read Image Express VI and the Write Image Express VI.

Use the Write Image Express VI to write DICOM tags

  1. Drop a Write Image Express VI from the Biomedical File I/O palette to a VI. The Configure Write Image dialog box appears.
  2. Select Write single image file as the Write Action.
  3. Set the File type to DICOM. The  Input DICOM Tags control becomes enabled.
  4. Specify the DICOM file path in the File path control.
  5. Modify the values of the numeric controls in the Input DICOM Tags field.
  6. Click More Tags ….  The Edit DICOM Tags dialog box appears.
  7. You can edit the values of the DICOM tags listed in the DICOM tag list.
  8. When you make edits, the DICOM standard tag type description information box shows some descriptions of the DICOM tag types.
  9. You can search or select other DICOM tags in the Search tag dropdown list and add them to the DICOM tag list by clicking Add.
  10. Click OK to confirm the settings and then close the Edit DICOM Tags dialog box and the Configure Write Image dialog box.
  11. On the block diagram, wire the image data to the 2D array (I32) input.
  12. You can wire DICOM tags to the DICOM tags in input if you want to configure DICOM tags according to the input.
  13. Right-click the DICOM tags in input and select Create>>Control. This creates an array control containing the DICOM tags you edited in the Configure Write Image dialog box.
  14. Running the VI adds the DICOM tags to the DICOM file.


Use the Read Image Express VI to read DICOM tags

  1. Drop a Read Image Express VI from the Biomedical File I/O palette to a VI. The Configure Read Image dialog box appears.
  2. Select Read single image file as the Read Action.
  3. Specify a DICOM file path in the File path field.
  4. If the file you specified is a valid DICOM file, the DICOM tags button becomes enabled under the Output Options.
  5. Click DICOM tags. The Select DICOM Tags dialog box appears. This dialog box lists the DICOM tags contained in the DICOM file.
  6. Select the checkboxes for the DICOM tags you want to output.
  7. Double-click the column headers of a column, except for Tag Value, to sort the list by that column.
  8. Click OK to confirm the settings and close the Select DICOM Tags dialog box.
  9. Select the Show file path terminals? checkbox in the Configure Read Image dialog box if you want to configure which DICOM tags to read when you run the VI.
  10. In the block diagram, expand all terminals for the Read Image Express VI. If you have checked Show file path terminals? in the Configure Read Image dialog box, you see the DICOM tag names terminal. You can wire a string array containing DICOM tag names to this terminal to configure which DICOM tags to read when you run this VI.
  11. Wire the DICOM tags output.
  12. Run the VI to read the DICOM tags information. Notice that the Read Image Express VI will always output some DICOM tags, including “pixel spacing”, “slice thickness”, “window center”, “window width” and “image orientation (patient)”.

Write and Read DICOM tags example

Following is the block diagram of an example for writing and reading DICOM tags. The VI in this example reads a PNG image, writes the image data to a DICOM file with some DICOM tags, and then reads the DICOM tags out output and displays the tags in a list box.

blcok1.jpg

blcok2.jpg

Contributors