DICOM Anonymization

DICOM Header and Image Defacing

dicomanon

The perl script "dicomanon" on penguin will clean the DICOM header and if selected, also deface the image data of DICOM files. The header is cleaned using dcmodify from the DCMTK toolkit with a set of attributes modified, zeroed or erased in accordance with the DICOM Standard PS3.1 2019e Basic Application Confidentiality Profile with some exceptions. Defacing is done using pydeface from Stanford University. Typing just the script name will show the usage summary (shown below):

Usage:
  dicomanon [-d <delta>] [-p <patientinfo>] [-n <nodes>] <file.dcm> [<file.dcm>...]
  dicomanon -h

Clean Philips Enhanced-MR DICOM files according to Basic Application Confidentiality Profile (BACP) and deface selected files.

Date Time Delta: -d switch

All date/times in the DICOM header can be offset to maintain Longitudinal Temporal Information (LTI). You should use the same delta for all files that would benefit from LTI. If <delta> is not provided, all dates and times are blanked or removed as specified by the standard BACP. If <delta> is provided, attributes are added indicating LTI modification was used.

The delta format can be specified in a flexible common language format (see manpage for Date::Manip::Delta). For example, '-100 days +7 hours -33 min 12 sec' or '-100d +7h -33mn 12s'. The coded normalized result of the delta is output and can be used in the future to achvieve the same delta. For the above it's '+0:0:-14:1:17:33:12'.

Universal Identifiers - UIDs

Philips UIDs are <manuf.id>.<serno>.<type.id>.<datetimestamp>

The UID is therefore completely unique. For anonymization, the <datetimestamp> portion is replaced with an offset date. The offset delta is that provided with the -d switch or otherwise a randomly selected delta. The serial number is replaced with a 6 digit replacement from a table containing known scanner's serial numbers. This would permit determining the scanner used for the scan if necessary. Also scans done on the same scanner will always have the same serial number in the UIDs and in the DeviceSerialNumber attribute. If a DICOM file with unknown serial number is anonymized, a unique random 6 digit number is selected and saved.

Patient Information

If a file is specified with the -p switch, it must have 3 lines that will be used for the PatientName, PatientID and PatientBirthday attributes. The 3 values must be valid DICOM value representations (VR) for the attributes to be replaced:

Any or all of the 3 values can be blank. If the file is not specified, all of these attributes will blank (as recommended by the BACP).

Protocol Name

The ProtocolName attribute is preserved. This is indicated in the inserted confidentiality attributes.

Private Attributes

All Private attributes are retained. This is indicated in the inserted confidentiality attributes. No Philips Private attributes contain any patient identifiers at this time.

Clean Recognizable Visual Features - Defacing

If a file named <root>.deface exists, where <root> is the name of DICOM file without the .dcm extension, the DICOM file will be defaced using pydeface. The attribute RecognizableVisualFeatures is inserted and set to NO. The quality of defacing should be checked by visual inspection. The script supports only single echo or 2 echo scans for defacing. You can use the command "touch <root>.deface" to create an empty file. This is available only if pydeface and FSL are present.

Cluster Job

If this script is called from the penguin master node, a cluster job will be submitted using the arguments provided. -n <nodes> specifies the maximum number of nodes to use. Header cleaning takes about 2 minutes per acquisition. Defacing can take from 5-20 minutes per defaced aqcuisition depending on the resolution.

Perl Script Note: This script is optimized for Philips Enhanced MR image files. It requires dcmdump, dcmodify and dcmconv from the DCMTK toolkit to clean headers. Also dcm2niix from Chris Rodens' mricroGL, pydeface from the Russell Poldrack Lab at Stanford University and FSL from FMRIB at Oxford University is required to deface images.

DICOM Header

DicomCleaner

