13 #ifndef mitkIOVolumeSplitReason_h
14 #define mitkIOVolumeSplitReason_h
17 #include <nlohmann/json.hpp>
46 using Pointer = std::shared_ptr<IOVolumeSplitReason>;
61 SliceDistanceInconsistency,
161 template<
typename BasicJsonType>
164 static_assert(std::is_enum<IOVolumeSplitReason::ReasonType>::value,
165 "IOVolumeSplitReason::ReasonType"
166 " must be an enum!");
170 template<
typename BasicJsonType>
173 static_assert(std::is_enum<IOVolumeSplitReason::ReasonType>::value,
174 "IOVolumeSplitReason::ReasonType"
175 " must be an enum!");
Records the reasons why a DICOM volume was split during loading.
std::shared_ptr< IOVolumeSplitReason > Pointer
Shared pointer type.
Pointer ExtendReason(ConstPointer otherReason) const
Clone this instance and extend it with reasons from another instance.
Pointer Clone() const
Create a deep copy of this instance.
std::string GetReasonDetails(ReasonType type) const
Get the detail string for a specific reason type.
static std::string TypeToString(ReasonType reasonType)
Convert a ReasonType to its string representation.
bool HasReason(ReasonType type) const
Check whether a specific reason type has been recorded.
static nlohmann::json ToJSON(ConstPointer reason)
Serialize a split reason to JSON.
static IOVolumeSplitReason::ReasonType StringToType(const std::string &reasonStr)
Convert a string representation to a ReasonType.
ReasonType
Enumeration of possible reasons for splitting a DICOM volume.
static Pointer New()
Create a new, empty IOVolumeSplitReason instance.
ReasonMapType m_ReasonMap
std::map< ReasonType, std::string > ReasonMapType
Map storing reason types and their associated detail strings.
void RemoveReason(ReasonType type)
Remove a previously added split reason.
static Pointer FromJSON(const nlohmann::json &j)
Deserialize a split reason from JSON.
void AddReason(ReasonType type, const std::string &detail="")
Add a split reason with optional detail text.
bool HasReasons() const
Check whether any split reasons have been recorded.
std::shared_ptr< const IOVolumeSplitReason > ConstPointer
Shared pointer to const type.
Find image slices visible on a given plane.
void from_json(const nlohmann::json &, GenericLookupTable< T > &)
Deserialize a GenericLookupTable from JSON.
void to_json(nlohmann::json &j, const GenericLookupTable< T > &t)
Serialize a GenericLookupTable to JSON.