| 87 | ////////////////////// Reading ///////////////////////// |
| 88 | |
| 89 | std::vector<BaseData::Pointer> AbstractFileReader::Read() |
| 90 | { |
| 91 | std::vector<BaseData::Pointer> result = this->DoRead(); |
| 92 | |
| 93 | const auto options = this->GetOptions(); |
| 94 | |
| 95 | for (auto& data : result) |
| 96 | { |
| 97 | data->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::READER_DESCRIPTION()), StringProperty::New(d->GetDescription())); |
| 98 | data->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::READER_VERSION()), StringProperty::New(MITK_VERSION_STRING)); |
| 99 | data->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::READER_MIME_NAME()), StringProperty::New(d->GetMimeType()->GetName())); |
| 100 | data->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::READER_MIME_CATEGORY()), StringProperty::New(d->GetMimeType()->GetCategory())); |
| 101 | if (this->GetInputStream() == nullptr) |
| 102 | { |
| 103 | data->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::READER_INPUTLOCATION()), StringProperty::New(Utf8Util::Local8BitToUtf8(this->GetInputLocation()))); |
| 104 | } |
| 105 | |
| 106 | for (const auto& option : options) |
| 107 | { |
| 108 | auto optionpath = IOMetaInformationPropertyConstants::READER_OPTION_ROOT().AddElement(option.first); |
| 109 | data->SetProperty(PropertyKeyPathToPropertyName(optionpath), StringProperty::New(option.second.ToString())); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | return result; |
| 114 | } |
| 115 | |
| 116 | DataStorage::SetOfObjects::Pointer AbstractFileReader::Read(DataStorage &ds) |
| 117 | { |