25 #include "itksys/SystemTools.hxx"
36 "Default reader for the example data structure")
44 std::vector<itk::SmartPointer<mitk::BaseData>> result;
47 std::string ext = itksys::SystemTools::GetFilenameLastExtension(location);
48 ext = itksys::SystemTools::LowerCase(ext);
56 std::ifstream file(location);
57 std::string content(
"");
61 while (getline(file, line))
73 outputData->SetData(content);
74 result.push_back(outputData.GetPointer());
84 MITK_ERROR <<
"Unknown error occurred while trying to read file.";
virtual std::vector< itk::SmartPointer< BaseData > > Read() override
Reads a path or stream and creates a list of BaseData objects.
ExampleDataStructureReaderService()
DataCollection - Class to facilitate loading/accessing structured data.
virtual ~ExampleDataStructureReaderService()
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
us::ServiceRegistration< IFileReader > RegisterService(us::ModuleContext *context=us::GetModuleContext())
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
The reader service for the MITK example data type.
Base class for creating mitk::BaseData objects from files or streams.
virtual std::string GetInputLocation() const override
Get the current input location.