diff Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h @ 1417:afdd5be8731c loader-injection-feature

when CT slices are loaded, it is now possible to act on this by implementing the ISlicePostProcessor interface and inject it in the loader.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 11 May 2020 17:38:29 +0200
parents f4a06ad1580b
children 60e30d73e2aa
line wrap: on
line diff
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h	Mon May 11 17:37:30 2020 +0200
+++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h	Mon May 11 17:38:29 2020 +0200
@@ -57,6 +57,12 @@
     static const unsigned int QUALITY_02 = 2;
         
     class ExtractedSlice;
+
+    class ISlicePostProcessor
+    {
+    public:
+      virtual void ProcessCTDicomSlice(const Orthanc::DicomMap& dicom) = 0;
+    };
     
     /** Helper class internal to OrthancSeriesVolumeProgressiveLoader */
     class SeriesGeometry : public boost::noncopyable
@@ -121,6 +127,8 @@
     std::vector<unsigned int>     slicesQuality_;
     bool                          volumeImageReadyInHighQuality_;
     
+    boost::shared_ptr<ISlicePostProcessor>  slicePostProcessor_;
+
     OrthancSeriesVolumeProgressiveLoader(
       OrthancStone::ILoadersContext& loadersContext,
       boost::shared_ptr<OrthancStone::DicomVolumeImage> volume,
@@ -141,6 +149,12 @@
 
     void SetSimultaneousDownloads(unsigned int count);
 
+    void SetDicomSlicePostProcessor(boost::shared_ptr<ISlicePostProcessor> slicePostProcessor)
+    {
+      // this will delete the previously stored slice processor, if any
+      slicePostProcessor_ = slicePostProcessor;
+    }
+
     bool IsVolumeImageReadyInHighQuality() const
     {
       return volumeImageReadyInHighQuality_;