Skip to content

Commit

Permalink
fix sampling for Partial fourier PV360
Browse files Browse the repository at this point in the history
  • Loading branch information
aTrotier committed Nov 26, 2024
1 parent c531fb4 commit b8036c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MRIBase/src/Datatypes/RawAcqData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function subsampleIndices(f::RawAcquisitionData; slice::Int=1, contrast::Int=1,
i1 = tr_center_idx - center_sample + 1 + f.profiles[i].head.discard_pre
i2 = tr_center_idx - center_sample + numSamp - f.profiles[i].head.discard_post
# convert to linear index
lineIdx = collect(i1:i2) .+ numSamp*((encSt2[i]-1)*numProf + (encSt1[i]-1))
lineIdx = collect(i1:i2) .+ numEncSamp *((encSt2[i]-1)*numProf + (encSt1[i]-1))
append!(idx, lineIdx)
end

Expand Down
12 changes: 7 additions & 5 deletions MRIFiles/src/Bruker/BrukerSequence360.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ function RawAcquisitionDataFid_360(b::BrukerFile)
numEchos = MRIFiles.acqNumEchos(b)
phaseFactor = MRIFiles.acqPhaseFactor(b)
numRep = MRIFiles.acqNumRepetitions(b)
numEncSteps = MRIFiles.acqSpatialSize1(b)
numEncSteps = MRIFiles.acqSpatialSize1(b)
readoutLength = parse.(Int,b["PVM_EncMatrix"])[1]

profileLength = N[1]*numChannel#MRIFiles.acqSize(b)[1] #Int((ceil(N[1]*numChannel*sizeof(dtype)/1024))*1024/sizeof(dtype)) # number of points + zeros
centerSample = parse.(Int,b["PVM_EncPftOverscans"])[1]
profileLength = readoutLength*numChannel#MRIFiles.acqSize(b)[1] #Int((ceil(N[1]*numChannel*sizeof(dtype)/1024))*1024/sizeof(dtype)) # number of points + zeros

I = open(filename,"r") do fd
read!(fd,Array{T,6}(undef, profileLength,
Expand All @@ -34,8 +36,8 @@ function RawAcquisitionDataFid_360(b::BrukerFile)
numRep))
end

encSteps1 = parse.(Int,b["PVM_EncGenSteps1"]).+round(Int,N[2]/2)
encSteps2 = parse.(Int,b["PVM_EncGenSteps2"]).+round(Int,N[3]/2)
encSteps1 = parse.(Int,b["PVM_EncGenSteps1"]).+floor(Int,N[2]/2)
encSteps2 = parse.(Int,b["PVM_EncGenSteps2"]).+floor(Int,N[3]/2)

objOrd = MRIFiles.acqObjOrder(b)
objOrd = objOrd.-minimum(objOrd)
Expand Down Expand Up @@ -79,7 +81,7 @@ function RawAcquisitionDataFid_360(b::BrukerFile)
head = AcquisitionHeader(number_of_samples=N[1], idx=counter,
read_dir=read_dir, phase_dir=phase_dir,
slice_dir=slice_dir, position=position,
center_sample=div(N[1],2),
center_sample=centerSample,#div(N[1],2),
available_channels = numChannel, #numAvailableChannel ?
active_channels = numChannel)
traj = Matrix{Float32}(undef,0,0)
Expand Down

0 comments on commit b8036c5

Please sign in to comment.