paramsBG[:measIsBGFrame][:] is an array and cannot be assigned with a constant true without .=. Moreover, down the code here is cat(4, params[:measData], paramsBG[:measData]) which also should produce an error.
I ended up implementing that by myself. Here is my implementation in case it is useful for a fix.
MPIFile(raw_measurement_path) do raw_measurement_file; MPIFile(bg_measurement_path) do background_file
params = loadDataset(raw_measurement_file)
frames=1:acqNumFrames(background_file)
params_background = loadDataset(background_file, frames=frames)
params_background[:measIsBGFrame] .= true
params[:measData] = cat(params[:measData], params_background[:measData], dims=4)
params[:measIsBGFrame] = cat(params[:measIsBGFrame], params_background[:measIsBGFrame], dims=1)
params[:acqNumFrames] += params_background[:acqNumFrames]
h5open(measurement_path, "w") do file
saveasMDF(file, params)
end
end;end
I encountered with an error while attempting to save a Brucker measurement together with a background measurement as one MDF. I used the
saveasMDF
with a keyword for the background file. It failed here https://github.com/MagneticParticleImaging/MPIFiles.jl/blob/a6601c352b8e15fbfef999e7e2ae27e0183aa272/src/Conversion.jl#L163paramsBG[:measIsBGFrame][:]
is an array and cannot be assigned with a constanttrue
without.=
. Moreover, down the code here iscat(4, params[:measData], paramsBG[:measData])
which also should produce an error.I ended up implementing that by myself. Here is my implementation in case it is useful for a fix.