Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 5321:5fae323b11ed
added OrthancPlugins::DicomInstance::Load()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 24 Jun 2023 12:43:10 +0200 |
parents | 49477780e25a |
children | 984300e70069 |
comparison
equal
deleted
inserted
replaced
5320:e4c3950345e9 | 5321:5fae323b11ed |
---|---|
3735 size_t size, | 3735 size_t size, |
3736 const std::string& transferSyntax) | 3736 const std::string& transferSyntax) |
3737 { | 3737 { |
3738 OrthancPluginDicomInstance* instance = OrthancPluginTranscodeDicomInstance( | 3738 OrthancPluginDicomInstance* instance = OrthancPluginTranscodeDicomInstance( |
3739 GetGlobalContext(), buffer, size, transferSyntax.c_str()); | 3739 GetGlobalContext(), buffer, size, transferSyntax.c_str()); |
3740 | |
3741 if (instance == NULL) | |
3742 { | |
3743 ORTHANC_PLUGINS_THROW_EXCEPTION(Plugin); | |
3744 } | |
3745 else | |
3746 { | |
3747 boost::movelib::unique_ptr<DicomInstance> result(new DicomInstance(instance)); | |
3748 result->toFree_ = true; | |
3749 return result.release(); | |
3750 } | |
3751 } | |
3752 #endif | |
3753 | |
3754 | |
3755 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 1) | |
3756 DicomInstance* DicomInstance::Load(const std::string& instanceId, | |
3757 OrthancPluginLoadDicomInstanceMode mode) | |
3758 { | |
3759 OrthancPluginDicomInstance* instance = OrthancPluginLoadDicomInstance( | |
3760 GetGlobalContext(), instanceId.c_str(), mode); | |
3740 | 3761 |
3741 if (instance == NULL) | 3762 if (instance == NULL) |
3742 { | 3763 { |
3743 ORTHANC_PLUGINS_THROW_EXCEPTION(Plugin); | 3764 ORTHANC_PLUGINS_THROW_EXCEPTION(Plugin); |
3744 } | 3765 } |