The DICOM header can be anonymized using DicomCleaner. To run on penguin just type "DicomCleaner". This program can be used to contact a remote DICOM server and transfer images from that server, clean the images and store them locally or send them back to a DICOM destination. It also includes a DICOM server that could listen for connections from remote DICOM clients, receive images, clean them and store them locally. We are not currently using either of these network modes, but are only cleaning local files already stored on our file server, godzilla. So in the GUI you can ignore the Configure, Query, Retrieve, and Send buttons.

After starting the program, click the "Import" button and select the directory containing the DICOM file(s) to be cleaned. The program will search the directory for all DICOM files and list them in the "Original" pane.

Select the files to be cleaned. It simplest to select the top level of the hierarchy and clean all the DICOM files found. Then click the "Clean" button. The cleaned files will appear in the "Cleaned" pane. Select the file(s) to be saved (or entire hierearchy) and click the Export button. Select the folder to save cleaned files in.

The option checkboxes shown in the illustration seem to be optimal.

DicomCleaner window

DICOM Images - "defacing"

Format Conversion

The first two defacing tools require NIFTI format images. The DICOM file must be converted to NIFTI, then defaced, then the defaced image data inserted back into the DICOM file.

For conversion to NIFTI, use dcm2niix program from Chris Rorden.

demo> dcm2niix -s y -f 02_MPrage 02_MPrage.dcm
Chris Rorden's dcm2niiX version v1.0.20190902  (JP2:OpenJPEG) GCC4.8.2 (64-bit Linux)
Philips Scaling Values RS:RI:SS = 2.95409:0:0.00627766 (see PMC3998685)
Convert 1 DICOM as /g5/kirby/jgillen/demo/02_MPrage (224x224x150x1)
Conversion required 0.911344 seconds (0.460000 for core code).
demo> 

For conversion from NIFTI back to DICOM there are no tools available. But the conversion is fairly simple to do using some FSL utilities. The image data is modified somewhat when it's converted to NIFTI format and defaced:

demo> set SCL = `dcmdump -s +P 2005,100e 02_MPRAGE.dcm | awk '{print $3}'`
demo> setenv FSLOUTPUTTYPE NIFTI_PAIR
demo> fslmaths 02_MPrage_deface.nii -mul $SCL 02_MPrage_deface -odt short
demo> fslswapdim 02_MPrage_deface.hdr x -y z 02_MPrage_deface2
demo> dcmodify -mf 7fe0,0010=02_MPrage_deface2.img 02_MPrage_deface.dcm
demo> rm 02_MPrage.nii 02_MPrage.json 02_MPrage_deface.* 02_MPrage_deface2.*
demo> 

Note: the above fslswapdim command is for transverse images. For saggital use "-y -z x" or for coronal use "-x -z y". If you don't want to keep the original DICOM images:

demo> rm 02_MPRrage.dcm.bak

if your shell is bash, the first 2 steps become:

demo> SCL=`dcmdump -s +P 2005,100e 02_MPRAGE.dcm | awk '{print $3}'`
demo> export FSLOUTPUTTYPE=NIFTI_PAIR

Pydeface

pydeface comes from the Russell Poldrack Lab at Stanford. This tool requires the images be in NIFTI format so DICOM files must be converted before defacing. This tool has been tested successfully for MPRAGE, FLAIR and T2 axial images. I's a fairly lengthy process - a 224 x 224 150 slice MPRAGE took 9 1/2 minutes to deface.

demo> pydeface 02_MPrage.nii
--------------
pydeface 2.0.0
--------------
Temporary files:
  /tmp/tmpbzzwd31f.mat
  /tmp/tmptzkkn8ii.nii.gz
Defacing...
  02_MPrage.nii
Defaced image saved as:
  02_MPrage_defaced.nii
Cleaning up...
Finished.
demo> 

mri_deface

mri_deface is a tool from the FreeSurfer package. For instruction see http://freesurfer.net/fswiki/mri_deface. This tool requires the images be in NIFTI format so DICOM files must be converted before defacing. This tool has been successfully used to deface MPRAGE images but not FLAIR images. This method registers the images to an atlas to identify brain and face and seems to be optimized for T1 weighted images.

