Differences between revisions 3 and 4
Deletions are marked like this. Additions are marked like this.
Line 75: Line 75:

set DATA1=/your_path/data1 \
set DATA2=/your_path/data2 \
set OUTPUT_DIR=/your_path/defaced_dicoms \
{{{
 set DATA1=/your_path/data1 \
 set DATA2=/your_path/data2 \
 set OUTPUT_DIR=/your_path/defaced_dicoms \
}}}
Line 93: Line 93:
    

BIRN Deidentification and Upload Pipeline

Author: Silvester Czanner (see also: SilvesterNotes)


  1. Overview of anonymizing and defacing code
  2. Limitations of the code
  3. Contents in distribution
  4. Setting up local environment variables for use
  5. Use instructions
  6. Support and contacts

1. Overview of anonymizing and defacing code

Goal
To anonymize and deface the dicom files

We provide a script (birnd_up) that reads a dicom image files, anonymizes the dicom headers and defaces dicom image volumes.

2. Limitations of the code

  • This anonymizing and defacing code has been tested on 3D structural images acquired on Siemens (Avanto and Sonata gradients) and GE (CRM and BRM gradients) systems
  • This code has been developed for linux platforms and tested on RED HAT, Fedora Core 2 To convert the dicom files to TIF images and visualy chceck the results
  • This code needs a Matlab license and an Image Toolbox license.
  • This code has been tested on Matlab's version 7.0 (r14)

3. Contents of distribution

The whole distribution package contains 6 subdirectories:

  • atlas

    face.gca, talairach_mixed_with_skull.gca

    matlab

    save_mgh_as_tifs.m

    scripts

    birnd_up

    bin

    dccp, dcdump, dcmdump, gentodc, mri_watershed-test, tclkit, mri_deface, mri_convert

    dcanon

    a2mrml, dcanon, dcanon.tcl

4. Setting up local environment variables

You need to set up the following two variables:

Setup the environment variable BIRND_UP_DIR to the BIRND-UP directory. For example:

  • setenv BIRND_UP_DIR /my_home_directory_path/BIRND-UP

Setup the variable MATLAB to the path of your matlab executable file For example:

  • setenv MATLAB /space/lyon/6/pubsw/common/matlab/7.0/bin/matlab

With these environments you can define aliases to run the scripts:

  • alias birnd_up $BIRND_UP_DIR/scripts/birnd_up

And then just run the scripts by typing:

  • birnd_up (or birnd_up -help)

5. How to use it

USAGE

birnd_up [options] -i <indir> -o <outdir> -subjid <subjID>

  • -i indir

    : input directory <dcmdir>

    -o outdir

    : output directory

    -study studydir

    : study directory

    -subjid subject_ID

    : subject ID

    -radius radius

    : radius in [mm], default 5

    -radius distance_from_brain

    : Default is 7mm, but if a bit of brain is being stripped, it can be increased, or if too much is face is left, it can be decreased.

    -result_check

    : create tif images from defaced volume

    -version

    : print version string

    -help

    : show the usage text

  • Examples:

     set DATA1=/your_path/data1 \
     set DATA2=/your_path/data2 \
     set OUTPUT_DIR=/your_path/defaced_dicoms \

    ./birnd_up -i $DATA1 $DATA2 -o $OUTPUT_DIR -subjid test_subj

    Defaced dicom files will be in:

    • $DATA1 --> $OUTPUT_DIR/test_subj/scan_1 $DATA2 --> $OUTPUT_DIR/test_subj/scan_2

    ./birnd_up -i $DATA1 $DATA2 -o $OUTPUT_DIR -subjid test_subj -study1 visit1

    Defaced dicom files will be in:

    • $DATA1 --> $OUTPUT_DIR/test_subj/visit1/scan_1 $DATA2 --> $OUTPUT_DIR/test_subj/visit1/scan_2

    ./birnd_up -i $DATA1 $DATA2 -o $OUTPUT_DIR -subjid test_subj -study1 visit1 -result_check

    Defaced dicom files will be in:

    • $DATA1 --> $OUTPUT_DIR/test_subj/visit1/scan_1 $DATA2 --> $OUTPUT_DIR/test_subj/visit1/scan_2

    TIF images from defaced data will be in:

    • $DATA1 --> $OUTPUT_DIR/test_subj/visit1/scan_1_tif $DATA2 --> $OUTPUT_DIR/test_subj/visit1/scan_2_tif

    6. Support and contacts

    Support is very limited but we will do our best to try to answer your questions. Please email your constructive comments to:

    BIRND-UP (last edited 2008-04-29 11:46:13 by localhost)