DICOM Anonymizer interface and usage explanation


--------------------------------------------------------------------------------------------------------------
STEPS:
--------------------------------------------------------------------------------------------------------------

Follow these steps to anonymize DICOM files, either specific files or folders:
1. Select A) a folder to scan for DICOM files to anonymize (check box to include subfolders) -or-
          B) add one or more files for anonymization -or-
          C) drag and drop a folder in the anonymizer window -or-
          D) drag and drop selected file(s) in the anonymizer window.
2. Select a destination folder. If selected, all anonymized DICOM files will be stored there.
                                If not selected, all anonymized files are stored in the folder of each
                                original DICOM file.
3. If you want to replace the patient ID in all DICOM files with a pseudonym, check 'Patient ID' and
   fill in the pseudonym.
4. Set the advanced options if needed.
5. Press the 'START ANONYMIZING' button.

The message window and progress bars will indicate the anonymization progress and display error and
regular messages. If you have a license of the 'Rubo DICOM viewer', this anonymization tool is included
and integrated.
See the arguments section below, how to automate and/or integrate the DICOM anonymizer with your software.


--------------------------------------------------------------------------------------------------------------
INTERFACE:
--------------------------------------------------------------------------------------------------------------

 'Anonymize folders'
Click the 'ANONYMIZE FOLDERS' area to activate anonymization of a folder. Select a source folder by clicking
the 'Select source folder' button, choose the correct folder and press 'Select folder'. No filenames are shown
in the browse window during source folder selection. You can also drag and drop a source folder. To include
all subfolders of the source folder, check the 'Search all subfolders' option.

 'Anonymize file(s)'
Click the 'ANONYMIZE FILE(S)' area to activate anonymization of one or more files. Add files by clicking
the 'Add file(s)' button. Select one or more files and press 'Open' to confirm. You can select more than
1 file in the browse window, by using the CTRL and/or SHIFT buttons while choosing filenames. It's also
possible to drag and drop one ore more filenames. The selected files are displayed in the 'Selected files'
list. Clear the selected files list by pressing the 'Clear' button.
 
 'Destination folder'
Check 'Destination folder same as source file(s)' to store all anonymized files in the same folder as the
source file. When this option is UN-checked, you have to choose a folder in which all anonymized files will
be stored. Press the 'Select destination folder' button to do so.
The Destination folder setting is stored separately for anonymization of folder or files.

'Pseudonymize'
Check 'Patient ID' and enter a new patient ID. All anonymized files will have the patient ID replaced.
The ID may not hold the backslash '\' character.

'Advanced Options'
 Replace UIDs:
   Check to replace all UIDs in tag with VR 'UI'. The original and replacement UIDs are stored in a ini-file
   (see below for the location) to maintain references between SOP instances. Delete this ini-file to
   destroy the references between SOP instances for future anonymizations. See the argument section for 
   usage of different ini-files.
 Private tags:
   Check to clear private tags. Private tags have odd group numbers and are used by different manufacturers
   in different ways. The data of a private tag is destroyed or the tag is removed.
 Curve data:
   Check to clear curve data. Curve data is stored in tags with group numbers 50XX and may hold audio data.
   The data of curve tags is destroyed or the tags are removed.
 Anonymized filename:
   Check to add text to add to the new destination filename. Choose to add to the beginning or end of the
   new filename. If the desination file already exists, it will NOT be overwritten; a number will be added
   to the new filename to store it next to the existing one. An example filename is displayed.

When all folders are set or all files are chosen, press 'START ANONYMIZING' to start anonymizing. The text
in the button will also show if you are anonymizing folders or files. It's one or the other, a combination
of folders and files is not allowed.
When anonymizing folders, the first step is searching the folder (and if set, subfolders) for DICOM files.
The anonymization progress is displayed using the message window and the progress bars. Stop the process
any time by clicking the 'STOP' button. Anonymizing the current file will finish before stopping the 
anonymization process.
Click the 'STOP' button 5 times rapidly to force the process to end, terminating the anonymizer. Use this
option as a last resort, do expect error messages and the current file will be corrupt.


