comparison RenderingPlugin/Sources/Plugin.cpp @ 1890:6ce81914f7e4

added classes BucketAccumulator1D/2D
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Jan 2022 22:08:55 +0100
parents fe4befc9c2b0
children cdf91ad891a5
comparison
equal deleted inserted replaced
1889:fe4befc9c2b0 1890:6ce81914f7e4
69 } 69 }
70 70
71 class Accessor : public boost::noncopyable 71 class Accessor : public boost::noncopyable
72 { 72 {
73 private: 73 private:
74 boost::mutex::scoped_lock lock_; 74 boost::mutex::scoped_lock lock_;
75 std::string instanceId_; 75 std::string instanceId_;
76 const OrthancStone::DicomStructureSet* rtstruct_; 76 OrthancStone::DicomStructureSet* rtstruct_;
77 77
78 public: 78 public:
79 Accessor(DicomStructureCache& that, 79 Accessor(DicomStructureCache& that,
80 const std::string& instanceId) : 80 const std::string& instanceId) :
81 lock_(that.mutex_), 81 lock_(that.mutex_),
111 bool IsValid() const 111 bool IsValid() const
112 { 112 {
113 return rtstruct_ != NULL; 113 return rtstruct_ != NULL;
114 } 114 }
115 115
116 const OrthancStone::DicomStructureSet& GetRtStruct() const 116 OrthancStone::DicomStructureSet& GetRtStruct() const
117 { 117 {
118 if (IsValid()) 118 if (IsValid())
119 { 119 {
120 return *rtstruct_; 120 return *rtstruct_;
121 } 121 }
763 763
764 AnswerNumpyImage(output, tmp, compress); 764 AnswerNumpyImage(output, tmp, compress);
765 } 765 }
766 766
767 767
768
768 OrthancPluginErrorCode OnChangeCallback(OrthancPluginChangeType changeType, 769 OrthancPluginErrorCode OnChangeCallback(OrthancPluginChangeType changeType,
769 OrthancPluginResourceType resourceType, 770 OrthancPluginResourceType resourceType,
770 const char* resourceId) 771 const char* resourceId)
771 { 772 {
772 switch (changeType) 773 switch (changeType)
776 { 777 {
777 DicomStructureCache::GetSingleton().Invalidate(resourceId); 778 DicomStructureCache::GetSingleton().Invalidate(resourceId);
778 } 779 }
779 780
780 break; 781 break;
782
783 case OrthancPluginChangeType_OrthancStarted:
784 {
785 DicomStructureCache::Accessor accessor(DicomStructureCache::GetSingleton(), "54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9");
786 accessor.GetRtStruct().Test();
787 break;
788 }
781 789
782 default: 790 default:
783 break; 791 break;
784 } 792 }
785 793