Difference between revisions of "IGT:Image Anonymization"

From NAMIC Wiki
Jump to: navigation, search
 
Line 37: Line 37:
 
dicom study and additionally will substitute the series number for the patient name. This is particularly useful when
 
dicom study and additionally will substitute the series number for the patient name. This is particularly useful when
 
loading multiple series into ''3dslicer'' as the slicer assigns the ''volume name'' to be the patient name that has been
 
loading multiple series into ''3dslicer'' as the slicer assigns the ''volume name'' to be the patient name that has been
extracted from the header. Using the command below will give each series a unique patient name which is just the series number.<br>
+
extracted from the header. Using the command below will give each series a unique patient name which is just the series number.
 +
The output directory, in this case /d/bigweekly/anon/ must exist prior to executing the command. <br>
 
<br>
 
<br>
 
  '''ls -1 | awk '{printf("wish $ANON_DIR/dcanon.tcl -patname %s -force -nostrip /d/bigweekly/example/%s /d/bigweekly/anon/%s &\n",$0,$0,$0)}' | sed s/.SER// | sh'''
 
  '''ls -1 | awk '{printf("wish $ANON_DIR/dcanon.tcl -patname %s -force -nostrip /d/bigweekly/example/%s /d/bigweekly/anon/%s &\n",$0,$0,$0)}' | sed s/.SER// | sh'''

Latest revision as of 21:30, 24 October 2007

Home < IGT:Image Anonymization

Procedures to anonymize images with DICOM, SIGNA, and GENESIS headers

Currently these procedures are to be used from within SPL on a solaris machine. In all cases, first login to a SOLARIS machine (e.g. ocean) and set the following environment variable or add it to your .tcshrc file:

setenv ANON_DIR /home/mark/anon



  • DICOM data anonymization


To see the DICOM anonymization options type:

wish $ANON_DIR/dcanon.tcl

Typically for most of our needs when processing a single DICOM series, something like the following is sufficient:

wish $ANON_DIR/dcanon.tcl -force -nostrip /d/bigweekly/example/000001.SER/ /d/bigweekly/example/anon1

This will make a copy of all of the DICOM images in directory /d/bigweekly/example/000001.SER/ and store the anonymized copy of the images to directory /d/bigweekly/example/anon1. The -force option will force the removal of the output directory/d/bigweekly/example/anon1 prior to anonymizing if the directory exists. A list of the dicom tags that are anonymized by this procedure can be found here: http://www.na-mic.org/Wiki/index.php/MBIRN:BIRNDUP:Removed_DICOM_Fields

Some datasets contain many series with many images in each series. Using host ocean can save a lot of time and is is possible to process an entire study simultaneously. This is particularly useful when processing fmri datasets that can contain more than fourty thousand images. The following example (run on ocean from the directory containing the all of the dicom series directories but no other directories or subdirectories) will process an entire dicom study and additionally will substitute the series number for the patient name. This is particularly useful when loading multiple series into 3dslicer as the slicer assigns the volume name to be the patient name that has been extracted from the header. Using the command below will give each series a unique patient name which is just the series number. The output directory, in this case /d/bigweekly/anon/ must exist prior to executing the command.

ls -1 | awk '{printf("wish $ANON_DIR/dcanon.tcl -patname %s -force -nostrip /d/bigweekly/example/%s /d/bigweekly/anon/%s &\n",$0,$0,$0)}' | sed s/.SER// | sh



  • SIGNA data anonymization


If you wanted to anonymize signa image I.001 and call it anon.001, from the directory with your non-anonymized signa image type:

$ANON_DIR/siganon I.001 anon.001

This can be done for an entire series. For example, if you had a directory full of signa images numbered I.001 to I.124, you could anonymize all of them (from within the directory containing the images) with the command:


ls -1 I.* | awk '{printf("$ANON_DIR/siganon I.%03d anon.%03d\n",NR,NR)}' | sh

This will create an anonymized series of 124 images called anon.001 - anon.124

  • GENESIS data anonymization



To anonymize image I.001 can call the resulting image anon.001. from the directory with your non-anonymized genesis images type:

$ANON_DIR/genanon I.001 anon.001

This can be done for an entire series. For example, if you had a directory full of genesis images numbered I.001 to I.124, you could anonymize all of them (from within the directory containing the images) with the command:

ls -1 I.* | awk '{printf("$ANON_DIR/genanon I.%03d anon.%03d\n",NR,NR)}' | sh

This will create an anonymized series of 124 images called anon.001 - anon.124
Note that the input image and the output image can be the same image if you are using the genanon program.

If you have any questions or suggestions, please email Mark Anderson