# HG changeset patch # User Sebastien Jodogne # Date 1587053485 -7200 # Node ID 1974913fd28a3e20b867e408c5b0e609e86ad35d # Parent 801db4e1828c27b16790d94aefa94fc4cc04e6af documenting "info" argument in Lua ReceivedInstanceFilter() diff -r 801db4e1828c -r 1974913fd28a Sphinx/source/users/lua.rst --- 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 `. The ``origin`` - parameter is :ref:`documented separately `. + parameter is :ref:`documented separately `. 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 `. @@ -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 `__ (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 `. +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: