16 #include <Poco/Path.h> 25 m_ImageExtension(
".nrrd")
38 if(inputImage.IsNull() || inputImage->IsEmpty())
40 MITK_WARN <<
"Input image is not valid. Cannot save image!";
87 std::vector<std::string> dummy1;
94 filenames = std::vector<std::string>();
97 Poco::Path testPath(path);
98 if(!testPath.isDirectory())
100 mitkThrow() <<
"Attemting to write to directory " << path <<
" which is not valid! Aborting!";
105 std::string uniqueID = myGen.
GetUID();
110 std::stringstream name;
113 filenames.push_back(name.str());
119 std::stringstream csvFilenameStream;
120 csvFilenameStream << path << uniqueID <<
"_ImageMessages.csv";
121 csvFileName = csvFilenameStream.str();
123 fb.open (csvFileName.c_str(),std::ios::out);
124 std::ostream os(&fb);
128 os <<
"image filename; MITK system timestamp; message\n";
144 if(extension.compare(0,1,
".") == 0)
145 extension = extension.substr(1,extension.size()-1);
151 for(std::vector<MimeType>::size_type i = 0 ; i< mimeTypes.size() ; ++i)
153 std::vector<std::string> extensions = mimeTypes[i].GetExtensions();
154 if (std::find(extensions.begin(), extensions.end(), extension) != extensions.end())
void SaveImages(std::string path, std::vector< std::string > &imageFilenames, std::string &csvFileName)
static IMimeTypeProvider * GetMimeTypeProvider(us::ModuleContext *context=us::GetModuleContext())
Get an IMimeTypeProvider instance.
std::string m_ImageExtension
stores the image extension, default is ".nrrd"
void GenerateData() override
ImageCollection m_LoggedImages
An image collection for every input. The string identifies the input.
~USImageLoggingFilter() override
std::map< int, std::string > m_LoggedMessages
(Optional) messages for every logged image
static std::string CATEGORY_IMAGES()
RealTimeClock is a superclass to WindowsRealTimeClock, LinuxRealTimeClock, etc.
bool SetImageFilesExtension(std::string extension)
std::vector< double > m_LoggedMITKSystemTimes
Logged system times for every logged image.
InputImageType * GetInput(void)
static void Save(const mitk::BaseData *data, const std::string &path, bool setPathProperty=false)
Save a mitk::BaseData instance.
OutputType * GetOutput()
Get the output data of this image source object.
A RAII helper class for core service objects.
mitk::RealTimeClock::Pointer m_SystemTimeClock
system time clock for system time tag
void AddMessageToCurrentImage(std::string message)