9#include "ismrmrd/export.h"
53 present_ = o.present_;
73 const T* operator->()
const {
77 const T& operator*()
const {
81 operator bool()
const {
85 bool is_present()
const {
89 bool has_value()
const noexcept {
96 throw std::runtime_error(
"Access optional value, which has not been set");
102 const T &value()
const &{
104 throw std::runtime_error(
"Access optional value, which has not been set");
111 throw std::runtime_error(
"Access optional value, which has not been set");
113 return std::move(value_);
116 const T &&value()
const &&{
118 throw std::runtime_error(
"Access optional value, which has not been set");
120 return std::move(value_);
124 return this->value();
128 return this->value();
130 const T &get()
const & {
131 return this->value();
134 const T&& get()
const &&{
135 return this->value();
138 T value_or(U &&default_value)
const &{
139 return bool(*
this) ? **this :
static_cast<T
>(std::forward<U>(default_value));
143 T value_or(U &&default_value) &&{
144 return bool(*
this) ? std::move(**
this) :
static_cast<T
>(std::forward<U>(default_value));
148 if (this->present_ && other.present_)
return this->get() == *other;
149 if ((!this->present_) && (!other.present_))
return true;
153 bool operator==(
const T& val)
const {
154 if (this->present_)
return this->get() == val;
163 void set(
const T& v) {
207 std::string dependencyType;
208 std::string measurementID;
213 std::string referencedSOPInstanceUID;
221 std::string patientPosition;
227 std::vector<MeasurementDependency> measurementDependency;
230 std::vector<ReferencedImageSequence> referencedImageSequence;
235 std::uint16_t coilNumber;
236 std::string coilName;
246 std::vector<CoilLabel> coilLabel;
256 std::int64_t H1resonanceFrequency_Hz;
277 MatrixSize(std::uint16_t x, std::uint16_t y, std::uint16_t z)
314 Limit(std::uint16_t minimum, std::uint16_t maximum, std::uint16_t center)
322 std::uint16_t minimum;
323 std::uint16_t maximum;
324 std::uint16_t center;
339 std::array<Optional<Limit>,ISMRMRD_USER_INTS> user;
363 std::vector<UserParameterLong> userParameterLong;
364 std::vector<UserParameterDouble> userParameterDouble;
365 std::vector<UserParameterString> userParameterString;
366 std::vector<UserParameterString> userParameterBase64;
371 std::string identifier;
372 std::vector<UserParameterLong> userParameterLong;
373 std::vector<UserParameterDouble> userParameterDouble;
374 std::vector<UserParameterString> userParameterString;
380 std::uint16_t kspace_encoding_step_1;
381 std::uint16_t kspace_encoding_step_2;
385 enum class TrajectoryType {
396 enum class MultibandCalibrationType {
403 std::vector<float> dZ;
407 std::vector<MultibandSpacing> spacing;
409 std::uint32_t multiband_factor;
410 MultibandCalibrationType calibration;
411 std::uint64_t calibration_encoding;
427 TrajectoryType trajectory;
440 enum class DiffusionDimension {
475 enum class WaveformType {
486 std::string waveformName;
487 WaveformType waveformType;
499 std::vector<Encoding> encoding;
502 std::vector<WaveformInformation> waveformInformation;
506 EXPORTISMRMRD
void deserialize(
const char* xml,
IsmrmrdHeader& h);
507 EXPORTISMRMRD
void serialize(
const IsmrmrdHeader& h, std::ostream& o);
509 EXPORTISMRMRD std::ostream& operator<<(std::ostream & os,
const IsmrmrdHeader&);
533 EXPORTISMRMRD
bool operator==(
const Limit &lhs,
const Limit &rhs);
534 EXPORTISMRMRD
bool operator!=(
const Limit &lhs,
const Limit &rhs);