Example:

one time setup for FreeSurfer - may already be done in your .cshrc

demo> source /usr/local/fsl-6.0.1/etc/fslconf/fsl.csh 
demo> setenv PATH ${FSLDIR}/bin:$PATH
demo> source /usr/local/freesurfer/FreeSurferEnv.csh
-------- freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.0-2beb96c --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /usr/local/freesurfer
FSFAST_HOME       /usr/local/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /usr/local/freesurfer/subjects
MNI_DIR           /usr/local/freesurfer/mni
FSL_DIR           /usr/local/fsl-6.0.1
demo> setenv ATLAS $FREESURFER_HOME/average

run mri_deface

demo> mri_deface 02_MPrage.nii $ATLAS/talairach_mixed_with_skull.gca $ATLAS/face.gca 02_MPrage_deface.nii
logging results to 02_MPrage_deface.log
reading '/usr/local/freesurfer/average/talairach_mixed_with_skull.gca'...
reading '02_MPrage.nii'...
changing type of input volume to 8 bits/voxel...
MRIchangeType: Building histogram 
bounding unknown intensity as < 10.3 or > 1461.6 
total sample mean = 111.8 (0 zeros)
spacing=8, using 2055 sample points, tol=1.00e-03...
resetting wm mean[0]: 143 --> 144
resetting gm mean[0]: 89 --> 89
input volume #1 is the most T1-like
using real data threshold=10.0
skull bounding box = (50, 52, 24) --> (205, 205, 228)
using (102, 103, 126) as brain centroid...
mean wm in atlas = 144, using box (83,84,101) --> (121, 121,151) to find MRI wm
before smoothing, mri peak at 79
robust fit to distribution - 79 +- 4.1
after smoothing, mri peak at 79, scaling input intensities by 1.823
scaling channel 0 by 1.82278
initial log_p = -5.6

after initial translation: (1.1, -14.8, -23.9): log p = -4.8

scale 1.000: max=-4.2, old_max =-4.8 (thresh=-4.8)

scale 1.000: max=-4.1, old_max =-4.2 (thresh=-4.2)

scale 1.000: max=-4.1, old_max =-4.1 (thresh=-4.1)
reducing scale to 0.2500

scale 0.250: max=-4.0, old_max =-4.1 (thresh=-4.1)

scale 0.250: max=-4.0, old_max =-4.0 (thresh=-4.0)

scale 0.250: max=-4.0, old_max =-4.0 (thresh=-4.0)
reducing scale to 0.0625

scale 0.062: max=-3.9, old_max =-4.0 (thresh=-4.0)

scale 0.062: max=-3.9, old_max =-3.9 (thresh=-3.9)

scale 0.062: max=-3.9, old_max =-3.9 (thresh=-3.9)
computing MAP estimate of linear transform...
dt = 5.00e-06, momentum=0.80, tol=1.00e-03
l_intensity = 1.0000
Aligning input volume to GCA...
Transform matrix
 1.18868  -0.09827   0.14958  -30.70943;
 0.04909   1.20207   0.37213  -88.07381;
-0.16933  -0.33529   1.09526   38.75517;
 0.00000   0.00000   0.00000   1.00000;
nsamples 2055
Quasinewton: input matrix
 1.18868  -0.09827   0.14958  -30.70943;
 0.04909   1.20207   0.37213  -88.07381;
-0.16933  -0.33529   1.09526   38.75517;
 0.00000   0.00000   0.00000   1.00000;
outof QuasiNewtonEMA: 009: -log(p) =   -0.0  tol 0.001000
pass 1, spacing 8: log(p) = -3.9 (old=-5.6)
computing final MAP estimate of linear transform using 228854 samples...
dt = 5.00e-06, momentum=0.80, tol=1.00e-03
l_intensity = 1.0000
Aligning input volume to GCA...
Transform matrix
 1.18868  -0.09827   0.14958  -30.70943;
 0.04909   1.20207   0.37213  -88.07381;