--------------------------------------------------------------------------------------------------------------
AUTOSTART ARGUMENTS:
--------------------------------------------------------------------------------------------------------------

'-fo'    Source folder to search for DICOM files. Must be followed by folder name
'-fd'    Destination folder. If not specified, anonymized files are stored in the folder of the source files.
         Must be followed by folder name
'-wc'    Wildcard, cannot be changed in the user interface. Must be followed by wildcard. Default '*.*'
'-fi'    Single DICOM file. Must be followed by filename
'-sf'    Search subfolders
'-pid'   Patient ID. Must be followed by a patient ID. Use double quotes if it holds spaces.
         Will replace the patient ID of all files to be anonymized (pseudonymization)
'-uid'   UID. Replace UIDs and preserve SOP instance references. Overrides registry settings
'-pt'    Private tags. Delete or clear private tags. Overrides registry settings
'-ct'    Curve tags. Delete or clear curve tags. Overrides registry settings
'-as'    String to append to new filename. Must be followed by a string. Overrides registry settings.
         Default '_anon'
'-asb'   Insert string to begin of new filename. Overrides registry settings
'-ase'   Insert string to end of new filename. Overrides registry settings
'-ork'   Registry key to store settings. Must be followed by a registry key.
         Default 'Software\Rubo Medical\DICOM Anonymizer'. Root is fixed to 'HKEY_CURRENT_USER'
'-fuid'  Replacement UID file. Stores original and replacement UIDs. Must be followed by a filename.
         Default 'My Documents\DICOMAnonymizer\ReplaceUIDs.ini'
'-quit'  Quit when finished anonymizing

ANY VALUE OF AN ARGUMENT MUST BE SPACE SEPARATED. USE DOUBLE QUOTES AROUND VALUES WITH SPACES. CHECK EXAMPLES
BELOW FOR SPACE SEPARATION AND USE OF QUOTES.

Examples:
  DICOMAnonymizer.exe -fo "C:\DICOM\Source folder" -fd "C:\Destination folder" -wc "*.dcm" -sf -quit
   -or-
  DICOMAnonymizer.exe -fi "C:\DICOM\1.dcm" -fi "C:\DICOM\2.dcm" -quit
   -or-
  DICOMAnonymizer.exe -fi "C:\DICOM\1.dcm" -fd "C:\DestinationFolder" -pid "NewID" -quit
   -or-
  DICOMAnonymizer.exe -fi "C:\DICOM\1.dcm" -pid "NewID" -uid -pt -ct -as "_anony" -quit
   -or-
  DICOMAnonymizer.exe -ork "Software\Rubo Medical\ThisRegistryKey"
   -or- 
  DICOMAnonymizer.exe -fuid "D:\My Folder\StudyXXXReplacementUIDs.ini"


--------------------------------------------------------------------------------------------------------------
ANONYMIZED DICOM TAGS:
--------------------------------------------------------------------------------------------------------------

A DICOM header holds all sorts of data, strings, numbers, binary data etc. See below which tags are anonymized
and how their values are cleared.

-TAGS holding UIDs:
  All numbers in a UIDs are replaced by random numbers, the original and replacement UIDs are stored in
   the replacement UID file. This maintains SOP instance references between DICOM files.
  Unless 'ReplaceUIDs' is set, the following DICOM Tags with UIDs are explicitly NOT anonymized; this
   to maintain SOP instance reference:
    [0008,0018] SOP Instance UID
    [0008,1155] Referenced SOP Instance UID
    [0020,000D] Study Instance UID
    [0020,000E] Series Instance UID
-TAGS holding strings, all characters are replaced by spaces or '0's.
-TAGS holding integers, all numbers are set to 0.
-TAGS holding data, all binary values are set to 0x00.
-TAGS holding dates, all values are set to 19700000.
-TAGS holding times, all times are set to 000000.
-TAGS may also be removed.


The following DICOM Tags are anonymized or removed: Click here for the list of DICOM Tags