Mercurial > hg > orthanc-python
comparison Sources/Autogenerated/sdk_GlobalFunctions.impl.h @ 41:393d2da0722a
upgrade to Orthanc SDK 1.7.2
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 08 Jul 2020 14:34:59 +0200 |
parents | b2bbb516056e |
children | 9e466631660a |
comparison
equal
deleted
inserted
replaced
40:1b6af7a317bf | 41:393d2da0722a |
---|---|
1436 { | 1436 { |
1437 return PyUnicode_FromString(s.GetContent()); | 1437 return PyUnicode_FromString(s.GetContent()); |
1438 } | 1438 } |
1439 } | 1439 } |
1440 | 1440 |
1441 static PyObject* sdk_OrthancPluginCreateFindMatcher(PyObject* module, PyObject* args) | |
1442 { | |
1443 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateFindMatcher()"); | |
1444 | |
1445 Py_buffer arg0; | |
1446 | |
1447 if (!PyArg_ParseTuple(args, "s*", &arg0)) | |
1448 { | |
1449 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1450 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1451 return NULL; | |
1452 } | |
1453 // This is the case of a constructor | |
1454 OrthancPluginFindMatcher* obj = OrthancPluginCreateFindMatcher(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len); | |
1455 PyBuffer_Release(&arg0); | |
1456 if (obj == NULL) | |
1457 { | |
1458 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1459 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1460 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1461 return NULL; | |
1462 } | |
1463 else | |
1464 { | |
1465 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1466 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginFindMatcher_Type, argList); | |
1467 Py_DECREF(argList); | |
1468 return python; | |
1469 } | |
1470 } | |
1471 | |
1441 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args) | 1472 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args) |
1442 { | 1473 { |
1443 PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()"); | 1474 PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()"); |
1444 | 1475 |
1445 | 1476 |
1533 return NULL; | 1564 return NULL; |
1534 } | 1565 } |
1535 else | 1566 else |
1536 { | 1567 { |
1537 return PyUnicode_FromString(s.GetContent()); | 1568 return PyUnicode_FromString(s.GetContent()); |
1569 } | |
1570 } | |
1571 | |
1572 static PyObject* sdk_OrthancPluginCreateDicomInstance(PyObject* module, PyObject* args) | |
1573 { | |
1574 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicomInstance()"); | |
1575 | |
1576 Py_buffer arg0; | |
1577 | |
1578 if (!PyArg_ParseTuple(args, "s*", &arg0)) | |
1579 { | |
1580 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1581 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1582 return NULL; | |
1583 } | |
1584 // This is the case of a constructor | |
1585 OrthancPluginDicomInstance* obj = OrthancPluginCreateDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len); | |
1586 PyBuffer_Release(&arg0); | |
1587 if (obj == NULL) | |
1588 { | |
1589 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1590 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1591 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1592 return NULL; | |
1593 } | |
1594 else | |
1595 { | |
1596 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1597 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList); | |
1598 Py_DECREF(argList); | |
1599 return python; | |
1600 } | |
1601 } | |
1602 | |
1603 static PyObject* sdk_OrthancPluginTranscodeDicomInstance(PyObject* module, PyObject* args) | |
1604 { | |
1605 PythonLock::LogCall("Calling Python global function: OrthancPluginTranscodeDicomInstance()"); | |
1606 | |
1607 Py_buffer arg0; | |
1608 const char* arg2 = NULL; | |
1609 | |
1610 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2)) | |
1611 { | |
1612 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1613 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
1614 return NULL; | |
1615 } | |
1616 // This is the case of a constructor | |
1617 OrthancPluginDicomInstance* obj = OrthancPluginTranscodeDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2); | |
1618 PyBuffer_Release(&arg0); | |
1619 if (obj == NULL) | |
1620 { | |
1621 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1622 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1623 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1624 return NULL; | |
1625 } | |
1626 else | |
1627 { | |
1628 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1629 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList); | |
1630 Py_DECREF(argList); | |
1631 return python; | |
1632 } | |
1633 } | |
1634 | |
1635 static PyObject* sdk_OrthancPluginCreateMemoryBuffer(PyObject* module, PyObject* args) | |
1636 { | |
1637 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateMemoryBuffer()"); | |
1638 | |
1639 unsigned long arg0 = 0; | |
1640 | |
1641 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
1642 { | |
1643 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1644 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1645 return NULL; | |
1646 } | |
1647 OrthancPlugins::MemoryBuffer buffer; | |
1648 OrthancPluginErrorCode code = OrthancPluginCreateMemoryBuffer(OrthancPlugins::GetGlobalContext(), *buffer, arg0); | |
1649 | |
1650 if (code == OrthancPluginErrorCode_Success) | |
1651 { | |
1652 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
1653 } | |
1654 else | |
1655 { | |
1656 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1657 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1658 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1659 return NULL; | |
1538 } | 1660 } |
1539 } | 1661 } |
1540 | 1662 |
1541 | 1663 |
1542 static PyMethodDef ORTHANC_SDK_FUNCTIONS[] = | 1664 static PyMethodDef ORTHANC_SDK_FUNCTIONS[] = |
1649 "Generated from C function OrthancPluginComputeMd5()" }, | 1771 "Generated from C function OrthancPluginComputeMd5()" }, |
1650 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS, | 1772 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS, |
1651 "Generated from C function OrthancPluginComputeSha1()" }, | 1773 "Generated from C function OrthancPluginComputeSha1()" }, |
1652 { "GenerateUuid", sdk_OrthancPluginGenerateUuid, METH_VARARGS, | 1774 { "GenerateUuid", sdk_OrthancPluginGenerateUuid, METH_VARARGS, |
1653 "Generated from C function OrthancPluginGenerateUuid()" }, | 1775 "Generated from C function OrthancPluginGenerateUuid()" }, |
1776 { "CreateFindMatcher", sdk_OrthancPluginCreateFindMatcher, METH_VARARGS, | |
1777 "Generated from C function OrthancPluginCreateFindMatcher()" }, | |
1654 { "GetPeers", sdk_OrthancPluginGetPeers, METH_VARARGS, | 1778 { "GetPeers", sdk_OrthancPluginGetPeers, METH_VARARGS, |
1655 "Generated from C function OrthancPluginGetPeers()" }, | 1779 "Generated from C function OrthancPluginGetPeers()" }, |
1656 { "AutodetectMimeType", sdk_OrthancPluginAutodetectMimeType, METH_VARARGS, | 1780 { "AutodetectMimeType", sdk_OrthancPluginAutodetectMimeType, METH_VARARGS, |
1657 "Generated from C function OrthancPluginAutodetectMimeType()" }, | 1781 "Generated from C function OrthancPluginAutodetectMimeType()" }, |
1658 { "SetMetricsValue", sdk_OrthancPluginSetMetricsValue, METH_VARARGS, | 1782 { "SetMetricsValue", sdk_OrthancPluginSetMetricsValue, METH_VARARGS, |
1659 "Generated from C function OrthancPluginSetMetricsValue()" }, | 1783 "Generated from C function OrthancPluginSetMetricsValue()" }, |
1660 { "GetTagName", sdk_OrthancPluginGetTagName, METH_VARARGS, | 1784 { "GetTagName", sdk_OrthancPluginGetTagName, METH_VARARGS, |
1661 "Generated from C function OrthancPluginGetTagName()" }, | 1785 "Generated from C function OrthancPluginGetTagName()" }, |
1786 { "CreateDicomInstance", sdk_OrthancPluginCreateDicomInstance, METH_VARARGS, | |
1787 "Generated from C function OrthancPluginCreateDicomInstance()" }, | |
1788 { "TranscodeDicomInstance", sdk_OrthancPluginTranscodeDicomInstance, METH_VARARGS, | |
1789 "Generated from C function OrthancPluginTranscodeDicomInstance()" }, | |
1790 { "CreateMemoryBuffer", sdk_OrthancPluginCreateMemoryBuffer, METH_VARARGS, | |
1791 "Generated from C function OrthancPluginCreateMemoryBuffer()" }, | |
1662 { NULL, NULL } | 1792 { NULL, NULL } |
1663 }; | 1793 }; |
1664 | 1794 |
1665 | 1795 |
1666 PyMethodDef* GetOrthancSdkFunctions() | 1796 PyMethodDef* GetOrthancSdkFunctions() |