fw4spl
SImageReader.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "ioVTK/config.hpp" // Declaration of class and function export
10 
11 #include <fwIO/IReader.hpp> // Definition of abstract reader class
12 
13 #include <boost/filesystem/path.hpp> // Used to save the file system path of loaded image
14 
15 // Pre-definition of ::fwData::Image to avoid inclusion file
16 namespace fwData
17 {
18 class Image;
19 }
20 
21 namespace fwJobs
22 {
23 class IJob;
24 }
25 
26 namespace ioVTK
27 {
28 
53 class IOVTK_CLASS_API SImageReader : public ::fwIO::IReader
54 {
55 
56 public:
57  ~SImageReader() noexcept
58  {
59  }
60 
62 
63  typedef ::fwCom::Signal< void ( SPTR(::fwJobs::IJob) ) > JobCreatedSignalType;
64 
70  IOVTK_API virtual void configureWithIHM() override;
71 
75  IOVTK_API SImageReader() noexcept;
76 
83  IOVTK_API static bool loadImage( const ::boost::filesystem::path& vtkFile,
84  const SPTR(::fwData::Image)& image,
85  const SPTR(JobCreatedSignalType)& sigJobCreated);
86 
87 protected:
88 
89  IOVTK_API virtual ::fwIO::IOPathType getIOPathType() const override;
90 
92  IOVTK_API virtual void starting() override;
93 
95  IOVTK_API virtual void stopping() override;
96 
98  IOVTK_API virtual void configuring() override;
99 
106  IOVTK_API void updating() override;
107 
109  IOVTK_API void info(std::ostream& _sstream ) override;
110 
111 private:
112 
114  bool m_bServiceIsConfigured;
115 
117  ::boost::filesystem::path m_fsImgPath;
118 
119  SPTR(JobCreatedSignalType) m_sigJobCreated;
120 
121 };
122 
123 } // namespace ioVTK
#define SPTR(_cls_)
Service reading a VTK Image using the fwVtkIO lib.
STL namespace.
Reader service API. It manages extension points definition and extension configuration.
Definition: IReader.hpp:34
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16
Contains the representation of the data objects used in the framework.
This namespace fwJobs provides jobs management.
The namespace ioVTK contains reader, writer and helper using the fwVtkIO lib for output and input act...