-0.16933  -0.33529   1.09526   38.75517;
 0.00000   0.00000   0.00000   1.00000;
nsamples 228854
Quasinewton: input matrix
 1.18868  -0.09827   0.14958  -30.70943;
 0.04909   1.20207   0.37213  -88.07381;
-0.16933  -0.33529   1.09526   38.75517;
 0.00000   0.00000   0.00000   1.00000;
outof QuasiNewtonEMA: 009: -log(p) =   -0.0  tol 0.001000
final transform:
 1.18868  -0.09827   0.14958  -30.70943;
 0.04909   1.20207   0.37213  -88.07381;
-0.16933  -0.33529   1.09526   38.75517;
 0.00000   0.00000   0.00000   1.00000;

anonymizing volume...
using wm = 95.0, gm = 74.5
wm covar:
 502.39935;
gm covar:
 659.34979;
.........................
817082 face voxels erased, 346692 ambiguous voxels retained
resampling to original coordinate system...
writing anonymized volume to 02_MPrage_deface.nii...
deidentification took 4 minutes and 56 seconds.

MINC deface_minipipe.pl / deface_volume.pl

This tool is part of the MINC Toolkit V2 from Montreal Neurological Institute. It requires the images be converted to MINC format. The provided conversion utility (dcn2mnc) seems to have some difficulty with Philips enhanced MR DICOM format. This tool also uses an atlas and it appears the selection of a matching atlas is important. I was able to process an MPRAGE using the tool but haven't yet determined how to get back to DICOM format or make other image types work.

demo/mnc> setenv PATH /opt/minc/1.9.17/bin:$PATH
demo/mnc> setenv PERL5LIB /opt/minc/1.9.17/perl
demo/mnc> deface_minipipe.pl 20190321_140431_201e1_mri.mnc 20190321_140431_1001e1_mri.mnc --model-dir /opt/minc/share/icbm152_model_09c --model mni_icbm152_t1_tal_nlin_sym_09c --3t --beastlib /opt/minc/share/beast-library-1.1
Processing:.......................................Done
Processing:.......................................Done
Processing:.......................................Done
.
.
.
Processing:.......................................Done
Processing:.......................................Done
Processing:.......................................Done
Number of iterations: 94 
CV of field change: 9.86956e-05
Processing:......................................................................................................................................................Done
Warning: For optimal results, you should use masking.
Usage: bestlinreg.pl [options] source.mnc target.mnc output.xfm [output.mnc]
       bestlinreg.pl -help to list options

-+-------------------------[0]-------------------------
 | steps:          8 8 8
 | blur_fwhm:      16
 | simplex:        32
 | source:         /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_16_blur.mnc
 | target:         /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_16_blur.mnc
 | xfm:            /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_0.xfm
-+-----------------------------------------------------

mincblur -clobber -no_apodize -fwhm 16 /tmp/deface_minipipe.pl-wCFsOuXu/clp_t1w.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_16
Making byte volume...
mincblur -clobber -no_apodize -fwhm 16 /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_16
Making byte volume...
minctracc -clobber -xcorr -lsq9 -step 8 8 8 -simplex 32 -tol 0.01 -est_translations /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_16_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_16_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_0.xfm
COG of v1: -220.994308 -197.155624 -2.820920
COG of v2: 0.000019 -19.278353 3.348202
   [trans] = 220.994324 177.877274 6.169123
Only center & trans required, now returning from init_transformation
Initial objective function val = 0.04781222
Final objective function value = 0.03326343
-+-------------------------[1]-------------------------
 | steps:          4 4 4
 | blur_fwhm:      8
 | simplex:        16
 | source:         /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8_blur.mnc
 | target:         /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8_blur.mnc
 | xfm:            /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_1.xfm
-+-----------------------------------------------------

