YAKAMI DICOM Tools ver. 1.1.3.0 Copyright (C) Masahiro YAKAMI 2011. All rights reserved. ================================================================================ How to specify output path ================================================================================ Index * How to specify output path * command list * basic commands * tag commands * commands to process strings ================================================================================ How to specify output path You can use commands to specify output path (folder and file names) of each file according to its DICOM header. These commands are available in DICOM Converter, Folder Renamer and File Mover. Commands and their arguments are used in parentheses. If the command line is "{ODIR}\{TAG 0010 0020}\{FILE}", the path of an output DICOM file is, for example, "D:\output\John Smith \dicom-0001.dcm". * "ODIR" command returns the output folder specified in GUI. {ODIR} returns "D:\output" for example. * "TAG" command returns the value of the tag specified by the arguments. {TAG 0010 0020} returns "John Smith " for example. TAG (0010,0020) contains patient's name. * "FILE" command returns the original file name. {FILE} returns "dicom-0001.dcm" for example. Multiple commands can be used in one pair of parentheses. They must be splited with "|". For example, you can use "TRIM" command like "{TAG 0010 0020|TRIM}". * "TRIM" command reads the output of the previous command, eliminate spaces and returns it. If "TAG 0010 0020" returns "John Smith ", {TAG 0010 0020|TRIM} returns "John Smith". ================================================================================ The whole list of commands Some commands requires arguments. A command and its arguments must be splited with space. The results of commands are under the following situation. base folder: D:\dicom-in original file name: D:\dicom-in\aaa\bbb\ccc.dcm output folder: D:\dicom-out patient name in the DICOM header (0010,0010)F John Smith patient ID in the DICOM header (0010,0020)F1234567 patient birthday: 31 Jan 1975 patient sex: male patient age: 64 years old study date: 25 March 2008 ======================================== base commands ======================================== The results of these commands have nothing to do with DICOM headers. ODIR format: ODIR explanation: The path specified as output folder. example: {ODIR} result: D:\dicom-out caution: The result is always "" in "Folder Renamer". RDIR format: RDIR explanation: Relative path of the original file based on the base folder. example: {RDIR} result: aaa\bbb\ caution: The result is always "" in "Folder Renamer". FILE format: FILE explanation: Original file name. example: {FILE} result: ccc.dcm caution: The result is always "" in "Folder Renamer". FILENAME format: FILENAME explanation: Original file name excluding extension example: {FILENAME} result: ccc caution: The result is always "" in "Folder Renamer". FILEEXT format: FILEEXT explanation: file extension example: {FILEEXT} result: .dcm caution: The result is always "" in "Folder Renamer". ======================================== TAG commands ======================================== The results of these commands depends on DICOM headers. TAG format: TAG {GROUP_NO} {TAG_NO} explanation: The value of specified DICOM header in text format. example: {TAG 0010 0020} result: 1234567 PTNAME format: PTNAME explanation: Patient name in DICOM header (0010,0010) in text format. example: {PTNAME} result: John Smith PTID format: PTID explanation: Patient ID in DICOM header (0010,0020) in text format. example: {PTID} result: 1234567 PTBIRTH format: PTBIRTH explanation: Patient birthday in DICOM header in text format. example: {PTBIRTH} result: 19750131 PTSEX format: PTSEX explanation: Patient sex in DICOM header in text format. example: {PTSEX} result: M PTAGE format: PTAGE explanation: Patient age in DICOM header in text format. example: {PTAGE} result: 64Y STDATE format: STDATE explanation: Study date in DICOM header in text format. example: {STDATE} result: 20080325 STYEAR format: STYEAR explanation: Study year in DICOM header in text format. example: {STYEAR} result: 2008 STMONTH format: STMONTH explanation: Study month in DICOM header in text format. example: {STMONTH} result: 03 STMDAY format: STMDAY explanation: Study date of the month in DICOM header in text format. example: {STMDAY} result: 25 STMODAL format: STMODAL explanation: Modality in DICOM header in text format. example: {STMODAL} result: CT STID format: STID explanation: Study ID in DICOM header in text format. example: {STID} result: 1 SEID format: SESE explanation: Series ID in DICOM header in text format. example: {SESE} result: 3 ACID format: ACID explanation: Acquisition ID in DICOM header in text format. example: {ACID} result: 3 INID or INNUM format: INID or INNUM explanation: Image number in DICOM header in text format. example: {INID} or {INNUM} result: 15 STUID format: STUID explanation: Study Instance UID (0020, 000D) in DICOM header in text format. example: {STUID} result: 1.2.392.200036.9123.100.19.1.5.57460649552.20061012115332.1 SEUID format: SEUID explanation: Series Instance UID (0020, 000E) in DICOM header in text format. example: {SEUID} result: 1.2.392.200036.9116.2.6.1.48.1215677236.1160708449.981157 INUID format: INUID explanation: SOP Instance UID (0008, 0018) in DICOM header in text format. example: {INUID} result: 1.2.392.200036.9116.2.6.2.48.1215677236.1160709458.203356 ACCN format: ACCN explanation: Accession Number (0008, 0050) in DICOM header in text format. example: {ACCN} result: 163870372034534 STDESC format: STDESC explanation: Study Description (0008, 1030) in DICOM header in text format. example: {STDESC} result: head SEDESC format: SEDESC explanation: Series Description (0008, 103E) in DICOM header in text format. example: {SEDESC} result: t1_se_3mm SQNAME format: SQNAME explanation: Sequence Name (0018, 0024) in DICOM header in text format. example: {SQNAME} result: *se2d1 ======================================== String command ======================================== These commands modify results of commands previous to them. TRIM format: TRIM explanation: Eliminate spaces in the head and tail. example: {TAG 0010 0010|TRIM} result: John Smith TRIMSTART format: TRIMSTART explanation: Eliminate spaces in the head. example: {TAG 0010 0010|TRIMSTART} result: John Smith TRIMEND format: TRIMEND explanation: Eliminate spaces in the tail. example: {TAG 0010 0010|TRIMEND} result: John Smith SUBSTRING format: SUBSTRING {START_POSITION} {LENGTH} explanation: Extract {LENGTH} letters from the {START_POSITION}th letter. The first letter is counted as the 0th letter. example: {TAG 0010 0010|SUBSTRING 1 6} result: ohn Sm RSUBSTRING format: RSUBSTRING {START_POSITION} {LENGTH} explanation: Extract {LENGTH} letters from the {START_POSITION}th letter. The last letter is counted as the 0th letter. Letters are counted backward. example: {TAG 0010 0010|RSUBSTRING 5 5} result: ith REPLACE format: REPLACE {TARGET} {NEW} explanation: Replace {TARGET} string with {NEW} string. example: {TAG 0010 0010|REPLACE ith o} result: John Smo ELIM format: ELIM {TARGET} explanation: Elimitate {TARGET} string. example: {TAG 0010 0010|ELIM ith} result: John Sm LEFTOVER format: LEFTOVER {DEFAULT} explanation: Overwrite {DEFAULT} string with the result of the previous command from the left side. example: {TAG 0010 0020|LEFTOVER 0000000000} result: 1234567 00 RIGHTOVER format: RIGHTOVER {DEFAULT} explanation: Overwrite {DEFAULT} string with the result of the previous command from the right side. example: {TAG 0010 0020|RIGHTOVER } result: 001234567 TOUPPER format: TOUPPER explanation: Change lower-case letters into upper-case letters. example: {TAG 0010 0010|TOUPPER} result: JOHN SMITH TOLOWER format: TOLOWER explanation: Change upper-case letters into lower-case letters. example: {TAG 0010 0010|TOLOWER} result: john smith INITIAL format: INITIAL explanation: Convert the result into initial. example: {TAG 0010 0010|INITIAL} result: J.S.