Skip to content

Commit

Permalink
Store boolean fields as HDF5 attributes in KomaMRIFiles/Phantom.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
pvillacorta committed Jan 13, 2025
1 parent 00d348d commit c79c2af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions KomaMRIFiles/src/Phantom/Phantom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ end
function export_motion_subfield!(field_group::HDF5.Group, subfield::AbstractRange, subname::String)
HDF5.attributes(field_group)[subname] = step(subfield) == 1 ? "$(first(subfield)):$(last(subfield))" : "$(first(subfield)):$(step(subfield)):$(last(subfield))"
end
function export_motion_subfield!(field_group::HDF5.Group, subfield::Bool, subname::String)
HDF5.attributes(field_group)[subname] = string(subfield)
end
function export_motion_subfield!(field_group::HDF5.Group, subfield::Array, subname::String)
field_group[subname] = subfield
end
function export_motion_subfield!(field_group::HDF5.Group, subfield::BitMatrix, subname::String)
field_group[subname] = Int.(subfield)
end
function export_motion_subfield!(field_group::HDF5.Group, subfield::Bool, subname::String)
field_group[subname] = string(subfield)
end

0 comments on commit c79c2af

Please sign in to comment.