7 #include "ioITK/SImageSeriesWriter.hpp" 9 #include "ioITK/InrImageWriterService.hpp" 11 #include <fwCore/base.hpp> 13 #include <fwData/Image.hpp> 14 #include <fwData/location/Folder.hpp> 15 #include <fwData/location/SingleFile.hpp> 17 #include <fwGui/Cursor.hpp> 18 #include <fwGui/dialog/LocationDialog.hpp> 19 #include <fwGui/dialog/MessageDialog.hpp> 20 #include <fwGui/dialog/ProgressDialog.hpp> 22 #include <fwIO/IWriter.hpp> 24 #include <fwItkIO/ImageWriter.hpp> 26 #include <fwMedData/ImageSeries.hpp> 28 #include <fwServices/macros.hpp> 37 SImageSeriesWriter::SImageSeriesWriter() noexcept
43 SImageSeriesWriter::~SImageSeriesWriter() noexcept
66 static ::boost::filesystem::path _sDefaultPath;
71 dialogFile.
addFilter(
"Inrimage",
"*.inr.gz");
72 dialogFile.
setOption(::fwGui::dialog::ILocationDialog::WRITE);
74 ::fwData::location::SingleFile::sptr result;
75 result = ::fwData::location::SingleFile::dynamicCast( dialogFile.
show() );
78 _sDefaultPath = result->getPath().parent_path();
79 this->
setFile( result->getPath() );
106 _sstream <<
"SImageSeriesWriter::info";
119 ::fwMedData::ImageSeries::csptr iseries = this->getInput< ::fwMedData::ImageSeries >(::fwIO::s_DATA_KEY);
123 iseries = this->getObject< ::fwMedData::ImageSeries >();
125 const ::fwData::Image::csptr& associatedImage = iseries->getImage();
126 SLM_ASSERT(
"associatedImage not instanced", associatedImage);
129 cursor.
setCursor(::fwGui::ICursor::BUSY);
130 InrImageWriterService::saveImage(this->
getFile(), associatedImage);
virtual IOITK_API void stopping() override
Override.
#define FW_DEPRECATED_KEY(newKey, access, version)
Use this macro when deprecating a service key to warn the developer.
virtual FWGUI_API void setCursor(::fwGui::ICursor::CursorType cursor) override
Set the cursor.
IOITK_API::fwIO::IOPathType getIOPathType() const override
Return managed file type, here FILE.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
virtual FWGUI_API void setDefaultLocation(::fwData::location::ILocation::sptr loc) override
Set the initial location for the dialog.
virtual IOITK_API void starting() override
Override.
FWGUI_API::fwGui::dialog::ILocationDialog & setOption(::fwGui::dialog::ILocationDialog::Options option) override
allow to set option to the file dialog mode=READ/WRITE, check=FILE_MUST_EXIST
FWGUI_API::fwData::location::ILocation::sptr show() override
Display the dialog.
virtual IOITK_API void configuring() override
Override.
IOITK_API void updating() override
Override.
FWGUI_API void addFilter(const std::string &filterName, const std::string &wildcardList) override
specify some filtering when browsing files:
virtual IOITK_API void configureWithIHM() override
Override.
IOITK_API void info(std::ostream &_sstream) override
Override.
FWIO_API void setFile(const ::boost::filesystem::path &file)
Sets file path.
virtual FWIO_API void configuring() override
This method proposes to parse xml configuration to retrieve file/files/folder paths.
FWIO_APIconst::boost::filesystem::path & getFile() const
Returns the file path set by the user or set during service configuration.
FWIO_API void clearLocations()
Clear any location set by the setFile/setFiles/setFolder setter.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Writer for .inr.gz image series.
IOPathType
IOPathType defines different type of paths used by service readers/writers.
Writer service API. It manages extension points definition and extension configuration.
FWGUI_API void setTitle(const std::string &title) override
Set the title for the dialog.
Defines the generic file/folder selector dialog for IHM.
Defines the generic cursor for IHM. Use the Delegate design pattern.
FWGUI_API void saveDefaultLocation(::fwData::location::ILocation::sptr loc) override
Save the specified default location for the dialog in preferences (if available)
The namespace ioITK contains services for reader, writer and helper for itk image.
FWIO_API bool hasLocationDefined() const
Returns if a location has been defined ( by the configuration process or directly by user ) ...
virtual FWGUI_API void setDefaultCursor() override
Set the default cursor.
std::string m_windowTitle
Title of the window that will open when the configureWithIHM slot is called.