mincblur -clobber -no_apodize -fwhm 8 /tmp/deface_minipipe.pl-wCFsOuXu/clp_t1w.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8
Making byte volume...
mincblur -clobber -no_apodize -fwhm 8 /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8
Making byte volume...
minctracc -clobber -xcorr -lsq9 -step 4 4 4 -simplex 16 -tol 0.004 -transformation /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_0.xfm /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_1.xfm
Initial objective function val = 0.07867811
Final objective function value = 0.06683248
-+-------------------------[2]-------------------------
 | steps:          4 4 4
 | blur_fwhm:      4
 | simplex:        8
 | source:         /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4_blur.mnc
 | target:         /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4_blur.mnc
 | xfm:            /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_2.xfm
-+-----------------------------------------------------

mincblur -clobber -no_apodize -fwhm 4 /tmp/deface_minipipe.pl-wCFsOuXu/clp_t1w.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4
Making byte volume...
mincblur -clobber -no_apodize -fwhm 4 /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4
Making byte volume...
minctracc -clobber -xcorr -lsq9 -step 4 4 4 -simplex 8 -tol 0.004 -transformation /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_1.xfm /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4_blur.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_2.xfm
Initial objective function val = 0.10627691
Final objective function value = 0.10601798
-+-------------------------[3]-------------------------
 | steps:          4 4 4
 | blur_fwhm:      8
 | simplex:        4
 | source:         /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8_dxyz.mnc
 | target:         /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8_dxyz.mnc
 | xfm:            /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_3.xfm
-+-----------------------------------------------------

mincblur -clobber -no_apodize -fwhm 8 -gradient /tmp/deface_minipipe.pl-wCFsOuXu/clp_t1w.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8
Making byte volume...
Transforming slices:......................................................................................................................................................Done
Making byte volume dx...Making byte volume dy...Making byte volume dz...mincblur -clobber -no_apodize -fwhm 8 -gradient /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8
Making byte volume...
Transforming slices:.................................................................................................................................................................................................Done
Making byte volume dx...Making byte volume dy...Making byte volume dz...minctracc -clobber -xcorr -lsq9 -step 4 4 4 -simplex 4 -tol 0.004 -transformation /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_2.xfm /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_8_dxyz.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_8_dxyz.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_3.xfm
Initial objective function val = 0.18266416
Final objective function value = 0.16798820
-+-------------------------[4]-------------------------
 | steps:          4 4 4
 | blur_fwhm:      4
 | simplex:        2
 | source:         /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4_dxyz.mnc
 | target:         /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4_dxyz.mnc
 | xfm:            /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4.xfm
-+-----------------------------------------------------

mincblur -clobber -no_apodize -fwhm 4 -gradient /tmp/deface_minipipe.pl-wCFsOuXu/clp_t1w.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4
Making byte volume...
Transforming slices:......................................................................................................................................................Done
Making byte volume dx...Making byte volume dy...Making byte volume dz...mincblur -clobber -no_apodize -fwhm 4 -gradient /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4
Making byte volume...
Transforming slices:.................................................................................................................................................................................................Done
Making byte volume dx...Making byte volume dy...Making byte volume dz...minctracc -clobber -xcorr -lsq9 -step 4 4 4 -simplex 2 -tol 0.004 -transformation /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_3.xfm /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4_dxyz.mnc /tmp/bestlinreg.pl-G2Dkyce5/mni_icbm152_t1_tal_nlin_sym_09c_4_dxyz.mnc /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4.xfm
Initial objective function val = 0.24382356
Final objective function value = 0.24299544
mv -f /tmp/bestlinreg.pl-G2Dkyce5/clp_t1w_4.xfm /tmp/deface_minipipe.pl-wCFsOuXu/t1w_stx.xfm

mincbeast --            an implementation of BEaST (Brain Extraction
                        using non-local Segmentation Technique) version 1.90.00

