annotate Database/Encodings/Generate.sh @ 642:6f8443295ca8

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Apr 2024 17:32:05 +0200
parents dbcbffb889da
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/bin/bash
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Inspired from Levin Alexander on 2016-11-03
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 # https://groups.google.com/d/msg/orthanc-users/kYURTgtgPmI/KeOL8lGFAwAJ
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 set -e
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 convert -quality 90 -resize 128x128 ../Lena.png /tmp/Lena.jpg
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 function Encode {
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 echo $1
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 SOURCE="Test-éüäöòДΘĝדصķћ๛ネİ"
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 CONVERTED=$(echo "$SOURCE" | iconv -c -t $1)
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 img2dcm /tmp/Lena.jpg Lena-$1.dcm \
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 -k "(0010,0010)=${CONVERTED}" \
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 -k "(0010,0020)=${1}" \
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 -k "(0008,0005)=${2}"
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 echo -n "${CONVERTED}" | md5sum
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 }
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 # http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 Encode 'arabic' 'ISO_IR 127'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 Encode 'ascii' 'ISO_IR 6' # More accurately, ISO 646
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 Encode 'cyrillic' 'ISO_IR 144'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 Encode 'greek' 'ISO_IR 126'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 Encode 'hebrew' 'ISO_IR 138'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 Encode 'latin1' 'ISO_IR 100'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 Encode 'latin2' 'ISO_IR 101'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 Encode 'latin3' 'ISO_IR 109'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 Encode 'latin4' 'ISO_IR 110'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 Encode 'latin5' 'ISO_IR 148'
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 Encode 'shift-jis' 'ISO_IR 13' # Japanese
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 Encode 'tis-620' 'ISO_IR 166' # Thai
dbcbffb889da test_findscu_encoding
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 Encode 'utf8' 'ISO_IR 192'