Skip to content

Commit

Permalink
Fix neglectBGFrames=false
Browse files Browse the repository at this point in the history
  • Loading branch information
jusack authored Dec 19, 2024
1 parent 48e7082 commit 7e29445
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Measurements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@ function getMeasurements(f::MPIFile, neglectBGFrames=true;
bgCorrection=false, bgFrames = 1:length(measBGFrameIdx(f)), interpolateBG=false, tfCorrection=rxHasTransferFunction(f),
sortFrames=false, numAverages=1, numPeriodGrouping=1, kargs...)

idxBG = measBGFrameIdx(f)[bgFrames]
hasBGFrames = length(idxBG) > 0

if neglectBGFrames
idx = measFGFrameIdx(f)

data = getAveragedMeasurements(f; frames=idx[frames],
numAverages=numAverages, kargs...)

idxBG = measBGFrameIdx(f)[bgFrames]
hasBGFrames = length(idxBG) > 0
if bgCorrection && !hasBGFrames
@warn "Background correction was selected but there are no background frames in the file."
elseif bgCorrection && hasBGFrames
Expand Down Expand Up @@ -432,4 +433,4 @@ function detectAndFixDistortions!(data::AbstractArray{T,4}, thresh) where T
end
end
return
end
end

0 comments on commit 7e29445

Please sign in to comment.