Показаны различия между двумя версиями страницы.
| Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
|
orthanc [2019/04/12 07:36] sector |
orthanc [2022/05/27 02:34] (текущий) sector |
||
|---|---|---|---|
| Строка 6: | Строка 6: | ||
| Решил попробовать сделать единое хранилище. \\ | Решил попробовать сделать единое хранилище. \\ | ||
| Конечно, | Конечно, | ||
| - | Поиск выдал Orthanc, система у меня Debian | + | Поиск выдал Orthanc, система у меня Debian |
| <code | ini> | <code | ini> | ||
| Строка 12: | Строка 12: | ||
| </ | </ | ||
| - | Установился, поправил конфиг для того что бы зайти в WEB, загрузил несколько картинок, по игрался... \\ | + | Установил, |
| - | Но что-то мне не совсем понравился стандартный web viewer...\\ | + | |
| - | Решил прикрутить | + | |
| - | Прописал в конфиг плагин: | + | |
| - | <code | ini > | + | В последних версиях пользователи хранятся |
| - | " | + | <code | ini> |
| - | "/ | + | credentials.json |
| - | ] | + | |
| - | </ | + | |
| - | И был | + | |
| - | Решил собирать из исходников… \\ | + | { |
| + | /** | ||
| + | * Sensitive configuration options. This file must *not* be | ||
| + | * publicly-readable. It must only be readable by the users that run | ||
| + | * the " | ||
| + | **/ | ||
| - | Ставим необходимое: \\ | + | // The list of the registered users. Because Orthanc uses HTTP |
| + | // Basic Authentication, | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| - | <code | ini> | ||
| - | sudo apt-get install build-essential unzip cmake mercurial uuid-dev libcurl4-openssl-dev | ||
| - | liblua5.1-0-dev libgtest-dev libpng-dev libsqlite3-dev libssl-dev libjpeg-dev | ||
| - | libdcmtk-dev libboost-all-dev libwrap0-dev libcharls-dev libjsoncpp-dev libpugixml-dev doxygen | ||
| </ | </ | ||
| - | + | Включение http сервера и авторизации тут: | |
| - | скачиваем:\\ | + | |
| <code | ini> | <code | ini> | ||
| - | wget https:// | + | Orthanc.json |
| + | " | ||
| - | </ | ||
| - | распаковываем, | + | " |
| - | <code | ini> | ||
| - | # cmake -DALLOW_DOWNLOADS=ON -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON -DUSE_SYSTEM_CIVETWEB=OFF | ||
| - | -DDCMTK_LIBRARIES=dcmjpls -DCMAKE_BUILD_TYPE=Release ~/ | ||
| - | # make | ||
| - | # make install | ||
| </ | </ | ||
| - | Скачал и подкинул плагин: | + | Что-то мне не понравился стандартный web viewer...\\ |
| + | Решил прикрутить | ||
| + | |||
| + | скачиваем: | ||
| <code | ini> | <code | ini> | ||
| Строка 58: | Строка 56: | ||
| </ | </ | ||
| - | все | + | нужно посмотреть -> http:// |
| + | |||
| + | по умолчанию подгружаются | ||
| + | поэтому директиву Plugins править не нужно.\\ | ||
| + | скаченную | ||
| + | и перезапустить orthanc.\\ | ||
| - | Конфиг был тут - / | ||
| - | Пока что в конфиге исправил только одну строчку, | ||
| <code | ini> | <code | ini> | ||
| Строка 73: | Строка 74: | ||
| </ | </ | ||
| - | + | TITLE AE -сервера, | |
| - | WEB-морда тут | + | И кодировка в которую они будут преобразованы " |
| - | Запуск с нужным конфигом: | ||
| <code | ini> | <code | ini> | ||
| - | # Orthanc | + | |
| + | " | ||
| + | |||
| + | // Check whether the called AET corresponds to the AET of Orthanc | ||
| + | // during an incoming DICOM SCU request | ||
| + | " | ||
| + | |||
| + | // The DICOM port | ||
| + | " | ||
| + | |||
| + | // The default encoding that is assumed for DICOM files without | ||
| + | // " | ||
| + | // C-Find requests (including worklists). The allowed values are | ||
| + | | ||
| + | // " | ||
| + | // " | ||
| + | // " | ||
| + | //" | ||
| + | " | ||
| </ | </ | ||
| + | <code | ini> | ||
| + | WEB-интерфейс тут http:// | ||
| + | </ | ||
| - | Будем курить дальше.\\ | ||
| - | Продолжение скоро. \\ | ||
| - | В плане подключить MariaDB и собирать все снимки с устройств централизованно. \\ | ||
| + | {{: | ||
| + | |||
| + | Подключение к СУБД: | ||
| + | |||
| + | <code | ini> | ||
| + | apt-get install default-mysql-server default-mysql-clietn defaultlt-libmysqlclient-dev orthanc-mysql | ||
| + | </ | ||
| + | |||
| + | Увеличиваем размер блока данных: | ||
| + | |||
| + | <code | ini> | ||
| + | mcedit my.cnf | ||
| + | |||
| + | max_allowed_packet = 128M | ||
| + | |||
| + | </ | ||
| + | |||
| + | создаем пользователя и бд, подключаемся: | ||
| + | |||
| + | <code | ini> | ||
| + | mcedit / | ||
| + | |||
| + | cat / | ||
| + | { | ||
| + | /** | ||
| + | * Configuration to use MySQL or MariaDB instead of the default | ||
| + | * SQLite back-end of Orthanc. You will have to install the | ||
| + | * " | ||
| + | **/ | ||
| + | " | ||
| + | // Enable the use of MySQL to store the Orthanc index? | ||
| + | " | ||
| + | | ||
| + | // Enable the use of MySQL to store the DICOM files? | ||
| + | " | ||
| + | | ||
| + | // Parameters of the MySLQ database | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | | ||
| + | // Optional: Disable the locking of the MySQL database | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | Контроль доступа и отправка на другие модальности: | ||
| + | <code | ini> | ||
| + | Orthanc.json | ||
| + | |||
| + | " | ||
| + | "/ | ||
| + | "/ | ||
| + | ], | ||
| + | |||
| + | " | ||
| + | </ | ||
| + | Lua: | ||
| + | |||
| + | Разрешения выполнять запросы | ||
| + | |||
| + | <code | ini> | ||
| + | |||
| + | cat access.lua | ||
| + | function IncomingHttpRequestFilter(method, | ||
| + | -- Only allow GET requests for non-admin users | ||
| + | |||
| + | if method == ' | ||
| + | return true | ||
| + | | ||
| + | return true | ||
| + | else | ||
| + | return false | ||
| + | end | ||
| + | end | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | Можно по ip | ||
| + | |||
| + | <code | ini> | ||
| + | |||
| + | function IncomingHttpRequestFilter(method, | ||
| + | if method == ' | ||
| + | -- Read-only access (only GET method is allowed) | ||
| + | return true | ||
| + | elseif username == ' | ||
| + | -- Read-write access for administrator (any HTTP method is allowed on localhost) | ||
| + | return true | ||
| + | else | ||
| + | -- Access is disallowed by default | ||
| + | return false | ||
| + | end | ||
| + | end | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | С помощью этого скрипта можно отправлять снимки которые пришли в Orthanc на другие DICOM сервера или на рабочие станции врачей. | ||
| + | |||
| + | <code | ini> | ||
| + | cat send.lua | ||
| + | function OnStoredInstance(instanceId, | ||
| + | SendToModality(instanceId, | ||
| + | end | ||
| + | |||
| + | </ | ||
| + | |||
| + | С помощью этого скрипта можно разбирать изображение которые приходят на Orthanc и маршрутизировать их на другие сервера. | ||
| + | |||
| + | <code | ini> | ||
| + | cat / | ||
| + | function OnStoredInstance(instanceId, | ||
| + | local Modality = tags[' | ||
| + | if string.find(Modality, | ||
| + | SendToModality(instanceId, | ||
| + | elseif string.find(Modality, | ||
| + | SendToModality(instanceId, | ||
| + | end | ||
| + | end | ||
| + | </ | ||
| + | |||
| + | |||
| + | перезапускаем: | ||
| + | |||
| + | <code | ini> | ||
| + | services orthanc restart | ||
| + | </ | ||
| + | |||
| + | Удаление старых записей | ||
| + | <code | ini> | ||
| + | $ curl --user admin: | ||
| + | [ | ||
| + | " | ||
| + | " | ||
| + | ] | ||
| + | $ curl -X DELETE http:// | ||
| + | $ curl -X DELETE http:// | ||
| + | </ | ||