Using OpenMP, max number of threads=16
initialscale:2 targetscale:1
4 1 2 0.20 0.25 0.95 20
2 1 4 0.50 0.25 0.95 20
2: 4 1 2 0.20 0.25 0.95 20
1: 2 1 4 0.50 0.25 0.95 20
0: 4 1 2 0.50 0.25 0.95 20
Performing pre-selection (0 MB/subject)....................done
Patch size: 1
Search area: 2
Beta: 0.250000
Threshold: 0.950000
Selection: 20
Dimensions: 48 57 48
Computing first moment image...done (0 sec)
Computing second moment image...done (0 sec)
Segment 33 /  48 (redoing 12113 voxels) t=0.902500, min=95  (0 sec)
Segment 33 /  48 (redoing 4359 voxels) t=0.857375, min=90  (1 sec)
Segment 33 /  48 (redoing 1542 voxels) t=0.814506, min=85  (0 sec)
Segment 33 /  48 (redoing 530 voxels) t=0.773781, min=80  (0 sec)
Segment 33 /  48 (redoing 167 voxels) t=0.735092, min=76  (0 sec)
Segment 33 /  48 (redoing 89 voxels) t=0.698337, min=72  (0 sec)
Segment 33 /  48 (redoing 77 voxels) t=0.663420, min=68  (0 sec)
Segment 33 /  48 (redoing 70 voxels) t=0.630249, min=64  (0 sec)
Segment 33 /  48 (redoing 61 voxels) t=0.598737, min=60  (1 sec)
Segment 33 /  48 (redoing 54 voxels) t=0.568800, min=57  (0 sec)
Segment 33 /  48 (redoing 48 voxels) t=0.540360, min=54  (0 sec)
Segment 33 /  48 (redoing 44 voxels) t=0.513342, min=51  (0 sec)
Segment 33 /  48 (redoing 39 voxels) t=0.487675, min=48  (0 sec)
Segment 33 /  48 (redoing 26 voxels) t=0.463291, min=45  (0 sec)
Segment 33 /  48 (redoing 22 voxels) t=0.440127, min=42  (0 sec)
Segment 33 /  48 (redoing 19 voxels) t=0.418120, min=39  (0 sec)
Segment 33 /  48 (redoing 10 voxels) t=0.397214, min=37  (1 sec)
Segment 33 /  48 (redoing 4 voxels) t=0.377354, min=35  (0 sec)
Segment 33 /  48 (redoing 1 voxels) t=0.358486, min=33  (0 sec)
Segment 33 /  48 done (0 sec, t=0.358486, min=33)
Performing pre-selection (4 MB/subject)....................done
Patch size: 1
Search area: 4
Beta: 0.250000
Threshold: 0.950000
Selection: 20
Dimensions: 96 114 96
Computing first moment image...done (0 sec)
Computing second moment image...done (0 sec)
Segment 81 /  96 (redoing 7142 voxels) t=0.902500, min=95  (8 sec)
Segment 81 /  96 (redoing 1788 voxels) t=0.857375, min=90  (1 sec)
Segment 81 /  96 (redoing 516 voxels) t=0.814506, min=85  (0 sec)
Segment 81 /  96 (redoing 152 voxels) t=0.773781, min=80  (1 sec)
Segment 81 /  96 (redoing 34 voxels) t=0.735092, min=76  (0 sec)
Segment 81 /  96 (redoing 10 voxels) t=0.698337, min=72  (0 sec)
Segment 81 /  96 done (0 sec, t=0.698337, min=72)
Writing a binary volume...
Transforming slices:..............................................Done
DIED: fast_blur --fwhm 6 /tmp/make_random_grid.pl-mLNMx3WY/0.mnc /tmp/make_random_grid.pl-mLNMx3WY/0_blur.mnc
DIED: make_random_grid.pl --clobber --mask /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c_face_mask.mnc /opt/minc/share/icbm152_model_09c/mni_icbm152_t1_tal_nlin_sym_09c_face_mask.mnc /tmp/deface_minipipe.pl-wCFsOuXu/grid.mnc --amplitude 12 --fwhm 6
demo/mnc>