fw4spl
SeriesRetriever.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWPACSIO_SERIESRETRIEVER_HPP__
8 #define __FWPACSIO_SERIESRETRIEVER_HPP__
9 
10 #include "fwPacsIO/config.hpp"
11 
12 #include <fwCom/Slot.hpp>
13 #include <fwCom/Slots.hpp>
14 
15 #include <fwTools/ProgressAdviser.hpp>
16 
17 #include <boost/filesystem/path.hpp>
18 
19 #include <dcmtk/config/osconfig.h>
20 #include <dcmtk/dcmnet/scp.h>
21 
22 namespace fwPacsIO
23 {
24 
28 class FWPACSIO_CLASS_API SeriesRetriever : public ::fwCore::BaseObject,
29  public DcmSCP
30 {
31 
32 public:
34  (()), new SeriesRetriever);
36 
37  FWPACSIO_API static const ::fwCom::Slots::SlotKeyType s_PROGRESS_CALLBACK_SLOT;
38  typedef ::fwCom::Slot<void (const std::string&, unsigned int, const std::string&)> ProgressCallbackSlotType;
39 
41  FWPACSIO_API SeriesRetriever();
42 
44  FWPACSIO_API ~SeriesRetriever();
45 
54  FWPACSIO_API void initialize(const std::string& applicationTitle, unsigned short applicationport, int timeout = 3,
55  ProgressCallbackSlotType::sptr progressCallback = ProgressCallbackSlotType::sptr());
56 
58  FWPACSIO_API bool start();
59 
60 protected:
62  virtual OFCondition handleIncomingCommand(T_DIMSE_Message* incomingMsg,
63  const DcmPresentationContextInfo& presContextInfo) override;
64 
71  virtual OFCondition handleSTORERequest(T_DIMSE_Message* incomingMsg, T_ASC_PresentationContextID presID);
72 
74  ::boost::filesystem::path m_path;
75 
77  ProgressCallbackSlotType::sptr m_progressCallback;
78 
80  unsigned int m_instanceIndex;
81 
82 };
83 
84 } // namespace fwPacsIO
85 
86 #endif /*__FWPACSIO_SERIESRETRIEVER_HPP__*/
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
fwPacsIO contains classes used to communicate with a PACS.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
ProgressCallbackSlotType::sptr m_progressCallback
Progress callback slot.
unsigned int m_instanceIndex
Dowloaded instance index.
Reads DICOM series from pacs.
::boost::filesystem::path m_path
Path where the files must be saved.