Инструменты пользователя

Инструменты сайта


orthanc

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
orthanc [2020/01/12 09:50]
sector
orthanc [2022/05/27 02:34] (текущий)
sector
Строка 13: Строка 13:
  
 Установил, поправил конфиг для того что бы зайти в WEB, загрузил несколько картинок... \\ Установил, поправил конфиг для того что бы зайти в WEB, загрузил несколько картинок... \\
 +
 +В последних версиях пользователи хранятся тут :
 +<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 "orthanc" service.
 +   **/
 +
 +  // The list of the registered users. Because Orthanc uses HTTP
 +  // Basic Authentication, the passwords are stored as plain text.
 +  "RegisteredUsers" : {
 +    "alice" : "alicePassword"
 +    "admin" : "adminPassword",
 +  }
 +}
 +
 +</code>
 +
 +Включение http сервера и авторизации тут:
 +
 +<code | ini>
 +
 +Orthanc.json
 + "HttpServerEnabled" : true,
 +
 +
 + "AuthenticationEnabled" : true,
 +
 +</code>
 +
 Что-то мне не понравился стандартный web viewer...\\ Что-то мне не понравился стандартный web viewer...\\
 Решил прикрутить  viewer от Osimis.  \\ Решил прикрутить  viewer от Osimis.  \\
Строка 123: Строка 157:
  
 </code> </code>
 +
 +Контроль доступа и отправка на другие модальности:
 +<code | ini>
 +Orthanc.json
 +
 +  "LuaScripts" : [
 +    "/etc/orthanc/lua/access.lua",
 +    "/etc/orthanc/lua/send.lua"
 +  ],
 +
 +"sample" : [ "AE_TITLE", "192.168.1.235", 4006 ]
 +</code>
 +Lua:
 +
 +Разрешения выполнять запросы  к Orthanc, с помощью этого скрипта можно разграничить права доступа к web интерфейсу Orthanc
 +
 +<code | ini>
 +
 +cat access.lua
 +function IncomingHttpRequestFilter(method, uri, ip, username, httpHeaders)
 +   -- Only allow GET requests for non-admin users
 +
 +  if method == 'GET' or method == 'POST' then
 +      return true
 +   elseif username == 'admin' then
 +      return true
 +   else
 +      return false
 +   end
 +end
 +
 +</code>
 +
 +
 +Можно по ip
 +
 +<code | ini>
 +
 +function IncomingHttpRequestFilter(method, uri, ip, username, httpHeaders)
 +  if method == 'GET' and (username == 'user' or username == 'admin') then
 +    -- Read-only access (only GET method is allowed)
 +    return true
 +  elseif username == 'admin' and ip == '127.0.0.1' then
 +    -- Read-write access for administrator (any HTTP method is allowed on localhost)
 +    return true
 +  else
 +    -- Access is disallowed by default
 +    return false
 +  end
 +end
 +
 +</code>
 +
 +
 +С помощью этого скрипта можно отправлять снимки которые пришли в Orthanc на другие DICOM сервера или на рабочие станции врачей.
 +
 +<code | ini>
 +cat send.lua
 +function OnStoredInstance(instanceId, tags, metadata)
 +    SendToModality(instanceId, 'sample')
 +end
 +
 +</code>
 +
 +С помощью этого скрипта можно разбирать изображение которые приходят на Orthanc и маршрутизировать их на другие сервера. 
 +
 +<code | ini>
 +cat /etc/orthanc/lua/send.lua
 +function OnStoredInstance(instanceId, tags, metadata)
 +    local Modality = tags['Modality']
 +        if string.find(Modality, 'CR') ~= nil then
 +            SendToModality(instanceId, 'sample')
 +        elseif string.find(Modality, 'MR') ~= nil then
 +            SendToModality(instanceId, 'sample')
 +        end
 +end
 +</code>
 +
  
 перезапускаем: перезапускаем:
Строка 129: Строка 241:
 services orthanc restart services orthanc restart
 </code> </code>
 +
 +Удаление старых записей
 +<code | ini>
 + $ curl --user admin:password http://localhost:8042/tools/find -d '{"Level":"Study","Query":{"StudyDate":"20120101-20121231"}}'
 +[
 +   "6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12",
 +   "ef2ce55f-9342856a-aee23907-2667e859-9f3b734d"
 +]
 +$ curl -X DELETE http://localhost:8042/studies/6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12
 +$ curl -X DELETE http://localhost:8042/studies/ef2ce55f-9342856a-aee23907-2667e859-9f3b734d
 +</code>
 +
orthanc.1578822619.txt.gz · Последнее изменение: 2020/01/12 09:50 — sector

Яндекс.Метрика