changeset 387:1974913fd28a

documenting "info" argument in Lua ReceivedInstanceFilter()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 16 Apr 2020 18:11:25 +0200
parents 801db4e1828c
children a3288fe6f84e
files Sphinx/source/users/lua.rst
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/users/lua.rst	Thu Apr 16 13:01:49 2020 +0200
+++ b/Sphinx/source/users/lua.rst	Thu Apr 16 18:11:25 2020 +0200
@@ -66,10 +66,12 @@
 
 Some **permission-related events** allow to filter incoming requests:
 
-* ``function ReceivedInstanceFilter(dicom, origin)``:
-  Invoked to known whether an incoming DICOM instance should be
+* ``function ReceivedInstanceFilter(dicom, origin, info)``: Invoked to
+  known whether an incoming DICOM instance should be
   accepted. :ref:`See this section <lua-filter-dicom>`. The ``origin``
-  parameter is :ref:`documented separately <lua-origin>`.
+  parameter is :ref:`documented separately <lua-origin>`. The ``info``
+  parameter contains additional information and was added in Orthanc
+  1.6.1.
 * ``function IncomingHttpRequestFilter(method, uri, ip, username,
   httpHeaders)``: Invoked to known whether a REST request should be
   accepted. :ref:`See this section <lua-filter-rest>`.
@@ -278,7 +280,7 @@
 filter the incoming DICOM instances. Here is an example of a Lua
 filter that only allows incoming instances of MR modality::
 
- function ReceivedInstanceFilter(dicom, origin) 
+ function ReceivedInstanceFilter(dicom, origin, info) 
     -- Only allow incoming MR images   
     if dicom.Modality == 'MR' then
        return true 
@@ -287,12 +289,12 @@
     end
  end
 
-The argument dicom corresponds to a `Lua table
+The argument ``dicom`` corresponds to a `Lua table
 <http://www.lua.org/pil/2.5.html>`__ (i.e. an associative array) that
 contains the DICOM tags of the incoming instance. For debugging
 purpose, you can print this structure as follows::
 
- function ReceivedInstanceFilter(dicom, origin) 
+ function ReceivedInstanceFilter(dicom, origin, info) 
     PrintRecursive(dicom)
     -- Accept all incoming instances (default behavior)
     return true 
@@ -300,6 +302,15 @@
 
 The argument ``origin`` is :ref:`documented separately <lua-origin>`.
 
+The argument ``info`` was introduced in Orthanc 1.6.1. It contains
+some additional information about the received DICOM instance,
+notably:
+
+* ``HasPixelData`` is ``true`` iff. the Pixel Data (7FE0,0010) tag is
+  present.
+* ``TransferSyntaxUID`` contains the transfer syntax UID of the
+  dataset of the instance (if applicable).
+
 
 .. _lua-filter-rest: