Skip to content

Commit

Permalink
Add isapprox function for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rkierulf authored Aug 22, 2024
1 parent a209a60 commit c309ab6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions KomaMRICore/src/rawdata/ISMRMRD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,13 @@ Base.:+(sig1::RawAcquisitionData, sig2::RawAcquisitionData) = RawAcquisitionData
sig1.profiles[i].data .+ sig2.profiles[i].data
) for i=1:length(sig1.profiles)]
)

Base.isapprox(sig1::RawAcquisitionData, sig2::RawAcquisitionData; kwargs...) = begin
(length(sig1.profiles) == length(sig2.profiles)) || return false

for i=1:length(sig1.profiles)
isapprox(sig1.profiles[i].data, sig2.profiles[i].data; kwargs...) || return false
end

return true
end

0 comments on commit c309ab6

Please sign in to comment.